*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Theme-independent tokens (shared by every theme) */
    --accent: #e8a020;
    --accent-light: #f5c060;
    --success: #1e8a4a;
    --danger: #c0392b;
    --warning: #d68910;
    --info: #1d4ed8;
    --bg: #f0f4f8;
    --surface: #ffffff;
    --surface2: #f7f9fc;
    --border: #dce4ed;
    --text: #1a2535;
    --text2: #4a5568;
    --text3: #8898aa;
    --radius: 12px;
    --radius-sm: 8px;
    --danger-bg: #fdecea; /* same pink as .badge-red so pills read as one family */
}

/* ============================================================
   Themes — selected via <html data-theme="...">.
   To switch the whole app, change the data-theme attribute in
   Views/Shared/_Layout.cshtml and _LoginLayout.cshtml.
   ============================================================ */

/* Active company theme: light — white chrome with red accents */
html[data-theme="helium-light"] {
    --primary: #C41E1E;
    --primary-light: #D83A3A;
    --primary-dark: #9B1515;
    --sidebar-bg: #FFFFFF;
    --login-grad-1: #6e0a1b;
    --login-grad-2: #a30d26;
    --login-grad-3: #C41E1E;
    --focus-glow: rgba(196,30,30,0.14);
    --primary-shadow: rgba(196,30,30,0.30);
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-lg: 0 2px 8px rgba(0,0,0,.06), 0 4px 20px rgba(0,0,0,.05);
    --bg: #F7F7F8;
    /* chrome (light) */
    --topbar-bg: #FFFFFF;
    --topbar-border: var(--border);
    --topbar-text: var(--text);
    --topbar-muted: var(--text3);
    --topbar-user-bg: #FFFFFF;
    --topbar-user-border: var(--border);
    --sidebar-border: var(--border);
    --sidebar-heading: var(--primary);
    --sidebar-label: var(--text3);
    --nav-text: var(--text2);
    --nav-hover-bg: #FEF2F2;
    --nav-hover-text: var(--primary);
    --nav-active-bg: var(--primary);
    --nav-active-text: #FFFFFF;
    --nav-active-shadow: 0 3px 10px rgba(196,30,30,.3);
}

/* Legacy dark-red chrome — flip <html data-theme="helium-red"> to revert */
html[data-theme="helium-red"] {
    --primary: #c8102e;
    --primary-light: #e6334a;
    --primary-dark: #8f0c21;
    --sidebar-bg: #a30d26;
    --login-grad-1: #6e0a1b;
    --login-grad-2: #a30d26;
    --login-grad-3: #c8102e;
    --focus-glow: rgba(200,16,46,0.14);
    --primary-shadow: rgba(200,16,46,0.30);
    --shadow: 0 2px 12px rgba(143,12,33,0.12);
    --shadow-lg: 0 8px 32px rgba(143,12,33,0.16);
    /* chrome (dark) */
    --topbar-bg: var(--primary-dark);
    --topbar-border: transparent;
    --topbar-text: #ffffff;
    --topbar-muted: rgba(255,255,255,0.55);
    --topbar-user-bg: rgba(255,255,255,0.08);
    --topbar-user-border: transparent;
    --sidebar-border: rgba(255,255,255,0.08);
    --sidebar-heading: #ffffff;
    --sidebar-label: rgba(255,255,255,0.4);
    --nav-text: rgba(255,255,255,0.65);
    --nav-hover-bg: rgba(255,255,255,0.08);
    --nav-hover-text: #ffffff;
    --nav-active-bg: rgba(255,255,255,0.14);
    --nav-active-text: #ffffff;
    --nav-active-shadow: none;
}

/* Legacy palette — flip <html data-theme="dark-blue"> to revert */
html[data-theme="dark-blue"] {
    --primary: #0f4c81;
    --primary-light: #1a6bb5;
    --primary-dark: #083460;
    --sidebar-bg: #0d3b6e;
    --login-grad-1: #0a3259;
    --login-grad-2: #0f4c81;
    --login-grad-3: #1a6bb5;
    --focus-glow: rgba(26,107,181,0.12);
    --primary-shadow: rgba(15,76,129,0.25);
    --shadow: 0 2px 12px rgba(15,76,129,0.10);
    --shadow-lg: 0 8px 32px rgba(15,76,129,0.14);
    /* chrome (dark) */
    --topbar-bg: var(--primary-dark);
    --topbar-border: transparent;
    --topbar-text: #ffffff;
    --topbar-muted: rgba(255,255,255,0.55);
    --topbar-user-bg: rgba(255,255,255,0.08);
    --topbar-user-border: transparent;
    --sidebar-border: rgba(255,255,255,0.08);
    --sidebar-heading: #ffffff;
    --sidebar-label: rgba(255,255,255,0.4);
    --nav-text: rgba(255,255,255,0.65);
    --nav-hover-bg: rgba(255,255,255,0.08);
    --nav-hover-text: #ffffff;
    --nav-active-bg: rgba(255,255,255,0.14);
    --nav-active-text: #ffffff;
    --nav-active-shadow: none;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.app-shell-login { min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--login-grad-1) 0%, var(--login-grad-2) 45%, var(--login-grad-3) 100%);
    position: relative; overflow: hidden; }
