:root {
    --oms-navy-950: #02351c;
    --oms-navy-900: #044f2c;
    --oms-navy-800: #056c38;
    --oms-blue-600: #058743;
    --oms-blue-500: #079852;
    --oms-blue-100: #e8f7ef;
    --oms-gold-500: #FFD700;
    --oms-slate-950: #172033;
    --oms-slate-700: #46566e;
    --oms-slate-500: #708096;
    --oms-slate-300: #cbd5e1;
    --oms-slate-200: #e2e8f0;
    --oms-slate-100: #f1f5f9;
    --oms-slate-50: #f7f9fc;
    --oms-white: #ffffff;
    --oms-green: #058743;
    --oms-red: #c33d4a;
    --oms-amber: #b66b10;
    --oms-sidebar: 238px;
    --oms-header: 68px;
    --oms-radius: 10px;
    --oms-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
}

html { font-size: 14px; }

html,
body {
    background: var(--oms-slate-50);
    color: var(--oms-slate-950);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

body.is-navigating { cursor: progress; }
body.sidebar-open { overflow: hidden; }

.app-shell { background: var(--oms-slate-50); }

.sidebar-dark {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--oms-sidebar);
    display: flex;
    flex-direction: column;
    padding: 18px 14px 14px;
    background: linear-gradient(175deg, #02351c, #058743 82%, #046b36);
    border-right: 1px solid rgba(255,255,255,.06);
    box-shadow: none;
    overflow-y: auto;
}

.sidebar-brand-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0 4px 24px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 9px;
    background: linear-gradient(145deg, rgba(255,255,255,.17), rgba(255,255,255,.06));
    color: #fff;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.sidebar-brand { margin: 0; font-size: 1.04rem; font-weight: 700; letter-spacing: -.01em; }
.sidebar-role-label { margin-top: 2px; color: #d7efe2; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; }
.nav-section-label { padding: 0 10px 7px; color: #c3e4d1; font-size: .63rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.modern-sidebar-nav { gap: 3px; }
.modern-sidebar-nav a,
.sidebar-help {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #e6f5ec;
    font-size: .86rem;
    font-weight: 500;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.modern-sidebar-nav a svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.modern-sidebar-nav a:hover,
.sidebar-help:hover { background: rgba(255,255,255,.07); color: #fff; }
.modern-sidebar-nav a.active,
.sidebar-help.active {
    background: rgba(255, 215, 0, .14);
    border-color: rgba(255, 215, 0, .32);
    color: #fff;
    font-weight: 650;
    box-shadow: inset 3px 0 0 #FFD700;
}

.sidebar-footer { margin-top: auto; padding-top: 20px; }
.help-icon { width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: .68rem; }

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.user-avatar {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #d8e7fb;
    color: var(--oms-navy-900);
    font-size: .75rem;
    font-weight: 800;
}

.sidebar-user-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.sidebar-user-copy strong { overflow: hidden; color: #f5f8fc; font-size: .77rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy small { color: #c3e4d1; font-size: .67rem; }
.sidebar-logout { color: #a9bad0; font-size: 1.05rem; }
.sidebar-logout:hover { color: #fff; }

.main-layout { min-width: 0; margin-left: var(--oms-sidebar); }
.top-header-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--oms-header);
    padding: 0 24px;
    border-bottom: 1px solid var(--oms-slate-200);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
}

.top-header-left { flex-direction: row; align-items: center; gap: 12px; }
.top-panel-title { color: var(--oms-navy-900); font-size: 1rem; font-weight: 700; line-height: 1.2; }
.top-panel-subtitle { margin-top: 2px; color: var(--oms-slate-500); font-size: .72rem; }
.top-header-right { gap: 12px; }
.header-user-block { padding-left: 12px; border-left: 1px solid var(--oms-slate-200); }
.header-user-name { color: var(--oms-slate-950); font-size: .8rem; font-weight: 650; }
.header-user-role { margin-top: 2px; color: var(--oms-slate-500); font-size: .68rem; }
.mobile-menu-btn { display: none; }

.content-area {
    width: 100%;
    max-width: 1640px;
    margin: 0 auto;
    padding: 20px 24px 36px;
}

.module-tabs {
    display: flex;
    gap: 3px;
    margin: -4px 0 18px;
    padding: 3px;
    overflow-x: auto;
    border: 1px solid var(--oms-slate-200);
    border-radius: 9px;
    background: #eef2f7;
    scrollbar-width: none;
}

.module-tabs::-webkit-scrollbar { display: none; }
.module-tabs a { min-height: 31px; display: inline-flex; align-items: center; padding: 0 13px; border-radius: 6px; color: var(--oms-slate-700); font-size: .76rem; font-weight: 600; white-space: nowrap; }
.module-tabs a:hover { color: var(--oms-navy-900); }
.module-tabs a.active { background: #fff; color: var(--oms-blue-600); box-shadow: 0 1px 3px rgba(15,23,42,.1); }

.page-section-header,
.users-page-header { margin-bottom: 14px; }
.page-section-header h1,
.users-page-title h1 { margin-bottom: 4px; color: var(--oms-navy-900); font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; }
.page-section-header p,
.users-page-title p { color: var(--oms-slate-500); font-size: .83rem; }

.card,
.oms-kpi-card,
.dashboard-panel,
.supplier-header-card,
.order-panel {
    border: 1px solid var(--oms-slate-200);
    border-radius: var(--oms-radius);
    background: #fff;
    box-shadow: var(--oms-shadow);
}

.card { padding: 16px; }
.oms-kpi-grid { gap: 12px; }
.oms-kpi-card { min-height: 92px; padding: 15px; }
.oms-kpi-card span { color: var(--oms-slate-500); font-size: .72rem; font-weight: 650; letter-spacing: .025em; text-transform: uppercase; }
.oms-kpi-card strong { color: var(--oms-navy-900); font-size: 1.35rem; line-height: 1.2; }

.data-table { color: var(--oms-slate-700); }
.data-table th,
.data-table td { padding: 10px 9px; border-bottom-color: #e8edf3; font-size: .76rem; }
.data-table th { background: #f7f9fc; color: #5c6a7e; font-size: .67rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.data-table tbody tr:hover { background: #fafcff; }
.table-wrap { border-radius: 8px; -webkit-overflow-scrolling: touch; }

.btn,
.logout-btn {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: .76rem;
    font-weight: 650;
    box-shadow: none;
}

.btn-primary { border-color: var(--oms-blue-600); background: var(--oms-blue-600); }
.btn-primary:hover { border-color: #046c36; background: #046c36; }
.btn-light,
.btn-secondary { border-color: var(--oms-slate-300); background: #fff; color: var(--oms-slate-700); }
.btn-light:hover,
.btn-secondary:hover { border-color: #aebaca; background: var(--oms-slate-50); color: var(--oms-navy-900); }
.btn-danger { background: var(--oms-red); }
.btn-sm { min-height: 29px; padding: 5px 9px; font-size: .7rem; }

input,
select,
textarea,
.search-input,
.form-control {
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--oms-slate-300);
    border-radius: 7px;
    background: #fff;
    color: var(--oms-slate-950);
    font-size: .78rem;
    outline: none;
}

textarea { min-height: 84px; }
input:focus,
select:focus,
textarea:focus,
.search-input:focus { border-color: var(--oms-blue-500); box-shadow: 0 0 0 3px rgba(5,135,67,.13); }
label { color: var(--oms-slate-700); font-size: .73rem; font-weight: 650; }

.status-badge,
.oms-status-badge,
.badge { padding: 4px 7px; border-radius: 999px; font-size: .66rem; font-weight: 700; }
.oms-badge-green { background: #e8f6ef; color: #08724b; }
.oms-badge-yellow { background: #fff4dd; color: #9a5a06; }
.oms-badge-red { background: #fdebec; color: #aa2d3b; }
.oms-badge-gray { background: #eef2f6; color: #536174; }

.modal-overlay { z-index: 80; background: rgba(7,21,40,.58); backdrop-filter: blur(3px); }
.modal-box { border: 1px solid rgba(255,255,255,.3); border-radius: 12px; box-shadow: 0 24px 70px rgba(7,21,40,.24); }
.modal-header h2 { color: var(--oms-navy-900); font-size: 1.1rem; }

.notification-center { position: relative; }
.notification-trigger {
    position: relative;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--oms-slate-200);
    border-radius: 8px;
    background: #fff;
    color: var(--oms-slate-700);
    cursor: pointer;
}
.notification-trigger:hover { border-color: var(--oms-slate-300); background: var(--oms-slate-50); color: var(--oms-navy-900); }
.notification-trigger svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-count { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; border-radius: 999px; background: var(--oms-red); color: #fff; font-size: .58rem; font-weight: 800; }
.notification-count.is-empty { display: none; }

.notification-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: -8px;
    width: min(390px, calc(100vw - 24px));
    overflow: hidden;
    border: 1px solid var(--oms-slate-200);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15,23,42,.18);
}
.notification-popover[hidden] { display: none; }
.notification-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px; border-bottom: 1px solid var(--oms-slate-200); }
.notification-popover-head div { display: flex; flex-direction: column; }
.notification-popover-head strong { color: var(--oms-navy-900); font-size: .86rem; }
.notification-popover-head span { color: var(--oms-slate-500); font-size: .67rem; }
.notification-popover-head a { color: var(--oms-blue-600); font-size: .69rem; font-weight: 650; }
.notification-list { max-height: min(470px, 65vh); overflow-y: auto; }
.notification-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 28px; border-bottom: 1px solid #edf1f5; }
.notification-item:last-child { border-bottom: 0; }
.notification-item > a { min-width: 0; padding: 12px 8px 12px 15px; }
.notification-item:hover { background: #f8fbff; }
.notification-item strong { display: block; padding-right: 5px; overflow: hidden; color: var(--oms-slate-950); font-size: .76rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.notification-item p { display: -webkit-box; margin: 3px 0 5px; overflow: hidden; color: var(--oms-slate-500); font-size: .69rem; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.notification-item time { color: #8a98aa; font-size: .62rem; }
.notification-dismiss { align-self: start; width: 27px; height: 27px; margin: 8px 5px 0 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #8390a2; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.notification-dismiss:hover { background: #edf2f7; color: var(--oms-red); }
.notification-empty { padding: 34px 18px; color: var(--oms-slate-500); font-size: .76rem; text-align: center; }

.context-notification {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto 28px;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 10px 10px 12px;
    border: 1px solid #bed6f8;
    border-left: 3px solid var(--oms-blue-600);
    border-radius: 8px;
    background: #f3f8ff;
}
.context-notification-icon { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: var(--oms-blue-600); color: #fff; font-size: .7rem; font-weight: 800; }
.context-notification strong { display: block; color: #16375d; font-size: .76rem; }
.context-notification p { max-width: 850px; margin: 2px 0 0; overflow: hidden; color: #59708c; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.context-notification > a { color: var(--oms-blue-600); font-size: .71rem; font-weight: 700; }

.content-tabs { display: flex; gap: 3px; margin: 14px 0 10px; border-bottom: 1px solid var(--oms-slate-200); }
.content-tabs button { min-height: 35px; padding: 0 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--oms-slate-500); font-size: .75rem; font-weight: 650; cursor: pointer; }
.content-tabs button:hover { color: var(--oms-navy-900); }
.content-tabs button.active { border-bottom-color: var(--oms-blue-600); color: var(--oms-blue-600); }
.notification-panel[hidden] { display: none; }
.notification-body-cell { min-width: 260px; max-width: 560px; color: var(--oms-slate-500); line-height: 1.45; }
.notification-error-cell { max-width: 300px; color: var(--oms-red); overflow-wrap: anywhere; }
.notification-kpis { margin-bottom: 4px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; width: min(360px, calc(100vw - 30px)); pointer-events: none; }
.oms-toast { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--oms-slate-200); border-left: 3px solid var(--oms-blue-600); border-radius: 9px; background: #fff; color: var(--oms-slate-700); box-shadow: 0 14px 35px rgba(15,23,42,.16); font-size: .75rem; pointer-events: auto; animation: oms-toast-in .2s ease both; }
.oms-toast.success { border-left-color: var(--oms-green); }
.oms-toast.error { border-left-color: var(--oms-red); }
.oms-toast button { border: 0; background: transparent; color: var(--oms-slate-500); cursor: pointer; }
@keyframes oms-toast-in { from { opacity: 0; transform: translateY(7px); } }

.page-loader { position: fixed; top: 0; right: 0; left: var(--oms-sidebar); z-index: 90; height: 2px; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .12s; }
.page-loader span { display: block; width: 38%; height: 100%; background: var(--oms-blue-500); transform: translateX(-110%); }
body.is-navigating .page-loader { opacity: 1; }
body.is-navigating .page-loader span { animation: oms-loading 1s ease-in-out infinite; }
@keyframes oms-loading { to { transform: translateX(370%); } }

.health-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.health-summary-card { padding: 14px; border: 1px solid var(--oms-slate-200); border-radius: 9px; background: #fff; }
.health-summary-card span { display: block; color: var(--oms-slate-500); font-size: .68rem; font-weight: 650; text-transform: uppercase; }
.health-summary-card strong { display: block; margin-top: 5px; color: var(--oms-navy-900); font-size: 1.25rem; }
.health-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.health-toolbar p { margin: 0; color: var(--oms-slate-500); font-size: .76rem; }
.health-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.health-item { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; gap: 10px; align-items: center; min-height: 62px; padding: 11px 12px; border: 1px solid var(--oms-slate-200); border-radius: 8px; background: #fff; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--oms-slate-300); }
.health-item.pass .health-dot { background: var(--oms-green); box-shadow: 0 0 0 4px rgba(22,133,91,.1); }
.health-item.warn .health-dot { background: var(--oms-amber); box-shadow: 0 0 0 4px rgba(182,107,16,.1); }
.health-item.fail .health-dot { background: var(--oms-red); box-shadow: 0 0 0 4px rgba(195,61,74,.1); }
.health-copy strong { display: block; color: var(--oms-slate-950); font-size: .77rem; }
.health-copy span { display: block; margin-top: 2px; color: var(--oms-slate-500); font-size: .68rem; }
.health-duration { color: #8a98aa; font-size: .64rem; }
.test-panel { margin-top: 16px; }
.live-test-grid .test-panel { margin-top: 16px; }
.test-panel h2 { margin: 0 0 4px; color: var(--oms-navy-900); font-size: 1rem; }
.test-panel > p { margin: 0 0 13px; color: var(--oms-slate-500); font-size: .75rem; }
.test-form-row { display: grid; grid-template-columns: minmax(180px, 320px) auto; gap: 9px; align-items: end; }
.test-result { margin-top: 10px; padding: 10px; border-radius: 7px; background: var(--oms-slate-100); color: var(--oms-slate-700); font-size: .73rem; }
.test-result.success { background: #eaf7f1; color: #0a6d4a; }
.test-result.error { background: #fdeced; color: #a72c39; }

@media (max-width: 1100px) {
    :root { --oms-sidebar: 220px; }
    .content-area { padding-inline: 18px; }
    .health-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 820px) {
    :root { --oms-header: 60px; }
    .sidebar-dark { width: min(278px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 18px 0 45px rgba(7,21,40,.22); }
    .sidebar-dark.active { transform: translateX(0); }
    .main-layout { margin-left: 0; }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 35; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(7,21,40,.55); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
    .sidebar-overlay.active { opacity: 1; visibility: visible; }
    .mobile-menu-btn { width: 35px; height: 35px; display: grid; place-content: center; gap: 4px; padding: 0; border: 1px solid var(--oms-slate-200); border-radius: 8px; background: #fff; }
    .mobile-menu-btn span { width: 15px; height: 1.5px; display: block; background: var(--oms-navy-900); }
    .page-loader { left: 0; }
    .top-header-bar { padding: 0 15px; }
    .content-area { padding: 15px 14px 28px; }
    .header-user-block { display: none; }
    .health-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    html { font-size: 13px; }
    .top-panel-subtitle { display: none; }
    .top-panel-title { max-width: 54vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .module-tabs { margin-bottom: 14px; }
    .page-section-header h1,
    .users-page-title h1 { font-size: 1.28rem; }
    .page-header-row,
    .users-page-header,
    .health-toolbar { align-items: stretch; flex-direction: column; }
    .page-header-row .btn,
    .users-page-header .btn,
    .health-toolbar .btn { width: 100%; justify-content: center; }
    .card { padding: 12px; }
    .oms-kpi-grid,
    .dashboard-exec-kpis { grid-template-columns: repeat(2, minmax(0,1fr)) !important; gap: 8px; }
    .oms-kpi-card { min-height: 78px; padding: 12px; }
    .oms-kpi-card strong { font-size: 1.08rem; overflow-wrap: anywhere; }
    .table-wrap { margin-inline: -12px; padding-inline: 12px; border-radius: 0; }
    .data-table { min-width: 680px; }
    .data-table th,
    .data-table td { padding: 9px 8px; }
    .context-notification { grid-template-columns: 25px minmax(0,1fr) 26px; }
    .context-notification > a { display: none; }
    .context-notification p { white-space: normal; }
    .notification-popover { position: fixed; top: calc(var(--oms-header) - 2px); right: 8px; left: 8px; width: auto; }
    .health-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
    .test-form-row { grid-template-columns: 1fr; }
    .test-form-row .btn { width: 100%; }
    .modal-overlay { padding: 8px; }
    .modal-box { width: 100%; max-height: calc(100vh - 16px); }
    .toast-region { right: 10px; bottom: 10px; left: 10px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Authentication screens */
.login-body { background-color: var(--oms-navy-950); }
.login-card {
    width: min(390px, 100%);
    padding: 30px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 13px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 28px 75px rgba(7,21,40,.32);
    backdrop-filter: blur(12px);
}
.login-card h1 { margin-bottom: 4px; color: var(--oms-navy-900); font-size: 1.35rem; letter-spacing: -.02em; }
.login-subtext { margin-bottom: 20px; color: var(--oms-slate-500); font-size: .78rem; }
.login-form { gap: 13px; }
.login-divider { color: var(--oms-slate-500); font-size: .7rem; }
.google-login-btn { min-height: 38px; border-color: var(--oms-slate-300); border-radius: 7px; color: var(--oms-slate-700); font-size: .77rem; }
.google-login-btn:hover { border-color: var(--oms-blue-500); background: var(--oms-blue-100); color: var(--oms-blue-600); }
.google-icon { color: var(--oms-blue-600); }

/* Beauty Duty green, gold and white brand system */
.brand-mark { border-color: rgba(255,215,0,.55); background: #fff; color: #058743; }
.user-avatar { background: #FFD700; color: #034f29; }
.module-tabs a.active { color: #058743; }
.oms-badge-yellow { background: #fff8cc; color: #5b4d00; }
.page-loader span { background: linear-gradient(90deg, #058743, #FFD700); }
.login-body { background: linear-gradient(145deg, #02351c, #058743); }
.google-login-btn:hover { border-color: #058743; background: #e8f7ef; color: #058743; }
.context-notification,
.supplier-urgent-alert { display: none !important; }

.nav-count {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 999px;
    background: #FFD700;
    color: #034f29;
    font-size: .64rem;
    font-weight: 800;
    line-height: 1;
}
.nav-count.is-empty { display: none; }
.modern-sidebar-nav a.active .nav-count { background: #fff; color: #058743; }

.settings-panel[hidden] { display: none; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-card { display: flex; flex-direction: column; gap: 15px; }
.settings-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.settings-card h2,
.template-group-card h2,
.template-help-card h2,
.settings-health-heading h2 { margin: 0 0 4px; color: var(--oms-navy-900); font-size: 1rem; }
.settings-card p,
.template-help-card p,
.settings-health-heading p { margin: 0; color: var(--oms-slate-500); font-size: .74rem; }
.settings-switch-list { display: grid; border: 1px solid var(--oms-slate-200); border-radius: 8px; overflow: hidden; }
.settings-switch-list .settings-switch { padding: 10px 11px; border-bottom: 1px solid var(--oms-slate-200); }
.settings-switch-list .settings-switch:last-child { border-bottom: 0; }
.settings-switch { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--oms-slate-700); cursor: pointer; }
.settings-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.settings-switch i { position: relative; width: 34px; height: 19px; flex: 0 0 auto; border-radius: 99px; background: #cbd5e1; transition: background-color .15s; }
.settings-switch i::after { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); content: ''; transition: transform .15s; }
.settings-switch input:checked + i { background: #058743; }
.settings-switch input:checked + i::after { transform: translateX(15px); }
.settings-switch input:focus-visible + i { outline: 3px solid rgba(255,215,0,.55); outline-offset: 2px; }
.form-group small { display: block; margin-top: 5px; color: var(--oms-slate-500); font-size: .68rem; }
.settings-save-bar { position: sticky; bottom: 10px; z-index: 10; display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; padding: 10px; border: 1px solid var(--oms-slate-200); border-radius: 9px; background: rgba(255,255,255,.96); box-shadow: var(--oms-shadow); }
.settings-save-bar [role="status"] { margin-right: auto; color: #058743; font-size: .73rem; font-weight: 650; }
.template-help-card { margin-bottom: 14px; }
.placeholder-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.placeholder-list code { padding: 4px 6px; border: 1px solid #cde8d8; border-radius: 5px; background: #eff9f3; color: #056533; font-size: .67rem; }
.template-group-card { margin-bottom: 14px; }
.template-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.template-editor { border: 1px solid var(--oms-slate-200); border-radius: 8px; background: #fff; }
.template-editor summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px; color: var(--oms-slate-700); font-size: .74rem; font-weight: 650; cursor: pointer; list-style: none; }
.template-editor summary::-webkit-details-marker { display: none; }
.template-editor summary small { color: #058743; font-size: .66rem; }
.template-editor .form-group { padding: 0 11px 11px; }
.template-editor textarea { width: 100%; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; line-height: 1.5; }
.settings-health-heading { margin-top: 0; }

.customer-sms-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.customer-sms-heading h2 { margin-bottom: 3px; }
.customer-sms-heading p { margin: 0; color: var(--oms-slate-500); font-size: .72rem; }
.customer-sms-card textarea { width: 100%; resize: vertical; }
.customer-sms-card form > .btn { margin-top: 10px; }
.inline-form-result { margin-left: 8px; color: #058743; font-size: .72rem; font-weight: 650; }

.delivery-log-row { cursor: pointer; }
.delivery-log-row:focus-visible { outline: 2px solid #058743; outline-offset: -2px; }
.delivery-log-row[aria-expanded="true"] { background: #f0faf4; }
.log-row-caret { float: right; color: #058743; font-size: .9rem; transition: transform .15s; }
.delivery-log-row[aria-expanded="true"] .log-row-caret { transform: rotate(180deg); }
.delivery-log-detail td { padding: 0 !important; background: #f7fbf9; }
.delivery-message-viewer { padding: 15px; border-left: 3px solid #058743; }
.delivery-message-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--oms-slate-500); font-size: .71rem; }
.delivery-message-meta strong { color: var(--oms-navy-900); font-size: .8rem; }
.delivery-message-viewer label { display: block; margin: 9px 0 4px; }
.delivery-message-viewer pre { max-height: 340px; margin: 0; padding: 11px; overflow: auto; border: 1px solid var(--oms-slate-200); border-radius: 7px; background: #fff; color: var(--oms-slate-950); font: .72rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 820px) {
    .settings-grid,
    .template-editor-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .settings-card-heading,
    .customer-sms-heading,
    .delivery-message-meta { align-items: stretch; flex-direction: column; }
    .settings-card-heading > .settings-switch { width: 100%; padding: 8px 0; border-top: 1px solid var(--oms-slate-200); }
    .settings-save-bar { bottom: 6px; align-items: stretch; flex-direction: column; }
    .settings-save-bar .btn { width: 100%; }
    .inline-form-result { display: block; margin: 8px 0 0; }
}

/* Responsive foundation shared by every OMS workspace */
html,
body { width: 100%; max-width: 100%; overflow-x: hidden; }
img,
svg,
video,
canvas,
iframe { max-width: 100%; }
.app-shell,
.main-layout,
.content-area,
.card,
.dashboard-panel,
.orders-table-panel,
.order-detail-main,
.order-action-panel { min-width: 0; max-width: 100%; }
.content-area { overflow-x: clip; }
.card,
.order-info-card,
.order-info-card p,
.timeline-item,
.timeline-item p { overflow-wrap: anywhere; word-break: normal; }
.record-link { color: #058743; font-weight: 700; text-decoration: underline; text-decoration-color: rgba(5,135,67,.3); text-underline-offset: 2px; }
.record-link:hover { text-decoration-color: #058743; }
.content-tabs,
.module-tabs { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
input,
select,
textarea,
button { max-width: 100%; }

@media (max-width: 960px) {
    :root { --oms-header: 60px; }
    .sidebar-dark {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        left: 0 !important;
        width: min(278px, 86vw) !important;
        max-width: none !important;
        height: 100dvh !important;
        transform: translateX(-105%) !important;
        transition: transform .22s ease !important;
        z-index: 50 !important;
    }
    .sidebar-dark.active,
    .sidebar-dark.mobile-open { left: 0 !important; transform: translateX(0) !important; }
    .sidebar-overlay { z-index: 45 !important; }
    .sidebar-overlay.active { display: block !important; opacity: 1 !important; visibility: visible !important; background: rgba(2,53,28,.58) !important; }
    .main-layout { width: 100% !important; margin-left: 0 !important; }
    .top-header-bar {
        height: var(--oms-header) !important;
        min-height: var(--oms-header) !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        padding: 0 14px !important;
    }
    .top-header-left { min-width: 0; flex: 1; flex-direction: row !important; align-items: center !important; gap: 10px !important; }
    .top-header-left > div { min-width: 0; }
    .top-header-right { width: auto !important; flex: 0 0 auto; }
    .header-user-block { display: none !important; }
    .mobile-menu-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        display: inline-grid !important;
        place-items: center !important;
        flex: 0 0 38px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid var(--oms-slate-200) !important;
        border-radius: 9px !important;
        background: #fff !important;
        color: #058743 !important;
        cursor: pointer;
        touch-action: manipulation;
    }
    .mobile-menu-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
    .top-panel-title { max-width: min(62vw, 420px); overflow: hidden; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
    .top-panel-subtitle { font-size: .66rem; }
    .page-loader { left: 0 !important; }
}

@media (max-width: 760px) {
    .content-area { width: 100%; padding: 13px 11px 26px !important; }
    .module-tabs { margin: -2px 0 13px; }
    .page-section-header,
    .page-header-row,
    .order-view-header-row,
    .users-page-header,
    .suppliers-page-header { width: 100%; align-items: stretch !important; flex-direction: column !important; }
    .page-section-header h1,
    .users-page-title h1,
    .suppliers-page-title h1 { font-size: 1.25rem !important; overflow-wrap: anywhere; }
    .page-header-row .btn,
    .order-view-header-row .btn { width: 100%; margin-right: 0; justify-content: center; }
    .order-detail-layout { width: 100%; grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
    .order-detail-main { gap: 12px !important; }
    .order-info-card,
    .order-action-panel .card { width: 100%; margin-bottom: 0 !important; padding: 13px !important; }
    .order-info-card h2,
    .order-action-panel h2 { font-size: 1.05rem; }
    .order-info-card p { max-width: 100%; white-space: normal; }
    .order-action-panel { position: static !important; }
    .order-action-panel .btn,
    .order-action-btn,
    .back-to-orders-btn { width: 100%; margin: 0 0 8px !important; }
    .action-field input,
    .action-field select { width: 100%; max-width: none; margin-right: 0; }
    .toolbar,
    .top-toolbar-row,
    .search-and-count,
    .top-toolbar-actions,
    .orders-filter-form,
    .orders-workspace-vertical .orders-filter-form { width: 100%; min-width: 0; }
    .search-input { width: 100%; max-width: none; }
    .modal-card,
    .modal-box { width: 100% !important; max-width: 100% !important; padding: 14px !important; }

    .table-wrap { width: 100%; max-width: 100%; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
    .data-table.responsive-table { width: 100% !important; min-width: 0 !important; display: block; border: 0; }
    .data-table.responsive-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
    .data-table.responsive-table tbody { width: 100%; display: grid; gap: 10px; }
    .data-table.responsive-table tbody tr { width: 100%; min-width: 0; display: block; overflow: hidden; border: 1px solid var(--oms-slate-200); border-radius: 9px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
    .data-table.responsive-table tbody td { width: 100% !important; min-width: 0 !important; max-width: 100% !important; display: grid !important; grid-template-columns: minmax(92px, 34%) minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 10px !important; border: 0; border-bottom: 1px solid #edf1f3; background: transparent; white-space: normal !important; text-align: left !important; overflow-wrap: anywhere; }
    .data-table.responsive-table tbody td:last-child { border-bottom: 0; }
    .data-table.responsive-table tbody td::before { content: attr(data-label); color: var(--oms-slate-500); font-size: .64rem; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
    .data-table.responsive-table tbody td[colspan] { display: block !important; }
    .data-table.responsive-table tbody td.responsive-unlabelled { grid-template-columns: 1fr; }
    .data-table.responsive-table tbody td.responsive-unlabelled::before { display: none; }
    .data-table.responsive-table tbody td[colspan]::before,
    .data-table.responsive-table tbody td.empty-cell::before { display: none; }
    .data-table.responsive-table tbody td > * { min-width: 0; max-width: 100%; }
    .data-table.responsive-table .btn { width: 100%; justify-content: center; }
    .data-table.responsive-table .delivery-message-viewer { border-left: 0; }
    .delivery-log-detail { margin-top: -10px; }
}

@media (max-width: 420px) {
    html { font-size: 12.5px; }
    .content-area { padding-inline: 9px !important; }
    .card { padding: 11px; }
    .oms-kpi-grid,
    .dashboard-exec-kpis,
    .health-summary-grid { grid-template-columns: 1fr !important; }
    .data-table.responsive-table tbody td { grid-template-columns: minmax(82px, 32%) minmax(0, 1fr); padding-inline: 9px !important; }
    .top-panel-title { max-width: 68vw; }
    .top-panel-subtitle { display: none; }
}

/* Final mobile layout rules: fixed workspace header, compact two-column KPIs and readable Settings controls. */
@media (max-width: 960px) {
    .main-layout {
        padding-top: var(--oms-header) !important;
    }

    .top-header-bar {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        z-index: 44 !important;
        width: 100% !important;
        box-shadow: 0 1px 8px rgba(15, 23, 42, .08);
    }
}

@media (max-width: 820px) {
    .settings-grid,
    .template-editor-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .settings-card,
    .settings-card .form-group,
    .settings-switch-list {
        width: 100% !important;
        min-width: 0 !important;
    }

    .settings-switch-list {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-auto-flow: row !important;
    }

    .settings-switch-list .settings-switch {
        width: 100% !important;
        min-width: 0 !important;
        display: flex !important;
    }

    .settings-switch > span {
        min-width: 0;
        overflow-wrap: normal !important;
        word-break: normal !important;
        hyphens: none;
    }

    .settings-card textarea,
    .settings-card input,
    .template-editor textarea {
        width: 100% !important;
        max-width: none !important;
    }

    .settings-card textarea {
        min-height: 92px;
    }
}

@media (max-width: 760px) {
    .oms-kpi-grid,
    .delivery-kpi-grid,
    .dashboard-exec-kpis,
    .dashboard-inline-stat-grid,
    .dashboard-inline-skeleton-grid,
    .supplier-header-card,
    .health-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .oms-kpi-card,
    .dashboard-inline-stat-card,
    .supplier-stat,
    .health-summary-card {
        min-width: 0;
        min-height: 82px;
        padding: 11px !important;
    }

    .oms-kpi-card span,
    .dashboard-inline-stat-label,
    .supplier-stat-label,
    .health-summary-card span {
        overflow-wrap: normal !important;
        word-break: normal !important;
        hyphens: none;
    }

    .dashboard-inline-stat-card-small {
        max-width: none;
    }
}
