/* Design tokens sampled from the approved UI mockup (E:\Demo\ChatGPT Image ...png) */
:root {
    --font-sans: 'Noto Sans Thai', 'Inter', 'Segoe UI', sans-serif;
    --font-num: 'Inter', 'Noto Sans Thai', sans-serif;

    --sidebar-bg: #081926;
    --sidebar-bg-2: #0D2233;
    --sidebar-text: #A9BCCB;
    --sidebar-text-hover: #FFFFFF;
    --sidebar-section: #5C7488;
    --sidebar-border: #16293A;
    --sidebar-width: 250px;
    --sidebar-width-sm: 74px;

    --brand: #FE7301;
    --brand-dark: #E06400;
    --brand-soft: #FFF3E8;

    --primary: #1B6CFA;
    --primary-dark: #0B57DE;
    --primary-soft: #E8F0FE;

    --success: #12B76A;
    --success-soft: #E7F8F0;
    --danger: #F0392B;
    --danger-soft: #FDECEA;
    --warning: #F5A623;
    --warning-soft: #FEF5E7;
    --info: #29B6FB;
    --info-soft: #E7F6FE;

    --page-bg: #F7F8FB;
    --card-bg: #FFFFFF;
    --border: #E8EBF0;
    --border-strong: #D6DBE4;

    --text: #101828;
    --text-muted: #667085;
    --text-soft: #98A2B3;

    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-lg: 0 8px 24px rgba(16, 24, 40, .10);

    /* Per-module accents, sampled from the mockup icon badges */
    --m1: #04927E;
    --m2: #0BA75F;
    --m3: #06ABAB;
    --m4: #8671E4;
    --m5: #0FB46B;
    --m6: #FE760C;
    --m7: #F64285;
    --m8: #0AACAC;
    --m9: #29B6FB;
    --m10: #E5306E;
}

html { font-size: 15px; }

body {
    font-family: var(--font-sans);
    background: var(--page-bg);
    color: var(--text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { font-weight: 600; color: var(--text); }

.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

a { text-decoration: none; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }

.app-sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width .18s ease, flex-basis .18s ease;
}

.app-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content { padding: 0 26px 32px; }

/* ---------- Sidebar ---------- */
.sb-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px 18px;
}