.app-shell-login::before {
    content: ''; position: absolute; width: 600px; height: 600px; border-radius: 50%;
    background: rgba(255,255,255,0.04); top: -200px; right: -150px;
}
.app-shell-login::after {
    content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%;
    background: rgba(255,255,255,0.03); bottom: -150px; left: -100px;
}

.login-box {
    background: rgba(255,255,255,0.97);
    border-radius: 20px;
    padding: 48px 44px 44px;
    width: 420px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.28);
    position: relative; z-index: 1;
    animation: fadeUp 0.5s ease;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 16px; margin-bottom: 14px;
    box-shadow: 0 6px 20px rgba(196,30,30,0.35);
}
.login-logo .logo-mark svg { width: 32px; height: 32px; fill: white; }
.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--primary-dark); letter-spacing: -0.3px; }
.login-logo p { font-size: 12.5px; color: var(--text3); margin-top: 2px; letter-spacing: 0.04em; }
.login-logo .login-logo-img { display: block; width: 210px; max-width: 80%; height: auto; margin: 0 auto 14px; }
.login-divider { height: 1px; background: var(--border); margin: 0 0 28px; }
.login-box label {
    display: block; font-size: 12.5px; font-weight: 600; color: var(--text2);
    margin-bottom: 6px; letter-spacing: 0.04em; text-transform: uppercase;
}
.input-group { position: relative; margin-bottom: 18px; }
.input-group svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--text3); }
.login-box input[type=text],
.login-box input[type=password],
.login-box input[type=email] {
    width: 100%; padding: 11px 14px 11px 40px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif; font-size: 14px; color: var(--text);
    background: var(--surface2); outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.login-box input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--focus-glow); background: #fff; }
.login-btn {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white; border: none; border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 600;
    cursor: pointer; margin-top: 6px; letter-spacing: 0.02em;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 16px var(--primary-shadow);
}
.login-btn:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-shadow); }
.login-btn:active { transform: translateY(0); }
.login-error {
    background: #fdecea; border: 1px solid #f5c6c2; color: var(--danger);
    padding: 9px 14px; border-radius: var(--radius-sm); font-size: 13px;
    margin-top: 14px;
}
.login-success {
    background: #e6f6ec; border: 1px solid #b4e1c1; color: var(--success);
    padding: 9px 14px; border-radius: var(--radius-sm); font-size: 13px;
    margin-top: 14px;
}
.hint-text { font-size: 12px; color: var(--text3); text-align: center; margin-top: 16px; }
.hint-text a { font-family: 'JetBrains Mono', monospace; padding: 1px 6px; border-radius: 4px; font-size: 11px; color: var(--primary); }

