/*
 * Brownfly IMS UI refresh
 * Shared, screen-first refinements layered over the legacy styles.
 * Kept separate so future UI updates can be maintained without disturbing
 * the original rules or the Excel-style BES print document.
 */
:root {
    --ui-radius-sm: 9px;
    --ui-radius-md: 14px;
    --ui-radius-lg: 18px;
    --ui-shadow-soft: 0 3px 12px rgba(25, 40, 25, .045);
    --ui-shadow-card: 0 8px 26px rgba(25, 40, 25, .065);
    --ui-shadow-hover: 0 12px 28px rgba(var(--primary-rgb), .13);
    --ui-line: var(--soft-border, #d9e4d5);
    --ui-focus: 0 0 0 3px rgba(var(--secondary-rgb, 77, 124, 47), .14);
}

html { scroll-padding-top: 90px; }
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Sidebar and navigation */
.sidebar {
    background: linear-gradient(165deg, var(--primary) 0%, rgba(var(--primary-rgb), .96) 100%);
    border-right: 1px solid rgba(255, 255, 255, .09);
    box-shadow: 8px 0 28px rgba(18, 32, 18, .12);
}
.sidebar-header {
    padding: 22px 18px 18px;
    border-bottom-color: rgba(255, 255, 255, .12);
}
.sidebar-header img {
    width: min(150px, 100%);
    max-height: 95px;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .08));
}
.sidebar-header h2:first-of-type {
    font-size: 17px;
    line-height: 1.35;
    letter-spacing: -.015em;
}
.sidebar-header h2 + h2 {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.45;
    font-weight: 500;
    opacity: .76;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.company-switcher { padding: 16px 18px 12px; }
.company-switcher label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .75);
}
.company-switcher label i { font-size: 16px; }
.company-switcher select {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .18);
    font-size: 13px;
}
.sidebar-menu { padding: 10px 12px 16px; }
.sidebar-menu ul { gap: 4px; }
.sidebar-menu li a {
    position: relative;
    min-height: 44px;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: rgba(255, 255, 255, .88);
    font-size: 13px;
    line-height: 1.35;
    letter-spacing: .005em;
}
.sidebar-menu li a i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    font-size: 20px;
    color: rgba(255, 255, 255, .76);
    transition: color .18s ease, transform .18s ease;
}
.sidebar-menu li a:hover {
    padding-left: 13px;
    border-color: rgba(255, 255, 255, .11);
    background: rgba(255, 255, 255, .085);
    color: #fff;
}
.sidebar-menu li a:hover i { color: var(--accent); transform: translateX(1px); }
.sidebar-menu li a.active {
    border-color: rgba(255, 255, 255, .13);
    border-left: 3px solid var(--accent);
    padding-left: 11px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}
.sidebar-menu li a.active i { color: var(--accent); }
.bes-sidebar-submenu {
    margin: 2px 0 5px 22px;
    padding: 4px 0 5px 12px;
    border-left: 1px solid rgba(255, 255, 255, .20);
}
.bes-sidebar-submenu a {
    display: flex !important;
    align-items: center;
    gap: 8px;
    min-height: 31px;
    padding: 6px 9px !important;
    border-radius: 7px;
    color: rgba(255, 255, 255, .75) !important;
    font-size: 11px !important;
    line-height: 1.35;
}
.bes-sidebar-submenu a i { font-size: 15px; color: var(--accent); }
.bes-sidebar-submenu a:hover {
    background: rgba(255, 255, 255, .09);
    color: #fff !important;
}
.sidebar-footer { padding: 14px 16px 18px; }
.sidebar-footer a {
    min-height: 43px;
    justify-content: flex-start;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 11px;
    font-size: 13px;
}
.sidebar-footer a i { font-size: 19px; }

/* Topbar: compact date/time and a clear user identity area */
.topbar {
    height: 76px;
    padding: 0 clamp(16px, 2.2vw, 30px);
    border-bottom: 1px solid rgba(var(--primary-rgb), .08);
    box-shadow: 0 4px 18px rgba(25, 40, 25, .045);
    backdrop-filter: saturate(150%) blur(12px);
}
.topbar-right { gap: clamp(12px, 1.8vw, 22px); }
.datetime { min-width: 160px; }
.datetime h4,
.datetime p {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
    line-height: 1.45;
    white-space: nowrap;
}
.datetime h4 { font-size: 12px; font-weight: 700; }
.datetime p { margin-top: 2px; font-size: 11px; }
.datetime i { font-size: 15px; color: var(--secondary); }
.profile { gap: 10px; cursor: default; }
.profile-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--soft-border);
    border-radius: 13px;
    background: var(--soft);
    color: var(--primary);
}
.profile-avatar i { font-size: 23px; }
.profile-info { max-width: 210px; }
.profile-info h4 {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}
.profile-info p {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.4;
}
.profile-info p i { font-size: 13px; }
.approval-level-label { font-size: 10px; padding: 2px 7px; }

/* Page titles and content spacing */
.page-header {
    align-items: flex-start;
    margin-bottom: 20px;
}
.page-header h1 {
    font-size: clamp(22px, 2vw, 28px);
    letter-spacing: -.025em;
    line-height: 1.24;
}
.page-header p {
    max-width: 900px;
    font-size: 13px;
    line-height: 1.6;
}
.dashboard { padding: clamp(18px, 2.4vw, 30px); }
.dashboard-section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 16px;
    font-weight: 700;
}
.dashboard-card {
    min-width: 0;
    border: 1px solid rgba(var(--primary-rgb), .07);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-soft);
}
.dashboard-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--secondary-rgb), .22);
    box-shadow: var(--ui-shadow-hover);
}
.dashboard-icon { flex: 0 0 58px; width: 58px; height: 58px; border-radius: 16px; }
.dashboard-icon i { font-size: 29px; }
.dashboard-info h5 { line-height: 1.45; }
.dashboard-info h2 { letter-spacing: -.035em; }

/* Shared cards, panels and section headings */
.form-card,
.table-card,
.chart-card,
.activity-card,
.stock-in-card,
.stock-history-card,
.product-view-card,
.view-product-card,
.supplier-view-card,
.category-card,
.stat-box,
.action-card {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-soft);
}
.form-card { padding: clamp(18px, 2vw, 28px); }
.table-card { box-shadow: var(--ui-shadow-soft); }
.table-header {
    gap: 14px;
    padding: 18px 22px;
    background: linear-gradient(180deg, #fff 0%, rgba(var(--primary-rgb), .015) 100%);
}
.table-header h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }

