.attendance-help { margin: .5rem 0 1rem; border: 1px solid #d4ded7; border-radius: 6px; background: #f7faf8; min-width: 0; }
.attendance-help > summary { cursor: pointer; padding: .65rem .8rem; color: #205440; display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.attendance-help > summary:focus-visible { outline: 3px solid #b58c36; outline-offset: 2px; }
.attendance-help > summary .bi { font-size: 1.15rem; flex-shrink: 0; }
.attendance-help[open] > summary { border-bottom: 1px solid #d4ded7; }
.attendance-help-body { padding: 1rem; font-size: .875rem; overflow-wrap: anywhere; }
.attendance-help-body li { margin-bottom: .5rem; }
.attendance-help-body ol, .attendance-help-body ul { padding-left: 1.25rem; }
.attendance-help-links { display: grid; gap: .25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.audit-values { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 36rem; overflow-y: auto; font-size: .8rem; }
.report-table td { vertical-align: top; min-width: 6rem; overflow-wrap: anywhere; }
.operations-dashboard { --trend-present: #367b55; --trend-absent: #b0444b; --trend-other: #bb8e32; }
.operations-dashboard .page-heading h1 { font-size: 2rem; }
.operations-dashboard a { color: var(--eb-green-dark); text-underline-offset: 3px; }
.dashboard-section { min-width: 0; padding: 1.25rem 0; border-top: 1px solid var(--eb-line); }
.dashboard-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.dashboard-section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.2rem; }
.dashboard-section-heading > span, .dashboard-section-heading > a { font-size: .82rem; }
.dashboard-section-heading > span { color: #59665e; }
.dashboard-live { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.dashboard-live > div { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: .2rem .5rem; }
.dashboard-live i { color: var(--eb-green); }
.dashboard-live span { color: #59665e; font-size: .8rem; }
.dashboard-live strong { grid-column: 2; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.dashboard-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr) auto auto; align-items: end; gap: .75rem; padding: 1.25rem 0 .75rem; }
.dashboard-filters > div { min-width: 0; }
.dashboard-filters input, .dashboard-filters select { min-width: 0; width: 100%; }
.dashboard-filters .form-label { font-size: .82rem; }
.dashboard-range { padding: .5rem 0 1rem; color: #59665e; font-size: .85rem; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; }
.dashboard-kpi { display: flex; flex-direction: column; justify-content: space-between; gap: .75rem; min-width: 0; min-height: 6.5rem; padding: .85rem; background: #fff; border: 1px solid var(--eb-line); border-radius: 6px; text-decoration: none; }
a.dashboard-kpi:hover { border-color: var(--eb-green); background: #f7faf7; }
.dashboard-kpi span { color: #59665e; font-size: .8rem; }
.dashboard-kpi strong { font-size: 1.55rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dashboard-kpi:nth-child(2) { border-top: 3px solid #bb8e32; }
.dashboard-kpi:nth-child(3) { border-top: 3px solid #b0444b; }
.dashboard-health { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding-top: 1rem; font-size: .8rem; color: #59665e; }
.dashboard-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.dashboard-columns > div { min-width: 0; }
.dashboard-legend { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; font-size: .73rem; }
.dashboard-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.dashboard-legend i { display: inline-block; width: .6rem; height: .6rem; }
.trend-present { background: var(--trend-present); }
.trend-absent { background: var(--trend-absent); }
.trend-other { background: var(--trend-other); }
.dashboard-trend { max-height: 22rem; overflow-y: auto; padding-right: .4rem; }
.dashboard-trend-row { display: grid; grid-template-columns: 6rem minmax(0, 1fr) 2.5rem; align-items: center; gap: .75rem; min-height: 2.3rem; font-size: .76rem; }
.dashboard-trend-row > strong { text-align: right; font-variant-numeric: tabular-nums; }
.dashboard-track { display: flex; height: 1rem; background: #e1e6df; overflow: hidden; }
.dashboard-track > span { height: 100%; }
.dashboard-table { font-size: .8rem; --bs-table-bg: transparent; }
.dashboard-table th { font-weight: 600; }
.dashboard-table td, .dashboard-table th { vertical-align: middle; overflow-wrap: anywhere; }
.dashboard-table td { font-variant-numeric: tabular-nums; }
.dashboard-ot { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-section h3 { display: flex; justify-content: space-between; gap: .75rem; margin: .5rem 0; font-size: 1rem; }
.dashboard-section h3 span { font-variant-numeric: tabular-nums; }
.dashboard-queue { margin: 0; padding: 0; list-style: none; }
.dashboard-queue li { border-bottom: 1px solid var(--eb-line); }
.dashboard-queue a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; font-size: .84rem; text-decoration: none; }
.dashboard-queue a > span { min-width: 0; overflow-wrap: anywhere; }
.dashboard-queue a:hover strong { text-decoration: underline; }
.dashboard-queue small { display: block; margin-top: .25rem; color: #59665e; }
.dashboard-empty { padding: 1rem 0; color: #59665e; font-size: .85rem; }
.dashboard-footnote { margin: .75rem 0 0; color: #59665e; font-size: .75rem; }
.dashboard-pagination { display: flex; align-items: center; gap: .75rem; margin-top: .75rem; font-size: .8rem; }
@media (max-width: 1199px) { .dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dashboard-ot { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
    .dashboard-columns { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .dashboard-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-filters > div:nth-child(3) { grid-column: 1 / -1; }
    .dashboard-filters > .icon-button { justify-self: end; }
    .dashboard-kpis, .dashboard-live { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
    @page { size: landscape; margin: 10mm; }
    .admin-sidebar, .admin-topbar, .sidebar-overlay, .no-print { display: none !important; }
    .admin-workspace { margin: 0 !important; padding: 0 !important; }
    .admin-content { max-width: none !important; padding: 0 !important; }
    .table-responsive { overflow: visible !important; }
    .report-table table { font-size: 7pt; width: 100%; table-layout: fixed; }
    .report-table td, .report-table th { min-width: 0; overflow-wrap: anywhere; padding: 2pt; }
    thead { display: table-header-group; }
    tr { break-inside: avoid; }
    body { background: white !important; color: black !important; }
}
.individual-report { page: individual; margin: 1rem 0 1.5rem; padding: 1rem; border: 1px solid var(--eb-line); background: #fff; }
.individual-report-heading { text-align: center; }
.individual-report-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 700; }
.individual-report-heading p { margin: .2rem 0 1rem; font-family: Georgia, serif; font-size: 1rem; }
.individual-report-note { margin: .75rem 0 0; color: #59665e; font-size: .75rem; }
.individual-report-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 2rem; }
.individual-report-meta > div { display: grid; grid-template-columns: minmax(6rem, .7fr) minmax(0, 1.3fr); gap: .5rem; }
.individual-report-meta span, .individual-report-totals span { color: #59665e; font-size: .75rem; }
.individual-report-meta strong, .individual-report-totals strong { overflow-wrap: anywhere; font-size: .85rem; }
.individual-report-table table { font-size: .82rem; }
.individual-report-table th, .individual-report-table td { padding: .4rem; vertical-align: middle; }
.individual-report-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 2rem; padding: 1rem 0; border-top: 1px solid var(--eb-line); }
.individual-report-totals > div { display: flex; justify-content: space-between; gap: .75rem; }
@page individual { size: A4 portrait; margin: 10mm; }
@page overtime { size: A4 landscape; margin: 8mm; }
.ot-master-report table { border-collapse: collapse; }
.ot-master-report th, .ot-master-report td { border: 1px solid var(--eb-line); }
.ot-master-report th { background: #f4edcf; }
.ot-master-report td.text-end { font-variant-numeric: tabular-nums; }
@media (max-width: 575px) {
    .individual-report-meta { grid-template-columns: 1fr; }
    .individual-report-totals { grid-template-columns: 1fr; gap: .5rem; }
}
@media print {
    .individual-report, .individual-report-table, .individual-report-totals { page: individual; }
    .individual-report { margin: 0 0 8pt; padding: 0; border: 0; }
    .individual-report-page-heading { display: none !important; }
    .individual-report-heading h2 { font-size: 18pt; }
    .individual-report-heading p { margin-bottom: 8pt; font-size: 11pt; }
    .individual-report-note { margin-top: 5pt; font-size: 7pt; }
    .individual-report-meta { gap: 3pt 14pt; font-size: 8pt; }
    .individual-report-meta strong, .individual-report-totals strong { font-size: 8pt; }
    .individual-report-table table { font-size: 7.5pt; }
    .individual-report-table th, .individual-report-table td { padding: 3pt; }
    .individual-report-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5pt 16pt; padding-top: 8pt; }
    body:has(.ot-master-report) .individual-report,
    body:has(.ot-master-report) .individual-report-table,
    body:has(.ot-master-report) .individual-report-totals { page: overtime; }
    .ot-master-report table { font-size: 6.5pt; table-layout: auto; }
    .ot-master-report td, .ot-master-report th { padding: 2pt; }
}
:root {
    --eb-ink: #202922;
    --eb-green: #214f3b;
    --eb-green-dark: #15382a;
    --eb-red: #a52d32;
    --eb-gold: #d8aa52;
    --eb-paper: #f5f6f1;
    --eb-line: #dfe4dc;
}

body {
    color: var(--eb-ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.auth-page {
    min-height: 100vh;
    margin: 0;
    background: var(--eb-paper);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(20rem, 0.9fr) minmax(24rem, 1.1fr);
}

.auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 7vw, 7rem);
    color: #fff;
    background-color: var(--eb-green-dark);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 4.25rem;
    height: 4.25rem;
    margin-bottom: 2.5rem;
    border: 2px solid var(--eb-gold);
    border-radius: 50%;
    color: var(--eb-gold);
    font-family: Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.brand-kicker, .section-label {
    margin-bottom: .75rem;
    color: var(--eb-gold);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12rem;
    text-transform: uppercase;
}

.auth-brand h1 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: clamp(2.8rem, 5vw, 5.5rem);
    line-height: 1;
}

.brand-copy { max-width: 28rem; margin-top: 1.5rem; color: rgba(255,255,255,.7); }
.auth-panel { display: grid; place-items: center; padding: 2rem; }
.auth-form-wrap { width: min(100%, 29rem); }
.auth-form-wrap h2 { font-family: Georgia, serif; font-size: 2.25rem; }
.form-control { border-color: var(--eb-line); border-radius: .35rem; }
.form-control:focus { border-color: var(--eb-green); box-shadow: 0 0 0 .2rem rgba(33,79,59,.14); }
.btn { border-radius: .35rem; font-weight: 700; }
.btn-primary { --bs-btn-bg: var(--eb-green); --bs-btn-border-color: var(--eb-green); --bs-btn-hover-bg: var(--eb-green-dark); --bs-btn-hover-border-color: var(--eb-green-dark); }

.admin-page { min-height: 100vh; margin: 0; background: #f1f3ef; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1040; width: 17rem; overflow-y: auto; color: #eef3ef; background: #18372b; border-right: 1px solid rgba(255,255,255,.08); }
.sidebar-brand { display: flex; align-items: center; gap: .8rem; height: 4.75rem; padding: 0 1.35rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand-mark { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid var(--eb-gold); border-radius: 50%; color: var(--eb-gold); font-family: Georgia, serif; font-weight: 700; }
.sidebar-brand strong { display: block; font-family: Georgia, serif; font-size: 1.15rem; }
.sidebar-brand small { display: block; color: rgba(255,255,255,.56); font-size: .69rem; text-transform: uppercase; }
.sidebar-nav { padding: 1.1rem .8rem 2rem; }
.sidebar-link, .sidebar-group summary { display: flex; align-items: center; gap: .75rem; min-height: 2.75rem; padding: .65rem .8rem; color: rgba(255,255,255,.75); text-decoration: none; border-radius: 6px; cursor: pointer; }
.sidebar-link:hover, .sidebar-group summary:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar-link.active { color: #fff; background: #285942; box-shadow: inset 3px 0 var(--eb-gold); }
.sidebar-link i, .sidebar-group summary i:first-child { width: 1.15rem; color: #d8c183; font-size: 1rem; text-align: center; }
.sidebar-group { margin-top: .2rem; }
.sidebar-group summary { justify-content: space-between; list-style: none; }
.sidebar-group summary::-webkit-details-marker { display: none; }
.sidebar-group summary > span { display: flex; align-items: center; gap: .75rem; }
.group-chevron { font-size: .7rem; transition: transform .2s ease; }
.sidebar-group[open] .group-chevron { transform: rotate(180deg); }
.sidebar-subnav { display: grid; gap: .1rem; padding: .2rem 0 .45rem 2.75rem; }
.sidebar-subnav a { padding: .5rem .65rem; color: rgba(255,255,255,.6); font-size: .88rem; text-decoration: none; border-left: 1px solid rgba(255,255,255,.13); }
.sidebar-subnav a:hover { color: #fff; border-left-color: var(--eb-gold); }
.sidebar-subnav a.active { color: #fff; border-left-color: var(--eb-gold); background: rgba(255,255,255,.05); }
.admin-workspace { min-height: 100vh; margin-left: 17rem; }
.admin-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; justify-content: space-between; min-height: 4.75rem; padding: .75rem clamp(1rem, 3vw, 2.25rem); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--eb-line); }
.topbar-start, .topbar-end, .user-name { display: flex; align-items: center; }
.topbar-start { gap: .75rem; }
.topbar-end { gap: 1rem; }
.topbar-product { font-family: Georgia, serif; font-size: 1.15rem; font-weight: 700; color: var(--eb-green-dark); }
.bahrain-clock { color: #657069; font-size: .82rem; white-space: nowrap; }
.topbar-divider { width: 1px; height: 1.5rem; background: var(--eb-line); }
.user-name { gap: .45rem; max-width: 13rem; overflow: hidden; color: #36413a; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.user-name i { color: var(--eb-green); font-size: 1.2rem; }
.icon-button { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; color: #445049; background: transparent; border: 1px solid var(--eb-line); border-radius: 6px; }
.icon-button:hover { color: var(--eb-green-dark); background: #edf2ed; }
.sidebar-toggle { display: none; font-size: 1.3rem; }
.logout-button { color: var(--eb-red); }
.admin-content { width: min(100%, 96rem); margin: 0 auto; padding: clamp(1.25rem, 3vw, 2.5rem); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.page-heading .section-label { margin-bottom: .3rem; color: #7a642b; }
.page-heading h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3rem); color: #1d2b23; }
.status-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .7rem; color: #315a43; background: #e4eee7; border: 1px solid #c9ddce; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.status-chip span { width: .45rem; height: .45rem; background: #338356; border-radius: 50%; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.metric-card { display: flex; align-items: center; gap: .9rem; min-height: 7.5rem; padding: 1.15rem; background: #fff; border: 1px solid var(--eb-line); border-top: 3px solid #758079; border-radius: 8px; box-shadow: 0 5px 18px rgba(32,41,34,.05); }
.metric-card p { margin: 0 0 .2rem; color: #68736c; font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.metric-card strong { display: block; color: #26322b; font-family: Georgia, serif; font-size: 2rem; line-height: 1; }
.metric-icon { display: grid; flex: 0 0 2.8rem; place-items: center; width: 2.8rem; height: 2.8rem; color: #58635c; background: #edf0ed; border-radius: 7px; font-size: 1.25rem; }
.metric-green { border-top-color: #367b55; } .metric-green .metric-icon { color: #246441; background: #e4f0e8; }
.metric-red { border-top-color: #a94b4f; } .metric-red .metric-icon { color: #96383d; background: #f7e7e7; }
.metric-gold { border-top-color: #bb8e32; } .metric-gold .metric-icon { color: #88661f; background: #f6eedc; }
.metric-alert { border-top-color: #c6603e; } .metric-alert .metric-icon { color: #a7462b; background: #f8e9e3; }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.dashboard-panel { min-height: 19rem; padding: 1.25rem; background: #fff; border: 1px solid var(--eb-line); border-radius: 8px; box-shadow: 0 5px 18px rgba(32,41,34,.04); }
.dashboard-panel.panel-wide { grid-column: span 2; }
.dashboard-panel header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #edf0ec; }
.dashboard-panel header > i { color: #718078; font-size: 1.1rem; }
.panel-kicker { margin: 0 0 .2rem; color: #90722e; font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.dashboard-panel h2 { margin: 0; font-family: Georgia, serif; font-size: 1.15rem; }
.chart-placeholder { display: flex; align-items: end; justify-content: space-around; height: 10rem; margin-top: 1rem; padding: 1rem 1rem 0; border-bottom: 1px solid #ccd3cd; }
.chart-placeholder span { width: 7%; height: var(--bar-height); background: #cfdbd2; border-radius: 3px 3px 0 0; }
.chart-placeholder span:nth-child(2n) { background: #e0c98f; }
.empty-label { margin: .6rem 0 0; color: #7b857f; font-size: .78rem; text-align: center; }
.empty-state { display: grid; place-items: center; min-height: 13rem; color: #7c8780; text-align: center; }
.empty-state i { font-size: 2rem; color: #afbab2; }
.empty-state p { margin: .6rem 0 0; font-size: .85rem; }
.empty-state.compact { min-height: 10rem; }
.donut-placeholder { display: grid; place-items: center; width: 9rem; height: 9rem; margin: 2rem auto 0; border: 1rem solid #e3e9e4; border-top-color: #d3b464; border-radius: 50%; }
.donut-placeholder span { display: grid; color: #344139; font-family: Georgia, serif; font-size: 1.8rem; text-align: center; }
.donut-placeholder small { color: #78837c; font-family: "Trebuchet MS", sans-serif; font-size: .68rem; text-transform: uppercase; }
.sidebar-overlay { display: none; }
.master-panel, .filter-panel, .form-panel, .detail-panel { background: #fff; border: 1px solid var(--eb-line); border-radius: 8px; box-shadow: 0 5px 18px rgba(32,41,34,.04); }
.filter-panel { margin-bottom: 1rem; padding: 1rem; }
.form-panel { max-width: 62rem; padding: clamp(1rem, 3vw, 2rem); }
.master-panel .table th { padding: .85rem 1rem; color: #5f6b64; background: #f5f7f4; border-bottom-color: var(--eb-line); font-size: .73rem; text-transform: uppercase; white-space: nowrap; }
.master-panel .table td { padding: .85rem 1rem; border-color: #edf0ed; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; color: #657069; border-top: 1px solid var(--eb-line); font-size: .85rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--eb-line); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr); gap: 1rem; }
.detail-panel { padding: 1.25rem; }
.detail-panel h2 { margin: 0 0 1.25rem; font-family: Georgia, serif; font-size: 1.2rem; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.detail-list div { padding-bottom: .75rem; border-bottom: 1px solid #edf0ed; }
.detail-list .detail-wide { grid-column: 1 / -1; }
.detail-list dt { margin-bottom: .25rem; color: #748078; font-size: .72rem; text-transform: uppercase; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.status-panel { align-self: start; }
.pagination { --bs-pagination-color: var(--eb-green); --bs-pagination-active-bg: var(--eb-green); --bs-pagination-active-border-color: var(--eb-green); }

.terminal-page { min-height: 100vh; margin: 0; color: #17251d; background: radial-gradient(circle at 50% 0, #fff 0, #f3f5ef 50%, #e5ebe3 100%); }
.terminal-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.terminal-brand { display: flex; align-items: center; gap: 1rem; min-height: 6rem; padding: 1rem clamp(1.25rem, 5vw, 4rem); color: #fff; background: #173b2b; border-bottom: 4px solid var(--eb-gold); }
.terminal-mark { display: grid; place-items: center; width: 3.5rem; aspect-ratio: 1; color: var(--eb-gold); border: 2px solid var(--eb-gold); border-radius: 50%; font-family: Georgia, serif; font-size: 1.2rem; font-weight: 700; }
.terminal-brand strong, .terminal-brand span:last-child { display: block; }
.terminal-brand strong { font-family: Georgia, serif; font-size: 1.35rem; }
.terminal-brand span:last-child { margin-top: .15rem; color: rgba(255,255,255,.68); font-size: .82rem; text-transform: uppercase; }
.terminal-stage { width: min(100% - 2rem, 62rem); align-self: center; justify-self: center; padding: clamp(2rem, 5vw, 4rem) 0; text-align: center; }
.terminal-clock { display: block; min-height: 1.5rem; margin-bottom: 2rem; color: #66736b; font-size: 1rem; font-variant-numeric: tabular-nums; }
.terminal-step { margin: 0 0 .5rem; color: #8a6c27; font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.terminal-copy h1, .terminal-success h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(2rem, 6vw, 4rem); }
.terminal-code-form { display: grid; gap: 1rem; width: min(100%, 48rem); margin: 2.5rem auto 0; }
.terminal-code-form input { width: 100%; min-height: 7rem; padding: 1rem; color: #173b2b; background: #fff; border: 3px solid #aebbb2; border-radius: 8px; outline: none; font-family: Georgia, serif; font-size: clamp(2rem, 7vw, 4.5rem); font-weight: 700; letter-spacing: 0; text-align: center; text-transform: uppercase; }
.terminal-code-form input:focus { border-color: var(--eb-green); box-shadow: 0 0 0 5px rgba(33,79,59,.14); }
.terminal-code-form button, .terminal-done { display: flex; align-items: center; justify-content: center; gap: 1rem; min-height: 5rem; padding: 1rem; color: #fff; background: var(--eb-green); border: 0; border-radius: 8px; font-size: 1.25rem; font-weight: 700; text-decoration: none; }
.terminal-alert { display: grid; gap: .3rem; width: min(100%, 48rem); margin: 1.5rem auto 0; padding: 1rem; color: #7e2529; background: #f8e8e8; border: 1px solid #e6bfc1; border-radius: 8px; }
.terminal-alert strong { font-size: 1.15rem; }
.terminal-code { display: inline-block; margin-bottom: .75rem; padding: .4rem .75rem; color: #25533e; background: #e2ece5; border-radius: 6px; font-weight: 700; }
.last-punch { min-height: 1.5rem; margin: 1.5rem 0; color: #657069; }
.punch-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.punch-button { display: grid; place-items: center; align-content: center; gap: .6rem; min-height: clamp(10rem, 27vh, 16rem); color: #fff; border: 0; border-radius: 8px; font-size: clamp(3rem, 9vw, 6rem); font-weight: 700; }
.punch-button i { font-size: .55em; }
.punch-in { background: #246b47; }
.punch-out { background: #9a3035; }
.punch-button:disabled { cursor: wait; filter: grayscale(.65); opacity: .55; }
.terminal-cancel { display: inline-block; margin-top: 1.75rem; padding: .8rem 1.5rem; color: #4f5b54; font-weight: 700; }
.terminal-success { display: grid; justify-items: center; }
.success-check { display: grid; place-items: center; width: 6rem; aspect-ratio: 1; margin-bottom: 1.25rem; color: #fff; background: #28774e; border-radius: 50%; font-size: 3.5rem; }
.success-identity { display: grid; gap: .35rem; margin-top: 1.5rem; }
.success-identity strong { font-family: Georgia, serif; font-size: clamp(1.6rem, 4vw, 2.5rem); }
.success-identity span { color: #59665e; font-weight: 700; }
.success-time { display: grid; width: 100%; container-type: inline-size; gap: .35rem; margin: 2rem 0; font-variant-numeric: tabular-nums; }
.success-time strong { color: #173b2b; font-family: Georgia, serif; font-size: min(7rem, 10cqi); line-height: 1; white-space: nowrap; }
.success-time span { color: #59665e; font-size: 1.1rem; }
.terminal-done { width: min(100%, 24rem); }

@media (max-width: 575.98px) {
    .terminal-brand { min-height: 5rem; }
    .terminal-stage { width: min(100% - 1.25rem, 62rem); padding: 1.5rem 0; }
    .terminal-clock { margin-bottom: 1.25rem; }
    .terminal-code-form input { min-height: 5.5rem; }
    .punch-form { gap: .65rem; }
    .punch-button { min-height: 9rem; }
}

@media (max-width: 1199.98px) {
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .admin-workspace { margin-left: 0; }
    .sidebar-toggle { display: inline-grid; }
    .sidebar-open .admin-sidebar { transform: translateX(0); }
    .sidebar-open { overflow: hidden; }
    .sidebar-open .sidebar-overlay { position: fixed; inset: 0; z-index: 1030; display: block; width: 100%; height: 100%; padding: 0; background: rgba(14,25,19,.56); border: 0; }
}

@media (max-width: 767.98px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-panel.panel-wide { grid-column: auto; }
    .bahrain-clock { display: none; }
    .topbar-divider { display: none; }
    .detail-grid { grid-template-columns: 1fr; }
    .table-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 479.98px) {
    .admin-topbar { min-height: 4.25rem; }
    .topbar-product { display: none; }
    .topbar-end { gap: .5rem; }
    .user-name { max-width: 8rem; font-size: .82rem; }
    .page-heading { align-items: start; }
    .status-chip { margin-top: .25rem; }
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 6.5rem; }
    .page-heading { flex-direction: column; }
    .page-heading > .d-flex { width: 100%; }
    .page-heading > .d-flex .btn { flex: 1; }
    .detail-list { grid-template-columns: 1fr; }
    .detail-list .detail-wide { grid-column: auto; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
}

@media (max-width: 767.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { min-height: 16rem; padding: 2rem; }
    .brand-mark { margin-bottom: 1rem; }
    .auth-brand h1 { font-size: 2.5rem; }
    .brand-copy { display: none; }
    .auth-panel { padding: 2.5rem 1.25rem; }
}

.calculation-section { padding: 1.5rem 0; border-bottom: 1px solid var(--eb-line); min-width: 0; }
.calculation-section .table-responsive { position: relative; }
.calculation-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.calculation-totals span, .calculation-totals strong { display: block; }
.calculation-totals strong { font-size: 1.75rem; font-variant-numeric: tabular-nums; }
.calculation-flags { overflow-wrap: anywhere; color: var(--eb-red); }
.calculation-section summary { cursor: pointer; }
@media (max-width: 575px) { .calculation-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }