/*
 * BlueOcean SFA admin theme. Loaded after the Vuexy theme and blueocean-palette.css (which recolours the
 * theme's purple/green/cyan/orange/red). This file sets typography, surfaces and the navigation chrome.
 */
:root {
    --bo-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-font-sans-serif: var(--bo-font);
    --bs-body-font-family: var(--bo-font);
    --bo-primary: #1d4ed8;
    --bo-primary-strong: #1e40af;
    --bo-primary-soft: #eaf0fd;
    --bo-navy: #0b1a33;
    --bo-navy-2: #11264a;
    --bo-navy-3: #1a3463;
    --bo-nav-text: #b7c3d9;
    --bo-bg: #f4f6fa;
    --bo-surface: #ffffff;
    --bo-surface-2: #f8fafc;
    --bo-border: #e3e8ef;
    --bo-text: #0f172a;
    --bo-text-2: #334155;
    --bo-muted: #64748b;
    --bo-success: #15803d;
    --bo-warning: #b45309;
    --bo-danger: #b91c1c;
    --bo-info: #0e7490;
    --bo-radius: 10px;
    --bo-radius-sm: 7px;
    --bo-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
    --bo-shadow-lg: 0 10px 30px -12px rgba(15, 23, 42, 0.25);
}

/* ---------- base ---------- */
html, body, .header-navbar, .table td, .table th, input, select, textarea, .popover, .tooltip,
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6,
.btn, .form-control, .form-select, .select2-container, .dropdown-menu, .table, .badge, .swal2-popup {
    font-family: var(--bo-font);
}
body { color: var(--bo-text-2); background-color: var(--bo-bg); font-size: 0.9rem; letter-spacing: -0.003em; }
html body { background-color: var(--bo-bg); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--bo-text); font-weight: 600; letter-spacing: -0.015em; }
a { text-decoration: none; }
::selection { background: rgba(29, 78, 216, 0.18); }
.text-muted { color: var(--bo-muted) !important; }