/* Inputs: one consistent focus style across shared pages */
.form-control,
.input-group input,
.company-select select,
.search-box input {
    border-radius: 10px;
    border: 1px solid var(--ui-line);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.form-control { min-height: 42px; padding: 11px 13px; font-size: 13px; }
.input-group input { padding-top: 12px; padding-bottom: 12px; font-size: 13px; }
.company-select select { padding: 11px 12px; font-size: 13px; }
.form-control:focus,
.input-group input:focus,
.company-select select:focus,
.search-box input:focus {
    border-color: var(--secondary);
    box-shadow: var(--ui-focus);
}
input::placeholder,
textarea::placeholder { color: #899184; opacity: 1; }
label { line-height: 1.45; }

/* Buttons and row actions */
.btn,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-add {
    min-height: 39px;
    border-radius: 10px;
    padding: 9px 15px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    box-shadow: none;
}
.btn-primary,
.btn-add { box-shadow: 0 3px 8px rgba(var(--primary-rgb), .10); }
.btn-primary:hover,
.btn-add:hover { box-shadow: 0 6px 15px rgba(var(--primary-rgb), .17); transform: translateY(-1px); }
.btn-secondary { background: #edf0eb; color: #435040; border: 1px solid #dce3d8; }
.btn-secondary:hover { background: #e1e8dd; color: var(--primary); }
.btn-danger:hover,
.btn-success:hover,
.btn-warning:hover { transform: translateY(-1px); }
.btn i,
.btn-add i { font-size: 17px; }
.action-buttons { gap: 6px; }
.action-buttons a,
.action-buttons button {
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 11px;
}
.action-buttons a:focus-visible,
.action-buttons button:focus-visible,
.btn:focus-visible,
.btn-add:focus-visible,
button:focus-visible,
a:focus-visible { outline: 3px solid rgba(var(--secondary-rgb), .35); outline-offset: 2px; }
button:disabled,
.btn:disabled,
.bes-btn:disabled { cursor: not-allowed; opacity: .58; transform: none !important; box-shadow: none !important; }

/* Data tables: legible headers and restrained hover */
.table-card table thead th,
.table-wrapper table thead th {
    padding: 12px 14px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: .055em;
    text-transform: uppercase;
}
.table-card table tbody td,
.table-wrapper table tbody td {
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.5;
}
.table-card table tbody tr:nth-child(even),
.table-wrapper table tbody tr:nth-child(even) { background: rgba(var(--primary-rgb), .018); }
.table-card table tbody tr:hover,
.table-wrapper table tbody tr:hover { background: rgba(var(--secondary-rgb), .065); }
.badge { padding: 5px 9px; font-size: 10px; line-height: 1.3; }

/* BES queue/forms only. Deliberately excludes the Excel/print document. */
@media screen {
    .bes-page .bes-list-card,
    .bes-page .bes-form-card,
    .bes-page .bes-document-card {
        border: 1px solid var(--ui-line, #d9e4d5);
        border-radius: var(--ui-radius-lg);
        box-shadow: var(--ui-shadow-soft);
    }
    .bes-page .bes-search { padding: 17px 18px; gap: 12px; }
    .bes-page .bes-search-input {
        min-height: 42px;
        padding: 10px 13px;
        border: 1px solid var(--ui-line, #d9e4d5);
        border-radius: 10px;
        font-size: 13px;
        transition: border-color .18s ease, box-shadow .18s ease;
    }
    .bes-page .bes-search-input:focus,
    .bes-page .bes-field input:focus,
    .bes-page .bes-field select:focus,
    .bes-page .bes-field textarea:focus,
    .bes-page .bes-vendor-field input:focus,
    .bes-page .bes-vendor-field select:focus,
    .bes-page .bes-vendor-field textarea:focus {
        border-color: var(--secondary, #d64d8b);
        outline: none;
        box-shadow: var(--ui-focus);
    }
    .bes-page .bes-btn {
        min-height: 38px;
        border-radius: 10px;
        padding: 9px 13px;
        font-size: 12px;
        line-height: 1.25;
        transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    }
    .bes-page .bes-btn-primary { box-shadow: 0 3px 9px rgba(var(--primary-rgb, 46, 74, 46), .12); }
    .bes-page .bes-btn-primary:hover,
    .bes-page .bes-btn-secondary:hover,
    .bes-page .bes-btn-danger:hover { transform: translateY(-1px); box-shadow: 0 5px 13px rgba(25, 40, 25, .10); }
    .bes-page .bes-table th { font-size: 10px; letter-spacing: .035em; text-transform: uppercase; }
    .bes-page .bes-table td { font-size: 12px; line-height: 1.45; }
    .bes-page .bes-table tbody tr:nth-child(even) { background: #fbfcfa; }
    .bes-page .bes-table tbody tr:hover { background: #f1f6ed; }
}

@media (max-width: 992px) {
    .topbar { height: 68px; }
    .datetime { min-width: 0; }
    .datetime h4 { font-size: 11px; }
    .datetime p { font-size: 10px; }
    .profile-avatar { width: 37px; height: 37px; flex-basis: 37px; }
    .profile-info { max-width: 160px; }
    .profile-info h4 { max-width: 160px; }
    .bes-page .page-header { flex-wrap: wrap; }
}
@media (max-width: 640px) {
    .topbar { padding: 0 12px; gap: 10px; }
    .topbar-right { gap: 10px; min-width: 0; }
    .datetime h4,
    .datetime p { gap: 4px; font-size: 9px; }
    .datetime i { font-size: 12px; }
    .profile { gap: 6px; }
    .profile-avatar { width: 33px; height: 33px; flex-basis: 33px; border-radius: 10px; }
    .profile-avatar i { font-size: 19px; }
    .profile-info { max-width: 105px; }
    .profile-info h4 { max-width: 105px; font-size: 10px; }
    .profile-info p { font-size: 9px; }
    .approval-level-label { font-size: 9px; }
    .page-header { align-items: flex-start; flex-wrap: wrap; }
    .page-header h1 { font-size: 22px; }
    .dashboard { padding: 15px; }
    .dashboard-grid { gap: 12px; }
    .dashboard-card { padding: 18px; }
    .dashboard-icon { width: 48px; height: 48px; flex-basis: 48px; }
    .dashboard-icon i { font-size: 24px; }
    .table-header { align-items: flex-start; flex-wrap: wrap; padding: 15px; }
    .form-card { padding: 16px; }
    .bes-page .bes-search-input { min-width: 0; }
    .bes-page .bes-table th,
    .bes-page .bes-table td { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* FIX 23 Oct 2026: keep the sticky top bar above the BES sheet's edge rails.
   The single-item BES uses a transformed document with positioned side edges;
   this header must paint above those elements when the page is scrolled. */
.topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 10000 !important;
    isolation: isolate;
    box-sizing: border-box !important;
    width: 100%;
    max-width: 100%;
    background: var(--card, #fff) !important;
}
.topbar-right,
.profile,
.profile-info {
    min-width: 0;
}
.profile-info {
    overflow: visible;
}

/* Uploaded account avatar in the shared top bar */
.profile-avatar img.profile-avatar-image{display:block;width:100%;height:100%;flex:0 0 100%;max-width:none;object-fit:cover;border:0;border-radius:inherit;margin:0}


/* 23 Oct 2026: normalize uploaded profile photos and align the topbar account block. */
.topbar {
    display: flex;
    align-items: center;
    min-height: 82px;
    height: 82px;
}
.topbar-right {
    display: flex;
    align-items: center;
    align-self: stretch;
    flex: 0 1 auto;
    min-width: 0;
}
.topbar .profile {
    display: flex;
    align-items: center;
    align-self: center;
    gap: 9px;
    min-width: 0;
    max-width: 290px;
    height: auto;
    flex: 0 1 auto;
}
.topbar .profile-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 58px;
    height: 58px;
    min-width: 58px;
    min-height: 58px;
    flex: 0 0 58px;
    padding: 0;
    overflow: hidden;
    border-radius: 10px;
    line-height: 1;
}
.topbar .profile-avatar img.profile-avatar-image {
    position: absolute;
    inset: 0;
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    flex: none;
    object-fit: cover;
    object-position: center 40%;
    image-rendering: auto;
    border: 0 !important;
    border-radius: inherit;
    margin: 0;
}
.topbar .profile-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    box-sizing: border-box;
    min-width: 0;
    max-width: 190px;
    overflow: hidden;
    align-self: center;
}
.topbar .profile-info h4 {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.35;
}
.topbar .profile-info p {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 2px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1.3;
}
.topbar .approval-level-label {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    max-width: 100%;
    margin-top: 3px;
    padding: 3px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    line-height: 1.25;
}
@media (max-width: 992px) {
    .topbar { height: 72px; min-height: 72px; }
    .topbar .profile-avatar {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        flex-basis: 48px;
    }
    .topbar .profile-info { max-width: 170px; }
}
@media (max-width: 640px) {
    .topbar { height: 68px; min-height: 68px; }
    .topbar-right { gap: 10px; }
    .topbar .profile { gap: 7px; max-width: none; }
    .topbar .profile-avatar {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        flex-basis: 42px;
        border-radius: 10px;
    }
    .topbar .profile-info { max-width: 140px; }
    .topbar .profile-info h4 { font-size: 11px; line-height: 1.3; }
    .topbar .profile-info p { font-size: 10px; }
    .topbar .approval-level-label { font-size: 9px; padding: 3px 6px; }
}
@media (max-width: 400px) {
    .topbar { padding-left: 8px; padding-right: 8px; }
    .topbar-right { gap: 7px; }
    .topbar .datetime h4 { font-size: 8px; }
    .topbar .datetime p { font-size: 9px; }
    .topbar .profile-info { max-width: 124px; }
}


/* ================================================================
   Advanced PR Input/Log + BES/Bid Evaluation sidebar interactions
   Shared across all screens so the two sections animate consistently.
   ================================================================ */
.sidebar-menu li.pr-sidebar-group,
.sidebar-menu li.bes-sidebar-group {
    position: relative;
    isolation: isolate;
}

.sidebar-menu li.pr-sidebar-group > a,
.sidebar-menu li.bes-sidebar-group > a {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-right: 38px !important;
    transition:
        background-color .24s ease,
        border-color .24s ease,
        color .24s ease,
        box-shadow .28s cubic-bezier(.2, .8, .2, 1),
        transform .2s ease;
}

/* Animated accent rail on hover / active group. */
.sidebar-menu li.pr-sidebar-group > a::before,
.sidebar-menu li.bes-sidebar-group > a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 5px 5px 0;
    background: var(--accent);
    transform: scaleY(.15);
    transform-origin: center;
    opacity: 0;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
}

.sidebar-menu li.pr-sidebar-group > a::after,
.sidebar-menu li.bes-sidebar-group > a::after {
    content: "";
    position: absolute;
    right: 16px;
    top: calc(50% - 4px);
    width: 7px;
    height: 7px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    border-radius: 0 0 1px 0;
    transform: rotate(-45deg);
    transform-origin: center;
    opacity: .72;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
    pointer-events: none;
}

.sidebar-menu li.pr-sidebar-group > a:hover,
.sidebar-menu li.bes-sidebar-group > a:hover {
    background: rgba(255, 255, 255, .105);
    border-color: rgba(255, 255, 255, .13);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.sidebar-menu li.pr-sidebar-group > a:hover::before,
.sidebar-menu li.bes-sidebar-group > a:hover::before {
    opacity: .7;
    transform: scaleY(.58);
}

.sidebar-menu li.pr-sidebar-group.active > a,
.sidebar-menu li.bes-sidebar-group.active > a {
    background: linear-gradient(105deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .075));
    border-color: rgba(255, 255, 255, .16);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055), 0 5px 14px rgba(0, 0, 0, .08);
}

.sidebar-menu li.pr-sidebar-group.active > a::before,
.sidebar-menu li.bes-sidebar-group.active > a::before {
    opacity: 1;
    transform: scaleY(1);
}

.sidebar-menu li.pr-sidebar-group.active > a::after,
.sidebar-menu li.bes-sidebar-group.active > a::after {
    opacity: 1;
    transform: rotate(45deg);
}

.sidebar-menu li.pr-sidebar-group > a > i,
.sidebar-menu li.bes-sidebar-group > a > i {
    transition: color .22s ease, transform .28s cubic-bezier(.2, .8, .2, 1);
}

.sidebar-menu li.pr-sidebar-group > a:hover > i,
.sidebar-menu li.bes-sidebar-group > a:hover > i {
    transform: translateX(2px) scale(1.04);
    color: var(--accent);
}

/* Keep the submenu in the layout so max-height/opacity can animate smoothly. */
.sidebar-menu li.pr-sidebar-group > .bes-sidebar-submenu,
.sidebar-menu li.bes-sidebar-group > .bes-sidebar-submenu {
    display: block !important;
    margin: 2px 0 4px 22px !important;
    padding: 0 0 0 12px !important;
    border-left: 1px solid rgba(255, 255, 255, .18);
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transform-origin: top;
    transition:
        max-height .38s cubic-bezier(.2, .8, .2, 1),
        opacity .22s ease,
        transform .3s cubic-bezier(.2, .8, .2, 1),
        padding .28s ease,
        visibility 0s linear .38s;
    will-change: max-height, opacity, transform;
}

.sidebar-menu li.pr-sidebar-group.active > .bes-sidebar-submenu,
.sidebar-menu li.bes-sidebar-group.active > .bes-sidebar-submenu {
    max-height: 190px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    padding: 4px 0 8px 12px !important;
    transition:
        max-height .42s cubic-bezier(.2, .8, .2, 1),
        opacity .25s ease .035s,
        transform .32s cubic-bezier(.2, .8, .2, 1),
        padding .28s ease,
        visibility 0s linear 0s;
}

.sidebar-menu li.pr-sidebar-group > .bes-sidebar-submenu > a,
.sidebar-menu li.bes-sidebar-group > .bes-sidebar-submenu > a {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 9px;
    min-height: 35px;
    margin: 3px 0;
    padding: 8px 10px !important;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, .76) !important;
    font-size: 12px !important;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-8px) scale(.985);
    transition:
        opacity .22s ease,
        transform .28s cubic-bezier(.2, .8, .2, 1),
        background-color .2s ease,
        border-color .2s ease,
        color .2s ease,
        box-shadow .2s ease;
}

.sidebar-menu li.pr-sidebar-group.active > .bes-sidebar-submenu > a,
.sidebar-menu li.bes-sidebar-group.active > .bes-sidebar-submenu > a {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.sidebar-menu li.pr-sidebar-group.active > .bes-sidebar-submenu > a:nth-child(1),
.sidebar-menu li.bes-sidebar-group.active > .bes-sidebar-submenu > a:nth-child(1) {
    transition-delay: .035s, .035s, 0s, 0s, 0s, 0s;
}
.sidebar-menu li.pr-sidebar-group.active > .bes-sidebar-submenu > a:nth-child(2),
.sidebar-menu li.bes-sidebar-group.active > .bes-sidebar-submenu > a:nth-child(2) {
    transition-delay: .075s, .075s, 0s, 0s, 0s, 0s;
}
.sidebar-menu li.bes-sidebar-group.active > .bes-sidebar-submenu > a:nth-child(3) {
    transition-delay: .115s, .115s, 0s, 0s, 0s, 0s;
}

.sidebar-menu li.pr-sidebar-group > .bes-sidebar-submenu > a > i,
.sidebar-menu li.bes-sidebar-group > .bes-sidebar-submenu > a > i {
    flex: 0 0 17px;
    min-width: 17px;
    font-size: 16px;
    color: var(--accent);
    transition: transform .22s cubic-bezier(.2, .8, .2, 1), color .2s ease;
}

.sidebar-menu li.pr-sidebar-group > .bes-sidebar-submenu > a:hover,
.sidebar-menu li.bes-sidebar-group > .bes-sidebar-submenu > a:hover {
    background: rgba(255, 255, 255, .09);
    border-color: rgba(255, 255, 255, .105);
    color: #fff !important;
    transform: translateX(3px) scale(1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .07);
}

.sidebar-menu li.pr-sidebar-group > .bes-sidebar-submenu > a:hover > i,
.sidebar-menu li.bes-sidebar-group > .bes-sidebar-submenu > a:hover > i {
    transform: translateX(2px) scale(1.07);
}

.sidebar-menu li.pr-sidebar-group > .bes-sidebar-submenu > a.active,
.sidebar-menu li.bes-sidebar-group > .bes-sidebar-submenu > a.active {
    background: rgba(var(--accent-rgb), .15) !important;
    border-color: rgba(var(--accent-rgb), .24) !important;
    border-left: 1px solid rgba(var(--accent-rgb), .45) !important;
    padding-left: 10px !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.sidebar-menu li.pr-sidebar-group > .bes-sidebar-submenu > a.active > i,
.sidebar-menu li.bes-sidebar-group > .bes-sidebar-submenu > a.active > i {
    color: var(--accent);
    transform: scale(1.08);
}

.sidebar-menu li.pr-sidebar-group > a:focus-visible,
.sidebar-menu li.bes-sidebar-group > a:focus-visible,
.sidebar-menu li.pr-sidebar-group > .bes-sidebar-submenu > a:focus-visible,
.sidebar-menu li.bes-sidebar-group > .bes-sidebar-submenu > a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-menu li.pr-sidebar-group > a,
    .sidebar-menu li.bes-sidebar-group > a,
    .sidebar-menu li.pr-sidebar-group > a::before,
    .sidebar-menu li.bes-sidebar-group > a::before,
    .sidebar-menu li.pr-sidebar-group > a::after,
    .sidebar-menu li.bes-sidebar-group > a::after,
    .sidebar-menu li.pr-sidebar-group > .bes-sidebar-submenu,
    .sidebar-menu li.bes-sidebar-group > .bes-sidebar-submenu,
    .sidebar-menu li.pr-sidebar-group > .bes-sidebar-submenu > a,
    .sidebar-menu li.bes-sidebar-group > .bes-sidebar-submenu > a,
    .sidebar-menu li.pr-sidebar-group > .bes-sidebar-submenu > a > i,
    .sidebar-menu li.bes-sidebar-group > .bes-sidebar-submenu > a > i {
        transition: none !important;
        animation: none !important;
    }
}

/* =====================================================================
   BROWNFLY IMS — 2026 PRODUCT UI LAYER
   Global screen-only refinement: calmer surfaces, clearer hierarchy,
   responsive controls, safer focus states and lightweight motion.
   Business logic, permissions and print-document styling are untouched.
   ===================================================================== */
@media screen {
    :root {
        --bf26-radius-xs: 7px;
        --bf26-radius-sm: 10px;
        --bf26-radius-md: 14px;
        --bf26-radius-lg: 20px;
        --bf26-surface: #fff;
        --bf26-surface-soft: rgba(255, 255, 255, .82);
        --bf26-border: rgba(var(--primary-rgb), .105);
        --bf26-shadow-xs: 0 2px 8px rgba(24, 40, 24, .035);
        --bf26-shadow-sm: 0 5px 18px rgba(24, 40, 24, .055);
        --bf26-shadow-md: 0 12px 32px rgba(24, 40, 24, .075);
        --bf26-shadow-focus: 0 0 0 4px rgba(var(--secondary-rgb), .13);
        --bf26-ease: cubic-bezier(.2, .72, .25, 1);
    }

    html { scroll-padding-top: 96px; }
    body {
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        background-color: var(--bg);
        background-image: radial-gradient(ellipse at 80% 0%, rgba(var(--secondary-rgb), .045), transparent 42%);
    }
    .wrapper { min-width: 0; }
    .content { min-width: 0; background: transparent; }

    /* Brand rail: richer depth while respecting each selected company theme. */
    .sidebar {
        background: linear-gradient(155deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 88%, #101a10) 100%);
        border-right: 1px solid rgba(255, 255, 255, .08);
        box-shadow: 12px 0 34px rgba(13, 26, 13, .13);
    }
    .sidebar-header {
        position: relative;
        isolation: isolate;
        padding-top: 22px;
        padding-bottom: 20px;
        overflow: hidden;
        background: linear-gradient(180deg, rgba(255,255,255,.045), transparent 100%);
    }
    .sidebar-header::before {
        content: "";
        position: absolute;
        z-index: -1;
        inset: -44px -30px auto;
        height: 140px;
        border-radius: 50%;
        background: radial-gradient(ellipse, rgba(var(--accent-rgb), .16), transparent 68%);
        pointer-events: none;
    }
    .sidebar-header img {
        max-width: 148px;
        max-height: 82px;
        object-fit: contain;
        filter: drop-shadow(0 4px 10px rgba(0,0,0,.12));
    }
    .company-switcher select {
        min-width: 0;
        color: #fff;
        background-color: rgba(255,255,255,.09);
        border: 1px solid rgba(255,255,255,.16);
        box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
        transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
    }
    .company-switcher select:hover { background-color: rgba(255,255,255,.13); }
    .company-switcher select:focus { outline: none; border-color: rgba(var(--accent-rgb), .75); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .14); }

    /* General top navigation and account block. */
    .topbar {
        background: rgba(255,255,255,.94) !important;
        border-bottom: 1px solid rgba(var(--primary-rgb), .085);
        box-shadow: 0 5px 22px rgba(25,40,25,.045);
        -webkit-backdrop-filter: saturate(155%) blur(14px);
        backdrop-filter: saturate(155%) blur(14px);
    }
    .topbar-left, .topbar-right { min-width: 0; }
    .topbar .datetime { color: var(--heading); }
    .topbar .datetime h4 { color: var(--heading); font-weight: 700; letter-spacing: -.01em; }
    .topbar .datetime p { color: var(--muted); }
    .topbar .datetime i { color: var(--secondary); }
    .topbar .profile { padding: 7px 9px; border: 1px solid transparent; border-radius: 15px; transition: background .2s ease, border-color .2s ease; }
    .topbar .profile:hover { background: rgba(var(--primary-rgb), .035); border-color: rgba(var(--primary-rgb), .08); }
    .topbar .profile-avatar { border: 1px solid rgba(var(--primary-rgb), .15); box-shadow: 0 3px 10px rgba(var(--primary-rgb), .09); }
    .topbar .profile-info h4 { color: var(--heading); letter-spacing: -.01em; }
    .topbar .profile-info p { color: var(--muted); }
    .approval-level-label {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        width: fit-content;
        max-width: 100%;
        padding: 3px 8px;
        border: 1px solid rgba(var(--secondary-rgb), .16);
        border-radius: 999px;
        background: rgba(var(--secondary-rgb), .07);
        color: var(--secondary);
        font-weight: 700;
        line-height: 1.35;
    }

    /* Main content: sharper hierarchy, controlled spacing and a short entrance. */
    .dashboard {
        min-width: 0;
        padding: clamp(18px, 2.4vw, 34px);
    }
    .dashboard > .page-header,
    .dashboard > .um-page-heading,
    .dashboard > .us-page-heading {
        position: relative;
        min-width: 0;
        margin-bottom: 22px;
    }
    .page-header {
        align-items: center;
        gap: 18px;
        padding-bottom: 18px;
        border-bottom: 1px solid rgba(var(--primary-rgb), .10);
    }
    .page-header h1 {
        color: var(--heading);
        font-size: clamp(23px, 2.1vw, 30px);
        font-weight: 750;
        line-height: 1.22;
        letter-spacing: -.04em;
        text-wrap: balance;
    }
    .page-header p {
        color: var(--muted);
        font-size: 13px;
        line-height: 1.65;
        text-wrap: pretty;
    }
    .page-header h1 i { color: var(--secondary); }
    .dashboard-section-title {
        color: var(--heading);
        letter-spacing: -.025em;
    }
    .dashboard-level-strip {
        border-color: var(--bf26-border) !important;
        border-radius: var(--bf26-radius-md) !important;
        box-shadow: var(--bf26-shadow-xs) !important;
    }

    /* Panels and cards share a quiet surface system instead of heavy shadows. */
    .form-card, .table-card, .chart-card, .activity-card,
    .stock-in-card, .stock-history-card, .product-view-card,
    .view-product-card, .supplier-view-card, .category-card,
    .stat-box, .action-card, .quote-history-card, .client-list-card,
    .client-list-form-card, .um-card, .us-card, .currency-settings-card,
    .pr-card, .ps-filter-card, .ps-table-card {
        min-width: 0;
        border: 1px solid var(--bf26-border);
        border-radius: var(--bf26-radius-lg);
        background: var(--bf26-surface);
        box-shadow: var(--bf26-shadow-sm);
    }
    .form-card, .chart-card, .activity-card, .stock-in-card,
    .stock-history-card, .product-view-card, .view-product-card,
    .supplier-view-card, .category-card {
        padding: clamp(16px, 2vw, 26px);
    }
    .table-card { overflow: hidden; }
    .table-header {
        flex-wrap: wrap;
        gap: 12px 18px;
        padding: 18px 22px;
        border-bottom: 1px solid var(--bf26-border);
        background: linear-gradient(180deg, #fff 0%, rgba(var(--primary-rgb), .018) 100%);
    }
    .table-header h3, .chart-card h3, .activity-card h3 {
        color: var(--heading);
        font-size: 16px;
        font-weight: 750;
        letter-spacing: -.02em;
    }

    /* Consistent keyboard focus and form control finish. */
    :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
        outline: 3px solid rgba(var(--secondary-rgb), .36);
        outline-offset: 2px;
    }
    .form-card :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]), select, textarea),
    .form-row :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]), select, textarea),
    .supplier-form-card :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea),
    .client-field :is(input, select, textarea),
    .pr-field :is(input, select, textarea),
    .ps-field :is(input, select, textarea),
    .um-form :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea),
    .us-form :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea),
    .currency-rate-input,
    .stock-field :is(input, select, textarea),
    .quote-search input,
    .client-search-form input,
    .um-search input,
    .supplier-search-input,
    .product-search-input {
        max-width: 100%;
        min-height: 42px;
        border: 1px solid rgba(var(--primary-rgb), .16);
        border-radius: 11px;
        background-color: #fff;
        color: var(--heading);
        box-shadow: inset 0 1px 2px rgba(20,35,20,.018);
        transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
    }
    .form-card :is(input, select, textarea):focus,
    .form-row :is(input, select, textarea):focus,
    .supplier-form-card :is(input, select, textarea):focus,
    .client-field :is(input, select, textarea):focus,
    .pr-field :is(input, select, textarea):focus,
    .ps-field :is(input, select, textarea):focus,
    .um-form :is(input, select, textarea):focus,
    .us-form :is(input, select, textarea):focus,
    .stock-field :is(input, select, textarea):focus,
    .quote-search input:focus,
    .client-search-form input:focus,
    .um-search input:focus,
    .supplier-search-input:focus,
    .product-search-input:focus,
    .currency-rate-input:focus {
        border-color: var(--secondary);
        outline: none;
        box-shadow: var(--bf26-shadow-focus);
        background-color: #fff;
    }
    .form-card label, .form-row label, .client-field label,
    .pr-field label, .ps-field label, .stock-field label {
        color: var(--heading);
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .005em;
    }
    input[type="checkbox"], input[type="radio"] { accent-color: var(--secondary); }
    input[type="file"] { max-width: 100%; }
    ::placeholder { color: #929b90; opacity: 1; }

    /* Buttons: controlled lift, consistent proportions and clear hierarchy. */
    :where(.btn, .btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning,
      .btn-add, .pr-btn, .ps-btn, .ps-action, .bes-btn, .client-primary-btn,
      .client-secondary-btn, .um-btn, .us-primary-button, .currency-save-btn,
      .stock-submit, .login-btn, .action-btn) {
        min-height: 39px;
        border-radius: 10px;
        font-weight: 700;
        letter-spacing: .005em;
        transition: transform .18s var(--bf26-ease), box-shadow .18s ease,
                    background-color .18s ease, border-color .18s ease, color .18s ease;
    }
    .btn-primary, .btn-add, .pr-btn-primary, .bes-btn-primary,
    .client-primary-btn, .um-btn-primary, .us-primary-button, .currency-save-btn {
        box-shadow: 0 4px 10px rgba(var(--primary-rgb), .13);
    }
    .btn-primary:hover, .btn-add:hover, .pr-btn-primary:hover,
    .bes-btn-primary:hover, .client-primary-btn:hover, .um-btn-primary:hover,
    .us-primary-button:hover, .currency-save-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 18px rgba(var(--primary-rgb), .18);
    }
    .btn:active, .btn-primary:active, .btn-add:active, .pr-btn:active,
    .bes-btn:active, .ps-btn:active, .um-btn:active { transform: translateY(0) scale(.985); }
    .btn-secondary, .pr-btn-light, .bes-btn-secondary, .client-secondary-btn {
        border: 1px solid rgba(var(--primary-rgb), .14);
    }
    .action-buttons { flex-wrap: wrap; align-items: center; }
    .action-buttons a, .action-buttons button { white-space: nowrap; }

    /* Data tables: readable headers, softer zebra rows and responsive scrolling. */
    .table-responsive, .table-wrapper, .product-table-wrapper,
    .supplier-table-wrapper, .client-list-table-wrap, .pr-log-table-wrap,
    .pr-item-table-wrap, .ps-table-wrap, .um-table-wrap,
    .currency-settings-table-wrap, .stock-history-wrapper, .quote-table-wrap,
    .bes-table-wrap, .pr-log-card, .quote-history-wrap {
        min-width: 0;
        scrollbar-width: thin;
        scrollbar-color: rgba(var(--secondary-rgb), .55) transparent;
    }
    .table-card table thead th, .table-wrapper table thead th,
    .product-table thead th, .supplier-table thead th,
    .client-list-table thead th, .pr-log-table thead th,
    .pr-item-table thead th, .ps-table thead th,
    .um-table thead th, .currency-settings-table thead th,
    .stock-history-table thead th, .quote-table thead th {
        background: var(--primary);
        color: #fff;
        border-color: rgba(255,255,255,.11);
        font-size: 10px;
        font-weight: 750;
        line-height: 1.45;
        letter-spacing: .065em;
        text-transform: uppercase;
    }
    .table-card table tbody td, .table-wrapper table tbody td,
    .supplier-table tbody td, .client-list-table tbody td,
    .pr-log-table tbody td, .pr-item-table tbody td,
    .ps-table tbody td, .um-table tbody td,
    .currency-settings-table tbody td, .stock-history-table tbody td,
    .quote-table tbody td {
        border-bottom-color: rgba(var(--primary-rgb), .075);
        color: var(--heading);
        line-height: 1.55;
        vertical-align: middle;
    }
    .table-card table tbody tr:nth-child(even),
    .table-wrapper table tbody tr:nth-child(even),
    .supplier-table tbody tr:nth-child(even),
    .client-list-table tbody tr:nth-child(even),
    .pr-log-table tbody tr:nth-child(even),
    .pr-item-table tbody tr:nth-child(even),
    .ps-table tbody tr:nth-child(even), .um-table tbody tr:nth-child(even),
    .currency-settings-table tbody tr:nth-child(even),
    .stock-history-table tbody tr:nth-child(even), .quote-table tbody tr:nth-child(even) {
        background: rgba(var(--primary-rgb), .018);
    }
    .table-card table tbody tr:hover, .table-wrapper table tbody tr:hover,
    .supplier-table tbody tr:hover, .client-list-table tbody tr:hover,
    .pr-log-table tbody tr:hover, .ps-table tbody tr:hover,
    .um-table tbody tr:hover, .currency-settings-table tbody tr:hover,
    .stock-history-table tbody tr:hover, .quote-table tbody tr:hover {
        background: rgba(var(--secondary-rgb), .065);
    }
    .table-responsive::-webkit-scrollbar, .table-wrapper::-webkit-scrollbar,
    .product-table-wrapper::-webkit-scrollbar, .supplier-table-wrapper::-webkit-scrollbar,
    .client-list-table-wrap::-webkit-scrollbar, .pr-log-table-wrap::-webkit-scrollbar,
    .ps-table-wrap::-webkit-scrollbar, .um-table-wrap::-webkit-scrollbar,
    .currency-settings-table-wrap::-webkit-scrollbar, .stock-history-wrapper::-webkit-scrollbar,
    .quote-table-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
    .table-responsive::-webkit-scrollbar-thumb, .table-wrapper::-webkit-scrollbar-thumb,
    .product-table-wrapper::-webkit-scrollbar-thumb, .supplier-table-wrapper::-webkit-scrollbar-thumb,
    .client-list-table-wrap::-webkit-scrollbar-thumb, .pr-log-table-wrap::-webkit-scrollbar-thumb,
    .ps-table-wrap::-webkit-scrollbar-thumb, .um-table-wrap::-webkit-scrollbar-thumb,
    .currency-settings-table-wrap::-webkit-scrollbar-thumb, .stock-history-wrapper::-webkit-scrollbar-thumb,
    .quote-table-wrap::-webkit-scrollbar-thumb {
        border: 2px solid transparent;
        border-radius: 99px;
        background: rgba(var(--secondary-rgb), .42);
        background-clip: padding-box;
    }
    .product-table tbody td { overflow-wrap: anywhere; }
    .product-table tbody tr { transition: background-color .18s ease; }

    /* Search/filter toolbars become coordinated controls rather than loose inputs. */
    .supplier-search-area, .product-search-area, .client-list-toolbar,
    .client-search-form, .quote-search, .pr-filters, .pr-search,
    .ps-filters, .ps-filter-card, .um-search {
        min-width: 0;
    }
    .supplier-search-box, .product-search-input-wrapper {
        border-radius: 12px;
        border-color: rgba(var(--primary-rgb), .15);
        background: #fff;
        box-shadow: inset 0 1px 2px rgba(20,35,20,.02);
    }
    .supplier-search-box:focus-within, .product-search-input-wrapper:focus-within {
        border-color: var(--secondary);
        box-shadow: var(--bf26-shadow-focus);
    }
    .supplier-search-result, .product-search-results { border-radius: 12px; box-shadow: var(--bf26-shadow-md); }
    .supplier-search-result, .product-search-results, .bes-searchable-menu { z-index: 12000; }

    /* Page-specific shared layouts. BES document sheet stays separate from this layer. */
    .pr-page .pr-card { border-color: var(--bf26-border); border-radius: var(--bf26-radius-lg); box-shadow: var(--bf26-shadow-sm); }
    .pr-page .pr-card-heading, .pr-page .pr-log-heading,
    .client-list-card-heading, .um-card-heading, .us-card-heading,
    .currency-settings-head, .ps-table-heading {
        color: var(--heading);
        letter-spacing: -.02em;
    }
    .pr-page .pr-filters, .ps-filters, .um-search {
        border-color: var(--bf26-border);
        border-radius: var(--bf26-radius-md);
        background: rgba(255,255,255,.86);
        box-shadow: var(--bf26-shadow-xs);
    }
    .pr-page .pr-stats, .ps-stats, .um-level-grid { gap: 12px; }
    .pr-page .pr-stat, .ps-stat, .um-level-guide, .um-heading-stat {
        border-radius: var(--bf26-radius-md);
        box-shadow: var(--bf26-shadow-xs);
    }
    .pr-page .pr-status-pill, .pr-page .pr-type-pill, .ps-pill,
    .quote-pill, .quote-due-pill, .bes-type-pill, .client-count-pill,
    .pr-company-badge, .ps-company, .um-level-tag, .stock-number {
        border-radius: 999px;
        font-weight: 750;
        letter-spacing: .005em;
    }
    .bes-page .bes-list-card, .bes-page .bes-form-card {
        border-color: var(--bf26-border);
        border-radius: var(--bf26-radius-lg);
        box-shadow: var(--bf26-shadow-sm);
    }
    .bes-page .bes-search { border-bottom-color: rgba(var(--primary-rgb), .08); }
    .bes-page .bes-btn { font-weight: 750; }
    .bes-page .bes-table-wrap { border-radius: 0 0 var(--bf26-radius-lg) var(--bf26-radius-lg); }
    .quote-history-card, .client-list-card, .client-list-form-card,
    .um-card, .us-card, .currency-settings-card, .ps-table-card {
        overflow: hidden;
    }
    .quote-history-head, .client-list-card-heading, .um-card-heading,
    .us-card-heading, .currency-settings-head, .ps-table-heading {
        border-bottom-color: rgba(var(--primary-rgb), .09);
    }
    .us-profile-banner { border-radius: var(--bf26-radius-lg); box-shadow: var(--bf26-shadow-sm); }
    .us-avatar, .um-avatar { box-shadow: 0 4px 14px rgba(var(--primary-rgb), .12); }
    .um-page-heading, .us-page-heading { color: var(--heading); }

    /* Empty, notice, and status surfaces maintain a clean information hierarchy. */
    .empty-products, .empty-products-content, .pr-empty, .ps-empty,
    .quote-empty, .client-empty-state, .um-empty, .contact-empty,
    .currency-empty-history, .bes-file-empty {
        border-radius: var(--bf26-radius-md);
    }
    .pr-alert, .supplier-error, .um-alert, .us-alert, .currency-notice,
    .bes-warning, .pr-inv-error, .pr-inv-detail {
        border-radius: 12px;
        box-shadow: var(--bf26-shadow-xs);
    }
    .badge, .status-badge, .status-pill { border-radius: 999px; font-weight: 750; }

    /* Layered searchable pickers, profile menus and confirmation dialogs. */
    .profile-menu {
        z-index: 13000;
        border: 1px solid var(--bf26-border);
        border-radius: 15px;
        box-shadow: var(--bf26-shadow-md);
        padding: 6px;
        background: #fff;
    }
    .profile-menu a { border-radius: 9px; padding: 12px 13px; }
    .profile-menu a:hover { background: rgba(var(--secondary-rgb), .07); color: var(--primary); }
    .swal2-popup {
        border: 1px solid rgba(var(--primary-rgb), .09) !important;
        border-radius: 22px !important;
        box-shadow: 0 24px 72px rgba(13,26,13,.19) !important;
        padding: 1.5rem !important;
    }
    .swal2-title { color: var(--heading) !important; letter-spacing: -.025em !important; }
    .swal2-styled { border-radius: 10px !important; font-weight: 700 !important; }

    /* Login page shares the same 2026 design language. */
    .login-page {
        background: radial-gradient(ellipse at 14% 8%, rgba(var(--secondary-rgb), .16), transparent 34%),
                    radial-gradient(ellipse at 88% 92%, rgba(var(--accent-rgb), .24), transparent 38%),
                    var(--bg);
    }
    .login-card {
        border: 1px solid rgba(var(--primary-rgb), .11);
        border-radius: 26px;
        box-shadow: 0 22px 70px rgba(var(--primary-rgb), .15), 0 2px 8px rgba(20,35,20,.035);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
    }
    .login-card .input-group input, .login-page .company-select select {
        min-height: 48px;
        border-radius: 12px;
        border-color: rgba(var(--primary-rgb), .16);
    }
    .login-card .input-group input:focus, .login-page .company-select select:focus {
        border-color: var(--secondary);
        box-shadow: var(--bf26-shadow-focus);
    }
    .login-btn { border-radius: 12px; box-shadow: 0 7px 18px rgba(var(--primary-rgb), .17); }
    .login-btn:hover { transform: translateY(-2px); box-shadow: 0 11px 24px rgba(var(--primary-rgb), .23); }

    /* Restrained page entrance; table rows and form data do not animate individually. */
    @keyframes bf26PageEnter {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .dashboard > .page-header,
    .dashboard > .um-page-heading,
    .dashboard > .us-page-heading,
    .dashboard > .dashboard-level-strip,
    .dashboard > .dashboard-grid,
    .dashboard > .table-card,
    .dashboard > .form-card,
    .dashboard > .chart-grid,
    .dashboard > .quick-actions,
    .dashboard > .stats-row {
        animation: bf26PageEnter .42s var(--bf26-ease) both;
    }
    .dashboard > .dashboard-grid { animation-delay: .045s; }
    .dashboard > .table-card, .dashboard > .form-card { animation-delay: .035s; }
    .dashboard-grid > .dashboard-card { transition: transform .24s var(--bf26-ease), box-shadow .24s ease, border-color .24s ease; }
    .dashboard-grid > .dashboard-card:focus-visible { outline-offset: 4px; }

    @media (hover: hover) and (pointer: fine) {
        .form-card:hover, .table-card:hover, .chart-card:hover,
        .activity-card:hover, .stock-in-card:hover, .stock-history-card:hover,
        .supplier-view-card:hover, .view-product-card:hover, .product-view-card:hover,
        .category-card:hover, .client-list-card:hover, .um-card:hover,
        .us-card:hover, .currency-settings-card:hover, .pr-card:hover {
            border-color: rgba(var(--secondary-rgb), .19);
        }
    }

    @media (max-width: 1200px) {
        .dashboard { padding: clamp(16px, 2.2vw, 26px); }
        .page-header { gap: 14px; }
        .topbar { padding-left: 18px; padding-right: 18px; }
    }
    @media (max-width: 992px) {
        .topbar { min-height: 72px; height: 72px; padding: 0 16px; }
        .topbar .profile { padding: 5px 6px; }
        .topbar .profile-avatar { width: 48px; height: 48px; min-width: 48px; min-height: 48px; flex-basis: 48px; }
        .topbar .profile-info { max-width: 150px; }
        .topbar .profile-info h4 { max-width: 150px; }
        .dashboard { padding: 18px; }
        .page-header { align-items: flex-start; }
        .page-header h1 { font-size: clamp(22px, 3.1vw, 27px); }
        .table-header { padding: 16px 18px; }
    }
    @media (max-width: 640px) {
        body { background-image: none; }
        .dashboard { padding: 13px; }
        .dashboard > .page-header { margin-bottom: 16px; padding-bottom: 14px; }
        .page-header { flex-direction: column; align-items: stretch; gap: 13px; }
        .page-header h1 { font-size: 22px; letter-spacing: -.03em; }
        .page-header p { font-size: 12px; line-height: 1.55; }
        .page-header .btn-add, .page-header .btn-primary,
        .page-header .pr-head-actions, .page-header .bes-actions { align-self: flex-start; }
        .topbar { min-height: 66px; height: 66px; padding: 0 9px; gap: 6px; }
        .topbar-right { gap: 4px; }
        .topbar .datetime { max-width: 118px; min-width: 0; }
        .topbar .datetime h4, .topbar .datetime p { gap: 3px; font-size: 9px; white-space: nowrap; }
        .topbar .datetime i { font-size: 11px; }
        .topbar .profile { padding: 3px; gap: 5px; border-radius: 9px; }
        .topbar .profile-avatar { width: 38px; height: 38px; min-width: 38px; min-height: 38px; flex-basis: 38px; border-radius: 9px; }
        .topbar .profile-avatar i { font-size: 20px; }
        .topbar .profile-info { max-width: 105px; }
        .topbar .profile-info h4 { max-width: 105px; font-size: 10px; }
        .topbar .profile-info p { font-size: 9px; }
        .topbar .approval-level-label { font-size: 8px; padding: 2px 5px; }
        .form-card, .chart-card, .activity-card, .stock-in-card,
        .stock-history-card, .product-view-card, .view-product-card,
        .supplier-view-card, .category-card { padding: 14px; border-radius: 15px; }
        .table-card { border-radius: 14px; }
        .table-header { padding: 14px; gap: 10px; }
        .table-header h3 { font-size: 15px; }
        .table-card table tbody td, .table-wrapper table tbody td { padding: 9px 10px; }
        .table-card table thead th, .table-wrapper table thead th { padding: 10px; }
        .dashboard-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
        .dashboard-grid .dashboard-card { min-height: 100px; padding: 16px; }
        .dashboard-level-strip { gap: 8px; padding: 12px; }
        .dashboard-level-strip .bes-type-pill { margin-left: 0 !important; }
        .pr-head-actions, .bes-actions, .client-form-actions,
        .supplier-form-actions, .um-form-actions, .us-form-actions { flex-wrap: wrap; }
        .action-buttons { gap: 5px; }
        .action-buttons a, .action-buttons button { min-height: 31px; padding: 6px 8px; }
        .swal2-popup { width: calc(100% - 24px) !important; border-radius: 17px !important; padding: 1.1rem !important; }
    }
    @media (prefers-reduced-motion: reduce) {
        .dashboard > .page-header, .dashboard > .um-page-heading,
        .dashboard > .us-page-heading, .dashboard > .dashboard-level-strip,
        .dashboard > .dashboard-grid, .dashboard > .table-card,
        .dashboard > .form-card, .dashboard > .chart-grid,
        .dashboard > .quick-actions, .dashboard > .stats-row {
            animation: none !important;
        }
    }
}