.sb-logo {
    width: 42px; height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    background: linear-gradient(140deg, var(--brand) 0%, #FFA23D 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 22px;
}

.sb-brand-text { min-width: 0; }
.sb-brand-name { font-size: 1.18rem; font-weight: 700; color: #fff; line-height: 1.1; letter-spacing: .2px; }
.sb-brand-sub { font-size: .66rem; color: var(--sidebar-section); line-height: 1.35; margin-top: 3px; }

.sb-nav { flex: 1 1 auto; overflow-y: auto; padding: 4px 12px 12px; }
.sb-nav::-webkit-scrollbar { width: 6px; }
.sb-nav::-webkit-scrollbar-thumb { background: #1D3346; border-radius: 3px; }

.sb-section {
    font-size: .68rem;
    color: var(--sidebar-section);
    letter-spacing: .6px;
    padding: 16px 12px 7px;
}

.sb-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    font-size: .9rem;
    margin-bottom: 2px;
    white-space: nowrap;
    transition: background .13s ease, color .13s ease;
}

.sb-link i { font-size: 1.05rem; width: 20px; text-align: center; flex: 0 0 20px; }
.sb-link:hover { background: var(--sidebar-bg-2); color: var(--sidebar-text-hover); }

.sb-link.active {
    background: var(--brand);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(254, 115, 1, .28);
}

.sb-link .sb-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: .68rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.sb-divider { height: 1px; background: var(--sidebar-border); margin: 12px 12px; }

/* Sub-menu shown only under the active module */
.sb-subgroup { margin: 2px 0 8px 22px; padding-left: 12px; border-left: 1px solid var(--sidebar-border); }
.sb-sub {
    display: block; padding: 7px 12px; border-radius: 8px;
    color: var(--sidebar-text); font-size: .84rem; white-space: nowrap;
}
.sb-sub:hover { background: var(--sidebar-bg-2); color: var(--sidebar-text-hover); }
.app.is-collapsed .sb-subgroup { display: none; }

.sb-foot {
    padding: 14px 22px 18px;
    border-top: 1px solid var(--sidebar-border);
    font-size: .72rem;
    color: var(--sidebar-section);
    line-height: 1.6;
}

/* Collapsed state */
.app.is-collapsed .app-sidebar { width: var(--sidebar-width-sm); flex-basis: var(--sidebar-width-sm); }
.app.is-collapsed .sb-brand-text,
.app.is-collapsed .sb-section,
.app.is-collapsed .sb-link span,
.app.is-collapsed .sb-link .sb-badge,
.app.is-collapsed .sb-foot { display: none; }
.app.is-collapsed .sb-brand { justify-content: center; padding-left: 0; padding-right: 0; }
.app.is-collapsed .sb-link { justify-content: center; padding-left: 0; padding-right: 0; }

/* ---------- Top bar ---------- */
.app-topbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 18px;
    padding: 14px 26px 10px;
}

.tb-toggle {
    flex: 0 0 auto;
    border: 0; background: transparent; color: var(--text-muted);
    font-size: 1.5rem; line-height: 1; padding: 4px 6px; border-radius: 8px; cursor: pointer;
}
.tb-toggle:hover { background: #EDEFF4; color: var(--text); }

.tb-title { flex: 0 1 auto; min-width: 0; }
.tb-title h1 { font-size: 1.55rem; margin: 0; line-height: 1.25; }
.tb-title .tb-sub { font-size: .88rem; color: var(--text-muted); margin-top: 2px; }

/* The strip must never be squeezed — a clipped KPI is worse than a wrapped row,
   so it keeps its natural width and moves to its own line when space runs out. */
.tb-kpis {
    display: flex; align-items: stretch; gap: 0;
    flex: 0 0 auto; margin-left: auto;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.tb-kpi { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-right: 1px solid var(--border); flex: 0 0 auto; }
.tb-kpi:last-child { border-right: 0; }
.tb-kpi-icon { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex: 0 0 40px; }
.tb-kpi-label { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }
.tb-kpi-value { font-size: 1.12rem; font-weight: 700; line-height: 1.25; white-space: nowrap; }
.tb-kpi-unit { font-size: .74rem; color: var(--text-soft); font-weight: 400; margin-left: 3px; }
.tb-kpi-delta { font-size: .74rem; font-weight: 500; white-space: nowrap; }
.tb-kpi-delta.up { color: var(--success); }
.tb-kpi-delta.down { color: var(--danger); }

.tb-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.tb-icon-btn {
    position: relative; width: 40px; height: 40px; border-radius: var(--radius);
    background: var(--card-bg); border: 1px solid var(--border);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 1.1rem; box-shadow: var(--shadow-sm); cursor: pointer;
}
.tb-icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.tb-icon-btn .dot-badge {
    position: absolute; top: -5px; right: -5px;
    background: var(--danger); color: #fff; font-size: .64rem; font-weight: 600;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; border: 2px solid var(--page-bg);
}

.tb-user { position: relative; display: flex; align-items: center; gap: 9px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px 6px 6px; box-shadow: var(--shadow-sm); cursor: pointer; }
.tb-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.tb-user-name { font-size: .84rem; white-space: nowrap; }

.tb-user-menu {
    display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 1050;
    min-width: 190px; padding: 6px;
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.tb-user-menu.open { display: block; }
.tb-user-menu a,
.tb-user-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 12px; border: 0; background: transparent; border-radius: 8px;
    font-family: var(--font-sans); font-size: .86rem; color: var(--text);
    text-align: left; cursor: pointer;
}
.tb-user-menu a:hover { background: var(--page-bg); }
.tb-user-menu button:hover { background: var(--danger-soft); color: #9C2016; }

/* Logout is a POST, so it is a button styled to match the nav links */
.sb-link-btn { width: 100%; border: 0; background: transparent; font-family: var(--font-sans); text-align: left; cursor: pointer; }

.tb-clock { text-align: right; font-size: .74rem; color: var(--text-soft); }
.tb-clock .t { font-size: .95rem; color: var(--text-muted); font-weight: 500; }

/* ---------- Breadcrumb ---------- */
.crumb { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--text-muted); margin: 0 0 18px; }
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--primary); }
.crumb .sep { color: var(--text-soft); }
.crumb .cur { color: var(--text); font-weight: 500; }

/* ---------- Cards ---------- */
.card-x {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-x-head { padding: 18px 22px 0; }
.card-x-body { padding: 22px; }
.card-x-title { font-size: 1.15rem; font-weight: 600; margin: 0; }
.card-x-sub { font-size: .86rem; color: var(--text-muted); margin-top: 3px; }

/* ---------- Module cards (dashboard) ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }

.mod-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px 20px 22px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}
.mod-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--border-strong); }

.mod-no {
    position: absolute; top: 14px; left: 14px;
    width: 26px; height: 26px; border-radius: 50%;
    color: #fff; font-size: .8rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-num);
}

.mod-icon { width: 108px; height: 108px; margin-bottom: 16px; }
.mod-icon img { width: 100%; height: 100%; object-fit: contain; }

.mod-name { font-size: 1.05rem; font-weight: 600; margin: 0 0 8px; }
.mod-desc { font-size: .82rem; color: var(--text-muted); line-height: 1.65; margin: 0 0 18px; flex: 1 1 auto; }

.btn-enter {
    display: inline-flex; align-items: center; gap: 10px;
    border: 1px solid var(--brand); color: var(--brand);
    background: transparent; border-radius: var(--radius);
    padding: 8px 18px; font-size: .86rem; font-family: var(--font-sans);
    transition: background .14s ease, color .14s ease;
}
.btn-enter:hover { background: var(--brand); color: #fff; }

/* ---------- Quick access ---------- */
.quick-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quick-item { display: flex; align-items: center; gap: 11px; padding: 10px 16px 10px 10px; border-radius: var(--radius); flex: 1 1 auto; min-width: 165px; }
.quick-item:hover { background: var(--page-bg); }
.quick-icon { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.quick-title { font-size: .87rem; font-weight: 500; color: var(--text); line-height: 1.3; }
.quick-sub { font-size: .74rem; color: var(--text-muted); }

/* ---------- Stat tiles (list pages) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-tile { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm); }
.stat-icon { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.stat-label { font-size: .82rem; color: var(--text-muted); }
.stat-value { font-size: 1.42rem; font-weight: 700; line-height: 1.2; }
.stat-value small { font-size: .8rem; font-weight: 400; color: var(--text-muted); margin-left: 4px; }

/* ---------- Buttons ---------- */
.btn { font-family: var(--font-sans); font-size: .88rem; border-radius: var(--radius); padding: 9px 18px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; cursor: pointer; transition: background .14s ease, border-color .14s ease, color .14s ease; }
.btn-primary-x { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(27, 108, 250, .25); }
.btn-primary-x:hover { background: var(--primary-dark); color: #fff; }
.btn-success-x { background: var(--success); color: #fff; box-shadow: 0 2px 6px rgba(18, 183, 106, .25); }
.btn-success-x:hover { background: #0E9B59; color: #fff; }
.btn-outline-x { background: var(--card-bg); color: var(--text); border-color: var(--border-strong); }
.btn-outline-x:hover { background: var(--page-bg); color: var(--text); }
.btn-brand-x { background: var(--brand); color: #fff; }
.btn-brand-x:hover { background: var(--brand-dark); color: #fff; }

/* ---------- Forms / filter bar ---------- */
.filter-bar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .84rem; color: var(--text-muted); }
.form-x {
    height: 42px; min-width: 190px;
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    background: var(--card-bg); padding: 0 14px;
    font-family: var(--font-sans); font-size: .88rem; color: var(--text);
}
.form-x:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27, 108, 250, .12); }
.form-x::placeholder { color: var(--text-soft); }

/* ---------- Table ---------- */
.table-x { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table-x thead th {
    background: #F9FAFC; color: var(--text); font-weight: 600;
    text-align: left; padding: 15px 20px; white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.table-x tbody td { padding: 15px 20px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.table-x tbody tr:last-child td { border-bottom: 0; }
.table-x tbody tr:hover { background: #FBFCFE; }
.table-x .ta-r { text-align: right; }
.table-x .ta-c { text-align: center; }

.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }

/* ---------- Badges ---------- */
.badge-x { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; padding: 4px 11px; border-radius: 20px; }
.badge-active { background: var(--success-soft); color: #0A8A50; }
.badge-inactive { background: var(--danger-soft); color: #C42A1E; }
.badge-pending { background: var(--warning-soft); color: #B87508; }
.badge-info { background: var(--primary-soft); color: var(--primary-dark); }
.text-active { color: var(--success); font-weight: 600; }
.text-inactive { color: var(--danger); font-weight: 600; }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 18px 22px; position: relative; }
.pager a, .pager span.pg {
    min-width: 34px; height: 34px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .85rem; color: var(--text-muted); border: 1px solid var(--border);
    background: var(--card-bg); font-family: var(--font-num);
}
.pager a:hover { border-color: var(--border-strong); color: var(--text); }
.pager .pg.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pager .pg.dots { border: 0; background: transparent; }
.pager .pager-info { position: absolute; right: 22px; font-size: .82rem; color: var(--text-muted); }

/* ---------- Alerts ---------- */
.alert-x {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 13px 18px; border-radius: var(--radius);
    font-size: .88rem; margin-bottom: 18px; border: 1px solid transparent;
}
.alert-x i { font-size: 1.05rem; line-height: 1.4; flex: 0 0 auto; }
.alert-x-success { background: var(--success-soft); color: #0A6E42; border-color: #B6E9CE; }
.alert-x-danger { background: var(--danger-soft); color: #9C2016; border-color: #F7C4BE; }
.alert-x-warning { background: var(--warning-soft); color: #8A5606; border-color: #F7DDAE; }

/* ---------- Form layout ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field-grid .field .form-x { width: 100%; min-width: 0; }
.field-error { color: var(--danger); font-size: .78rem; }
.ta-r { text-align: right; }

.form-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border);
}

/* Compact controls inside detail rows */
.table-x .form-x { height: 36px; font-size: .85rem; }

/* ---------- Summary table ---------- */
.summary-table { width: 100%; font-size: .9rem; border-collapse: collapse; }
.summary-table th { text-align: left; font-weight: 400; color: var(--text-muted); padding: 7px 0; }
.summary-table td { text-align: right; padding: 7px 0; font-weight: 500; }
.summary-table td.unit { width: 46px; text-align: left; padding-left: 8px; color: var(--text-soft); font-weight: 400; font-size: .82rem; }
.summary-table tr.sep th, .summary-table tr.sep td { border-top: 1px solid var(--border); padding-top: 11px; }
.summary-table tr.total th { color: var(--text); font-weight: 600; font-size: 1rem; padding-top: 4px; }
.summary-table tr.total td { font-size: 1.22rem; font-weight: 700; padding-top: 4px; }

@media (max-width: 1100px) {
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .field-grid { grid-template-columns: 1fr; }
}

/* ---------- Auth pages (login / change password / denied) ---------- */
.auth-body { display: flex; min-height: 100vh; margin: 0; }

.auth-photo {
    flex: 1 1 55%;
    background-image: url('../img/hero-fleet.jpg');
    background-size: cover;
    background-position: center 45%;
    position: relative;
}
.auth-photo-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(8, 25, 38, .35) 0%, rgba(8, 25, 38, .88) 100%);
    display: flex; align-items: flex-end; padding: 48px;
}
.auth-photo-text h2 { color: #fff; font-size: 1.62rem; margin: 0 0 6px; }
.auth-photo-text p { color: rgba(255, 255, 255, .78); font-size: .92rem; margin: 0; }

.auth-panel {
    flex: 0 0 460px;
    display: flex; align-items: center; justify-content: center;
    background: var(--card-bg); padding: 40px 34px;
}
.auth-card { width: 100%; max-width: 360px; }

.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.auth-logo {
    width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px;
    background: linear-gradient(140deg, var(--brand) 0%, #FFA23D 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.4rem;
}
.auth-brand-name { font-size: 1.2rem; font-weight: 700; letter-spacing: .2px; line-height: 1.1; }
.auth-brand-sub { font-size: .7rem; color: var(--text-muted); margin-top: 3px; }

.auth-title { font-size: 1.5rem; margin: 0 0 6px; }
.auth-sub { font-size: .88rem; color: var(--text-muted); margin: 0 0 24px; }

.auth-card .field { display: flex; flex-direction: column; gap: 6px; }
.auth-card .field label { font-size: .85rem; color: var(--text-muted); }

.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-soft); font-size: 1rem; }
.input-icon .form-x { width: 100%; min-width: 0; padding-left: 40px; padding-right: 40px; }
.input-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: var(--text-soft);
    padding: 6px 8px; cursor: pointer; font-size: 1rem; border-radius: 6px;
}
.input-eye:hover { color: var(--text); }

.auth-check { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--text-muted); margin: 4px 0 22px; cursor: pointer; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--primary); }

.auth-submit { width: 100%; justify-content: center; padding: 12px 18px; font-size: .95rem; }

.auth-foot { font-size: .82rem; color: var(--text-soft); text-align: center; margin: 20px 0 0; }
.auth-link-btn { border: 0; background: transparent; color: var(--text-muted); font-family: var(--font-sans); font-size: .84rem; cursor: pointer; text-decoration: underline; }
.auth-link-btn:hover { color: var(--danger); }

@media (max-width: 900px) {
    .auth-photo { display: none; }
    .auth-panel { flex: 1 1 100%; }
}

/* ---------- Charts ---------- */
.chart-row { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; }
.chart-box { position: relative; height: 260px; }

@media (max-width: 1100px) {
    .chart-row { grid-template-columns: 1fr; }
}

/* ---------- Pay slip ---------- */
.slip-sheet {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 34px 38px; max-width: 820px;
    box-shadow: var(--shadow-sm);
}
.slip-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--text); }
.slip-company { font-size: 1.18rem; font-weight: 700; }
.slip-addr { font-size: .82rem; color: var(--text-muted); margin-top: 3px; }
.slip-title { text-align: right; font-size: 1.28rem; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.slip-title span { font-size: .82rem; font-weight: 400; color: var(--text-muted); }

.slip-meta { width: 100%; margin: 20px 0 24px; font-size: .9rem; border-collapse: collapse; }
.slip-meta th { text-align: left; font-weight: 400; color: var(--text-muted); padding: 6px 12px 6px 0; width: 130px; white-space: nowrap; }
.slip-meta td { padding: 6px 24px 6px 0; font-weight: 500; }

.slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.slip-col-head { font-weight: 600; padding-bottom: 8px; border-bottom: 1px solid var(--border-strong); margin-bottom: 6px; }
.slip-lines { width: 100%; font-size: .89rem; border-collapse: collapse; }
.slip-lines td { padding: 7px 0; }
.slip-lines td.num { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.slip-lines tr.slip-sum td { border-top: 1px solid var(--border-strong); font-weight: 600; padding-top: 9px; }

.slip-net {
    display: flex; justify-content: space-between; align-items: center; gap: 20px;
    margin-top: 24px; padding: 16px 20px; background: var(--page-bg); border-radius: var(--radius);
}
.slip-net-words { font-size: .89rem; color: var(--text-muted); }
.slip-net-value { display: flex; align-items: baseline; gap: 10px; }
.slip-net-value span { font-size: .89rem; color: var(--text-muted); }
.slip-net-value strong { font-size: 1.5rem; }
.slip-net-value .unit { font-size: .82rem; }

.slip-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-top: 46px; text-align: center; font-size: .85rem; color: var(--text-muted); }
.slip-line { border-bottom: 1px dotted var(--text-soft); margin-bottom: 8px; height: 34px; }

@media print {
    .app-sidebar, .app-topbar, .crumb, .filter-bar, .alert-x { display: none !important; }
    .app-content { padding: 0 !important; }
    .slip-sheet { border: 0; box-shadow: none; max-width: 100%; }
}

@media (max-width: 700px) {
    .slip-sheet { padding: 22px 20px; }
    .slip-cols { grid-template-columns: 1fr; gap: 18px; }
    .slip-head { flex-direction: column; }
    .slip-title { text-align: left; }
}

/* ---------- Section heading ---------- */
.sec-head { margin: 26px 0 16px; }
.sec-head h2 { font-size: 1.28rem; margin: 0; }
.sec-head p { font-size: .87rem; color: var(--text-muted); margin: 4px 0 0; }

/* ---------- Soft color helpers ---------- */
.sf-1 { background: rgba(4, 146, 126, .1); color: var(--m1); }
.sf-2 { background: rgba(11, 167, 95, .1); color: var(--m2); }
.sf-3 { background: rgba(6, 171, 171, .1); color: var(--m3); }
.sf-4 { background: rgba(134, 113, 228, .12); color: var(--m4); }
.sf-5 { background: rgba(15, 180, 107, .1); color: var(--m5); }
.sf-6 { background: rgba(254, 118, 12, .1); color: var(--m6); }
.sf-7 { background: rgba(246, 66, 133, .1); color: var(--m7); }
.sf-8 { background: rgba(10, 172, 172, .1); color: var(--m8); }
.sf-9 { background: rgba(41, 182, 251, .12); color: var(--m9); }
.sf-10 { background: rgba(229, 48, 110, .1); color: var(--m10); }
.sf-primary { background: var(--primary-soft); color: var(--primary); }
.sf-success { background: var(--success-soft); color: var(--success); }
.sf-danger { background: var(--danger-soft); color: var(--danger); }
.sf-warning { background: var(--warning-soft); color: #B87508; }

.bg-1 { background: var(--m1); } .bg-2 { background: var(--m2); }
.bg-3 { background: var(--m3); } .bg-4 { background: var(--m4); }
.bg-5 { background: var(--m5); } .bg-6 { background: var(--m6); }
.bg-7 { background: var(--m7); } .bg-8 { background: var(--m8); }
.bg-9 { background: var(--m9); } .bg-10 { background: var(--m10); }

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
    .mod-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Not enough room beside the title: the strip takes its own full-width row rather
   than shrinking. order:3 sends it below the title and the user menu. */
@media (max-width: 1560px) {
    .tb-kpis {
        order: 3;
        flex: 1 1 100%;
        margin-left: 0;
        overflow-x: auto;
    }
    .tb-right { margin-left: auto; }
}

@media (max-width: 1200px) {
    .mod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .app-sidebar { position: fixed; z-index: 1040; left: 0; transform: translateX(-100%); transition: transform .2s ease; }
    .app.is-open .app-sidebar { transform: translateX(0); }
    .app.is-collapsed .app-sidebar { width: var(--sidebar-width); flex-basis: var(--sidebar-width); }
    .mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-content, .app-topbar { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 600px) {
    .mod-grid, .stat-grid { grid-template-columns: 1fr; }
    .tb-clock { display: none; }
    .tb-title h1 { font-size: 1.3rem; }
    .tb-kpi { padding: 10px 14px; }
}