/* ---------- sidebar ---------- */
.main-menu.menu-light,
.main-menu.menu-light .navigation,
.main-menu.menu-light .navigation .navigation-header,
.main-menu.menu-light .navigation li.has-sub ul,
.main-menu.menu-light .navigation > li ul,
.main-menu .navbar-header,
.main-menu .main-menu-content { background: var(--bo-navy); }
.main-menu.menu-light { border-right: 0; box-shadow: none; }
/* The template's white fade under the menu header; its script shows it (inline style) when the menu scrolls. */
.main-menu .shadow-bottom { display: none !important; }
.main-menu .navbar-header { height: 72px; padding: 1rem 1rem 0.75rem 1.25rem; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.main-menu .navbar-header .navbar-brand { margin-top: 0.35rem; display: flex; align-items: center; gap: 0.7rem; }
.main-menu .navbar-header .navbar-brand .brand-text,
.main-menu .navbar-header .navbar-brand h2.brand-text { color: #fff; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; padding-left: 0; }
.bo-brand-mark {
    width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2563eb 0%, #0e7490 100%); color: #fff;
    font-weight: 800; font-size: 0.8rem; letter-spacing: 0.02em; box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.7);
}
.bo-brand-text { display: flex; flex-direction: column; line-height: 1.15; overflow: hidden; }
.bo-brand-text small { color: var(--bo-nav-text); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.main-menu .navbar-header .modern-nav-toggle .toggle-icon,
.main-menu .navbar-header .modern-nav-toggle .collapse-toggle-icon { color: var(--bo-nav-text) !important; }
.main-menu .main-menu-content { padding-top: 0.6rem; }
.main-menu.menu-light .navigation { font-size: 0.875rem; font-weight: 500; }
.main-menu.menu-light .navigation li a { color: var(--bo-nav-text); }
.main-menu.menu-light .navigation li a svg,
.main-menu.menu-light .navigation li a i { color: #8193b2; }
.main-menu.menu-light .navigation > li > a { margin: 1px 12px; padding: 9px 12px; border-radius: var(--bo-radius-sm); }
.main-menu.menu-light .navigation > li:not(.active) > a:hover,
.main-menu.menu-light .navigation li ul li:not(.active) > a:hover { background: var(--bo-navy-2); color: #fff; padding-left: 12px; transition: background 0.15s; }
.main-menu.menu-light .navigation li ul li:not(.active) > a:hover { padding-left: 22px; }
.main-menu.menu-light .navigation > li:not(.active) > a:hover svg { color: #fff; }
.main-menu.menu-light .navigation > li.open:not(.menu-item-closing) > a,
.main-menu.menu-light .navigation > li.sidebar-group-active > a { background: var(--bo-navy-2); color: #fff; }
.main-menu.menu-light .navigation > li.open > a svg,
.main-menu.menu-light .navigation > li.sidebar-group-active > a svg { color: #fff; }
.main-menu.menu-light .navigation > li.active > a,
.main-menu.menu-light .navigation > li ul .active {
    background: var(--bo-primary) !important; color: #fff; box-shadow: 0 6px 16px -8px rgba(29, 78, 216, 0.9);
}
.main-menu.menu-light .navigation > li.active > a svg,
.main-menu.menu-light .navigation > li ul .active svg,
.main-menu.menu-light .navigation > li ul .active > a { color: #fff; }
.main-menu.menu-light .navigation li ul li > a { margin: 1px 12px; padding: 7px 12px 7px 22px; border-radius: var(--bo-radius-sm); font-size: 0.84rem; }
.main-menu.menu-light .navigation li ul li > a svg { width: 8px !important; height: 8px !important; }
.main-menu.menu-light .navigation > li ul .active { border-radius: var(--bo-radius-sm); margin: 1px 12px; }
.main-menu.menu-light .navigation > li ul .active > a { margin: 0; }
.main-menu.menu-light .navigation .navigation-header { color: #6b7d9c; font-size: 0.68rem; letter-spacing: 0.08em; margin: 1.1rem 0 0.3rem 1.9rem; }
.main-menu .main-menu-content::-webkit-scrollbar { width: 6px; }
.main-menu .main-menu-content::-webkit-scrollbar-thumb { background: var(--bo-navy-3); border-radius: 6px; }
.main-menu .ps__thumb-y { background-color: var(--bo-navy-3) !important; }
.main-menu .ps__rail-y, .main-menu .ps__rail-y:hover, .main-menu .ps--clicking .ps__rail-y,
.main-menu .ps__rail-y.ps--clicking { background-color: transparent !important; opacity: 1; }
.main-menu .ps__thumb-y { background-color: rgba(255, 255, 255, 0.18) !important; }
.menu-collapsed .main-menu:not(.expanded) .navigation > li > a { margin: 1px 10px; }
.menu-collapsed .main-menu:not(.expanded) .bo-brand-text { display: none; }

/* ---------- top bar ---------- */
.header-navbar.floating-nav {
    background: rgba(255, 255, 255, 0.92) !important; backdrop-filter: saturate(160%) blur(8px);
    border: 1px solid var(--bo-border); border-radius: var(--bo-radius); box-shadow: var(--bo-shadow) !important;
    min-height: 60px;
}
.header-navbar-shadow { display: none !important; }
.header-navbar .navbar-container { padding-left: 1rem; padding-right: 1rem; }
.header-navbar .navbar-container ul.navbar-nav li a.nav-link-style svg,
.header-navbar .navbar-container .ficon { color: var(--bo-muted); }
.bo-topbar-title { display: flex; flex-direction: column; line-height: 1.2; margin-left: 0.5rem; }
.bo-topbar-title strong { color: var(--bo-text); font-weight: 650; font-size: 0.95rem; }
.bo-topbar-title span { color: var(--bo-muted); font-size: 0.76rem; }
.header-navbar .navbar-container .dropdown-user-link .user-name { color: var(--bo-text); font-weight: 600; }
.header-navbar .navbar-container .dropdown-user-link .user-status { color: var(--bo-muted); font-size: 0.74rem; }
.bo-avatar {
    width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--bo-primary-soft); color: var(--bo-primary); font-weight: 700; font-size: 0.85rem;
    border: 1px solid #d3def9;
}
.bo-chip {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.65rem; border-radius: 999px;
    background: var(--bo-surface-2); border: 1px solid var(--bo-border); color: var(--bo-text-2); font-size: 0.78rem; font-weight: 500;
}
.bo-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bo-success); }

/* ---------- page header ---------- */
.content-header-title, .content-header .content-header-title {
    color: var(--bo-text); font-weight: 650; font-size: 1.35rem; border-right: 0 !important; padding-right: 0 !important;
}
.content-header .breadcrumb { font-size: 0.8rem; }
.bo-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0.25rem 0 1.25rem; }
.bo-page-head h2 { margin: 0; font-size: 1.4rem; }
.bo-page-head p { margin: 0.2rem 0 0; color: var(--bo-muted); }

/* ---------- cards ---------- */
.card {
    border: 1px solid var(--bo-border); border-radius: var(--bo-radius); box-shadow: var(--bo-shadow); margin-bottom: 1.5rem;
}
.card .card-header { border-bottom: 0; padding: 1.1rem 1.25rem 0.4rem; }
.card .card-title, .card-header .card-title { color: var(--bo-text); font-size: 1rem; font-weight: 600; }
.card .card-body { padding: 1.1rem 1.25rem; }
.card-footer { background: var(--bo-surface-2); border-top: 1px solid var(--bo-border); }

/* KPI tiles (dashboard and summaries) */
.bo-kpi { display: block; height: 100%; padding: 1.1rem 1.2rem; color: inherit; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
a.bo-kpi:hover { border-color: #c7d4f2; box-shadow: var(--bo-shadow-lg); transform: translateY(-1px); color: inherit; }
.bo-kpi .bo-kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }
.bo-kpi .bo-kpi-label { color: var(--bo-muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.bo-kpi .bo-kpi-value { color: var(--bo-text); font-size: 1.65rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bo-kpi .bo-kpi-sub { color: var(--bo-muted); font-size: 0.8rem; margin-top: 0.3rem; }
.bo-kpi-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.bo-kpi-icon svg { width: 19px; height: 19px; }
.bo-tint-blue { background: #eaf0fd; color: #1d4ed8; }
.bo-tint-green { background: #e8f5ee; color: #15803d; }
.bo-tint-teal { background: #e6f4f7; color: #0e7490; }
.bo-tint-amber { background: #fdf3e6; color: #b45309; }
.bo-tint-red { background: #fbeaea; color: #b91c1c; }
.bo-tint-slate { background: #eef1f5; color: #475569; }
.bo-map { height: 440px; border-radius: 0 0 var(--bo-radius) var(--bo-radius); }
.bo-empty { padding: 2.2rem 1rem; text-align: center; color: var(--bo-muted); }

/* ---------- tables ---------- */
.table { color: var(--bo-text-2); --bs-table-hover-bg: #f5f8fe; }
.table > :not(caption) > * > * { padding: 0.7rem 1rem; border-bottom-color: var(--bo-border); }
.table thead th, .table thead tr th, .table tfoot th {
    background: var(--bo-surface-2) !important; color: var(--bo-muted) !important; font-size: 0.72rem !important;
    font-weight: 650 !important; letter-spacing: 0.05em; text-transform: uppercase; border-bottom: 1px solid var(--bo-border) !important;
    border-top: 0; white-space: nowrap; vertical-align: middle;
}
.table thead.table-dark th, .table .thead-dark th { background: var(--bo-navy-2) !important; color: #dbe4f3 !important; }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: #fafbfd; }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: #f3f7fe; }
.table td { vertical-align: middle; }
.table-bordered > :not(caption) > * > * { border-color: var(--bo-border); }
.card .table:last-child { margin-bottom: 0; }
.card > .table-responsive:last-child > .table, .card > .table:last-child { border-bottom-left-radius: var(--bo-radius); border-bottom-right-radius: var(--bo-radius); }
.tabular, .table td.num, .table th.num { font-variant-numeric: tabular-nums; text-align: right; }

/* DataTables */
div.dataTables_wrapper div.dataTables_length select,
div.dataTables_wrapper div.dataTables_filter input { border-radius: var(--bo-radius-sm); border-color: #cfd8e3; }
div.dataTables_wrapper div.dataTables_info { color: var(--bo-muted); font-size: 0.82rem; }
.dt-buttons .btn { border-radius: var(--bo-radius-sm) !important; }
.page-item .page-link { border-radius: var(--bo-radius-sm) !important; margin: 0 2px; border: 0; color: var(--bo-text-2); background: transparent; }
.page-item.active .page-link { background-color: var(--bo-primary) !important; color: #fff; box-shadow: none; }
.pagination { background: transparent; }
.pagination .page-item:first-child .page-link, .pagination .page-item:last-child .page-link { background: transparent; }

/* ---------- forms ---------- */
.form-control, .form-select, .input-group-text,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border-color: #cfd8e3; border-radius: var(--bo-radius-sm); color: var(--bo-text);
}
.form-control, .form-select { min-height: 38px; font-size: 0.9rem; }
.form-control::placeholder { color: #94a3b8; }
.form-control:focus, .form-select:focus,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--bo-primary) !important; box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14) !important;
}
.form-label, label { color: var(--bo-text-2); font-weight: 550; font-size: 0.82rem; }
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--classic .select2-results__option--highlighted[aria-selected] { background-color: var(--bo-primary) !important; }
.select2-container--default .select2-selection--multiple .select2-selection__choice { background-color: var(--bo-primary) !important; border-color: var(--bo-primary) !important; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn { border-radius: var(--bo-radius-sm); font-weight: 600; font-size: 0.86rem; padding: 0.55rem 1.05rem; letter-spacing: 0; }
.btn-sm, .btn-group-sm > .btn { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
.btn-lg { padding: 0.75rem 1.4rem; }
.btn:focus { box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.18) !important; }
[class*="btn-"]:not([class*="btn-outline-"]):not([class*="btn-flat-"]):not([class*="btn-gradient-"]):not([class*="btn-relief-"]):hover:not(.disabled):not(:disabled) { box-shadow: 0 6px 14px -8px rgba(15, 23, 42, 0.5); }
.btn-primary:hover:not(.disabled):not(:disabled) { background-color: var(--bo-primary-strong) !important; border-color: var(--bo-primary-strong) !important; }
.btn-outline-secondary, .btn-secondary { color: var(--bo-text-2); }
.btn-secondary { background-color: #fff !important; border: 1px solid #cfd8e3 !important; color: var(--bo-text-2) !important; }
.btn-secondary:hover:not(.disabled):not(:disabled) { background-color: var(--bo-surface-2) !important; color: var(--bo-text) !important; }

/* ---------- badges, alerts, misc ---------- */
.badge { font-weight: 600; letter-spacing: 0.01em; border-radius: 6px; padding: 0.35em 0.6em; }
.alert { border-radius: var(--bo-radius-sm); }
.dropdown-menu { border: 1px solid var(--bo-border); border-radius: var(--bo-radius-sm); box-shadow: var(--bo-shadow-lg); }
.dropdown-item { font-size: 0.86rem; }
.modal-content { border-radius: 12px; border: 0; box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.45); }
.modal-header { background: var(--bo-surface-2) !important; border-bottom: 1px solid var(--bo-border); border-radius: 12px 12px 0 0; }
.modal .modal-header .btn-close { box-shadow: none; transform: none; border-radius: 6px; background-color: transparent; }
.nav-tabs .nav-link { font-weight: 600; color: var(--bo-muted); }
.nav-tabs .nav-link.active { color: var(--bo-primary); }
.nav-tabs .nav-link:after { background: var(--bo-primary) !important; }
.nav-pills .nav-link.active { box-shadow: none; }
.swal2-popup { border-radius: 14px !important; }
.swal2-styled.swal2-confirm { background-color: var(--bo-primary) !important; border-radius: var(--bo-radius-sm) !important; }
.scroll-top { border-radius: 10px; }
.footer { color: var(--bo-muted); font-size: 0.8rem; }
.footer a { color: var(--bo-text-2); }
.content-wrapper .content-header-title { margin-bottom: 0.25rem; }
.bg-light-primary { background: var(--bo-primary-soft) !important; }

/* Old pages styled their table heads inline (dark slate bars); bring them into the palette. */
thead[style*="background-color: #222D32"], thead[style*="background-color:#222D32"] { background-color: var(--bo-navy-2) !important; }

/* ---------- login ---------- */
.bo-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bo-surface); }
.bo-auth-brand {
    position: relative; overflow: hidden; color: #dbe4f3; padding: 3rem 3.5rem; display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(1200px 600px at -10% 110%, rgba(14, 116, 144, 0.45), transparent 60%),
                radial-gradient(900px 500px at 110% -10%, rgba(37, 99, 235, 0.55), transparent 60%),
                linear-gradient(160deg, #0b1a33 0%, #0e2347 60%, #0b1a33 100%);
}
.bo-auth-brand::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.18;
    background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 44px 44px; mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent);
}
.bo-auth-brand > * { position: relative; z-index: 1; }
.bo-auth-logo { display: flex; align-items: center; gap: 0.8rem; color: #fff; font-weight: 700; font-size: 1.1rem; }
.bo-auth-logo .bo-brand-mark { width: 42px; height: 42px; flex-basis: 42px; font-size: 0.95rem; border-radius: 11px; }
.bo-auth-brand h1 { color: #fff; font-size: 2.1rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.03em; max-width: 30rem; margin-bottom: 1rem; }
.bo-auth-brand p.lead { color: #b7c3d9; font-size: 1rem; max-width: 30rem; }
.bo-auth-points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 0.85rem; }
.bo-auth-points li { display: flex; gap: 0.7rem; align-items: flex-start; color: #cdd8ea; font-size: 0.92rem; }
.bo-auth-points li span.tick { flex: 0 0 22px; height: 22px; border-radius: 6px; background: rgba(37, 99, 235, 0.35); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; }
.bo-auth-foot { color: #7f8fab; font-size: 0.8rem; }
.bo-auth-form { display: flex; align-items: center; justify-content: center; padding: 3rem 1.5rem; background: var(--bo-surface); }
.bo-auth-card { width: 100%; max-width: 400px; }
.bo-auth-card h2 { font-size: 1.6rem; margin-bottom: 0.35rem; }
.bo-auth-card .sub { color: var(--bo-muted); margin-bottom: 2rem; }
.bo-auth-card .form-control { min-height: 44px; font-size: 0.95rem; }
.bo-auth-card .btn-primary { min-height: 46px; font-size: 0.95rem; }
.bo-auth-card .company { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.75rem; border-radius: 999px; background: var(--bo-primary-soft); color: var(--bo-primary); font-weight: 600; font-size: 0.8rem; margin-bottom: 1.5rem; }
@media (max-width: 991.98px) {
    .bo-auth { grid-template-columns: 1fr; }
    .bo-auth-brand { padding: 2rem 1.5rem; min-height: auto; }
    .bo-auth-brand h1 { font-size: 1.5rem; }
    .bo-auth-points, .bo-auth-foot { display: none; }
}

/* ---------- dark mode (the moon button) ---------- */
.dark-layout {
    --bo-bg: #0b1220; --bo-surface: #111a2e; --bo-surface-2: #0f1729; --bo-border: #1f2b44;
    --bo-text: #e6ecf5; --bo-text-2: #c5cfdf; --bo-muted: #8a9ab5; --bo-primary-soft: rgba(37, 99, 235, 0.16);
}
.dark-layout body, html.dark-layout body, .dark-layout .content, .dark-layout .app-content { background-color: var(--bo-bg) !important; }
.dark-layout .card, .dark-layout .header-navbar.floating-nav, .dark-layout .modal-content, .dark-layout .dropdown-menu { background-color: var(--bo-surface) !important; border-color: var(--bo-border) !important; }
.dark-layout .header-navbar.floating-nav { background: rgba(17, 26, 46, 0.92) !important; }
.dark-layout .main-menu, .dark-layout .main-menu .navigation, .dark-layout .main-menu .navbar-header, .dark-layout .main-menu .main-menu-content,
.dark-layout .main-menu .navigation li.has-sub ul, .dark-layout .main-menu .navigation > li ul { background-color: #070f1f !important; }
.dark-layout .table thead th { background: var(--bo-surface-2) !important; }
.dark-layout .bo-tint-blue { background: rgba(37, 99, 235, 0.18); color: #93b4f8; }
.dark-layout .bo-tint-green { background: rgba(21, 128, 61, 0.2); color: #7fd3a1; }
.dark-layout .bo-tint-teal { background: rgba(14, 116, 144, 0.22); color: #7fcfe0; }
.dark-layout .bo-tint-amber { background: rgba(180, 83, 9, 0.22); color: #f2b877; }
.dark-layout .bo-tint-red { background: rgba(185, 28, 28, 0.22); color: #f19a9a; }
.dark-layout .bo-tint-slate { background: rgba(148, 163, 184, 0.16); color: #c5cfdf; }
.dark-layout .bo-chip { background: var(--bo-surface-2); border-color: var(--bo-border); color: var(--bo-text-2); }

/* ---------- responsive: every page usable on a phone ---------- */
.bo-scroll-x { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bo-scroll-x > table { margin-bottom: 0; }
.dataTables_wrapper .bo-scroll-x { margin: 0.5rem 0; }
img, iframe, video { max-width: 100%; }
@media (max-width: 991.98px) {
    .header-navbar.floating-nav { width: calc(100vw - 2rem) !important; margin-left: 1rem !important; margin-right: 1rem !important; }
    .content.app-content { padding-left: 1rem !important; padding-right: 1rem !important; }
}
@media (max-width: 767.98px) {
    body { font-size: 0.875rem; }
    .content.app-content { padding: calc(1rem + 4.45rem + 1rem) 0.75rem 0 !important; }
    .header-navbar.floating-nav { width: calc(100vw - 1.5rem) !important; margin: 0.75rem 0.75rem 0 !important; }
    .bo-page-head { flex-direction: column; align-items: stretch; }
    .bo-page-head > div:last-child { flex-wrap: wrap; }
    .bo-page-head h2 { font-size: 1.2rem; }
    .content-header .breadcrumb-wrapper, .content-header .breadcrumbs-top .breadcrumb { display: none; }
    .card .card-header { flex-wrap: wrap; gap: 0.5rem; }
    .card .card-header > * { max-width: 100%; }
    .card .card-body { padding: 0.9rem; }
    .bo-kpi .bo-kpi-value { font-size: 1.35rem; }
    .table > :not(caption) > * > * { padding: 0.55rem 0.7rem; }
    .btn { padding: 0.5rem 0.85rem; }
    .btn-group, .dt-buttons { flex-wrap: wrap; gap: 0.35rem; }
    div.dataTables_wrapper div.dataTables_length,
    div.dataTables_wrapper div.dataTables_filter,
    div.dataTables_wrapper div.dataTables_info,
    div.dataTables_wrapper div.dataTables_paginate { text-align: left !important; justify-content: flex-start !important; margin-top: 0.4rem; }
    div.dataTables_wrapper div.dataTables_filter input { width: 100% !important; margin-left: 0 !important; }
    div.dataTables_wrapper div.dataTables_filter label { width: 100%; }
    div.dataTables_wrapper .row > [class*="col-"] { width: 100%; }
    .pagination { flex-wrap: wrap; }
    .modal-dialog { margin: 0.5rem; }
    .form-control, .form-select { font-size: 16px; } /* no zoom-in on iPhone */
    .d-flex.justify-content-between { flex-wrap: wrap; gap: 0.5rem; }
    .float-end, .float-right, .pull-right { float: none !important; }
    .footer { text-align: center; }
}

/* ---------- older pages (layouts.app → admin layout): AdminLTE / Bootstrap 3 class names ---------- */
.bo-legacy .box { background: var(--bo-surface); border: 1px solid var(--bo-border); border-radius: var(--bo-radius); box-shadow: var(--bo-shadow); margin-bottom: 1.5rem; }
.bo-legacy .box-header { padding: 1rem 1.25rem 0.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.bo-legacy .box-title { font-size: 1rem; font-weight: 600; color: var(--bo-text); margin: 0; }
.bo-legacy .box-body, .bo-legacy .box-footer { padding: 1rem 1.25rem; }
.bo-legacy .box-footer { border-top: 1px solid var(--bo-border); background: var(--bo-surface-2); border-radius: 0 0 var(--bo-radius) var(--bo-radius); }
.bo-legacy .content-header h1, .bo-legacy > .content-header > h1 { font-size: 1.35rem; font-weight: 650; color: var(--bo-text); margin: 0.25rem 0 1rem; }
.bo-legacy .content-header .breadcrumb { display: none; }
.bo-legacy .btn-default { background: #fff; border: 1px solid #cfd8e3; color: var(--bo-text-2); }
.bo-legacy .btn-default:hover { background: var(--bo-surface-2); }
.bo-legacy .pull-right { float: right; } .bo-legacy .pull-left { float: left; }
.bo-legacy .form-group { margin-bottom: 1rem; }
.bo-legacy .control-label { font-weight: 550; font-size: 0.82rem; color: var(--bo-text-2); margin-bottom: 0.3rem; }
.bo-legacy .label { display: inline-block; padding: 0.25em 0.55em; border-radius: 6px; font-size: 0.75rem; font-weight: 600; color: #fff; background: var(--bo-muted); }
.bo-legacy .label-success { background: var(--bo-success); } .bo-legacy .label-danger { background: var(--bo-danger); }
.bo-legacy .label-warning { background: var(--bo-warning); } .bo-legacy .label-info, .bo-legacy .label-primary { background: var(--bo-primary); }
.bo-legacy .img-responsive { max-width: 100%; height: auto; }
.bo-legacy .img-circle { border-radius: 50%; }
.bo-legacy .hidden-xs { display: initial; }
.bo-legacy [class*="col-xs-"] { flex: 0 0 auto; width: 100%; }
@media (min-width: 768px) {
    .bo-legacy .col-xs-6 { width: 50%; } .bo-legacy .col-xs-4 { width: 33.333%; } .bo-legacy .col-xs-3 { width: 25%; }
}
@media (max-width: 767.98px) {
    .bo-legacy .hidden-xs { display: none !important; }
    .bo-legacy .pull-right, .bo-legacy .pull-left { float: none; }
    .bo-legacy .container { padding: 0; }
}
/* Older pages: filter forms in box headers wrap; negative-margin layout hacks are neutralised. */
.bo-legacy .box-header form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; width: 100%; }
.bo-legacy .box-header form > [class*="col-"] { flex: 1 1 190px; width: auto; max-width: 100%; padding: 0; }
.bo-legacy .box-header form > .btn { margin-left: auto; }
.bo-legacy [style*="margin-top: -"], .bo-legacy [style*="margin-top:-"] { margin-top: 0 !important; }
.bo-legacy .nav-pills > li > a, .bo-legacy .nav-tabs > li > a { display: block; padding: 0.5rem 1rem; border-radius: var(--bo-radius-sm); color: var(--bo-text-2); font-weight: 600; }
.bo-legacy .nav-pills > li > a.active { background: var(--bo-primary); color: #fff; }
.bo-legacy .nav-pills { gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* ---------- phone width: the page itself never scrolls sideways (wide tables scroll inside their card) ---------- */
.app-content { overflow-x: clip; }

/* Row actions in tables: one tidy group of small buttons that wraps instead of stretching the row. */
.bo-row-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; min-width: 150px; }
.bo-row-actions .btn { white-space: nowrap; }

/* Older pages wrap themselves in <section class="content"> / .content-wrapper, which the template uses for the
   page frame (left margin = menu width): inside .bo-legacy they are plain blocks, or the page shifts right. */
.bo-legacy .content, .bo-legacy .content-wrapper { margin: 0 !important; padding: 0 !important; min-height: 0 !important; width: auto !important; }

/* No ERP link on this instance (System Settings > ERP off): no "Send to ERP" buttons. */
.bo-no-erp .bo-erp-action { display: none !important; }

/* Button captions never break mid-word ("Sav/e"). */
.btn { white-space: nowrap; }

/* Older pages: action rows (Add / Export to Excel / Export to PDF) sit in one right-aligned row, not staggered by
   floats; searchable dropdowns are never squeezed to a few letters. */
.bo-legacy .row.no-print > [class*="col-"] { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; align-items: center; }
.bo-legacy .row.no-print > [class*="col-"] > form { display: contents; }
.bo-legacy .row.no-print .btn { float: none !important; margin: 0 !important; }
.bo-legacy .select2-container { min-width: 200px; }

/* Table search and length boxes fit the card on a phone. */
@media (max-width: 767.98px) {
    .dataTables_wrapper .dataTables_filter label { display: flex; align-items: center; gap: 0.5rem; width: 100%; margin: 0; }
    .dataTables_wrapper .dataTables_filter input { flex: 1 1 auto; min-width: 0; width: auto !important; margin-left: 0 !important; }
    .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_length { text-align: left !important; }
}

/* Company logo (Settings > Company Profile): menu, sign-in page, settings */
.bo-brand-logo { height: 34px; min-width: 34px; max-width: 96px; flex: 0 0 auto; padding: 3px 5px; border-radius: 9px; background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.bo-brand-logo img { max-height: 100%; max-width: 100%; object-fit: contain; }
.bo-auth-card .bo-auth-company-logo { display: block; max-height: 64px; max-width: 220px; object-fit: contain; margin-bottom: 1rem; }
.bo-logo-current { max-height: 48px; max-width: 160px; object-fit: contain; padding: 4px; border: 1px solid var(--bo-border, #e2e8f0); border-radius: 6px; background: #fff; }

/* Company Profile: report preview */
@media (min-width: 1200px) { .bo-sticky-preview { position: sticky; top: 96px; } }
.bo-report-preview { --rp-color: #1e3a8a; background: #fff; color: #1e293b; border: 1px solid #e2e8f0; border-radius: 6px; padding: 16px; font-size: 0.78rem; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }
.bo-report-preview .rp-head { text-align: center; border-bottom: 2px solid var(--rp-color); padding-bottom: 8px; margin-bottom: 8px; }
.bo-report-preview .rp-head img { display: block; max-height: 48px; max-width: 180px; object-fit: contain; margin: 0 auto 4px; }
.bo-report-preview .rp-name { font-size: 1rem; font-weight: 700; color: var(--rp-color); }
.bo-report-preview .rp-lines { color: #64748b; font-size: 0.72rem; }
.bo-report-preview .rp-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.bo-report-preview .rp-title strong { font-size: 0.9rem; color: #0f172a; }
.bo-report-preview .rp-title span { color: #64748b; font-size: 0.7rem; }
.bo-report-preview table { width: 100%; border-collapse: collapse; }
.bo-report-preview th { background: var(--rp-color); color: #fff; padding: 4px 6px; text-align: left; font-weight: 600; }
.bo-report-preview td { padding: 4px 6px; border-bottom: 1px solid #e2e8f0; }
.bo-report-preview .rp-signs { display: flex; gap: 16px; margin-top: 28px; }
.bo-report-preview .rp-signs:empty { display: none; }
.bo-report-preview .rp-signs div { flex: 1; border-top: 1px solid #94a3b8; padding-top: 3px; text-align: center; color: #475569; font-size: 0.7rem; }
.bo-report-preview .rp-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; color: #94a3b8; font-size: 0.68rem; }
.bo-favicon-current { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }

/* Product pictures (products list, product form, featured products) */
.bo-product-thumb { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; border: 1px solid var(--bo-border); background: #fff; display: inline-block; vertical-align: middle; }
.bo-product-thumb.is-featured { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25); }
.bo-product-thumb-empty { background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 6px, #e2e8f0 6px, #e2e8f0 12px); }
.bo-product-thumb-lg { width: 96px; height: 96px; object-fit: contain; border-radius: 10px; border: 1px solid var(--bo-border); background: #fff; }

/* Drop-down lists (select2): the highlighted row was blue text on a blue background (QA 19-10: "type hides"). */
.select2-container .select2-results__option[aria-selected='true'] { background-color: var(--bo-primary-soft) !important; color: var(--bo-primary) !important; }
.select2-container .select2-results__option--highlighted,
.select2-container .select2-results__option--highlighted[aria-selected] { background-color: var(--bo-primary) !important; color: #fff !important; }
.select2-container .select2-results__option:empty { display: none; } /* the blank placeholder option */