/* =====================================================================
   EXACT COMPANY SWATCH THEME — GLOBAL APPLICATION UI
   Applies the supplied swatch as the visible company theme color rather
   than using it only as a minor accent. This is screen UI only; official
   BES/Quotation document templates keep their approved document palettes.
   ===================================================================== */
@media screen {
  body.brownfly, body.akinito, body.single {
    background-color: var(--bg) !important;
    color: var(--text) !important;
  }

  /* Sidebar, company switcher and navigation use the exact company swatch. */
  body.brownfly .sidebar, body.akinito .sidebar, body.single .sidebar {
    background: var(--primary) !important;
    color: var(--primary-contrast) !important;
    border-right: 1px solid rgba(var(--primary-contrast-rgb), .18) !important;
    box-shadow: 8px 0 24px rgba(var(--primary-contrast-rgb), .12) !important;
  }
  body.brownfly .sidebar-header,
  body.akinito .sidebar-header,
  body.single .sidebar-header {
    background: transparent !important;
    border-bottom-color: rgba(var(--primary-contrast-rgb), .18) !important;
  }
  body.brownfly .sidebar-header h2,
  body.brownfly .sidebar-header p,
  body.brownfly .company-switcher label,
  body.brownfly .sidebar-menu li a,
  body.brownfly .sidebar-menu li a i,
  body.brownfly .sidebar-footer a,
  body.akinito .sidebar-header h2,
  body.akinito .sidebar-header p,
  body.akinito .company-switcher label,
  body.akinito .sidebar-menu li a,
  body.akinito .sidebar-menu li a i,
  body.akinito .sidebar-footer a,
  body.single .sidebar-header h2,
  body.single .sidebar-header p,
  body.single .company-switcher label,
  body.single .sidebar-menu li a,
  body.single .sidebar-menu li a i,
  body.single .sidebar-footer a {
    color: var(--primary-contrast) !important;
    opacity: 1;
  }
  body.brownfly .sidebar-menu li a:hover,
  body.brownfly .sidebar-menu li a.active,
  body.akinito .sidebar-menu li a:hover,
  body.akinito .sidebar-menu li a.active,
  body.single .sidebar-menu li a:hover,
  body.single .sidebar-menu li a.active {
    background: rgba(var(--primary-contrast-rgb), .09) !important;
    border-color: rgba(var(--primary-contrast-rgb), .18) !important;
    border-left-color: var(--secondary) !important;
    color: var(--primary-contrast) !important;
    box-shadow: none !important;
  }
  body.brownfly .sidebar-menu li a.active i,
  body.brownfly .sidebar-menu li a:hover i,
  body.akinito .sidebar-menu li a.active i,
  body.akinito .sidebar-menu li a:hover i,
  body.single .sidebar-menu li a.active i,
  body.single .sidebar-menu li a:hover i,
  body.brownfly .bes-sidebar-submenu a i,
  body.akinito .bes-sidebar-submenu a i,
  body.single .bes-sidebar-submenu a i {
    color: var(--secondary) !important;
  }
  body.brownfly .bes-sidebar-submenu a,
  body.akinito .bes-sidebar-submenu a,
  body.single .bes-sidebar-submenu a {
    color: var(--primary-contrast) !important;
  }
  body.brownfly .company-switcher select,
  body.akinito .company-switcher select,
  body.single .company-switcher select {
    color: var(--primary-contrast) !important;
    background: rgba(255,255,255,.62) !important;
    border: 1px solid rgba(var(--primary-contrast-rgb), .22) !important;
    box-shadow: none !important;
  }
  body.brownfly .company-switcher select option,
  body.akinito .company-switcher select option,
  body.single .company-switcher select option {
    color: var(--primary-contrast) !important;
    background: #fff !important;
  }
  body.brownfly .sidebar-footer a,
  body.akinito .sidebar-footer a,
  body.single .sidebar-footer a {
    border-color: rgba(var(--primary-contrast-rgb), .22) !important;
    background: rgba(255,255,255,.28) !important;
  }

  /* Header bars and primary action surfaces use the chosen swatch. */
  body.brownfly .table-card table thead th,
  body.brownfly .table-wrapper table thead th,
  body.brownfly .product-table thead th,
  body.brownfly .supplier-table thead th,
  body.brownfly .client-list-table thead th,
  body.brownfly .pr-log-table thead th,
  body.brownfly .pr-item-table thead th,
  body.brownfly .ps-table thead th,
  body.brownfly .um-table thead th,
  body.brownfly .currency-settings-table thead th,
  body.brownfly .stock-history-table thead th,
  body.brownfly .quote-table thead th,
  body.akinito .table-card table thead th,
  body.akinito .table-wrapper table thead th,
  body.akinito .product-table thead th,
  body.akinito .supplier-table thead th,
  body.akinito .client-list-table thead th,
  body.akinito .pr-log-table thead th,
  body.akinito .pr-item-table thead th,
  body.akinito .ps-table thead th,
  body.akinito .um-table thead th,
  body.akinito .currency-settings-table thead th,
  body.akinito .stock-history-table thead th,
  body.akinito .quote-table thead th,
  body.single .table-card table thead th,
  body.single .table-wrapper table thead th,
  body.single .product-table thead th,
  body.single .supplier-table thead th,
  body.single .client-list-table thead th,
  body.single .pr-log-table thead th,
  body.single .pr-item-table thead th,
  body.single .ps-table thead th,
  body.single .um-table thead th,
  body.single .currency-settings-table thead th,
  body.single .stock-history-table thead th,
  body.single .quote-table thead th {
    background: var(--primary) !important;
    color: var(--primary-contrast) !important;
    border-color: rgba(var(--primary-contrast-rgb), .28) !important;
  }

  body.brownfly .btn-primary,
  body.brownfly .btn-add,
  body.brownfly .stock-submit,
  body.brownfly .btn-edit-product,
  body.brownfly .pr-btn-primary,
  body.brownfly .bes-btn-primary,
  body.brownfly .client-primary-btn,
  body.brownfly .um-btn-primary,
  body.brownfly .us-primary-button,
  body.brownfly .currency-save-btn,
  body.akinito .btn-primary,
  body.akinito .btn-add,
  body.akinito .stock-submit,
  body.akinito .btn-edit-product,
  body.akinito .pr-btn-primary,
  body.akinito .bes-btn-primary,
  body.akinito .client-primary-btn,
  body.akinito .um-btn-primary,
  body.akinito .us-primary-button,
  body.akinito .currency-save-btn,
  body.single .btn-primary,
  body.single .btn-add,
  body.single .stock-submit,
  body.single .btn-edit-product,
  body.single .pr-btn-primary,
  body.single .bes-btn-primary,
  body.single .client-primary-btn,
  body.single .um-btn-primary,
  body.single .us-primary-button,
  body.single .currency-save-btn {
    background: var(--primary) !important;
    background-image: none !important;
    border-color: rgba(var(--primary-contrast-rgb), .25) !important;
    color: var(--primary-contrast) !important;
    text-shadow: none !important;
    box-shadow: 0 3px 9px rgba(var(--primary-contrast-rgb), .10) !important;
  }
  body.brownfly .btn-primary:hover, body.brownfly .btn-add:hover,
  body.brownfly .stock-submit:hover, body.brownfly .btn-edit-product:hover,
  body.brownfly .pr-btn-primary:hover, body.brownfly .bes-btn-primary:hover,
  body.akinito .btn-primary:hover, body.akinito .btn-add:hover,
  body.akinito .stock-submit:hover, body.akinito .btn-edit-product:hover,
  body.akinito .pr-btn-primary:hover, body.akinito .bes-btn-primary:hover,
  body.single .btn-primary:hover, body.single .btn-add:hover,
  body.single .stock-submit:hover, body.single .btn-edit-product:hover,
  body.single .pr-btn-primary:hover, body.single .bes-btn-primary:hover {
    filter: brightness(.96) !important;
    color: var(--primary-contrast) !important;
  }

  body.brownfly .pagination a.active, body.brownfly .pagination a:hover,
  body.akinito .pagination a.active, body.akinito .pagination a:hover,
  body.single .pagination a.active, body.single .pagination a:hover,
  body.brownfly .delivery-type-button.active,
  body.akinito .delivery-type-button.active,
  body.single .delivery-type-button.active,
  body.brownfly .sidebar-mobile-toggle,
  body.akinito .sidebar-mobile-toggle,
  body.single .sidebar-mobile-toggle {
    background: var(--primary) !important;
    border-color: rgba(var(--primary-contrast-rgb), .25) !important;
    color: var(--primary-contrast) !important;
  }
  body.brownfly .action-card:hover,
  body.akinito .action-card:hover,
  body.single .action-card:hover {
    background: var(--primary) !important;
    color: var(--primary-contrast) !important;
  }

  /* Current company tint for selected cards, badges, icons and focus accents. */
  body.brownfly .dashboard-icon,
  body.brownfly .stock-in-card .card-icon,
  body.brownfly .stock-out-grid .stock-card-header > i,
  body.akinito .dashboard-icon,
  body.akinito .stock-in-card .card-icon,
  body.akinito .stock-out-grid .stock-card-header > i,
  body.single .dashboard-icon,
  body.single .stock-in-card .card-icon,
  body.single .stock-out-grid .stock-card-header > i {
    background: var(--soft) !important;
    color: var(--secondary) !important;
  }
  body.brownfly .profile-avatar,
  body.akinito .profile-avatar,
  body.single .profile-avatar {
    background: var(--soft) !important;
    color: var(--secondary) !important;
    border-color: var(--soft-border) !important;
  }
  body.brownfly :where(input, select, textarea):focus,
  body.akinito :where(input, select, textarea):focus,
  body.single :where(input, select, textarea):focus {
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 3px rgba(var(--secondary-rgb), .17) !important;
  }
}


/* The login experience remains on its established green palette. */
body.login-page {
    --primary: #2E4A2E;
    --secondary: #4D7C2F;
    --accent: #D2B48C;
    --primary-rgb: 46, 74, 46;
    --secondary-rgb: 77, 124, 47;
    --accent-rgb: 210, 180, 140;
    --primary-contrast: #FFFFFF;
    --primary-contrast-rgb: 255, 255, 255;
}


/* ================================================================
   COMPANY SWATCH TEXT CONTRAST PATCH — 2026-11-12
   Keep the exact company swatches while making all text/icons readable.
   This patch is screen-only; official BES/Quotation print templates
   retain their approved document typography and color treatment.
   ================================================================ */
@media screen {
  body.brownfly:not(.login-page),
  body.akinito:not(.login-page),
  body.single:not(.login-page) {
    color: var(--text) !important;
  }

  /* Sidebar: the company swatches are light, so all navigation text is dark. */
  body.brownfly:not(.login-page) .sidebar,
  body.akinito:not(.login-page) .sidebar,
  body.single:not(.login-page) .sidebar {
    background: var(--primary) !important;
    color: var(--primary-contrast) !important;
  }
  body.brownfly:not(.login-page) .sidebar :is(.sidebar-header, .sidebar-header h2, .sidebar-header p, .company-switcher label, .sidebar-menu a, .sidebar-menu a span, .sidebar-menu a i, .bes-sidebar-submenu a, .bes-sidebar-submenu a span, .bes-sidebar-submenu a i, .sidebar-footer a, .sidebar-footer a span, .sidebar-footer a i),
  body.akinito:not(.login-page) .sidebar :is(.sidebar-header, .sidebar-header h2, .sidebar-header p, .company-switcher label, .sidebar-menu a, .sidebar-menu a span, .sidebar-menu a i, .bes-sidebar-submenu a, .bes-sidebar-submenu a span, .bes-sidebar-submenu a i, .sidebar-footer a, .sidebar-footer a span, .sidebar-footer a i),
  body.single:not(.login-page) .sidebar :is(.sidebar-header, .sidebar-header h2, .sidebar-header p, .company-switcher label, .sidebar-menu a, .sidebar-menu a span, .sidebar-menu a i, .bes-sidebar-submenu a, .bes-sidebar-submenu a span, .bes-sidebar-submenu a i, .sidebar-footer a, .sidebar-footer a span, .sidebar-footer a i) {
    color: var(--primary-contrast) !important;
    opacity: 1 !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) .sidebar-menu li a:hover,
  body.brownfly:not(.login-page) .sidebar-menu li a.active,
  body.brownfly:not(.login-page) .bes-sidebar-submenu a:hover,
  body.brownfly:not(.login-page) .bes-sidebar-submenu a.active,
  body.akinito:not(.login-page) .sidebar-menu li a:hover,
  body.akinito:not(.login-page) .sidebar-menu li a.active,
  body.akinito:not(.login-page) .bes-sidebar-submenu a:hover,
  body.akinito:not(.login-page) .bes-sidebar-submenu a.active,
  body.single:not(.login-page) .sidebar-menu li a:hover,
  body.single:not(.login-page) .sidebar-menu li a.active,
  body.single:not(.login-page) .bes-sidebar-submenu a:hover,
  body.single:not(.login-page) .bes-sidebar-submenu a.active {
    background: rgba(var(--primary-contrast-rgb), .10) !important;
    border-color: rgba(var(--primary-contrast-rgb), .18) !important;
    color: var(--primary-contrast) !important;
    box-shadow: none !important;
  }
  body.brownfly:not(.login-page) .company-switcher select,
  body.akinito:not(.login-page) .company-switcher select,
  body.single:not(.login-page) .company-switcher select {
    color: var(--primary-contrast) !important;
    background: rgba(255,255,255,.72) !important;
    border: 1px solid rgba(var(--primary-contrast-rgb), .28) !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) .company-switcher select option,
  body.akinito:not(.login-page) .company-switcher select option,
  body.single:not(.login-page) .company-switcher select option {
    color: var(--primary-contrast) !important;
    background: #fff !important;
  }

  /* Every button that uses the light company swatch gets dark readable text. */
  body.brownfly:not(.login-page) :is(.btn-primary, .btn-add, .stock-submit, .btn-edit-product, .pr-btn-primary, .bes-btn-primary, .client-primary-btn, .um-btn-primary, .us-primary-button, .currency-save-btn, .menu-toggle, .sidebar-mobile-toggle, .delivery-type-button.active, .pagination a.active),
  body.akinito:not(.login-page) :is(.btn-primary, .btn-add, .stock-submit, .btn-edit-product, .pr-btn-primary, .bes-btn-primary, .client-primary-btn, .um-btn-primary, .us-primary-button, .currency-save-btn, .menu-toggle, .sidebar-mobile-toggle, .delivery-type-button.active, .pagination a.active),
  body.single:not(.login-page) :is(.btn-primary, .btn-add, .stock-submit, .btn-edit-product, .pr-btn-primary, .bes-btn-primary, .client-primary-btn, .um-btn-primary, .us-primary-button, .currency-save-btn, .menu-toggle, .sidebar-mobile-toggle, .delivery-type-button.active, .pagination a.active) {
    background: var(--primary) !important;
    background-image: none !important;
    border-color: rgba(var(--primary-contrast-rgb), .30) !important;
    color: var(--primary-contrast) !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) :is(.btn-primary, .btn-add, .stock-submit, .btn-edit-product, .pr-btn-primary, .bes-btn-primary, .client-primary-btn, .um-btn-primary, .us-primary-button, .currency-save-btn, .menu-toggle, .sidebar-mobile-toggle, .delivery-type-button.active, .pagination a.active) *,
  body.akinito:not(.login-page) :is(.btn-primary, .btn-add, .stock-submit, .btn-edit-product, .pr-btn-primary, .bes-btn-primary, .client-primary-btn, .um-btn-primary, .us-primary-button, .currency-save-btn, .menu-toggle, .sidebar-mobile-toggle, .delivery-type-button.active, .pagination a.active) *,
  body.single:not(.login-page) :is(.btn-primary, .btn-add, .stock-submit, .btn-edit-product, .pr-btn-primary, .bes-btn-primary, .client-primary-btn, .um-btn-primary, .us-primary-button, .currency-save-btn, .menu-toggle, .sidebar-mobile-toggle, .delivery-type-button.active, .pagination a.active) * {
    color: inherit !important;
    text-shadow: none !important;
  }

  /* Text-only accents must be darker than the pale company swatch. */
  body.brownfly:not(.login-page) :is(.datetime h4, .table-header h3, .modal-header h3, .action-buttons .view, .btn-view, .badge-primary, .page-header h1, .page-title, .section-title),
  body.akinito:not(.login-page) :is(.datetime h4, .table-header h3, .modal-header h3, .action-buttons .view, .btn-view, .badge-primary, .page-header h1, .page-title, .section-title),
  body.single:not(.login-page) :is(.datetime h4, .table-header h3, .modal-header h3, .action-buttons .view, .btn-view, .badge-primary, .page-header h1, .page-title, .section-title) {
    color: var(--secondary) !important;
  }
  body.brownfly:not(.login-page) .table-header h3,
  body.akinito:not(.login-page) .table-header h3,
  body.single:not(.login-page) .table-header h3,
  body.brownfly:not(.login-page) .modal-header h3,
  body.akinito:not(.login-page) .modal-header h3,
  body.single:not(.login-page) .modal-header h3 {
    font-weight: 700 !important;
  }

  /* Dashboard banner used to place white text over the pale swatch. */
  body.brownfly:not(.login-page) .welcome-banner,
  body.akinito:not(.login-page) .welcome-banner,
  body.single:not(.login-page) .welcome-banner {
    background: linear-gradient(135deg, var(--soft), var(--primary)) !important;
    color: var(--primary-contrast) !important;
  }
  body.brownfly:not(.login-page) .welcome-banner :is(h1,h2,h3,p,span,strong,i),
  body.akinito:not(.login-page) .welcome-banner :is(h1,h2,h3,p,span,strong,i),
  body.single:not(.login-page) .welcome-banner :is(h1,h2,h3,p,span,strong,i) {
    color: var(--primary-contrast) !important;
    opacity: 1 !important;
  }

  /* Data table headings, toasts and small interactive labels. */
  body.brownfly:not(.login-page) :is(.table-card, .table-wrapper, .table-responsive, .log-table-wrap, .po-log-wrap) table thead th,
  body.akinito:not(.login-page) :is(.table-card, .table-wrapper, .table-responsive, .log-table-wrap, .po-log-wrap) table thead th,
  body.single:not(.login-page) :is(.table-card, .table-wrapper, .table-responsive, .log-table-wrap, .po-log-wrap) table thead th {
    background: var(--primary) !important;
    color: var(--primary-contrast) !important;
    border-color: rgba(var(--primary-contrast-rgb), .32) !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) .bfc-online-toast,
  body.akinito:not(.login-page) .bfc-online-toast,
  body.single:not(.login-page) .bfc-online-toast {
    color: var(--primary-contrast) !important;
  }
  body.brownfly:not(.login-page) .bfc-online-toast :is(h1,h2,h3,p,span,strong,small),
  body.akinito:not(.login-page) .bfc-online-toast :is(h1,h2,h3,p,span,strong,small),
  body.single:not(.login-page) .bfc-online-toast :is(h1,h2,h3,p,span,strong,small) {
    color: var(--primary-contrast) !important;
  }

  /* Topbar text remains dark on its white surface. */
  body.brownfly:not(.login-page) .topbar,
  body.akinito:not(.login-page) .topbar,
  body.single:not(.login-page) .topbar { color: var(--heading) !important; }
  body.brownfly:not(.login-page) .topbar :is(.profile-name,.profile-info,.datetime h4,.topbar-title),
  body.akinito:not(.login-page) .topbar :is(.profile-name,.profile-info,.datetime h4,.topbar-title),
  body.single:not(.login-page) .topbar :is(.profile-name,.profile-info,.datetime h4,.topbar-title) {
    color: var(--heading) !important;
  }
}


/* Final readability overrides for light company swatches. Exact brand
   backgrounds stay #FFCCFF / #A8D08D / #FFFF00; text is dark enough to read. */
@media screen {
  body.brownfly:not(.login-page),
  body.akinito:not(.login-page),
  body.single:not(.login-page) { color: var(--text) !important; }

  /* Navigation and company switcher: defeat white text inherited from the old dark sidebar. */
  body.brownfly:not(.login-page) .sidebar .sidebar-menu li > a,
  body.brownfly:not(.login-page) .sidebar .sidebar-menu li > a :is(span,i),
  body.brownfly:not(.login-page) .sidebar .bes-sidebar-submenu > a,
  body.brownfly:not(.login-page) .sidebar .bes-sidebar-submenu > a :is(span,i),
  body.brownfly:not(.login-page) .sidebar .company-switcher label,
  body.brownfly:not(.login-page) .sidebar .sidebar-header :is(h1,h2,h3,p),
  body.akinito:not(.login-page) .sidebar .sidebar-menu li > a,
  body.akinito:not(.login-page) .sidebar .sidebar-menu li > a :is(span,i),
  body.akinito:not(.login-page) .sidebar .bes-sidebar-submenu > a,
  body.akinito:not(.login-page) .sidebar .bes-sidebar-submenu > a :is(span,i),
  body.akinito:not(.login-page) .sidebar .company-switcher label,
  body.akinito:not(.login-page) .sidebar .sidebar-header :is(h1,h2,h3,p),
  body.single:not(.login-page) .sidebar .sidebar-menu li > a,
  body.single:not(.login-page) .sidebar .sidebar-menu li > a :is(span,i),
  body.single:not(.login-page) .sidebar .bes-sidebar-submenu > a,
  body.single:not(.login-page) .sidebar .bes-sidebar-submenu > a :is(span,i),
  body.single:not(.login-page) .sidebar .company-switcher label,
  body.single:not(.login-page) .sidebar .sidebar-header :is(h1,h2,h3,p) {
    color: var(--primary-contrast) !important;
    opacity: 1 !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) .sidebar .sidebar-menu li.pr-sidebar-group.active > .bes-sidebar-submenu > a.active,
  body.brownfly:not(.login-page) .sidebar .sidebar-menu li.bes-sidebar-group.active > .bes-sidebar-submenu > a.active,
  body.akinito:not(.login-page) .sidebar .sidebar-menu li.pr-sidebar-group.active > .bes-sidebar-submenu > a.active,
  body.akinito:not(.login-page) .sidebar .sidebar-menu li.bes-sidebar-group.active > .bes-sidebar-submenu > a.active,
  body.single:not(.login-page) .sidebar .sidebar-menu li.pr-sidebar-group.active > .bes-sidebar-submenu > a.active,
  body.single:not(.login-page) .sidebar .sidebar-menu li.bes-sidebar-group.active > .bes-sidebar-submenu > a.active {
    color: var(--primary-contrast) !important;
    background: rgba(var(--primary-contrast-rgb), .13) !important;
    border-color: rgba(var(--primary-contrast-rgb), .22) !important;
  }
  body.brownfly:not(.login-page) .company-switcher select,
  body.akinito:not(.login-page) .company-switcher select,
  body.single:not(.login-page) .company-switcher select {
    color: var(--primary-contrast) !important;
    background: rgba(255,255,255,.82) !important;
    border-color: rgba(var(--primary-contrast-rgb),.28) !important;
  }
  body.brownfly:not(.login-page) .company-switcher select option,
  body.akinito:not(.login-page) .company-switcher select option,
  body.single:not(.login-page) .company-switcher select option {
    background: #fff !important; color: #222 !important;
  }

  /* Primary colored controls use the correct dark ink, including child icons/text. */
  body.brownfly:not(.login-page) :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active),
  body.akinito:not(.login-page) :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active),
  body.single:not(.login-page) :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active) {
    color: var(--primary-contrast) !important;
    text-shadow: none !important;
  }
  body.brownfly:not(.login-page) :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active) *,
  body.akinito:not(.login-page) :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active) *,
  body.single:not(.login-page) :is(.btn-primary,.btn-add,.stock-submit,.btn-edit-product,.pr-btn-primary,.bes-btn-primary,.client-primary-btn,.um-btn-primary,.us-primary-button,.currency-save-btn,.menu-toggle,.sidebar-mobile-toggle,.delivery-type-button.active,.pagination a.active,.nav-tabs .nav-link.active,.tab-button.active,.filter-tab.active) * {
    color: inherit !important; text-shadow: none !important;
  }

  /* These accent labels were using the pastel swatch itself as text on white. */
  body.brownfly:not(.login-page) :is(.datetime h4,.dashboard-info h2,.chart-card h3,.activity-card h3,.activity-content h4,.table-header h3,.modal-header h3,.category-info h3,.price,.stock-number,.category-badge,.stock-quantity,.supplier-view-icon,.supplier-contact-icon,.supplier-table .email-link,.supplier-table .phone-link,.action-buttons .view,.btn-view,.badge-primary,.product-table .product-uom,.product-table .product-price),
  body.akinito:not(.login-page) :is(.datetime h4,.dashboard-info h2,.chart-card h3,.activity-card h3,.activity-content h4,.table-header h3,.modal-header h3,.category-info h3,.price,.stock-number,.category-badge,.stock-quantity,.supplier-view-icon,.supplier-contact-icon,.supplier-table .email-link,.supplier-table .phone-link,.action-buttons .view,.btn-view,.badge-primary,.product-table .product-uom,.product-table .product-price),
  body.single:not(.login-page) :is(.datetime h4,.dashboard-info h2,.chart-card h3,.activity-card h3,.activity-content h4,.table-header h3,.modal-header h3,.category-info h3,.price,.stock-number,.category-badge,.stock-quantity,.supplier-view-icon,.supplier-contact-icon,.supplier-table .email-link,.supplier-table .phone-link,.action-buttons .view,.btn-view,.badge-primary,.product-table .product-uom,.product-table .product-price) {
    color: var(--secondary) !important;
  }

  /* Main data-grid headers: dark text on the official light company swatch. */
  body.brownfly:not(.login-page) :is(.table-card,.table-wrapper,.table-responsive,.log-table-wrap,.po-log-wrap) table thead th,
  body.akinito:not(.login-page) :is(.table-card,.table-wrapper,.table-responsive,.log-table-wrap,.po-log-wrap) table thead th,
  body.single:not(.login-page) :is(.table-card,.table-wrapper,.table-responsive,.log-table-wrap,.po-log-wrap) table thead th {
    color: var(--primary-contrast) !important;
    text-shadow: none !important;
  }

  /* Dashboard banner uses a light tint so its text never disappears on the swatch. */
  body.brownfly:not(.login-page) .welcome-banner,
  body.akinito:not(.login-page) .welcome-banner,
  body.single:not(.login-page) .welcome-banner {
    background: linear-gradient(135deg,var(--soft),var(--primary)) !important;
    color: var(--primary-contrast) !important;
  }
  body.brownfly:not(.login-page) .welcome-banner :is(h1,h2,h3,p,span,strong,i),
  body.akinito:not(.login-page) .welcome-banner :is(h1,h2,h3,p,span,strong,i),
  body.single:not(.login-page) .welcome-banner :is(h1,h2,h3,p,span,strong,i) {
    color: var(--primary-contrast) !important; opacity: 1 !important;
  }

  /* Toast copy and topbar text. */
  body.brownfly:not(.login-page) .bfc-online-toast,
  body.akinito:not(.login-page) .bfc-online-toast,
  body.single:not(.login-page) .bfc-online-toast { color: var(--primary-contrast) !important; }
  body.brownfly:not(.login-page) .topbar,
  body.akinito:not(.login-page) .topbar,
  body.single:not(.login-page) .topbar { color: var(--heading) !important; }
}