.topbar {
    height: 60px; background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex; align-items: center; padding: 0 24px; gap: 16px;
    flex-shrink: 0; box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 100;
}
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--topbar-text); padding: 6px; border-radius: 8px; flex-shrink: 0; }
.sidebar-toggle svg { width: 22px; height: 22px; stroke: currentColor; fill: none; display: block; }
.sidebar-toggle:hover { background: var(--nav-hover-bg); color: var(--primary); }
.sidebar-backdrop { display: none; }
.topbar-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar-logo .t-mark { width: 34px; height: 34px; background: linear-gradient(135deg, var(--accent), var(--accent-light)); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.topbar-logo .t-mark svg { width: 18px; height: 18px; fill: white; }
.topbar-logo .brand { font-size: 15px; font-weight: 700; color: var(--topbar-text); letter-spacing: 0.01em; line-height: 1; }
.topbar-logo .sub { font-size: 10px; color: var(--topbar-muted); font-weight: 400; line-height: 1; margin-top: 2px; display: block; }
.topbar-logo .topbar-logo-img { height: 34px; width: auto; display: block; background: #fff; padding: 5px 11px; border-radius: 9px; box-shadow: 0 1px 5px rgba(0,0,0,0.22); }
.topbar-sep { flex: 1; }
.breadcrumb { font-size: 12.5px; color: var(--topbar-muted); display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.breadcrumb .crumb-active { color: var(--topbar-text); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb .crumb-link, .breadcrumb > span:not(.crumb-active) { flex-shrink: 0; }
.breadcrumb .crumb-link { color: var(--topbar-muted); cursor: pointer; transition: color 0.18s; text-decoration: none; }
.breadcrumb .crumb-link:hover { color: var(--primary); text-decoration: underline; }
.topbar-user { display: flex; align-items: center; gap: 10px; background: var(--topbar-user-bg); border: 1px solid var(--topbar-user-border); border-radius: 24px; padding: 5px 14px 5px 8px; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #f0901a); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: white; }
.emp-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; background: var(--surface2); border: 1px solid var(--border); }
.emp-avatar-fallback { font-size: 12px; font-weight: 700; color: white; background: linear-gradient(135deg, var(--accent), #f0901a); border: none; }
.emp-avatar-lg { width: 96px; height: 96px; }
.user-name { font-size: 13px; color: var(--topbar-text); font-weight: 500; }
.logout-btn { padding: 6px 14px; background: var(--topbar-user-bg); color: var(--topbar-muted); border: 1px solid var(--topbar-user-border); border-radius: 20px; font-family: 'Outfit', sans-serif; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background 0.2s, color 0.2s; display: flex; align-items: center; gap: 5px; text-decoration: none; }
.logout-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; }
.logout-btn:hover { background: var(--nav-hover-bg); color: var(--primary); border-color: var(--nav-hover-bg); text-decoration: none; }

.module-layout { flex: 1; display: flex; overflow: hidden; min-height: calc(100vh - 60px); }
.sidebar { width: 230px; flex-shrink: 0; background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border); display: flex; flex-direction: column; padding: 20px 0; overflow-y: auto; }
.sidebar-module { padding: 0 16px 16px; border-bottom: 1px solid var(--sidebar-border); margin-bottom: 16px; }
.sidebar-module .label { font-size: 10.5px; color: var(--sidebar-label); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; display: block; }
.sidebar-module h3 { font-size: 16px; font-weight: 700; color: var(--sidebar-heading); margin-top: 2px; }
.sidebar-module-link { color: inherit; text-decoration: none; }
.sidebar-module-link:hover { text-decoration: underline; }
.sidebar-nav { padding: 0 8px; flex: 1; }
.sidebar-group-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: none; border: none; cursor: pointer; font-family: 'Outfit', sans-serif;
    font-size: 10.5px; color: var(--sidebar-heading); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
    padding: 14px 12px 6px; text-align: left;
}
.sidebar-group-toggle:hover { color: var(--nav-hover-text); }
.sidebar-group-toggle .chev { width: 12px; height: 12px; stroke: currentColor; fill: none; flex-shrink: 0; transition: transform 0.25s ease; }
.sidebar-group.open .sidebar-group-toggle .chev { transform: rotate(90deg); }
.sidebar-group-items { overflow: hidden; max-height: 0; transition: max-height 0.28s ease; }
.sidebar-group.open .sidebar-group-items { max-height: 1000px; }
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
    color: var(--nav-text); font-size: 13.5px; font-weight: 500;
    cursor: pointer; transition: background 0.15s, color 0.15s; margin-bottom: 2px;
    text-decoration: none;
}
.nav-item svg { width: 16px; height: 16px; stroke: currentColor; flex-shrink: 0; fill: none; }
.nav-item:hover { background: var(--nav-hover-bg); color: var(--nav-hover-text); text-decoration: none; }
.nav-item.active { background: var(--nav-active-bg); color: var(--nav-active-text); box-shadow: var(--nav-active-shadow); }

.sidebar-back { padding: 0 8px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--sidebar-border); }
.back-btn { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; color: var(--nav-text); font-size: 13px; cursor: pointer; transition: background 0.15s, color 0.15s; width: 100%; background: none; border: none; font-family: 'Outfit', sans-serif; font-weight: 500; text-decoration: none; }
.back-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.back-btn:hover { background: var(--nav-hover-bg); color: var(--nav-hover-text); text-decoration: none; }

.module-content { flex: 1; padding: 28px 30px; overflow-y: auto; }
.module-header { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; }
.module-header h2 { font-size: 22px; font-weight: 600; }
.module-header p { font-size: 13.5px; color: var(--text3); margin-top: 3px; }

/* Screen tabs — a strip of links between related screens (Views/Shared/_ScreenTabs).
   Deliberately NOT named .tab-strip/.pc-tab: PettyCash/Index.cshtml uses a bare
   class="tab-strip" styled only under #pcScreen, so a global rule of that name would
   leak into it for every property it does not itself declare. A tab the role cannot
   view is rendered greyed and inert, using the app-wide disabled convention
   (opacity ~.45 + cursor:not-allowed, as on .list-page-btn:disabled). */
.screen-tabs { display: flex; align-items: stretch; overflow-x: auto; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.screen-tab { display: inline-flex; align-items: center; gap: 7px; padding: 12px 20px; border-bottom: 3px solid transparent; font-family: 'Outfit', sans-serif; font-size: 12.5px; font-weight: 600; color: var(--text3); white-space: nowrap; text-decoration: none; cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.screen-tab:hover:not(.disabled):not(.active) { background: var(--surface2); color: var(--text); text-decoration: none; }
.screen-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--focus-glow); cursor: default; }
.screen-tab.disabled { opacity: 0.45; cursor: not-allowed; }

.dash-content { flex: 1; padding: 28px 30px; overflow-y: auto; }
.dash-welcome { margin-bottom: 24px; }
.dash-welcome h2 { font-size: 22px; font-weight: 600; color: var(--text); }
.dash-welcome p { font-size: 13.5px; color: var(--text3); margin-top: 3px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); border: 1px solid var(--border); display: flex; align-items: center; gap: 16px; transition: transform 0.2s, box-shadow 0.2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 22px; height: 22px; fill: none; }
.s-blue { background: #e8f0fb; }
.s-blue svg { stroke: #1a6bb5; }
.s-green { background: #e6f6ec; }
.s-green svg { stroke: #1e8a4a; }
.s-amber { background: #fef3e2; }
.s-amber svg { stroke: #d68910; }
.s-red { background: #fdecea; }
.s-red svg { stroke: #c0392b; }
.stat-info .label { font-size: 12px; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-info .value { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.2; font-family: 'JetBrains Mono', monospace; }
.stat-info .change { font-size: 12px; margin-top: 2px; }
.up { color: var(--success); }
.down { color: var(--danger); }

.modules-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.module-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.module-card { background: var(--surface); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow); border: 1.5px solid var(--border); cursor: pointer; text-align: center; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; position: relative; overflow: hidden; text-decoration: none; color: inherit; display: block; }
.module-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: var(--radius) var(--radius) 0 0; }
.module-card.m-accounts::before { background: linear-gradient(90deg, #1a6bb5, #3498db); }
.module-card.m-warehouse::before { background: linear-gradient(90deg, #1e8a4a, #27ae60); }
.module-card.m-kitchen::before { background: linear-gradient(90deg, #d68910, #e67e22); }
.module-card.m-admin::before { background: linear-gradient(90deg, #8e44ad, #9b59b6); }
.module-card.m-hrm::before { background: linear-gradient(90deg, #c0392b, #e74c3c); }
.module-card.m-mis::before { background: linear-gradient(90deg, #16a085, #1abc9c); }
.module-card.m-sysadmin::before { background: linear-gradient(90deg, #2c3e50, #4a6278); }
.module-card.m-security::before { background: linear-gradient(90deg, #5d3fd3, #845ec2); }
.module-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; text-decoration: none; }
.module-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.module-icon svg { width: 26px; height: 26px; fill: none; }
.m-accounts .module-icon { background: #e8f0fb; } .m-accounts .module-icon svg { stroke: #1a6bb5; }
.m-warehouse .module-icon { background: #e6f6ec; } .m-warehouse .module-icon svg { stroke: #1e8a4a; }
.m-kitchen .module-icon { background: #fef3e2; } .m-kitchen .module-icon svg { stroke: #d68910; }
.m-admin .module-icon { background: #f5eefb; } .m-admin .module-icon svg { stroke: #8e44ad; }
.m-hrm .module-icon { background: #fdecea; } .m-hrm .module-icon svg { stroke: #c0392b; }
.m-mis .module-icon { background: #e0f5f1; } .m-mis .module-icon svg { stroke: #16a085; }
.m-sysadmin .module-icon { background: #eaecee; } .m-sysadmin .module-icon svg { stroke: #2c3e50; }
.m-security .module-icon { background: #ece5fb; } .m-security .module-icon svg { stroke: #5d3fd3; }
.module-card h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.module-card p { font-size: 12px; color: var(--text3); line-height: 1.5; }
.module-badge { display: inline-block; margin-top: 10px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.m-accounts .module-badge { background: #e8f0fb; color: #1a6bb5; }
.m-warehouse .module-badge { background: #e6f6ec; color: #1e8a4a; }
.m-kitchen .module-badge { background: #fef3e2; color: #d68910; }
.m-admin .module-badge { background: #f5eefb; color: #8e44ad; }
.m-hrm .module-badge { background: #fdecea; color: #c0392b; }
.m-mis .module-badge { background: #e0f5f1; color: #16a085; }
.m-sysadmin .module-badge { background: #eaecee; color: #2c3e50; }
.m-security .module-badge { background: #ece5fb; color: #5d3fd3; }

.chart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 26px; }
.chart-card { background: var(--surface); border-radius: var(--radius); padding: 18px 20px 20px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.chart-card h4 { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.chart-canvas-wrap { position: relative; height: 240px; }
.chart-canvas-wrap canvas { max-width: 100%; }

.data-card { background: var(--surface); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 20px; }
.search-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.search-bar input[type=text] { flex: 1; max-width: 360px; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: 'Outfit', sans-serif; font-size: 14px; color: var(--text); background: var(--surface2); outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.search-bar input[type=text]:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--focus-glow); background: #fff; }
.search-count { font-size: 12.5px; color: var(--text3); }

.data-card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.data-card-title svg { width: 16px; height: 16px; stroke: var(--primary-light); fill: none; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead tr { border-bottom: 2px solid var(--border); }
thead th { text-align: left; padding: 8px 12px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text3); font-weight: 600; }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.12s; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 10px 12px; color: var(--text2); vertical-align: middle; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-green { background: #e6f6ec; color: #1e8a4a; }
.badge-amber { background: #fef3e2; color: #d68910; }
.badge-red { background: #fdecea; color: #c0392b; }
.badge-blue { background: #e8f0fb; color: #1a6bb5; }
.badge-purple { background: #f5eefb; color: #8e44ad; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.15s, transform 0.1s, box-shadow 0.15s; text-decoration: none; }
.btn:hover { background: var(--surface2); text-decoration: none; box-shadow: var(--shadow); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; border-color: transparent; box-shadow: 0 2px 8px var(--primary-shadow); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: white; }
.btn-danger { background: var(--danger); color: white; border-color: transparent; }
.btn-danger:hover { background: #962f23; color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); padding: 5px 8px; }
.btn-ghost:hover { background: var(--surface2); color: var(--primary-dark); }

.form-row { display: grid; gap: 14px; margin-bottom: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.form-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.form-field input[type=text],
.form-field input[type=email],
.form-field input[type=password],
.form-field input[type=number],
.form-field input[type=date],
.form-field input[type=tel],
.form-field input:not([type]),
.form-field select,
.form-field textarea {
    width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-family: 'Outfit', sans-serif; font-size: 14px;
    color: var(--text); background: var(--surface2); outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--focus-glow);
    background: #fff;
}
.form-field input:disabled { background: var(--surface2); color: var(--text2); cursor: not-allowed; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

/* Signature upload widget (User Setup) — frame + hidden file input triggered
   by a styled button label; mirrors the HRM employee photo widget. */
.sig-upload { display: flex; gap: 16px; align-items: flex-start; }
.sig-upload .sig-frame {
    width: 260px; height: 90px; flex-shrink: 0;
    border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
    background: var(--surface2); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.sig-upload .sig-frame img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.sig-upload .sig-frame .ph { color: var(--text3); font-size: 13px; }
.sig-upload .sig-meta { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
/* Restore .btn appearance on the upload label — .form-field label would otherwise win. */
.form-field .sig-upload label.btn { display: inline-flex; margin-bottom: 0; font-size: 12px; font-weight: 500; color: var(--text); }
.sig-upload .sig-file { font-size: 12.5px; color: var(--text2); }
.sig-upload .sig-hint { font-size: 12px; color: var(--text3); max-width: 320px; }
.sig-upload input[type=file] { display: none; }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px; }
.alert-success { background: #e6f6ec; border: 1px solid #b4e1c1; color: var(--success); }
.alert-danger  { background: #fdecea; border: 1px solid #f5c6c2; color: var(--danger); }
.alert-warning { background: #fef3e2; border: 1px solid #fae1bf; color: var(--warning); }
.alert-info    { background: #e8f0fb; border: 1px solid #c5d8ee; color: var(--primary-light); }

.actions-cell { display: flex; gap: 6px; }
.row-actions { display: flex; gap: 6px; align-items: center; }

.field-validation-error { color: var(--danger); font-size: 12px; }
.input-validation-error { border-color: var(--danger) !important; }

@media (max-width: 900px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .module-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-grid { grid-template-columns: 1fr; }
    .sidebar { width: 200px; }
    .form-row.cols-2, .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr; }
}

/* Small screens — the sidebar becomes an off-canvas drawer toggled from the topbar hamburger. */
@media (max-width: 768px) {
    .topbar { padding: 0 12px; gap: 10px; }
    .sidebar-toggle { display: inline-flex; }
    .breadcrumb .crumb-link, .breadcrumb > span:not(.crumb-active) { display: none; }
    .topbar-logo .sub { display: none; }
    .user-name { display: none; }
    .topbar-user { padding: 4px; }

    .sidebar {
        position: fixed; top: 0; bottom: 0; left: 0;
        width: 260px; max-width: 85vw;
        z-index: 1200; border-right: none;
        box-shadow: 0 10px 40px rgba(0,0,0,0.25);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    body.sidebar-open .sidebar { transform: translateX(0); }

    .sidebar-backdrop {
        display: block; position: fixed; inset: 0; z-index: 1100;
        background: rgba(20, 30, 50, 0.45);
        opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
    }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    body.sidebar-open { overflow: hidden; }

    .module-content { padding: 16px 14px; }
    .module-header { flex-wrap: wrap; gap: 10px; }
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ============================================================
   Report View (printable document) — used by Chart of Accounts
   ============================================================ */
.report-link { display: inline-flex; align-items: center; justify-content: center; color: var(--primary); text-decoration: none; cursor: pointer; }
.report-link svg { width: 22px; height: 22px; stroke: currentColor; fill: none; }
.report-link:hover { color: var(--primary-dark); }

.report-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }

.report-doc { background: var(--surface); border-radius: var(--radius); padding: 26px 30px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.report-head { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 2px solid var(--border); }
.report-logo { height: 46px; width: auto; background: #fff; padding: 4px 8px; border-radius: var(--radius-sm); }
.report-company { font-size: 12px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.report-title { font-size: 20px; font-weight: 600; color: var(--text); margin-top: 2px; }
.report-meta { font-size: 12px; color: var(--text3); margin-top: 4px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th { text-align: left; padding: 9px 10px; border-bottom: 2px solid var(--border); color: var(--text2); font-weight: 600; background: var(--surface2); }
.report-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text); }
/* Print typography matches the screens: mono tabular figures, 14px section heads */
.report-table .num { text-align: right; font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.report-table .ctr { text-align: center; }
.report-table tfoot td { font-weight: 700; }
.report-doc h3 { margin: 14px 0 6px; font-size: 14px; }

/* Report shown standalone / inside the modal iframe */
.report-body { background: #fff; padding: 24px 28px; }

/* ── Shared dashboard-report screen styles (ACC0044/45/46 + Voucher Details) ──
   One block instead of a per-view #xxxReport copy; wrap the screen in
   class="report-screen". auto-fit lets 6- and 7-tile banners space evenly. */
.report-screen .sum-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.report-screen .sum-tile { padding: 10px 12px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.report-screen .sum-tile:last-child { border-right: 0; }
.report-screen .sum-tile label { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.report-screen .sum-tile .sum-val { font-size: 15px; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.report-screen .sum-tile .sum-val.warn { color: var(--danger); }
.report-screen .sum-tile .sum-val.ok { color: var(--success); }
.report-screen .info-grid { display: grid; grid-template-columns: repeat(3, auto 1fr); gap: 6px 10px; font-size: 13px; }
.report-screen .info-grid dt { font-weight: 700; color: var(--text3); white-space: nowrap; }
.report-screen .info-grid dd { margin: 0; }
.report-screen h3.sec { margin: 18px 0 8px; font-size: 14px; }
.report-screen h3.sec small { font-weight: 400; color: var(--text3); font-size: 12px; }
.report-screen td.num, .report-screen th.num { text-align: right; font-family: 'JetBrains Mono', monospace; }
.report-screen td.ctr, .report-screen th.ctr { text-align: center; }
.report-screen td.mono { font-family: 'JetBrains Mono', monospace; }
.report-screen td.warn { color: var(--danger); font-weight: 700; }
.report-screen td.dim { color: var(--text3); }
.report-screen .flag { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 8px; background: var(--danger-bg); color: var(--danger); margin: 1px; }

/* Full-screen Report View modal */
.report-modal { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: rgba(20,30,50,.55); }
.report-modal[hidden] { display: none; }
.report-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--border); }
.report-modal-title { font-size: 15px; font-weight: 600; color: var(--text); }
.report-modal-actions { display: flex; gap: 8px; }
.report-modal-frame { flex: 1; width: 100%; border: 0; background: #fff; }

@media print {
    .topbar, .sidebar, .sidebar-back, .sidebar-backdrop, .sidebar-toggle, .no-print { display: none !important; }
    .app-shell, .module-layout { display: block !important; }
    .module-content { padding: 0 !important; overflow: visible !important; }
    .report-doc { box-shadow: none; border: none; padding: 0; }
    .report-table th, .report-table td { padding: 5px 8px; }
    body { background: #fff; }
    .list-toolbar, .list-pagination { display: none !important; }
    #toast-container, .confirm-overlay { display: none !important; }
}

/* ── List search + pagination (list-table.js) ─────────────────────────── */
.list-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; margin-bottom: 16px; flex-wrap: wrap;
}
.list-search {
    flex: 1; max-width: 320px; padding: 9px 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif; font-size: 14px; color: var(--text);
    background: var(--surface2); outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.list-search:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--focus-glow); background: #fff; }
.list-pagesize { font-size: 12.5px; color: var(--text3); display: inline-flex; align-items: center; gap: 6px; }
.list-pagesize select {
    padding: 6px 8px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif; font-size: 13px; color: var(--text);
    background: var(--surface2); outline: none; cursor: pointer;
}

.list-pagination {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; margin-top: 16px; flex-wrap: wrap;
}
.list-info { font-size: 12.5px; color: var(--text3); }
.list-pages { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.list-page-btn {
    min-width: 32px; padding: 6px 10px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
    font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.list-page-btn:hover:not(:disabled):not(.active) { background: var(--surface2); }
.list-page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; cursor: default; }
.list-page-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.list-dots { padding: 0 4px; color: var(--text3); }

/* ── Toast notifications (notify.js) ───────────────────────────────────── */
#toast-container {
    position: fixed; top: 18px; right: 18px; z-index: 4000;
    display: flex; flex-direction: column; gap: 10px;
    max-width: 360px; pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex; align-items: flex-start; gap: 11px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-left: 4px solid var(--text3);
    border-radius: var(--radius-sm); box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    padding: 12px 14px; font-size: 13.5px; line-height: 1.4;
    opacity: 0; transform: translateX(120%); transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.hide { opacity: 0; transform: translateX(120%); }
.toast-icon {
    flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff; margin-top: 1px;
}
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.toast-message { word-wrap: break-word; }
.toast-close {
    flex: 0 0 auto; background: none; border: none; cursor: pointer;
    font-size: 18px; line-height: 1; color: var(--text3); padding: 0 2px;
}
.toast-close:hover { color: var(--text); }
.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon { background: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-error .toast-icon { background: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-icon { background: var(--warning); }
.toast-info { border-left-color: var(--info); }
.toast-info .toast-icon { background: var(--info); }

/* ── Confirm modal (notify.js) ─────────────────────────────────────────── */
.confirm-overlay {
    position: fixed; inset: 0; z-index: 4100;
    background: rgba(20,28,40,0.45); backdrop-filter: blur(1px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}
.confirm-overlay.show { opacity: 1; }
.confirm-card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25); border: 1px solid var(--border);
    width: 92%; max-width: 400px; padding: 22px 24px;
    transform: translateY(8px) scale(0.98); transition: transform 0.2s;
}
.confirm-overlay.show .confirm-card { transform: translateY(0) scale(1); }
.confirm-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.confirm-message { font-size: 13.5px; color: var(--text2, var(--text)); line-height: 1.5; margin-bottom: 20px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================
   Voucher document (ACC0053) — the formal single-voucher layout.
   Lives here rather than in a view because two places render it:
   the Single Voucher tab on the screen and the printable report
   view, both through _VoucherDocument.cshtml. Page-break and
   @page rules stay in the print view — they are print concerns.
   ============================================================ */
/* Double-ruled frame: an outer rule with a thin gutter, then the
   inner rule the content sits inside. */
.vd-doc { max-width: 900px; margin: 0 auto 34px; border: 1px solid var(--text3); padding: 5px; border-radius: 2px; }
.vd-doc-in { border: 1px solid var(--text3); padding: 22px 24px 18px; }
.vd-head { display: flex; align-items: flex-start; gap: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--text); }
.vd-logo { height: 42px; width: auto; }
.vd-org { flex: 1; }
.vd-org .vd-co { font-size: 15px; font-weight: 700; }
.vd-org .vd-br { font-size: 13px; font-weight: 600; margin-top: 1px; }
.vd-org .vd-addr { font-size: 11px; color: var(--text3); margin-top: 2px; line-height: 1.45; }
.vd-org .vd-vtype { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--primary); margin-top: 8px; }
.vd-stampwrap { text-align: right; }
/* Rubber-stamp treatment — rotated, double-ruled, slightly faded. */
.vd-stamp-mark { display: inline-block; font-size: 14px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
                 border: 2.5px solid currentColor; box-shadow: inset 0 0 0 1px currentColor; padding: 4px 11px 3px;
                 border-radius: 2px; transform: rotate(-7deg); opacity: .8; white-space: nowrap; }
.vd-stamp-mark.posted { color: var(--success); }
.vd-stamp-mark.approved { color: var(--primary); }
.vd-stamp-mark.submitted { color: var(--warning); }
.vd-stamp-mark.returned { color: var(--danger); }
.vd-stamp-mark.draft { color: var(--text3); }
.vd-stamp { font-size: 10.5px; color: var(--text3); text-align: right; line-height: 1.6; white-space: nowrap; margin-top: 10px; }
.vd-title { text-align: center; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 12px 0; }

/* Bordered two-column header. */
.vd-meta { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 10px; }
.vd-meta td { border: 1px solid var(--border); padding: 5px 8px; vertical-align: top; }
.vd-meta td.lbl { width: 15%; color: var(--text3); font-weight: 600; text-transform: uppercase; font-size: 10px; letter-spacing: .04em; }
.vd-meta td.val { width: 35%; }
.vd-meta td.val.mono { font-family: 'JetBrains Mono', monospace; font-weight: 700; }

.vd-lines { width: 100%; border-collapse: collapse; font-size: 12px; }
.vd-lines th { border: 1px solid var(--border); padding: 5px 8px; text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); background: var(--surface2); }
.vd-lines td { border: 1px solid var(--border); padding: 4px 8px; vertical-align: top; }
.vd-lines .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vd-lines .code { font-family: 'JetBrains Mono', monospace; }
/* Line particulars sit under the account name, in the same cell. */
.vd-lines .vd-lnarr { display: block; font-size: 11px; color: var(--text3); font-style: italic; margin-top: 2px; }
.vd-lines tfoot td { font-weight: 800; background: var(--surface2); }
.vd-lines tfoot td.vd-tot { border-bottom: 4px double var(--text); }
.vd-unmapped { color: var(--danger); font-weight: 600; }
.vd-partial { font-size: 11px; color: var(--danger); font-weight: 600; }

.vd-words { margin-top: 12px; padding: 9px 12px; background: var(--surface2); border-left: 3px solid var(--primary); border-radius: var(--radius-sm); font-size: 12.5px; }
.vd-words .vd-blk-lbl { display: inline; margin-bottom: 0; margin-right: 8px; }
.vd-narration { margin-top: 11px; font-size: 12.5px; }
.vd-blk-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--text3); display: block; margin-bottom: 2px; }

.vd-sign { display: flex; justify-content: space-between; gap: 20px; margin-top: 46px; }
.vd-sign-col { flex: 1; text-align: center; }
.vd-sign-line { border-top: 1px solid var(--text); padding-top: 5px; font-size: 11px; color: var(--text2); }
/* Name printed above the rule it signs over. */
.vd-sign-name { font-size: 11px; color: var(--text3); min-height: 16px; margin-bottom: 3px; }
.vd-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding-top: 8px;
           border-top: 1px dotted var(--border); font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text3); }
.vd-foot .bad { color: var(--danger); font-weight: 700; }

/* ============================================================
   Entry-screen prints (#printArea) — the day-sheet / expense
   prints assembled client-side by the Daily Sales & Expense,
   Sales Approval and Expense screens. One themed definition
   shared by all three views; each view keeps only the
   body-visibility trick that isolates its #printArea, since
   putting `body * { visibility:hidden }` here would blank the
   printable report pages, which also load this stylesheet.
   Backgrounds carry print-color-adjust:exact or browsers strip
   them when printing.
   ============================================================ */
@media print {
  @page { size: A4; margin: 12mm; }
  /* display needs !important: each view hides #printArea on screen with a rule in
     its own <style>, which loads after this sheet and would otherwise win the tie. */
  #printArea { display: block !important; position: absolute; left: 0; top: 0; width: 100%;
               font-family: 'Outfit', sans-serif; font-size: 10.5px; color: var(--text);
               -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* Header: logo + branch/title block over a primary rule (cf. .vd-head).
     .pr-header = DSE/Sales Approval markup, .pr-head = Expense markup. */
  .pr-header, .pr-head { display: flex; align-items: center; gap: 12px; text-align: left;
                         margin-bottom: 10px; border-bottom: 2px solid var(--primary); padding-bottom: 8px; }
  .pr-logo { height: 38px; width: auto; }
  .pr-company { font-size: 16px; font-weight: 700; color: var(--primary); letter-spacing: .02em; }
  .pr-title { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--text2); margin-top: 2px; }
  .pr-date { font-size: 10.5px; color: var(--text3); margin-top: 2px; }

  /* Label/value meta block (Expense print). */
  .pr-meta { margin: 8px 0 12px; font-size: 11px; }
  .pr-meta div { margin: 2px 0; }
  .pr-meta b { display: inline-block; min-width: 90px; color: var(--text2); }

  /* Tables. Headers get the .vd-lines th treatment; amounts print in mono. */
  .pr-main-table, .pr-cp-table, .pr-attach-table, .pr-tbl { width: 100%; border-collapse: collapse; font-size: 10px; }
  .pr-main-table th, .pr-main-table td, .pr-cp-table th, .pr-cp-table td,
  .pr-attach-table th, .pr-attach-table td, .pr-tbl th, .pr-tbl td { border: 1px solid var(--border); padding: 3px 5px; }
  .pr-main-table th, .pr-cp-table th, .pr-attach-table th, .pr-tbl th {
    background: var(--surface2); color: var(--text3); font-size: 9px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em; }
  .pr-main-table th, .pr-cp-table th { text-align: center; }
  .pr-attach-table th, .pr-tbl th { text-align: left; }
  .pr-main-table thead, .pr-cp-table thead, .pr-attach-table thead, .pr-tbl thead { display: table-header-group; }
  .pr-sl { width: 24px; text-align: center; }
  .pr-amt, .pr-tbl .num { text-align: right; white-space: nowrap;
                          font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-variant-numeric: tabular-nums; }
  .pr-amt { width: 80px; }
  .pr-bold { font-weight: 700; }
  /* Section totals: tinted row, double accounting rule under the amount(s). */
  .pr-total-row td, .pr-total td { background: var(--surface2); font-weight: 700; }
  .pr-total-row td.pr-amt, .pr-total td.num:last-child { border-bottom: 3px double var(--text); }

  /* Section bars: primary on a light primary tint with a left accent rule. */
  .pr-section-hdr { font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; text-align: left;
                    color: var(--primary); background: var(--focus-glow);
                    border: 1px solid var(--border); border-left: 3px solid var(--primary);
                    padding: 4px 8px; margin-top: 8px; }

  /* Signatures: name printed above the rule it signs over (cf. .vd-sign). */
  .pr-sig { display: flex; justify-content: space-between; gap: 20px; margin-top: 34px; page-break-inside: avoid; }
  .pr-sig > div { width: 180px; text-align: center; }
  .pr-sig-name { font-size: 10px; color: var(--text3); min-height: 14px; margin-bottom: 3px; }
  .pr-sig-line { border-top: 1px solid var(--text); padding-top: 4px; font-size: 10px; font-weight: 600; color: var(--text2); }

  /* Supporting documents. */
  .pr-attach-hdr { margin-top: 12px; }
  .pr-attach-fig { margin: 10px 0; text-align: center; page-break-inside: avoid; }
  .pr-attach-img { max-width: 100%; max-height: 900px; border: 1px solid var(--border); border-radius: 2px; }
  .pr-attach-fig figcaption { font-size: 9px; color: var(--text3); margin-top: 3px; }
  /* Annotation on a document row whose file failed to load for embedding. */
  .pr-missing { color: var(--danger); font-weight: 600; }
}
