/* =====================================================================
   Partner Portal — corporate theme (v5.0, client-neutral)
   Client colours come from Branding/client.config (ClientBrand.CssVariables);
   the values below are only a neutral fallback used before that file is read.
   Do not put client names or client colours in this file.
   Loaded AFTER Bootstrap 3 + AdminLTE 2.4. Restyles the application shell
   and every existing content page (boxes, forms, GridViews, modals)
   without requiring markup changes in those pages.
   ===================================================================== */

/* ---------- Fonts (self-hosted, no CDN dependency) ---------- */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }

/* ---------- Design tokens ---------- */
:root {
    --ink: #14213D;           /* deep navy: sidebar, headings */
    --ink-2: #0E182E;         /* deeper navy: nested nav */
    --text: #1D2733;
    --muted: #5A6675;
    --faint: #8B96A3;
    --line: #DDE2E8;
    --line-soft: #EAEEF2;
    --surface: #F5F6F8;
    --panel: #FFFFFF;

    --accent: #2F5D8A;        /* client logo colour: marks, stripes, highlights */
    --accent-soft: #6386A7;   /* lighter accent for use on navy */
    --brand: #2F5D8A;         /* interactive colour (white text passes WCAG AA) */
    --brand-600: #295279;
    --brand-700: #224363;
    --brand-50: #F0F4F7;
    --brand-100: #D5DFE8;
    --brand-rgb: 47, 93, 138;  /* all overridden per client by ClientBrand.CssVariables() */

    --success: #0B7A4B;       /* completed / paid / OK states */
    --success-50: #E7F4ED;
    --danger: #B42318;        /* dues, rejections, errors */
    --danger-50: #FDEDEB;
    --warn: #B54708;
    --warn-50: #FEF3E6;
    --info: #1D5FB8;
    --info-50: #EAF1FB;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(20, 33, 61, .05), 0 1px 1px rgba(20, 33, 61, .03);
    --shadow-lg: 0 12px 32px rgba(20, 33, 61, .14);
    --focus: 0 0 0 3px rgba(47, 93, 138, .28);

    --header-h: 60px;
    --sidebar-w: 240px;
    --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body,
.main-header .logo,
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6,
.btn, .form-control, .tooltip, .popover {
    font-family: var(--font) !important;
}
body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "tnum" 0;
}
h1, h2, h3, h4, h5, h6 { color: var(--ink); letter-spacing: -.005em; font-variant: normal; }
a { color: var(--brand-600); }
a:hover, a:focus { color: var(--brand-700); }
::selection { background: var(--brand-50); color: var(--ink); }
.num, .tabular { font-variant-numeric: tabular-nums; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.sr-only-focusable:focus { position: static; width: auto; height: auto; }
.skip-link {
    position: absolute; left: 12px; top: -48px; z-index: 2000;
    background: var(--panel); color: var(--ink); padding: 10px 14px;
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-weight: 600;
}
.skip-link:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* =====================================================================
   SHELL — header, sidebar, content, footer (AdminLTE overrides)
   ===================================================================== */
.wrapper { background: var(--surface); }

/* Header */
.main-header { max-height: none; z-index: 1030; box-shadow: none; }
.main-header .logo {
    height: var(--header-h);
    width: var(--sidebar-w);
    padding: 0 16px;
    background: var(--panel) !important;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    line-height: 1;
}
.main-header .logo:hover { background: var(--panel) !important; }
.brand-mark {
    display: block; height: 32px; width: auto;
}
.brand-name {
    display: flex; flex-direction: column; gap: 2px;
    border-left: 1px solid var(--line); padding-left: 10px; white-space: nowrap;
}
.brand-name strong { color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.brand-name span { display: none; }
.main-header .logo .logo-lg { display: flex; align-items: center; gap: 10px; }
.main-header .logo .logo-mini { display: none; }
.logo-mini-img {
    width: 34px; height: 34px; object-fit: contain;
    border-radius: 6px; display: block;
}

.main-header .navbar {
    margin-left: var(--sidebar-w);
    min-height: var(--header-h);
    background: var(--panel) !important;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 20px 0 4px;
    gap: 16px;
}
.main-header .navbar::before, .main-header .navbar::after { display: none; }
.main-header .sidebar-toggle {
    color: var(--ink) !important;
    padding: 0; width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    flex: 0 0 auto;
}
.main-header .sidebar-toggle:before { content: none; }
.main-header .sidebar-toggle:hover { background: var(--surface) !important; color: var(--ink) !important; }
.main-header .sidebar-toggle .fa { font-size: 18px; }

.topbar-title { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.topbar-title .crumb { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title h1 {
    margin: 0; font-size: 18px; font-weight: 600; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar-meta { display: flex; align-items: center; gap: 0; flex: 0 0 auto; }
.topbar-meta > .meta-block {
    display: flex; flex-direction: column; justify-content: center;
    padding: 0 16px; line-height: 1.3; border-left: 1px solid var(--line-soft);
    min-height: 36px;
}
.topbar-meta > .meta-block:first-child { border-left: 0; }
.meta-label { color: var(--muted); font-size: 11.5px; }
.meta-value { color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; }

/* Identity block (lblCCname renders spans from code-behind) */
.identity { max-width: 320px; }
.identity .id-meta { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity .id-name { display: block; color: var(--ink); font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity br { display: none; }

.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px 4px 6px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line);
    font-size: 12px; color: var(--ink); font-weight: 500;
}
.status-pill img, .status-pill .user-image {
    width: 18px !important; height: 18px !important; margin: 0 !important; float: none !important; border-radius: 0 !important;
}
.status-pill.is-empty-label .status-text { display: none; }

.btn-signout {
    display: inline-flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 14px !important; margin: 0 0 0 12px !important;
    background: var(--panel) !important; color: var(--ink) !important;
    border: 1px solid var(--line) !important; border-radius: var(--radius-sm) !important;
    font-weight: 600 !important; font-size: 13px !important; float: none !important;
    box-shadow: none !important;
}
.btn-signout:hover { border-color: var(--danger) !important; color: var(--danger) !important; background: var(--danger-50) !important; }

/* Sidebar */
.main-sidebar {
    width: var(--sidebar-w);
    padding-top: var(--header-h);
    background: var(--ink) !important;
}
.sidebar { padding-bottom: 24px; }
.sidebar-menu { padding: 8px 0; }
.sidebar-menu > li.header {
    background: transparent !important;
    color: #7F93A7 !important;
    font-size: 12px; font-weight: 500;
    padding: 18px 20px 6px !important;
    text-transform: none; letter-spacing: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-menu > li > a {
    color: #C3CFDB !important;
    padding: 10px 16px 10px 20px !important;
    border-left: 3px solid transparent;
    font-size: 14px; font-weight: 500;
    display: flex !important; align-items: center; gap: 12px;
}
.sidebar-menu > li > a > .fa,
.sidebar-menu > li > a > .glyphicon { width: 18px; text-align: center; font-size: 15px; color: #8FA3B7; }
.sidebar-menu > li > a > span:not(.pull-right-container) { flex: 1 1 auto; }
.sidebar-menu > li > a .pull-right-container { position: static !important; margin-left: auto; }
.sidebar-menu > li > a .pull-right-container .fa { transition: transform .15s ease; color: #7F93A7; }
.sidebar-menu > li:hover > a,
.sidebar-menu > li.menu-open > a {
    background: rgba(255, 255, 255, .05) !important;
    color: #FFFFFF !important;
}
.sidebar-menu > li.active > a {
    background: rgba(255, 255, 255, .08) !important;
    color: #FFFFFF !important;
    border-left-color: var(--accent-soft);
}
.sidebar-menu > li.active > a > .fa, .sidebar-menu > li:hover > a > .fa { color: #FFFFFF; }

.sidebar-menu .treeview-menu {
    background: var(--ink-2) !important;
    padding: 4px 0 8px !important;
}
.sidebar-menu .treeview-menu > li > a {
    color: #A9B8C7 !important;
    padding: 8px 16px 8px 30px !important;
    font-size: 13.5px;
    display: flex !important; align-items: center; gap: 12px;
    border-left: 3px solid transparent;
    white-space: normal; line-height: 1.35;
}
.sidebar-menu .treeview-menu > li > a > .fa { width: 16px; text-align: center; color: #6F869C; font-size: 13.5px; }
.sidebar-menu .treeview-menu > li > a:hover { color: #FFFFFF !important; background: rgba(255,255,255,.04); }
.sidebar-menu .treeview-menu > li > a:hover > .fa { color: #CFE0EE; }
.sidebar-menu .treeview-menu > li.active > a {
    color: #FFFFFF !important;
    background: rgba(var(--brand-rgb), .16);
    border-left-color: var(--accent-soft);
}
.sidebar-menu .treeview-menu > li.active > a > .fa { color: var(--accent-soft); }

.sidebar-foot {
    margin: 16px 16px 0; padding: 14px; border-radius: var(--radius);
    background: rgba(255, 255, 255, .05); color: #A9B8C7; font-size: 12.5px; line-height: 1.45;
}
.sidebar-foot strong { color: #FFFFFF; font-weight: 600; display: block; margin-bottom: 2px; }

/* Collapsed (sidebar-mini) */
@media (min-width: 768px) {
    .sidebar-mini.sidebar-collapse .main-header .logo { width: 60px; padding: 0 13px; }
    .sidebar-mini.sidebar-collapse .main-header .logo .logo-lg { display: none; }
    .sidebar-mini.sidebar-collapse .main-header .logo .logo-mini { display: block; }
    .sidebar-mini.sidebar-collapse .main-header .navbar { margin-left: 60px; }
    .sidebar-mini.sidebar-collapse .main-sidebar { width: 60px !important; }
    .sidebar-mini.sidebar-collapse .content-wrapper,
    .sidebar-mini.sidebar-collapse .main-footer { margin-left: 60px !important; }
    .sidebar-mini.sidebar-collapse .sidebar-menu > li.header,
    .sidebar-mini.sidebar-collapse .sidebar-foot { display: none; }
    .sidebar-mini.sidebar-collapse .sidebar-menu > li > a { padding: 12px 0 12px 18px !important; }
    .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > span:not(.pull-right-container) {
        top: 0; margin-left: -3px; padding: 12px 5px 12px 20px;
        background: var(--ink-2) !important; width: 220px; left: 57px;
    }
    .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu { top: 46px; left: 60px; width: 220px; }
}

/* Content */
.content-wrapper, .main-footer { margin-left: var(--sidebar-w); }
.content-wrapper { background: var(--surface); }
.fixed .content-wrapper, .fixed .right-side { padding-top: var(--header-h); }
.portal-main { padding: 24px 28px 40px; }
.portal-main > .content, .portal-main .content { padding: 0; min-height: 0; margin: 0; }
.portal-main section.content > .container-fluid { padding: 0; }

.main-footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12.5px;
    padding: 14px 28px;
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.main-footer a { color: var(--muted); }

/* Password-expiry banner */
.pwd-banner {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 20px; padding: 12px 16px;
    background: var(--warn-50); border: 1px solid #F7D3AE; border-radius: var(--radius);
    color: #7A2E0B; font-size: 13.5px;
}
.pwd-banner .fa { color: var(--warn); font-size: 16px; }
.pwd-banner .pwd-text { flex: 1 1 auto; font-weight: 500; }
.pwd-banner a { color: #7A2E0B; font-weight: 600; text-decoration: underline; }
.pwd-banner.is-hidden, .pwd-banner:has(.pwd-text:empty) { display: none; }

/* =====================================================================
   COMPONENTS used by all content pages (AdminLTE / Bootstrap 3)
   ===================================================================== */

/* Boxes → panels */
.box {
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: 1px solid var(--line) !important;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.box.box-solid { border: 1px solid var(--line); }
.box-header {
    padding: 14px 20px;
    color: var(--ink);
}
.box-header.with-border { border-bottom: 1px solid var(--line-soft); }
.box-header > .box-title,
.box-header .box-title {
    font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.4;
}
.box-header > .box-tools { top: 10px; right: 12px; }
.btn-box-tool { color: var(--faint); border-radius: var(--radius-sm); padding: 6px 8px; }
.btn-box-tool:hover, .open .btn-box-tool { color: var(--ink); background: var(--surface); }
.box-body { padding: 18px 20px; }
.box-body::after { content: ""; display: table; clear: both; }
.box-footer {
    background: #FAFBFC;
    border-top: 1px solid var(--line-soft);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 14px 20px;
}
.box-footer::after { content: ""; display: table; clear: both; }
.box-footer .btn + .btn { margin-left: 8px; }
.box.collapsed-box .box-header.with-border { border-bottom: 0; }

/* Page-level header labels used as totals (e.g. Ledger) */
.box-header .control-label { color: var(--muted); }
.box-header span.control-label, .box-footer span.control-label {
    color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums;
}

/* Legacy panels (Bootstrap panel) */
.panel { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); }
.panel-default > .panel-heading { background: #FAFBFC; border-color: var(--line-soft); color: var(--ink); border-radius: var(--radius) var(--radius) 0 0; }
.panel-title { font-weight: 600; font-size: 15px; }
.list-group-item { border-color: var(--line-soft); }

/* Forms */
.form-horizontal .form-group { margin-left: 0; margin-right: 0; margin-bottom: 14px; }
.form-group { margin-bottom: 14px; }
.control-label, label {
    color: var(--muted);
    font-weight: 500;
    font-size: 13px;
}
.form-horizontal .control-label { padding-top: 8px; }
.form-control {
    height: 38px;
    padding: 7px 12px;
    font-size: 14px;
    color: var(--text);
    background-color: var(--panel);
    border: 1px solid #CDD6DE;
    border-radius: var(--radius-sm) !important;
    box-shadow: none;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.form-control.input-sm, .input-sm {
    height: 36px; font-size: 13.5px; padding: 6px 10px; border-radius: var(--radius-sm);
}
textarea.form-control { height: auto; min-height: 88px; }
select.form-control { padding-right: 28px; }
.form-control:hover { border-color: #B7C3CE; }
.form-control:focus {
    border-color: var(--brand) !important;
    box-shadow: var(--focus) !important;
    outline: 0;
}
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control, .aspNetDisabled.form-control {
    background: var(--surface); color: var(--muted); cursor: not-allowed;
}
.form-control::placeholder { color: #9AA8B5; }

.input-group .form-control:not(:first-child) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.input-group .form-control:not(:last-child) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-group-addon {
    background: var(--surface);
    border: 1px solid #CDD6DE;
    color: var(--muted);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    min-width: 38px;
}
.input-group-addon:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-btn .btn { height: 36px; }

.radio-inline, .checkbox-inline { color: var(--text); font-weight: 400; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
.has-error .form-control { border-color: var(--danger); }
.help-block { color: var(--muted); font-size: 12.5px; }

/* Buttons */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13.5px;
    padding: 8px 16px;
    line-height: 1.4;
    border-width: 1px;
    box-shadow: none !important;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn-sm, .btn-group-sm > .btn { padding: 6px 12px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 5px; }
.btn.input-sm { height: 36px; padding: 6px 14px; }
.btn:focus-visible { box-shadow: var(--focus) !important; }

.btn-primary:not([style*="background"]), .btn-info:not([style*="background"]), .btn-success:not([style*="background"]), .btn.bg-purple:not([style*="background"]), .btn.bg-light-blue:not([style*="background"]), .btn.bg-olive:not([style*="background"]) {
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #FFFFFF !important;
}
.btn-primary:not([style*="background"]):hover, .btn-info:not([style*="background"]):hover, .btn-success:not([style*="background"]):hover, .btn.bg-purple:not([style*="background"]):hover, .btn.bg-light-blue:not([style*="background"]):hover, .btn-primary:not([style*="background"]):focus, .btn-info:not([style*="background"]):focus, .btn-success:not([style*="background"]):focus, .btn-primary:not([style*="background"]):active, .btn-info:not([style*="background"]):active, .btn-success:not([style*="background"]):active {
    background-color: var(--brand-600) !important;
    border-color: var(--brand-600) !important;
    color: #FFFFFF !important;
}
.btn-default {
    background: var(--panel);
    border-color: #CDD6DE;
    color: var(--ink);
}
.btn-default:hover, .btn-default:focus, .btn-default:active { background: var(--surface); border-color: #B7C3CE; color: var(--ink); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #971D14; border-color: #971D14; }
.btn-warning { background: var(--warn); border-color: var(--warn); }
.btn-warning:hover { background: #93390A; border-color: #93390A; }
.btn-link { color: var(--brand-600); font-weight: 500; }

/* Status filter button rows (Sample status etc.) keep their semantic inline colours */
.btn[style*="background"] { border-color: rgba(16, 42, 67, .12) !important; }
.btn[style*="background"]:hover { filter: brightness(.94); }
.btn-group > .btn { margin-bottom: 6px; }
.box-body .btn-group { flex-wrap: wrap; }

/* Tables & ASP.NET GridView */
.table-responsive { border: 0; border-radius: var(--radius-sm); }
.table,
table.table {
    width: 100%;
    margin-bottom: 12px;
    background: var(--panel);
    border: 1px solid var(--line) !important;
    font-size: 13px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.table > thead > tr > th,
.table > tbody > tr > th,
.table > tr > th,
.table th {
    background: #F1F4F7 !important;
    color: var(--ink) !important;
    font-weight: 600;
    font-size: 12.5px;
    text-transform: none;
    letter-spacing: 0;
    vertical-align: middle !important;
    padding: 10px 12px !important;
    border-color: var(--line) !important;
    border-bottom: 1px solid var(--line) !important;
    white-space: nowrap;
}
.table th a { color: var(--ink) !important; }
.table > tbody > tr > td,
.table > tr > td,
.table td {
    padding: 9px 12px !important;
    vertical-align: middle !important;
    border-color: var(--line-soft) !important;
}
.table-bordered > tbody > tr > td, .table-bordered > tbody > tr > th { border: 1px solid var(--line-soft) !important; }
.table-striped > tbody > tr:nth-of-type(odd):not(.pagination-ys) { background-color: #FAFBFC; }
.table-hover > tbody > tr:hover:not(.pagination-ys) { background-color: var(--brand-50) !important; }
.table tfoot td, .table tr:last-child > td[style*="font-weight"] { font-weight: 600; }

/* GridView footer totals: calm, not shouting red */
.table .grid-total, .grid-total { color: var(--ink) !important; font-weight: 700 !important; font-size: 13.5px !important; }

/* GridView empty-data row */
.table td[colspan] { color: var(--muted); }

/* GridView pager (PagerStyle CssClass="pagination-ys") */
.pagination-ys, tr.pagination-ys > td { background: var(--panel) !important; border: 0 !important; padding: 10px 0 !important; margin: 0 !important; }
.pagination-ys table { border: 0 !important; margin: 0 !important; }
.pagination-ys table > tbody > tr > td { display: inline-block !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
.pagination-ys table > tbody > tr > td > a,
.pagination-ys table > tbody > tr > td > span {
    display: inline-flex !important; align-items: center; justify-content: center;
    float: none !important;
    min-width: 32px; height: 32px; padding: 0 10px !important; margin: 0 4px 0 0 !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--panel) !important;
    color: var(--ink) !important;
    font-size: 13px; font-weight: 500; text-decoration: none;
}
.pagination-ys table > tbody > tr > td > a:hover { border-color: var(--brand) !important; color: var(--brand-600) !important; background: var(--brand-50) !important; }
.pagination-ys table > tbody > tr > td > span {
    background: var(--ink) !important; border-color: var(--ink) !important; color: #FFFFFF !important; cursor: default;
}

/* Labels / badges */
.label { border-radius: 999px; font-weight: 600; padding: .3em .7em; font-size: 11.5px; }
.label-success, .bg-green { background-color: var(--success) !important; }
.label-danger, .bg-red { background-color: var(--danger) !important; }
.label-warning, .bg-yellow { background-color: var(--warn) !important; }
.label-info, .bg-aqua, .bg-light-blue, .bg-blue { background-color: var(--info) !important; }
.badge { border-radius: 999px; background: var(--ink); font-weight: 600; }

/* Alerts & callouts */
.alert { border-radius: var(--radius); border: 1px solid transparent; }
.alert-success { background: var(--success-50) !important; color: #075634 !important; border-color: #BFE3CF; }
.alert-danger { background: var(--danger-50) !important; color: #7A140C !important; border-color: #F4C7C2; }
.alert-warning { background: var(--warn-50) !important; color: #7A2E0B !important; border-color: #F7D3AE; }
.alert-info { background: var(--info-50) !important; color: #123D78 !important; border-color: #C7DAF3; }

/* Modals */
.modal-backdrop.in { opacity: .45; background: #0B1B2A; }
.modal-content {
    border: 0; border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-title { font-size: 17px; font-weight: 600; color: var(--ink); }
.modal-header .close { opacity: .5; font-size: 24px; margin-top: -4px; }
.modal-header .close:hover { opacity: 1; }
.modal-body { padding: 18px 20px; }
.modal-footer { border-top: 1px solid var(--line-soft); background: #FAFBFC; }
@media (min-width: 992px) { .modal-wide { width: min(1120px, 94vw) !important; } }

/* Datepicker / timepicker */
.datepicker.dropdown-menu { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow-lg); padding: 8px; font-family: var(--font); }
.datepicker table tr td.active, .datepicker table tr td.active:hover,
.datepicker table tr td.active.active, .datepicker table tr td span.active {
    background: var(--brand) !important; background-image: none !important; color: #FFF !important; text-shadow: none;
}
.datepicker table tr td.today { background: var(--brand-50) !important; background-image: none !important; }
.datepicker table tr td, .datepicker table tr th { border-radius: 6px; }

/* jQuery UI autocomplete */
.ui-autocomplete {
    max-height: 240px; overflow-x: hidden; overflow-y: auto;
    border-radius: var(--radius-sm); border: 1px solid var(--line) !important; box-shadow: var(--shadow-lg);
    font-family: var(--font); font-size: 13.5px; background: var(--panel);
}
.ui-menu .ui-menu-item a.ui-state-focus, .ui-menu .ui-menu-item a.ui-state-active,
.ui-menu .ui-menu-item .ui-state-active { background: var(--brand-50) !important; border-color: transparent !important; color: var(--ink) !important; }

/* Legacy helpers kept for existing pages */
.lblWrap { word-wrap: normal; word-break: break-all; }
.blink-warning { color: inherit; font-weight: 500; animation: none; }

/* =====================================================================
   DASHBOARD (Main.aspx)
   ===================================================================== */
.dash-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    margin-bottom: 20px;
}
.dash-head h2 { margin: 0 0 4px; font-size: 24px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.dash-head p { margin: 0; color: var(--muted); font-size: 14px; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-actions .btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; }

.notice {
    display: flex; gap: 12px; align-items: flex-start;
    margin-bottom: 20px; padding: 12px 16px;
    background: var(--info-50); border: 1px solid #C7DAF3; border-radius: var(--radius);
    color: #123D78; font-size: 13.5px;
}
.notice .fa { margin-top: 3px; color: var(--info); }
.notice .notice-body { flex: 1 1 auto; font-weight: 500; }
.notice.is-hidden, .notice:has(.notice-body > span:empty) { display: none; }

.dash-top {
    display: grid;
    grid-template-columns: minmax(300px, 5fr) minmax(0, 7fr);
    gap: 20px;
    margin-bottom: 20px;
}
.dash-top.no-balance { grid-template-columns: 1fr; }

/* The one bold element: account position */
.balance-panel {
    position: relative;
    background: var(--ink);
    color: #FFFFFF;
    border-radius: 14px;
    padding: 22px 24px 20px;
    display: flex; flex-direction: column; gap: 16px;
    overflow: hidden;
    min-height: 212px;
}
.balance-panel::before {
    /* client accent rule */
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-soft) 100%);
}
.balance-panel .bp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.balance-panel .bp-label { font-size: 14px; color: #B8C7D6; font-weight: 500; }
.balance-panel .bp-date { font-size: 12px; color: #8EA3B8; }
.balance-panel .bp-amount {
    font-size: 40px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em;
    font-variant-numeric: tabular-nums; color: #FFFFFF; word-break: break-all;
}
.balance-panel .bp-amount .cur { font-size: 24px; font-weight: 500; color: #B8C7D6; margin-right: 4px; vertical-align: 6px; }
.balance-panel .bp-note { font-size: 12.5px; color: #8EA3B8; margin-top: 4px; }
.balance-panel .bp-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.balance-panel .btn-pay {
    background: #FFFFFF !important; color: var(--ink) !important; border: 0 !important;
    height: 40px; padding: 0 18px; display: inline-flex; align-items: center; gap: 8px;
}
.balance-panel .btn-pay:hover { background: var(--brand-50) !important; }
.balance-panel .btn-ghost {
    background: transparent !important; color: #FFFFFF !important; border: 1px solid rgba(255,255,255,.28) !important;
    height: 40px; padding: 0 16px; display: inline-flex; align-items: center;
}
.balance-panel .btn-ghost:hover { border-color: #FFFFFF !important; }
.balance-panel .pay-wrap { display: contents; }

/* Today band: one panel, divided columns (they share one unit & one day) */
.today-panel {
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.today-panel .tp-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 22px; border-bottom: 1px solid var(--line-soft);
}
.today-panel .tp-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.today-panel .tp-head span { color: var(--muted); font-size: 12.5px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); flex: 1 1 auto; }
.stat {
    padding: 18px 22px 16px; display: flex; flex-direction: column; gap: 6px;
    border-left: 1px solid var(--line-soft);
}
.stat:first-child { border-left: 0; }
.stat .stat-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .stat-label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }
.stat.is-work .stat-label .dot { background: var(--info); }
.stat.is-reject .stat-label .dot { background: var(--danger); }
.stat .stat-value {
    font-size: 34px; font-weight: 600; line-height: 1.1; color: var(--ink);
    font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.stat.is-reject.has-value .stat-value { color: var(--danger); }
.stat .stat-link {
    margin-top: auto; padding-top: 8px; font-size: 13px; font-weight: 600; color: var(--brand-600);
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none;
}
.stat .stat-link:hover { color: var(--brand-700); text-decoration: underline; }
.stat .stat-link .fa { font-size: 12px; }

.dash-bottom {
    display: grid; grid-template-columns: minmax(0, 7fr) minmax(280px, 5fr); gap: 20px;
}
.dash-bottom.single { grid-template-columns: 1fr; }
.card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; }
.card-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.card-head span { color: var(--muted); font-size: 12.5px; }
.card-body { padding: 16px 20px 20px; }

.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.shortcut {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    color: var(--ink) !important; font-weight: 500; font-size: 13.5px; text-decoration: none !important;
    background: var(--panel); transition: border-color .12s ease, background-color .12s ease;
}
.shortcut:hover { border-color: var(--brand); background: var(--brand-50); }
.shortcut .ico {
    width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface); color: var(--ink); font-size: 15px;
}
.shortcut:hover .ico { background: #FFFFFF; color: var(--brand-600); }
.shortcut-empty { color: var(--muted); font-size: 13.5px; margin: 0; }

.bulletin-body { color: var(--text); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.bulletin-body table { max-width: 100%; }
.bulletin-body p:last-child { margin-bottom: 0; }

/* Work order detail status chips (grdDtls) */
.status-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-chip.is-done { background: var(--success-50); color: #075634 !important; }
.status-chip.is-pending { background: var(--warn-50); color: #93390A !important; }

/* =====================================================================
   EMPLOYEE HOME (EmpHome.aspx)
   ===================================================================== */
.target-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.target-head .t-label { font-size: 15px; color: var(--muted); font-weight: 500; }
.target-head .t-value { font-size: 28px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.period-block { margin-bottom: 20px; }
.period-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line-soft); }
.period-summary .ps { padding: 14px 20px; border-left: 1px solid var(--line-soft); }
.period-summary .ps:first-child { border-left: 0; }
.period-summary .ps-label { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; margin-bottom: 2px; }
.period-summary .ps-value { display: block; font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.period-block .table { margin: 0; border-left: 0 !important; border-right: 0 !important; border-bottom: 0 !important; border-radius: 0; }
.period-block .table-wrap { padding: 0; overflow-x: auto; }
.period-block .table td:nth-child(n+3), .period-block .table th:nth-child(n+3) { text-align: right; }
.period-block table[id$="grdOutstanding"] td:nth-child(n+2),
.period-block table[id$="grdOutstanding"] th:nth-child(n+2) { text-align: right; }

/* =====================================================================
   AUTH (Default.aspx sign-in)
   ===================================================================== */
.auth-body { background: var(--surface); min-height: 100vh; margin: 0; }
.auth {
    min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 5fr) minmax(420px, 6fr);
}
.auth-aside {
    position: relative; color: #FFFFFF; overflow: hidden; isolation: isolate;
    padding: 48px 56px; display: flex; flex-direction: column; gap: 40px;
    background:
        radial-gradient(640px 420px at 100% 0%, rgba(var(--brand-rgb), .30), transparent 65%),
        radial-gradient(520px 380px at 0% 100%, rgba(var(--brand-rgb), .12), transparent 70%),
        var(--ink);
}
.auth-aside::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-soft) 100%);
}
.auth-aside::after {
    /* neutral decorative rings (no client artwork, works for every client) */
    content: ""; position: absolute; z-index: -1; right: -160px; bottom: -160px; width: 460px; height: 460px;
    border-radius: 50%; border: 56px solid rgba(255, 255, 255, .035);
    box-shadow: 0 0 0 70px rgba(255, 255, 255, .02);
}
/* Client logo: light version straight on the panel, or the normal logo on a white tile */
/* Explicit height: SVG logos without width/height attributes would otherwise collapse */
.auth-aside .aside-logo { height: 68px; max-width: 280px; width: auto; object-fit: contain; object-position: left center; display: block; align-self: flex-start; }
.auth-aside .brand-tile {
    display: inline-flex; align-self: flex-start; background: #FFFFFF; border-radius: 12px; padding: 10px 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.auth-aside .brand-tile img { height: 56px; max-width: 240px; width: auto; object-fit: contain; display: block; }
.auth-aside .aside-wordmark { font-size: 26px; font-weight: 700; letter-spacing: -.01em; color: #FFFFFF; }
.auth-aside .aside-kicker {
    display: inline-block; margin: 0 0 14px; padding: 4px 10px; border-radius: 999px;
    background: rgba(var(--brand-rgb), .22); color: #FFFFFF; font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
}
.auth-aside h1 { color: #FFFFFF; font-size: 34px; line-height: 1.15; font-weight: 600; margin: 0 0 14px; letter-spacing: -.02em; max-width: 18ch; }
.auth-aside .lede { color: #BAC5D3; font-size: 16px; line-height: 1.55; margin: 0; max-width: 42ch; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; max-width: 44ch; }
.auth-points li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; }
.auth-points .pi {
    width: 36px; height: 36px; border-radius: 9px; background: rgba(255,255,255,.08);
    display: inline-flex; align-items: center; justify-content: center; color: var(--accent-soft); font-size: 15px;
}
.auth-points strong { display: block; color: #FFFFFF; font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.auth-points span { color: #A3B0C2; font-size: 13.5px; line-height: 1.5; }
.auth-aside .aside-foot { margin-top: auto; color: #8592A6; font-size: 12.5px; }
.auth-aside .aside-foot p { margin: 0 0 4px; }
.auth-aside .aside-help { color: #C9D2DE; line-height: 1.7; margin-bottom: 18px !important; }
.auth-aside .aside-help strong { color: #FFFFFF; font-weight: 600; }
.auth-aside .aside-help .aside-legal { color: #8592A6; }
.auth-aside .aside-help .fa { color: var(--accent-soft); margin-right: 4px; }
.auth-aside .aside-foot a { color: #C9D2DE; text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); }
.auth-aside .powered {
    padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); color: #8592A6; font-size: 12.5px;
}
.auth-aside .powered a { color: #FFFFFF; font-weight: 600; text-decoration: none; }
.auth-aside .powered a:hover { text-decoration: underline; }
.auth-aside .copyright { color: #8592A6; }



.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .mobile-brand { display: none; }
.auth-card h2 { font-size: 26px; font-weight: 600; margin: 0 0 6px; color: var(--ink); letter-spacing: -.01em; }
.auth-card .sub { color: var(--muted); margin: 0 0 24px; font-size: 14.5px; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: #E8EBEF; border-radius: 9px; margin-bottom: 22px; }
.seg button {
    border: 0; background: transparent; border-radius: 6px; height: 36px; font: 600 13px/1 var(--font);
    color: var(--muted); cursor: pointer;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: #FFFFFF; color: var(--brand-700); box-shadow: 0 1px 2px rgba(20,33,61,.14); }
.seg button:focus-visible { box-shadow: var(--focus); }
.js .login-type-select { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.field { margin-bottom: 16px; }
.field label { display: block; color: var(--ink); font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.field .control { position: relative; }
.field .control .fa-lead { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 15px; pointer-events: none; }
.field .form-control { height: 44px; padding-left: 40px; font-size: 15px; }
.field .form-control.no-lead { padding-left: 12px; }
.field .form-control.has-reveal { padding-right: 64px; }
.field .reveal {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: var(--muted); height: 34px; padding: 0 10px; border-radius: 6px;
    font: 600 12.5px/1 var(--font); cursor: pointer;
}
.field .reveal:hover { color: var(--ink); background: var(--surface); }
.field .field-error { display: none; color: var(--danger); font-size: 12.5px; margin-top: 6px; font-weight: 500; }
.field.has-err .form-control { border-color: var(--danger); }
.field.has-err .field-error { display: block; }
.field-hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.field-hint[hidden] { display: none; }
.caps-hint { color: var(--warn); font-weight: 600; }
.field-row { display: flex; justify-content: flex-end; margin: -4px 0 18px; }
.field-row a { font-size: 13.5px; font-weight: 600; }

.btn-signin {
    width: 100%; height: 46px; font-size: 15px !important; border-radius: 8px !important;
}
.btn-signin.is-busy { opacity: .75; cursor: progress; }

/* Server messages (sign-in, reset, change password) */
.auth-alert {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 14px; margin: 0 0 20px; border-radius: var(--radius-sm); border: 1px solid;
    font-size: 13.5px; line-height: 1.45;
}
.auth-alert > .fa { font-size: 17px; margin-top: 1px; flex: 0 0 auto; }
.auth-alert strong { display: block; font-weight: 600; }
.auth-alert span { display: block; }
.auth-alert span:empty { display: none; }
.auth-alert.is-error { background: var(--danger-50); border-color: #F4C7C2; color: #7A140C; }
.auth-alert.is-error > .fa { color: var(--danger); }
.auth-alert.is-locked { background: #FFF4E5; border-color: #F5C98F; color: #6B2A07; }
.auth-alert.is-locked > .fa { color: var(--warn); }
.auth-alert.is-info { background: var(--info-50); border-color: #C7DAF3; color: #123D78; }
.auth-alert.is-info > .fa { color: var(--info); }
.auth-alert.is-success { background: var(--success-50); border-color: #BFE3CF; color: #075634; }
.auth-alert.is-success > .fa { color: var(--success); }

.auth-secure {
    display: flex; gap: 10px; align-items: flex-start;
    margin: 18px 0 0; padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--brand-50); color: var(--brand-ink, #6B2A07); font-size: 12.5px; line-height: 1.5;
}
.auth-secure .fa { color: var(--brand); font-size: 15px; margin-top: 1px; }
.legal { margin-top: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.legal a { color: var(--ink); text-decoration: underline; text-decoration-color: #B7C3CE; text-underline-offset: 2px; }
.legal a:hover { text-decoration-color: var(--ink); }
.auth-help { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.auth-help p { margin: 0 0 10px; }
.auth-help strong { color: var(--ink); font-weight: 600; }
.auth-help a { font-weight: 600; }
.auth-help .vendor-support { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.auth-help .vendor-support .fa { color: var(--faint); margin-top: 2px; }
.auth-card .mobile-wordmark { font-size: 22px; font-weight: 700; color: var(--ink); }

/* =====================================================================
   PASSWORD PAGES (ForgotPassword.aspx, ContactUs/ChangePassword.aspx)
   ===================================================================== */
.pw-card {
    max-width: 760px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line);
    border-radius: 14px; box-shadow: var(--shadow); padding: 28px 32px 24px; position: relative; overflow: hidden;
}
.pw-card::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-soft) 100%);
}
.pw-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.pw-head h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.pw-head p { margin: 0; color: var(--muted); font-size: 14px; max-width: 60ch; }
.pw-icon {
    width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-50); color: var(--brand); font-size: 19px;
}
.pw-steps { list-style: none; display: flex; gap: 8px; margin: 0 0 20px; padding: 0; counter-reset: none; }
.pw-steps li {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px;
    border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600;
}
.pw-steps li span {
    width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: #FFFFFF; border: 1px solid var(--line); font-size: 12px;
}
.pw-steps li.is-current { background: var(--brand-50); color: var(--brand-700); }
.pw-steps li.is-current span { background: var(--brand); border-color: var(--brand); color: #FFFFFF; }
.pw-steps li.is-done { color: var(--success); }
.pw-steps li.is-done span { background: var(--success); border-color: var(--success); color: transparent; position: relative; }
.pw-steps li.is-done span::after { content: "\2713"; position: absolute; color: #FFFFFF; font-size: 12px; }
.pw-meta { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.pw-account { color: var(--ink); font-weight: 600; font-size: 14.5px; }
.pw-user, .pw-user[disabled] {
    background: transparent !important; color: var(--ink) !important; font-weight: 600; border: 0; padding: 0;
    cursor: default; width: auto; min-width: 10ch;
}
.pw-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: start; }
.pw-body .pw-fields { min-width: 0; }
.pw-rules {
    list-style: none; margin: 26px 0 0; padding: 14px 16px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line-soft); font-size: 13px; color: var(--muted);
}
.pw-rules li { position: relative; padding-left: 24px; margin: 6px 0; line-height: 1.4; }
.pw-rules li::before {
    content: ""; position: absolute; left: 0; top: 2px; width: 14px; height: 14px; border-radius: 50%;
    border: 1.5px solid #B7C1CC; background: #FFFFFF;
}
.pw-rules li.is-ok { color: var(--success); }
.pw-rules li.is-ok::before { border-color: var(--success); background: var(--success); box-shadow: inset 0 0 0 3px #FFFFFF; }
.pw-rules li.is-bad { color: #7A140C; }
.pw-rules li.is-bad::before { border-color: var(--danger); }
.pw-match.is-ok { color: var(--success); font-weight: 600; }
.pw-match.is-bad { color: var(--danger); font-weight: 600; }
.otp-input { letter-spacing: .4em; font-size: 20px !important; font-variant-numeric: tabular-nums; max-width: 220px; }
.pw-actions {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    margin: 8px -32px -24px; padding: 16px 32px; background: #FAFBFC; border-top: 1px solid var(--line-soft);
}
.pw-actions .btn { height: 40px; }
.pw-actions .btn-link { margin-left: auto; }
.pw-client-msg { display: none; }

/* =====================================================================
   SECURITY NOTICES + DASHBOARD ADDITIONS
   ===================================================================== */
.sec-banner {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 20px; padding: 12px 16px;
    background: var(--danger-50); border: 1px solid #F4C7C2; border-radius: var(--radius);
    color: #7A140C; font-size: 13.5px;
}
.sec-banner .fa { color: var(--danger); font-size: 17px; }
.sec-banner .sec-text { flex: 1 1 auto; font-weight: 500; }
.sec-banner a { color: #7A140C; font-weight: 600; text-decoration: underline; white-space: nowrap; }

.dash-head .last-signin { margin-top: 6px; font-size: 13px; color: var(--muted); }
.dash-head .last-signin .fa { color: var(--success); margin-right: 4px; }
.dash-head .last-signin span { margin-left: 4px; }

.dash-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.support-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.support-list li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; font-size: 13.5px; color: var(--text); }
.support-list .ico {
    width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-50); color: var(--brand); font-size: 15px;
}
.support-list .sl-label { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.support-list a { font-weight: 600; }

.sidebar-foot a { color: #FFFFFF; }
.sidebar-foot a:hover { color: var(--accent-soft); }

/* Simple shell (MasterPage.master: no sidebar) */
.simple-shell .content-wrapper, .simple-shell .main-footer { margin-left: 0 !important; }
.simple-shell .main-header .navbar { margin-left: var(--sidebar-w); }
.simple-shell .portal-main { max-width: 1040px; margin: 0 auto; }

/* Standalone error page */
.error-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.error-card { max-width: 480px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 36px; box-shadow: var(--shadow); }
.error-card img { height: 48px; border-radius: 4px; margin-bottom: 24px; }
.error-card h1 { font-size: 22px; margin: 0 0 8px; font-weight: 600; }
.error-card p { color: var(--muted); margin: 0 0 22px; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1280px) {
    .topbar-meta .meta-session { display: none; }
}
@media (max-width: 1100px) {
    .dash-top, .dash-bottom { grid-template-columns: 1fr; }
    .identity { max-width: 220px; }
}
@media (max-width: 991px) {
    .auth { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-card .mobile-brand { display: block; margin-bottom: 28px; }
    .auth-card .mobile-brand img { height: 52px; max-width: 220px; width: auto; object-fit: contain; object-position: left center; }
    .pw-body { grid-template-columns: 1fr; gap: 0; }
    .pw-rules { margin: 4px 0 18px; }
    .topbar-meta .meta-status { display: none; }
    .period-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .period-summary .ps:nth-child(3) { border-left: 0; }
    .period-summary .ps:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}
@media (max-width: 767px) {
    .main-header .logo { width: 100%; border-right: 0; justify-content: center; }
    .main-header .navbar { margin-left: 0 !important; padding: 0 12px 0 4px; }
    .main-sidebar { padding-top: calc(var(--header-h) * 2); transform: translate(calc(-1 * var(--sidebar-w)), 0); }
    .sidebar-open .main-sidebar { transform: translate(0, 0); }
    .content-wrapper, .main-footer { margin-left: 0 !important; }
    .fixed .content-wrapper { padding-top: calc(var(--header-h) * 2); }
    .sidebar-open .content-wrapper, .sidebar-open .main-footer { transform: translate(var(--sidebar-w), 0); }
    .topbar-meta .identity, .topbar-meta .meta-session { display: none; }
    .btn-signout .txt { display: none; }
    .btn-signout { width: 38px; padding: 0 !important; justify-content: center; }
    .portal-main { padding: 16px 14px 32px; }
    .dash-head h2 { font-size: 21px; }
    .balance-panel .bp-amount { font-size: 34px; }
    .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stat { padding: 14px 12px; }
    .stat .stat-value { font-size: 28px; }
    .stat .stat-label { font-size: 12px; align-items: flex-start; }
    .stat .stat-label .dot { margin-top: 5px; }
    .stat .stat-link { font-size: 12.5px; }
    .shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shortcut { padding: 10px; gap: 10px; font-size: 13px; }
    .shortcut .ico { width: 30px; height: 30px; }
    .form-horizontal .control-label { text-align: left; padding-top: 0; margin-bottom: 4px; }
    .main-footer { padding: 14px; }
    .box-body, .box-header, .box-footer { padding-left: 14px; padding-right: 14px; }
    .auth-main { padding: 32px 16px; }
    .pw-card { padding: 22px 16px 20px; }
    .pw-actions { margin: 8px -16px -20px; padding: 14px 16px; }
    .pw-actions .btn-link { margin-left: 0; }
    .pw-head .pw-icon { display: none; }
    .sec-banner { flex-wrap: wrap; }
}

/* =====================================================================
   PRINT — hide chrome so reports print cleanly
   ===================================================================== */
@media print {
    .main-header, .main-sidebar, .main-footer, .pwd-banner, .sec-banner, .dash-actions, .btn-box-tool { display: none !important; }
    .content-wrapper { margin: 0 !important; padding: 0 !important; background: #FFF !important; }
    .box, .card { box-shadow: none !important; border-color: #CCC !important; }
}

/* Today's work orders grid: keep identifiers on one line */
table[id$="grdDtls"] td:nth-child(2), table[id$="grdDtls"] td:nth-child(3),
table[id$="grdDtls"] td:nth-child(5), table[id$="grdDtls"] td:nth-child(9),
table[id$="grdDtls"] td:last-child { white-space: nowrap; }
table[id$="grdDtls"] td:nth-child(6) { min-width: 200px; }

/* ---- Sign-in page: full details, fits one laptop screen, never clips ---- */
.aside-trust {
    list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px;
}
.aside-trust li {
    display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09);
    color: #C9D2DE; font-size: 12px; font-weight: 500;
}
.aside-trust .fa { color: var(--accent-soft); font-size: 13px; }

@media (min-width: 992px) {
    .auth { min-height: 100vh; height: auto; }
    .auth-aside {
        padding: clamp(24px, 4.5vh, 48px) clamp(32px, 4vw, 56px);
        gap: clamp(14px, 2.8vh, 32px);
    }
    .auth-aside .aside-logo { height: clamp(48px, 7.5vh, 68px); }
    .auth-aside .brand-tile img { height: clamp(40px, 6vh, 56px); }
    .auth-aside h1 { font-size: clamp(26px, 4vh, 34px); margin-bottom: 10px; max-width: 20ch; }
    .auth-aside .lede { font-size: clamp(14px, 1.9vh, 16px); max-width: 48ch; }
    .auth-aside .aside-kicker { margin-bottom: clamp(8px, 1.5vh, 14px); }
    /* Descriptions stay visible; they sit on one line beside the heading area */
    .auth-points { gap: clamp(10px, 1.8vh, 16px); max-width: 52ch; }
    .auth-points li { grid-template-columns: 34px 1fr; gap: 12px; align-items: center; }
    .auth-points .pi { width: 34px; height: 34px; }
    .auth-points strong { font-size: 14.5px; margin-bottom: 0; }
    .auth-points span { font-size: 13px; line-height: 1.4; }
    .auth-main { padding: clamp(16px, 3.5vh, 48px) 24px; }
}
@media (min-width: 992px) and (max-height: 820px) {
    .auth-card .sub { margin-bottom: 16px; }
    .seg { margin-bottom: 14px; }
    .field { margin-bottom: 12px; }
    .field label { margin-bottom: 4px; }
    .field .form-control { height: 40px; }
    .field-row { margin: -2px 0 12px; }
    .btn-signin { height: 42px; }
    .auth-secure { margin-top: 12px; padding: 8px 12px; }
    .legal { margin-top: 12px; }
    .auth-help { margin-top: 14px; padding-top: 12px; }
}
@media (min-width: 992px) and (max-height: 700px) {
    .auth-aside .lede { display: none; }   /* very short screens only; the feature list carries the detail */
    .aside-trust li { padding: 4px 9px; }
}
/* ---- Shell branding (Main.master): any client logo size ---- */
.main-header .brand-mark { height: 34px; width: auto; max-width: 104px; object-fit: contain; object-position: left center; flex: 0 0 auto; }
.main-header .logo .logo-lg { gap: 8px; min-width: 0; }
.main-header .brand-name { padding-left: 8px; min-width: 0; }
.main-header .brand-name strong { font-size: 12.5px; }
.brand-name.no-logo { border-left: 0; padding-left: 0; white-space: normal; }
.brand-name.no-logo strong { font-size: 14px; line-height: 1.2; }
.brand-name.no-logo span { display: block; color: var(--muted); font-size: 12px; }
.logo-mini-text {
    width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand); color: #FFFFFF; font-weight: 700; font-size: 14px;
}
.sidebar-foot .fa { width: 14px; color: var(--accent-soft); margin-right: 4px; }
.sidebar-foot .sf-hours { color: #8FA0B4; font-size: 12px; }
.main-footer a { color: var(--ink); text-decoration: none; }
.main-footer a:hover { text-decoration: underline; }
/* ---- Dashboard: lab bulletin (HTML authored in the database) ---- */
.bulletin-body {
    max-height: 440px; overflow-y: auto; overflow-x: hidden;   /* long bulletins scroll inside the card */
    padding-top: 12px;
}
.bulletin-body * { max-width: 100% !important; box-sizing: border-box; }
.bulletin-body img, .bulletin-body table { height: auto; }
.bulletin-body > :first-child { margin-top: 0 !important; }
/* Cards in the dashboard's bottom row keep their own height */
.dash-bottom { align-items: start; }

/* =====================================================================
   DASHBOARD v4.1 — operations overview, live workflow, full-width cards
   ===================================================================== */
.ops { margin-bottom: 20px; }
.ops-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ops-head h3 { margin: 0 0 2px; font-size: 17px; font-weight: 600; }
.ops-range { color: var(--muted); font-size: 12.5px; }
.period { display: inline-flex; gap: 2px; padding: 3px; background: #E8EBEF; border-radius: 8px; }
.period a {
    padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none;
}
.period a:hover { color: var(--ink); }
.period a.is-on { background: #FFFFFF; color: var(--brand-700); box-shadow: 0 1px 2px rgba(20, 33, 61, .14); }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi {
    position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; align-items: start;
    text-align: left; width: 100%; padding: 14px 16px 12px; border-radius: var(--radius);
    background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer;
    font: inherit; color: inherit; transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.kpi:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(20, 33, 61, .08); transform: translateY(-1px); }
.kpi:focus-visible { outline: none; box-shadow: var(--focus); }
.kpi::after { content: "\f105"; font-family: FontAwesome; position: absolute; right: 14px; bottom: 12px; color: var(--faint); font-size: 14px; }
.kpi-ico {
    grid-column: 2; grid-row: 1 / span 2; width: 32px; height: 32px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--ink); font-size: 14px;
}
.kpi-label { grid-column: 1; grid-row: 1; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi-value { grid-column: 1; grid-row: 2; font-size: 26px; font-weight: 600; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-value small { font-size: 16px; color: var(--muted); margin-right: 2px; font-weight: 500; }
.kpi-hint { grid-column: 1 / span 2; grid-row: 3; color: var(--faint); font-size: 12px; }
.kpi.is-good .kpi-ico { background: var(--success-50); color: var(--success); }
.kpi.is-info .kpi-ico { background: var(--info-50); color: var(--info); }
.kpi.is-warn .kpi-ico { background: var(--warn-50); color: var(--warn); }
.kpi.is-warn .kpi-value { color: var(--warn); }
.kpi.is-bad { border-color: #F4C7C2; }
.kpi.is-bad .kpi-ico { background: var(--danger-50); color: var(--danger); }
.kpi.is-bad .kpi-value { color: var(--danger); }
.kpi.is-money .kpi-ico { background: var(--brand-50); color: var(--brand); }
.kpi.is-loading, .flow-btn.is-loading, .flow-alert.is-loading { opacity: .6; cursor: progress; }
.ops-error { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--warn-50); color: #7A2E0B; font-size: 13px; }

/* Live sample workflow (the largest component) */
.flow-card { margin-bottom: 20px; }
.flow-card .card-head h3 { display: inline-flex; align-items: center; gap: 10px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(11, 122, 75, .5); animation: livepulse 2s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(11,122,75,.45); } 70% { box-shadow: 0 0 0 8px rgba(11,122,75,0); } 100% { box-shadow: 0 0 0 0 rgba(11,122,75,0); } }
.flow { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; counter-reset: none; }
.flow-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 6px; }
/* connector line between stages */
.flow-step::before {
    content: ""; position: absolute; top: 26px; left: -50%; right: 50%; height: 3px; background: var(--brand-100); z-index: 0;
}
.flow-step:first-child::before { display: none; }
.flow-btn {
    position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 0 0 10px; border: 0; background: transparent; cursor: pointer; font: inherit; color: inherit; border-radius: var(--radius);
}
.flow-btn:hover .flow-ico { background: var(--brand); color: #FFFFFF; border-color: var(--brand); }
.flow-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.flow-ico {
    width: 54px; height: 54px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: #FFFFFF; border: 3px solid var(--brand-100); color: var(--brand); font-size: 20px; transition: all .12s ease;
}
.flow-count { font-size: 24px; font-weight: 600; color: var(--ink); line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.flow-name { font-size: 13px; font-weight: 600; color: var(--text); text-align: center; }
.flow-pct { font-size: 12px; color: var(--faint); }
.flow-step.is-empty .flow-ico { color: var(--faint); border-color: var(--line); }
.flow-step.is-empty .flow-count { color: var(--faint); }
.flow-wait {
    border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px;
    padding: 3px 10px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.flow-wait:hover { border-color: var(--brand); color: var(--brand-700); }
.flow-step.is-bottleneck .flow-ico { border-color: var(--warn); color: var(--warn); background: var(--warn-50); }
.flow-step.is-bottleneck .flow-wait { background: var(--warn-50); border-color: #F7D3AE; color: #93390A; }
.flow-step.is-bottleneck .flow-wait::before { content: "\f071"; font-family: FontAwesome; margin-right: 5px; }

.flow-alerts { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.flow-alert {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border-radius: var(--radius-sm);
    border: 1px solid; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.flow-alert span { flex: 1 1 auto; }
.flow-alert .go { opacity: .6; }
.flow-alert:hover .go { opacity: 1; }
.flow-alert.is-danger { background: var(--danger-50); border-color: #F4C7C2; color: #7A140C; }
.flow-alert.is-danger > .fa:first-child { color: var(--danger); }
.flow-alert.is-warn { background: var(--warn-50); border-color: #F7D3AE; color: #7A2E0B; }
.flow-alert.is-warn > .fa:first-child { color: var(--warn); }
.flow-alert.is-info { background: var(--info-50); border-color: #C7DAF3; color: #123D78; }
.flow-alert.is-info > .fa:first-child { color: var(--info); }
.flow-ok { grid-column: 1 / -1; margin: 0; color: var(--success); font-weight: 600; font-size: 13.5px; }

/* Full-width cards: shortcuts, bulletin, contact */
.dash-full { margin-bottom: 20px; }
.shortcut-grid.is-wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.bulletin-card .bulletin-body { max-height: none; overflow: visible; }
.support-list.is-row { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 24px; }

/* Drill-down list */
#modalList .modal-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
#modalList .modal-header .close { order: 3; margin-left: auto; }
#modalList .list-sub { color: var(--muted); font-size: 12.5px; }
.list-grid td { white-space: nowrap; }
.list-grid td:nth-child(4) { white-space: normal; min-width: 180px; }

@media (max-width: 1280px) {
    .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
    .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 20px; }
    .flow-step:nth-child(5)::before { display: none; }
    .flow-alerts { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .flow-step::before { display: none; }
}

/* =====================================================================
   WORK PAGES v4.2 — Sample status (single + all), Work order
   ===================================================================== */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; color: var(--ink); }
.page-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.req { color: var(--danger); font-weight: 700; }
.card-body.no-pad { padding: 0; }
.card + .card, .card + .status-chips, .status-chips + .card { margin-top: 0; }
.filter-card, .results-card, .wo-card { margin-bottom: 18px; }

/* Shared field grid */
.filter-grid, .form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; align-items: end; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fg-field { min-width: 0; }
.fg-field > label, .fg-field .fg-label { display: block; color: var(--ink); font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.fg-field .form-control { height: 38px; }
.fg-field select.form-control { padding-right: 28px; }
.fg-span-2 { grid-column: span 2; }
.fg-span-3 { grid-column: span 3; }
.fg-action { align-self: end; }
.fg-action .btn { height: 38px; }
.fg-field .form-control + .form-control { margin-top: 6px; }
.fg-error { margin: 12px 0 0; color: var(--danger); font-weight: 600; font-size: 13px; }
.fg-error[hidden], .wo-error[hidden] { display: none; }
.input-pair { display: flex; gap: 6px; }
.input-pair .pair-sm { flex: 0 0 96px; }
.input-pair .pair-xs { flex: 0 0 72px; }
.input-pair .form-control:not(.pair-sm):not(.pair-xs) { flex: 1 1 auto; min-width: 0; }
.file-input { height: auto !important; padding: 6px 8px; }

/* Status chips (quick filter + colour key) */
.status-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.status-chips .sc-label { color: var(--muted); font-size: 12.5px; font-weight: 600; margin-right: 2px; }
.st-chip {
    --c: #64748B;
    display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px;
    background: var(--panel); border: 1px solid var(--line); color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer;
    box-shadow: inset 4px 0 0 var(--c);
}
.st-chip:hover { border-color: var(--c); background: #FAFBFC; }
.st-registered { --c: #64748B; }
.st-accepted { --c: #CA8A04; }
.st-pending { --c: #C2410C; }
.st-rejected { --c: #B42318; }
.st-ack { --c: #9333EA; }
.st-processed { --c: #0F766E; }
.st-auth { --c: #1D5FB8; }
.st-printed { --c: #A21CAF; }
.st-held { --c: #7F1D1D; }

/* Result grid: the code-behind paints whole rows in strong colours; map each to a soft tint + edge */
.status-grid > tbody > tr { --st: transparent; --st-bg: transparent; color: var(--text) !important; background-color: transparent !important; }
.status-grid > tbody > tr > td { background: var(--st-bg) !important; color: var(--text) !important; border-color: var(--line-soft) !important; }
.status-grid > tbody > tr > td:first-child { box-shadow: inset 4px 0 0 var(--st); }
.status-grid > tbody > tr:hover > td { filter: brightness(.97); }
.status-grid tr[style*="#999999" i] { --st: #64748B; --st-bg: #F4F5F7; }
.status-grid tr[style*="#FFFF00" i] { --st: #CA8A04; --st-bg: #FEFAE8; }
.status-grid tr[style*="#CE8639" i] { --st: #C2410C; --st-bg: #FFF4EC; }
.status-grid tr[style*="#D86161" i] { --st: #B42318; --st-bg: #FDEFEE; }
.status-grid tr[style*="#FF99FF" i] { --st: #9333EA; --st-bg: #F7F0FE; }
.status-grid tr[style*="#339966" i] { --st: #0F766E; --st-bg: #ECF7F5; }
.status-grid tr[style*="#1E90FF" i] { --st: #1D5FB8; --st-bg: #EEF4FC; }
.status-grid tr[style*="MediumVioletRed" i] { --st: #A21CAF; --st-bg: #FBF0FC; }
.status-grid tr[style*="background-color:Red" i] { --st: #7F1D1D; --st-bg: #FBECEC; }
.status-grid td.mono, .wo-tests td.mono, .table td.mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 12.5px; }
.table td.strong { font-weight: 600; color: var(--ink) !important; }
.table td.wrap { white-space: normal; min-width: 160px; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.status-grid td { white-space: nowrap; }

.st-pill {
    display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px;
    background: var(--st, #64748B); color: #FFFFFF !important; font-size: 12px; font-weight: 600; text-decoration: none !important;
}
a.st-pill[href]:hover { filter: brightness(.92); }
.st-pill.aspNetDisabled, .st-pill[disabled] { opacity: .85; cursor: default; }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--line); background: var(--panel); color: var(--ink) !important; text-decoration: none !important;
}
.btn-icon:hover { border-color: var(--brand); color: var(--brand-600) !important; background: var(--brand-50); }
.btn-icon.is-danger:hover { border-color: var(--danger); color: var(--danger) !important; background: var(--danger-50); }
.btn-icon.aspNetDisabled { opacity: .4; pointer-events: none; }
.btn-chip {
    display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line);
    background: var(--panel); color: var(--ink) !important; font-size: 12px; font-weight: 600; text-decoration: none !important; white-space: nowrap;
}
.btn-chip:hover { border-color: var(--brand); color: var(--brand-700) !important; }
.btn-chip:empty { display: none; }
.print-flag { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.print-flag:empty { display: none; }
.test-link { color: var(--brand-700) !important; font-weight: 600; text-decoration: none; }
.test-link:hover { text-decoration: underline; }
.print-choice p { color: var(--muted); margin-bottom: 14px; }
.print-choice .btn + .btn { margin-top: 8px; }

/* Work order */
.wo-head-side { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.wo-balance {
    display: flex; flex-direction: column; padding: 8px 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); min-width: 170px;
}
.wo-balance .wo-bal-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.wo-balance .wo-bal-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.wo-temp label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.wo-temp .input-group { width: 220px; }
.wo-temp .form-control, .wo-temp .btn { height: 38px; }
/* code-behind switches these classes on the balance and total labels */
.BalanceGreen { color: var(--success) !important; font-weight: 600; float: none !important; }
.BalanceRed { color: var(--danger) !important; font-weight: 600; float: none !important; }
.wo-total .BalanceRed { color: var(--ink) !important; }
.wo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.wo-grid > .card { margin-bottom: 18px; }
.step-no {
    display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%;
    background: var(--brand); color: #FFFFFF; font-size: 12px; font-weight: 700; vertical-align: 1px;
}
.wo-total { font-size: 13px; color: var(--muted); }
.wo-total strong { font-size: 18px; color: var(--ink); margin-left: 6px; font-variant-numeric: tabular-nums; }
.wo-add { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.ac-wrap { position: relative; }
.ac-wrap .ac-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.ac-wrap .form-control.has-ico { padding-left: 34px; height: 42px; font-size: 15px; }
.wo-add-code .form-control { height: 42px; }
.fg-field { position: relative; }
.ac-menu {
    position: absolute !important; z-index: 1050; margin: 4px 0 0 !important; padding: 4px !important; list-style: none;
    min-width: 260px; max-height: 280px; overflow-y: auto; background: var(--panel) !important;
    border: 1px solid var(--line) !important; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    font-family: var(--font); font-size: 13.5px;
}
.ac-item { padding: 7px 10px !important; border-radius: 6px; cursor: pointer; color: var(--text); background: transparent !important; }
.ac-item.is-active, .ac-item:hover { background: var(--brand-50) !important; color: var(--brand-700) !important; }
.wo-tests td { vertical-align: middle !important; }
.wo-tests .vial-input { height: 32px; width: 150px; font-family: Consolas, Menlo, monospace; }
.wo-tests input[type=checkbox] { width: 16px; height: 16px; }
.toggle-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
.toggle-check input { width: 16px; height: 16px; margin: 0; }
.toggle-check label { margin: 0; color: var(--ink); font-weight: 500; font-size: 13.5px; }
details.wo-more > summary { list-style: none; cursor: pointer; }
details.wo-more > summary::-webkit-details-marker { display: none; }
details.wo-more > summary .fa { transition: transform .15s ease; color: var(--muted); }
details.wo-more[open] > summary .fa { transform: rotate(180deg); }
details.wo-more:not([open]) > summary { border-bottom: 0; }
details.wo-more .opt { color: var(--muted); font-weight: 400; font-size: 13px; }
.wo-actions {
    position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px;
    margin: 0 -28px -40px; padding: 14px 28px; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 16px rgba(20, 33, 61, .06); backdrop-filter: blur(4px);
}
.wo-actions-right { display: flex; gap: 10px; margin-left: auto; }
.wo-actions .btn { height: 42px; padding: 0 18px; }
.btn-lg-wide { min-width: 180px; }
.wo-error { margin: 0; color: var(--danger); font-weight: 600; font-size: 13.5px; }

@media (max-width: 1100px) {
    .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wo-grid { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 767px) {
    .filter-grid, .form-grid, .form-grid.cols-3, .wo-add { grid-template-columns: 1fr; }
    .fg-span-2, .fg-span-3 { grid-column: auto; }
    .wo-temp .input-group { width: 100%; }
    .wo-actions { margin: 0 -14px -32px; padding: 12px 14px; }
}

/* Sample status grid density (v4.2.1) */
.status-grid td, .status-grid th { padding: 8px 10px !important; font-size: 12.5px; }
.status-grid td.wrap { min-width: 280px; max-width: 420px; white-space: normal; line-height: 1.45; }
.status-grid td:nth-child(3):empty { padding: 0 !important; }
.status-grid .btn-icon { width: 28px; height: 28px; }
.status-grid .print-flag { font-size: 10.5px; }

/* card-head span rule must not grey out the step numbers */
.card-head .step-no { color: #FFFFFF !important; font-size: 12px !important; }
.card-head .wo-total strong { color: var(--ink); }

/* Autocomplete list (AjaxControlToolkit renders suggestions into the .ac-list div and adds .ac-menu) */
.ac-list.ac-menu, .ac-menu {
    height: auto !important; width: auto !important; min-width: 100%; max-width: 560px; max-height: 300px !important;
    overflow-y: auto !important; z-index: 1060 !important;
}
.ac-menu .ac-item, .ac-menu li { list-style: none; white-space: normal; font-size: 13.5px; line-height: 1.35; }

/* Work order: every input and select in the form is the same height */
.wo-page .fg-field .form-control,
.wo-page .wo-temp .form-control, .wo-page .wo-temp .btn,
.wo-page .input-group-btn .btn, .wo-page .input-group-addon { height: 40px !important; }
.wo-page .fg-field select.form-control { padding-top: 6px; padding-bottom: 6px; }
.wo-page .ac-wrap .form-control.has-ico, .wo-page .wo-add-code .form-control { height: 42px !important; }
.wo-page .file-input { height: auto !important; }
.wo-page .input-pair .form-control { margin-top: 0 !important; }
/* =====================================================================
   PAY ONLINE v4.3 — single-page payment (OnlinePayment.aspx)
   ===================================================================== */
.pay-secure {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
    background: var(--success-50); color: #075634; font-size: 13px; font-weight: 600; border: 1px solid #BFE3CF;
}
.pay-client-msg[hidden] { display: none; }

.pay-account {
    display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 0; margin-bottom: 20px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.pay-account > div { padding: 18px 22px; border-left: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pay-account > div:first-child { border-left: 0; }
.pa-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.pa-who strong { font-size: 17px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-code { color: var(--faint); font-size: 12.5px; }
.pa-num { font-size: 22px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pa-stat.is-due { background: linear-gradient(135deg, var(--brand-50), #FFFFFF); }
.pa-stat.is-due .pa-num { color: var(--brand-700); font-size: 26px; }

.pay-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.pay-card { margin-bottom: 18px; }

/* Amount options */
.amt-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.amt-opt {
    position: relative; display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 16px 18px; cursor: pointer;
    border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); transition: border-color .12s ease, box-shadow .12s ease;
    font-weight: 400;
}
.amt-opt:hover { border-color: var(--brand-100); }
.amt-opt.is-on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12); background: linear-gradient(180deg, var(--brand-50), #FFFFFF 70%); }
.amt-opt input[type=radio] { width: 18px; height: 18px; margin: 3px 0 0; flex: 0 0 auto; accent-color: var(--brand); }
.amt-opt .aspNetDisabled { opacity: .5; }
.ao-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.ao-title { color: var(--ink); font-weight: 600; font-size: 14px; }
.ao-amt { font-size: 24px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ao-hint { color: var(--muted); font-size: 12.5px; }
.ao-input { position: relative; display: block; }
.ao-input .cur { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; font-weight: 600; }
.ao-input .form-control { height: 44px; padding-left: 30px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ao-input .form-control[disabled] { background: var(--surface); }

/* Payment methods */
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.pm-tile {
    position: relative; display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px 16px; cursor: pointer;
    border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); font-weight: 400;
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.pm-tile:hover { border-color: var(--brand-100); transform: translateY(-1px); }
.pm-tile input { position: absolute; opacity: 0; pointer-events: none; }
.pm-tile:focus-within { box-shadow: var(--focus); }
.pm-ico {
    width: 42px; height: 42px; border-radius: 10px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface); color: var(--ink); font-size: 19px;
}
.pm-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pm-name { color: var(--ink); font-weight: 600; font-size: 14px; }
.pm-fee { color: var(--muted); font-size: 12px; }
.pm-tick { position: absolute; top: 10px; right: 10px; color: var(--brand); font-size: 18px; opacity: 0; transition: opacity .12s ease; }
.pm-tile.is-on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12); }
.pm-tile.is-on .pm-ico { background: var(--brand); color: #FFFFFF; }
.pm-tile.is-on .pm-tick { opacity: 1; }

/* Summary */
.pay-summary { position: sticky; top: calc(var(--header-h) + 16px); }
.ps-card { overflow: hidden; }
.ps-card::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-soft)); }
.ps-lines { margin: 0 0 14px; }
.ps-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13.5px; }
.ps-lines > div[hidden] { display: none; }
.ps-lines dt { color: var(--muted); font-weight: 500; }
.ps-lines dd { margin: 0; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ps-total {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 14px 0 6px; border-top: 1px dashed var(--line);
}
.ps-total span { color: var(--ink); font-weight: 600; }
.ps-total strong { font-size: 28px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ps-method { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.btn-pay-now { width: 100%; height: 50px; font-size: 16px !important; border-radius: 10px !important; opacity: .55; }
.btn-pay-now.is-ready { opacity: 1; box-shadow: 0 8px 18px rgba(var(--brand-rgb), .28) !important; }
.btn-pay-now.is-busy { opacity: .75; cursor: progress; }
.ps-terms { display: flex; gap: 8px; margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.ps-terms .fa { color: var(--success); margin-top: 2px; }

@media (max-width: 1100px) {
    .pay-grid { grid-template-columns: 1fr; }
    .pay-summary { position: static; }
    .pay-account { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pay-account > div:nth-child(3) { border-left: 0; }
    .pay-account > div:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}
@media (max-width: 767px) {
    .amt-options { grid-template-columns: 1fr; }
    .pay-account { grid-template-columns: 1fr; }
    .pay-account > div { border-left: 0 !important; border-top: 1px solid var(--line-soft); }
    .pay-account > div:first-child { border-top: 0; }
}

/* Dashboard: recent payments (v4.4) */
.pay-hist-card .card-head { gap: 12px; flex-wrap: wrap; }
.pay-hist-card .card-head h3 .fa { color: var(--brand); margin-right: 6px; }
.ph-head { display: flex; flex-direction: column; gap: 2px; }
.ph-head .ph-sub { color: var(--muted); font-size: 12.5px; }
.ph-actions { display: flex; gap: 8px; }
.ph-actions .btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; }
.ph-table { margin: 0 !important; border: 0 !important; }
.ph-table th:first-child, .ph-table td:first-child { padding-left: 20px !important; }
.ph-table th:last-child, .ph-table td:last-child { padding-right: 20px !important; }
.ph-table td { vertical-align: middle !important; }
.ph-date { display: block; color: var(--ink); font-weight: 600; }
.ph-time { display: block; color: var(--faint); font-size: 12px; }
.ph-mode {
    display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 12.5px; font-weight: 600;
}
.ph-mode .fa { color: var(--brand); width: 14px; text-align: center; }
.ph-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--warn-50); color: #93390A; font-size: 11.5px; font-weight: 600; }
.ph-remarks { color: var(--muted); max-width: 320px; white-space: normal !important; }
.ph-amt { font-weight: 700; color: var(--success) !important; font-size: 14px; white-space: nowrap; }
.ph-amt.is-debit { color: #93390A !important; }
.ph-empty { margin: 0; padding: 22px 20px; color: var(--muted); }
.ph-empty .fa { margin-right: 6px; }
@media (max-width: 767px) { .ph-remarks { display: none; } .ph-actions { width: 100%; } }

/* ==========================================================================
   v4.5 - Payment result (Message.aspx, ResponsePayUrl.aspx)
   ========================================================================== */
.pay-result-page { max-width: 680px; margin: 0 auto; padding-top: 24px; }
.pr-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 32px 32px 24px; text-align: center; border-top: 5px solid var(--info); }
.pr-card.is-ok { border-top-color: var(--success); }
.pr-card.is-fail { border-top-color: var(--danger); }
.pr-card.is-warn { border-top-color: var(--warn); }
.pr-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: var(--info-50); color: var(--info); }
.pr-card.is-ok .pr-icon { background: var(--success-50); color: var(--success); }
.pr-card.is-fail .pr-icon { background: var(--danger-50); color: var(--danger); }
.pr-card.is-warn .pr-icon { background: var(--warn-50); color: var(--warn); }
.pr-title { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: var(--ink); }
.pr-text { margin: 0 auto 18px; max-width: 480px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.pr-amount { display: inline-flex; flex-direction: column; gap: 2px; padding: 12px 28px; margin-bottom: 18px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-soft); }
.pr-amount span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.pr-amount strong { font-size: 30px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pr-details { margin: 0 0 20px; text-align: left; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.pr-details div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
.pr-details div:last-child { border-bottom: 0; }
.pr-details div:nth-child(even) { background: var(--surface); }
.pr-details dt { color: var(--muted); font-weight: 500; }
.pr-details dd { margin: 0; font-weight: 600; color: var(--text); text-align: right; word-break: break-all; font-variant-numeric: tabular-nums; }
.pr-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pr-actions .btn { min-height: 42px; padding: 10px 18px; border-radius: 8px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.pr-help { display: flex; gap: 10px; align-items: flex-start; text-align: left; margin-top: 20px; padding: 12px 14px; border-radius: 8px; background: var(--info-50); color: var(--text); font-size: 13.5px; }
.pr-help i { color: var(--info); margin-top: 3px; }
.pr-help a { color: var(--info); font-weight: 600; }
@media (max-width: 600px) {
    .pay-result-page { padding-top: 8px; }
    .pr-card { padding: 24px 16px 18px; }
    .pr-actions .btn { flex: 1 1 100%; justify-content: center; }
    .pr-details div { flex-direction: column; gap: 2px; }
    .pr-details dd { text-align: left; }
}
/* =====================================================================
   Charts (js/portal-charts.js) and the employee (marketing) dashboard
   ===================================================================== */
.pc-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pc-row { display: grid; grid-template-columns: minmax(110px, 34%) 1fr auto; align-items: center; gap: 12px; padding: 4px 6px; border-radius: 6px; outline: none; }
.pc-row:hover, .pc-row:focus-visible { background: var(--surface); }
.pc-row:focus-visible { box-shadow: var(--focus); }
.pc-label { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-track { position: relative; height: 12px; }
.pc-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 0 4px 4px 0; min-width: 3px; }
.pc-value { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; min-width: 84px; }
.pc-cols { display: block; width: 100%; height: auto; }
.pc-cols .pc-grid { stroke: var(--line-soft); stroke-width: 1; }
.pc-cols .pc-base { stroke: var(--line); }
.pc-cols .pc-tick, .pc-cols .pc-xlab { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.pc-cols .pc-col { fill: var(--brand); }
.pc-cols .pc-hit { fill: transparent; cursor: default; }
.pc-cols .pc-hit:hover { fill: rgba(var(--brand-rgb), .07); }
.pc-empty { margin: 0; padding: 28px 8px; text-align: center; color: var(--faint); font-size: 13px; }
.pc-tip {
    position: absolute; z-index: 3000; display: none; pointer-events: none; max-width: 260px;
    background: var(--ink); color: #FFFFFF; border-radius: 8px; padding: 8px 10px; box-shadow: var(--shadow-lg);
    font: 12.5px/1.45 var(--font);
}
.pc-tip strong { display: block; font-weight: 600; }
.pc-tip span { display: block; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pc-tip em { display: block; font-style: normal; color: rgba(255, 255, 255, .72); }

.emp-head .emp-role { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 10px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-size: 12.5px; font-weight: 600; }
.kpi.is-static { cursor: default; }
.kpi.is-static:hover { border-color: var(--line); box-shadow: var(--shadow); transform: none; }
.kpi.is-static::after { content: none; }
.kpi-delta { font-weight: 600; }
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.emp-kpis { margin-bottom: 20px; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.chart-grid .card { margin: 0; }
.chart-grid .chart-wide { grid-column: 1 / -1; }
.chart-card .card-body { padding-top: 12px; }
@media (max-width: 991px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .pc-row { grid-template-columns: minmax(90px, 40%) 1fr auto; gap: 8px; } .pc-value { min-width: 64px; } }
/* Type-to-search dropdowns (Select2, see initSearchable in js/portal.js) */
.select2-container { font: inherit; }
.select2-container--default .select2-selection--single {
    height: 38px; border: 1px solid #CDD6DE; border-radius: var(--radius-sm); background: var(--panel);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 36px; padding-left: 12px; padding-right: 30px; color: var(--text); font-size: 14px; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--faint); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; right: 6px; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single { border-color: var(--brand); box-shadow: var(--focus); outline: none; }
.select2-container--default.select2-container--disabled .select2-selection--single { background: var(--surface); cursor: not-allowed; }
.select2-dropdown { border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 2100; }
.select2-search--dropdown { padding: 8px; }
.select2-container--default .select2-search--dropdown .select2-search__field { height: 34px; border: 1px solid #CDD6DE; border-radius: var(--radius-sm); padding: 6px 10px; font-size: 14px; outline: none; }
.select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: var(--brand); box-shadow: var(--focus); }
.select2-results__option { padding: 7px 12px; font-size: 13.5px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--brand); color: #FFFFFF; }
.select2-container--default .select2-results__option[aria-selected=true] { background: var(--brand-50); color: var(--brand-700); }
.select2-container--default .select2-results > .select2-results__options { max-height: 300px; }
/* Work order status */
.wos-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.wos-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; border-left: 4px solid var(--line); }
.wos-tile span { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.wos-tile strong { display: block; font-size: 24px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.wos-tile.is-done { border-left-color: var(--success); }
.wos-tile.is-pending { border-left-color: var(--warn); }
.wos-tile.is-pending strong { color: var(--warn); }
.wos-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.wos-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.wos-pill.is-done { background: var(--success-50); color: var(--success); }
.wos-pill.is-pending { background: var(--warn-50); color: var(--warn); }
.wos-grid td { vertical-align: top; }
@media (max-width: 767px) { .wos-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Sidebar help box: one contact per row, icon beside the text, long emails wrap cleanly */
.sidebar-foot .sf-line { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; font-size: 13px; line-height: 1.4; }
.sidebar-foot .sf-line .fa { flex: 0 0 14px; width: 14px; margin: 2px 0 0; text-align: center; }
.sidebar-foot .sf-line span { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.sidebar-foot .sf-hours { color: #8FA0B4; font-size: 12px; }
/* Dashboard welcome: password age under the last sign-in line */
.dash-head .pwd-age { margin-top: 2px; }
.dash-head .pwd-age .fa { color: var(--muted); }