/* Explicit operational table header text override. Kept separate from
   document preview classes so BES and Quotation print sheets are untouched. */
@media screen {
  body.brownfly:not(.login-page) .table-card table thead th,
  body.brownfly:not(.login-page) .table-wrapper table thead th,
  body.brownfly:not(.login-page) .table-responsive table thead th,
  body.brownfly:not(.login-page) .product-table thead th,
  body.brownfly:not(.login-page) .supplier-table thead th,
  body.brownfly:not(.login-page) .client-list-table thead th,
  body.brownfly:not(.login-page) .pr-log-table thead th,
  body.brownfly:not(.login-page) .pr-item-table thead th,
  body.brownfly:not(.login-page) .ps-table thead th,
  body.brownfly:not(.login-page) .um-table thead th,
  body.brownfly:not(.login-page) .currency-settings-table thead th,
  body.brownfly:not(.login-page) .stock-history-table thead th,
  body.brownfly:not(.login-page) .quote-table thead th,
  body.brownfly:not(.login-page) .po-log-table thead th,
  body.akinito:not(.login-page) .table-card table thead th,
  body.akinito:not(.login-page) .table-wrapper table thead th,
  body.akinito:not(.login-page) .table-responsive table thead th,
  body.akinito:not(.login-page) .product-table thead th,
  body.akinito:not(.login-page) .supplier-table thead th,
  body.akinito:not(.login-page) .client-list-table thead th,
  body.akinito:not(.login-page) .pr-log-table thead th,
  body.akinito:not(.login-page) .pr-item-table thead th,
  body.akinito:not(.login-page) .ps-table thead th,
  body.akinito:not(.login-page) .um-table thead th,
  body.akinito:not(.login-page) .currency-settings-table thead th,
  body.akinito:not(.login-page) .stock-history-table thead th,
  body.akinito:not(.login-page) .quote-table thead th,
  body.akinito:not(.login-page) .po-log-table thead th,
  body.single:not(.login-page) .table-card table thead th,
  body.single:not(.login-page) .table-wrapper table thead th,
  body.single:not(.login-page) .table-responsive table thead th,
  body.single:not(.login-page) .product-table thead th,
  body.single:not(.login-page) .supplier-table thead th,
  body.single:not(.login-page) .client-list-table thead th,
  body.single:not(.login-page) .pr-log-table thead th,
  body.single:not(.login-page) .pr-item-table thead th,
  body.single:not(.login-page) .ps-table thead th,
  body.single:not(.login-page) .um-table thead th,
  body.single:not(.login-page) .currency-settings-table thead th,
  body.single:not(.login-page) .stock-history-table thead th,
  body.single:not(.login-page) .quote-table thead th,
  body.single:not(.login-page) .po-log-table thead th {
    color: var(--primary-contrast) !important;
    text-shadow: none !important;
  }
}

/* -------------------------------------------------------------------------
   Modern company workspace selector — shared sidebar popup
   ------------------------------------------------------------------------- */
.company-switcher { padding: 15px 16px 13px !important; }
.company-switcher-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px 2px;
    color: var(--primary-contrast, #172033) !important;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    line-height: 1.2;
    opacity: .75;
}
.company-switcher-label i { font-size: 15px; }
.company-switch-trigger {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 11px 10px;
    border: 1px solid rgba(var(--primary-contrast-rgb, 23,32,51), .19);
    border-radius: 13px;
    background: rgba(255,255,255,.48);
    color: var(--primary-contrast, #172033) !important;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(17,24,39,.045), inset 0 1px 0 rgba(255,255,255,.45);
    transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.company-switch-trigger:hover {
    background: rgba(255,255,255,.72);
    border-color: rgba(var(--primary-contrast-rgb, 23,32,51), .32);
    box-shadow: 0 7px 17px rgba(17,24,39,.09);
    transform: translateY(-1px);
}
.company-switch-trigger:focus-visible,
.company-switch-close:focus-visible,
.company-switch-cancel:focus-visible,
.company-option-card:focus-visible {
    outline: 3px solid rgba(var(--secondary-rgb, 77,124,47), .35);
    outline-offset: 3px;
}
.company-switch-trigger-mark {
    display: inline-flex;
    flex: 0 0 35px;
    width: 35px;
    height: 35px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,.64);
    color: var(--primary-contrast, #172033) !important;
    font-size: 19px;
}
.company-switch-trigger-copy { display: flex; flex: 1 1 auto; min-width: 0; flex-direction: column; gap: 3px; }
.company-switch-trigger-copy small {
    color: var(--primary-contrast, #172033) !important;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .09em;
    opacity: .66;
}
.company-switch-trigger-copy strong {
    display: -webkit-box;
    overflow: hidden;
    color: var(--primary-contrast, #172033) !important;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.company-switch-trigger-chevron { flex: 0 0 auto; font-size: 20px; color: var(--primary-contrast, #172033) !important; opacity: .75; }

.company-switch-modal[hidden] { display: none !important; }
.company-switch-modal {
    position: fixed;
    z-index: 20000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transition: opacity .16s ease, visibility .16s ease;
}
.company-switch-modal.is-visible { opacity: 1; visibility: visible; }
.company-switch-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 18, 14, .64);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}
.company-switch-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 650px);
    max-height: min(90vh, 820px);
    overflow: auto;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 22px;
    background: #fff;
    color: #172033;
    box-shadow: 0 28px 90px rgba(0,0,0,.28);
    transform: translateY(12px) scale(.985);
    transition: transform .2s cubic-bezier(.2,.75,.25,1);
    scrollbar-width: thin;
}
.company-switch-modal.is-visible .company-switch-panel { transform: translateY(0) scale(1); }
.company-switch-panel-accent {
    height: 6px;
    background: linear-gradient(90deg, #e9a9d9 0%, #f5e65a 50%, #9bc77b 100%);
}
.company-switch-panel-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 25px 26px 19px;
}
.company-switch-heading-icon {
    display: flex;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #f1f5f1;
    color: #304b35;
    font-size: 24px;
}
.company-switch-heading-copy { flex: 1 1 auto; min-width: 0; }
.company-switch-eyebrow {
    display: block;
    margin: 1px 0 5px;
    color: #778276;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
}
.company-switch-heading-copy h2 {
    margin: 0;
    color: #172033;
    font-size: clamp(20px, 3vw, 25px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.15;
}
.company-switch-heading-copy p { margin: 7px 0 0; color: #657064; font-size: 12px; line-height: 1.5; }
.company-switch-close {
    display: inline-flex;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e9e4;
    border-radius: 10px;
    background: #fff;
    color: #526052;
    cursor: pointer;
    font-size: 21px;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.company-switch-close:hover { background: #f5f7f4; border-color: #cfd8ce; color: #172033; }
.company-switch-current {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 26px 16px;
    padding: 11px 13px;
    border: 1px solid #e5ece3;
    border-radius: 12px;
    background: #f7faf6;
}
.company-switch-current-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #5c9a54; box-shadow: 0 0 0 4px rgba(92,154,84,.12); }
.company-switch-current span:last-child { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.company-switch-current small { color: #758172; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.company-switch-current strong { color: #263528; font-size: 11px; font-weight: 800; line-height: 1.35; }
.company-switch-options { display: grid; grid-template-columns: 1fr; gap: 9px; padding: 0 26px 19px; }
.company-option-card {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 78px;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    overflow: hidden;
    border: 1px solid #e5e9e4;
    border-radius: 14px;
    background: #fff;
    color: #202b23;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.company-option-card::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: var(--company-accent, #a8d08d);
    content: "";
}
.company-option-card:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--company-accent, #a8d08d) 75%, #aeb8ac);
    background: #fbfcfa;
    box-shadow: 0 7px 18px rgba(31,45,31,.07);
    transform: translateY(-1px);
}
.company-option-card.is-current {
    border-color: color-mix(in srgb, var(--company-accent, #a8d08d) 72%, #aeb8ac);
    background: color-mix(in srgb, var(--company-accent, #a8d08d) 13%, #fff);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--company-accent, #a8d08d) 25%, transparent);
}
.company-option-card:disabled { cursor: wait; opacity: .58; }
.company-option-logo-wrap {
    display: flex;
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border: 1px solid rgba(25,40,25,.07);
    border-radius: 11px;
    background: rgba(255,255,255,.9);
}
.company-option-logo { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.company-option-copy { display: flex; flex: 1 1 auto; min-width: 0; }
.company-option-copy strong { color: #1f2b21; font-size: 12px; font-weight: 800; line-height: 1.4; }
.company-option-state {
    display: inline-flex;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f6f2;
    color: #667465;
    font-size: 19px;
}
.company-option-card.is-current .company-option-state { background: #263d2b; color: #fff; }
.company-option-current-label {
    position: absolute;
    top: 7px;
    right: 52px;
    color: #536b52;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .1em;
}
.company-switch-feedback {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: -4px 26px 16px;
    padding: 11px 13px;
    border: 1px solid #dce9d8;
    border-radius: 10px;
    background: #f4faf2;
    color: #315a31;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}
.company-switch-feedback[hidden] { display: none !important; }
.company-switch-feedback.is-countdown { border-color: #d7e4d2; background: #f0f7ed; }
.company-switch-countdown {
    display: inline-flex;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border: 2px solid #79a96b;
    border-radius: 50%;
    background: #fff;
    color: #315a31;
    font-size: 15px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}
.company-switch-countdown[hidden] { display: none !important; }
.company-switch-feedback-message { min-width: 0; }
.company-switch-feedback.is-error { border-color: #f1c9c9; background: #fff5f5; color: #9b2f2f; }
.company-switch-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 26px 19px;
    border-top: 1px solid #edf0ec;
}
.company-switch-panel-footer > span { display: flex; align-items: center; gap: 6px; color: #788276; font-size: 10px; font-weight: 600; }
.company-switch-panel-footer > span i { font-size: 15px; }
.company-switch-cancel {
    min-width: 85px;
    padding: 9px 15px;
    border: 1px solid #dfe5dd;
    border-radius: 9px;
    background: #fff;
    color: #384638;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease;
}
.company-switch-cancel:hover { background: #f5f8f3; border-color: #cbd6c8; }
.company-switch-modal.is-switching .company-option-card { pointer-events: none; }
body.company-switch-modal-open { overflow: hidden !important; }

@media (max-width: 600px) {
    .company-switch-modal { align-items: flex-end; padding: 10px; }
    .company-switch-panel { width: 100%; max-height: 92vh; border-radius: 19px; }
    .company-switch-panel-header { gap: 11px; padding: 21px 18px 16px; }
    .company-switch-heading-icon { flex-basis: 40px; width: 40px; height: 40px; font-size: 21px; }
    .company-switch-current { margin: 0 18px 13px; }
    .company-switch-options { padding: 0 18px 15px; gap: 8px; }
    .company-option-card { min-height: 72px; gap: 10px; padding: 10px 11px; }
    .company-option-logo-wrap { flex-basis: 43px; width: 43px; height: 43px; }
    .company-option-copy strong { font-size: 11px; }
    .company-option-current-label { right: 48px; top: 5px; font-size: 7px; }
    .company-switch-feedback { margin: -2px 18px 13px; }
    .company-switch-panel-footer { align-items: flex-start; padding: 13px 18px 17px; }
    .company-switch-panel-footer > span { max-width: 70%; line-height: 1.4; }
}
@media (prefers-reduced-motion: reduce) {
    .company-switch-trigger, .company-switch-modal, .company-switch-panel, .company-option-card,
    .company-switch-close, .company-switch-cancel { transition: none !important; }
}
