/* ==========================================================
   HLT Attendance — Design System
   Palette: deep "night-shift" navy + amber (clock/time accent)
   Type: Manrope (headings) + IBM Plex Sans (body/data — good
         tabular figures, since this app is table-heavy)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
    --bg:            #F5F6FA;
    --surface:       #FFFFFF;
    --sidebar:       #101B32;
    --sidebar-hover: #182645;
    --sidebar-text:  #AEB8CE;
    --sidebar-text-active: #FFFFFF;
    --accent:        #E8A33D;
    --accent-strong: #C97F1E;
    --accent-soft:   rgba(232, 163, 61, 0.14);
    --text:          #1B2333;
    --text-muted:    #6B7280;
    --border:        #E4E7EE;
    --success:       #1E8E5A;
    --success-soft:  rgba(30, 142, 90, 0.12);
    --danger:        #D6455B;
    --danger-soft:   rgba(214, 69, 91, 0.10);
    --warning:       #C97F1E;
    --warning-soft:  rgba(232, 163, 61, 0.16);
    --radius:        10px;
    --sidebar-w:     240px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Sans', -apple-system, Segoe UI, sans-serif;
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 0;
}

a { color: inherit; }

/* ---------------- App shell / sidebar ---------------- */

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

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand img { display: block; }
.sidebar-brand .brand-icon { width: 38px; height: auto; flex-shrink: 0; }

.sidebar-brand .wordmark {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: #fff;
    letter-spacing: -0.01em;
}

.sidebar-brand .wordmark span {
    display: block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 0.68rem;
    color: var(--sidebar-text);
    letter-spacing: 0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--sidebar-text);
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a svg { flex-shrink: 0; opacity: 0.85; }

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav a.active {
    background: var(--accent-soft);
    color: var(--sidebar-text-active);
    border-left-color: var(--accent);
}

.sidebar-nav a.active svg { opacity: 1; }

.sidebar-foot {
    padding: 16px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.85rem;
}

.sidebar-foot .who {
    color: #fff;
    font-weight: 600;
    margin-bottom: 2px;
}

.role-chip {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 8px;
}

.sidebar-foot a.logout {
    color: var(--sidebar-text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sidebar-foot a.logout:hover { color: #fff; }

/* ---------------- Main content ---------------- */

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 32px 40px 60px;
    max-width: 1180px;
}

.page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header h1 { font-size: 1.5rem; }

/* ---------------- Buttons ---------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--sidebar); color: #fff; }
.btn-primary:hover { background: #1a2942; }

.btn-accent { background: var(--accent); color: #1B2333; }
.btn-accent:hover { background: var(--accent-strong); color: #fff; }

.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--sidebar); }

.btn-danger-ghost { background: var(--danger-soft); color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 5px 11px; font-size: 0.8rem; }

/* ---------------- Cards / messages ---------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
}

.msg-banner {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid transparent;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-weight: 500;
    font-size: 0.88rem;
}

/* ---------------- Ledger-style table ---------------- */

.ledger {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.ledger th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: #FAFBFD;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.ledger td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}

.ledger tbody tr:last-child td { border-bottom: none; }
.ledger tbody tr:hover { background: #FAFBFD; }

/* status dot + pill */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.dot-present, .dot-active, .dot-met { background: var(--success); }
.dot-absent, .dot-inactive { background: var(--danger); }
.dot-late, .dot-half_day { background: var(--warning); }
.dot-leave { background: var(--text-muted); }
.dot-admin { background: var(--accent); }
.dot-staff { background: var(--text-muted); }

.pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-met { color: var(--success); font-weight: 600; }
.badge-short { color: var(--danger); font-weight: 600; }

/* ---------------- Forms ---------------- */

.form-card { max-width: 480px; }

.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.field .hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

.field input, .field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus, .field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.form-actions a { color: var(--text-muted); text-decoration: none; font-size: 0.88rem; }
.form-actions a:hover { color: var(--text); }

/* ---------------- Access denied ---------------- */

.denied {
    max-width: 420px;
    margin: 10vh auto;
    text-align: center;
}
.denied .code { font-family: 'Manrope', sans-serif; font-size: 3rem; font-weight: 800; color: var(--danger); }

/* ==========================================================
   Login page
   ========================================================== */

.login-shell {
    min-height: 100vh;
    display: flex;
    background: var(--surface);
}

.login-art {
    flex: 1.1;
    background: radial-gradient(circle at 30% 20%, #1a2942 0%, var(--sidebar) 55%, #0a1226 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 40px;
}

.clock-wrap {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 1.5px solid rgba(232,163,61,0.35);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    animation: clock-appear 0.9s ease-out;
}

.clock-wrap::before,
.clock-wrap::after {
    content: '';
    position: absolute;
    inset: -34px;
    border-radius: 50%;
    border: 1px solid rgba(232,163,61,0.14);
}
.clock-wrap::after { inset: -68px; border-color: rgba(232,163,61,0.07); }

.clock-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    background: var(--accent);
    border-radius: 4px;
}
.hand-hour  { width: 4px; height: 55px; transform: translateX(-50%) rotate(210deg); animation: sweep-hour 12s linear infinite; }
.hand-min   { width: 3px; height: 82px; transform: translateX(-50%) rotate(45deg); animation: sweep-min 12s linear infinite; }
.clock-center { position: absolute; width: 9px; height: 9px; background: var(--accent); border-radius: 50%; }

@keyframes clock-appear {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes sweep-hour { from { transform: translateX(-50%) rotate(210deg); } to { transform: translateX(-50%) rotate(570deg); } }
@keyframes sweep-min  { from { transform: translateX(-50%) rotate(45deg); }  to { transform: translateX(-50%) rotate(405deg); } }

.login-art h2 {
    font-size: 1.5rem;
    color: #fff;
    text-align: center;
    animation: rise-in 0.7s ease-out 0.15s both;
}
.login-art p {
    color: var(--sidebar-text);
    text-align: center;
    max-width: 280px;
    margin-top: 8px;
    font-size: 0.92rem;
    animation: rise-in 0.7s ease-out 0.28s both;
}

.login-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-box { width: 100%; max-width: 340px; }

.login-box .brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    animation: rise-in 0.6s ease-out both;
}
.login-box .brand-row .wordmark { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.1rem; }
.login-logo { width: 190px; height: auto; display: block; }

.login-box h1 {
    font-size: 1.35rem;
    margin-bottom: 6px;
    animation: rise-in 0.6s ease-out 0.08s both;
}
.login-box .sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 26px;
    animation: rise-in 0.6s ease-out 0.14s both;
}

.login-box form .field:nth-of-type(1) { animation: rise-in 0.6s ease-out 0.20s both; }
.login-box form .field:nth-of-type(2) { animation: rise-in 0.6s ease-out 0.26s both; }
.login-box form button { animation: rise-in 0.6s ease-out 0.32s both; }

@keyframes rise-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-box button.btn-accent {
    width: 100%;
    justify-content: center;
    padding: 11px 16px;
    font-size: 0.95rem;
}

.login-error {
    background: var(--danger-soft);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.86rem;
    margin-bottom: 18px;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

.login-demo-hint {
    margin-top: 22px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

@media (max-width: 900px) {
    .login-art { display: none; }
}

@media (max-width: 860px) {
    .sidebar { position: static; height: auto; width: 100%; flex-direction: row; align-items: center; }
    .sidebar-brand { border-bottom: none; padding: 14px 16px; }
    .sidebar-nav { flex-direction: row; padding: 8px; overflow-x: auto; }
    .sidebar-nav a.active { border-left: none; border-bottom: 3px solid var(--accent); }
    .sidebar-foot { display: none; }
    .app-shell { flex-direction: column; }
    .main { margin-left: 0; padding: 24px 20px 40px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------------- Attendance: time chips, form rows ---------------- */

.table-wrap { 
    /* overflow-x: auto;  */
    border-radius: var(--radius); 
}
.ledger td.nowrap { white-space: nowrap; }

.chip {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}
.chip-next { background: rgba(135, 94, 176, 0.14); color: #6b4a93; }
.chip-live { background: var(--success-soft); color: var(--success); margin-left: 0; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.duration-note {
    font-size: 0.84rem;
    color: var(--text-muted);
    background: var(--bg);
    border-radius: 8px;
    padding: 8px 12px;
    margin: -4px 0 12px;
}
.duration-note strong { color: var(--text); }

/* ---------------- 12-hour time dropdowns ---------------- */
.time12 { display: flex; align-items: center; gap: 6px; }
.time12 select { width: auto; min-width: 72px; }
.time12 .colon { color: var(--text-muted); font-weight: 600; }

/* ---------------- Monthly report ---------------- */
.report-note { color: var(--text-muted); font-size: 0.86rem; margin: 0 0 16px; max-width: 760px; }
.report-note strong { color: var(--text); font-weight: 600; }

.ledger .num, .ledger th.num { text-align: right; }
.ledger .sub { display: block; font-size: 0.74rem; color: var(--text-muted); font-weight: 400; }
.ledger .days { color: var(--accent-strong); font-size: 1.02rem; }
.ledger tfoot td {
    background: #FAFBFD; border-top: 2px solid var(--border);
    font-weight: 600; font-variant-numeric: tabular-nums;
}

/* ---------------- Inline action forms / destructive button ---------------- */
.inline-form { display: inline; margin: 0; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b93549; }

/* ==========================================================
   Attendance form (add / edit)
   ========================================================== */
.back-link { display: inline-block; font-size: 0.82rem; color: var(--text-muted); text-decoration: none; margin-bottom: 6px; }
.back-link:hover { color: var(--text); }
.req { color: var(--danger); }
.opt-text { color: var(--text-muted); font-weight: 400; }

.card.af { max-width: 760px; padding: 0; overflow: visible; }
.af-body { padding: 6px 28px 4px; }
.af-section { padding: 22px 0; border-top: 1px solid var(--border); }
.af-section:first-child { border-top: none; }
.af-title {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px;
}
.af-field { margin-bottom: 16px; }
.af-field:last-child { margin-bottom: 0; }
.af-label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; }
.af-input {
    width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px;
    font: inherit; font-size: 0.92rem; background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.af-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.af-date { max-width: 280px; }
.af-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; line-height: 1.45; }
.af-foot {
    display: flex; align-items: center; gap: 10px; padding: 16px 28px;
    border-top: 1px solid var(--border); background: #FAFBFD; border-radius: 0 0 var(--radius) var(--radius);
}

/* ---- Status chips ---- */
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; --c: var(--text-muted); --c-soft: rgba(107, 114, 128, 0.12); }
.opt-present  { --c: var(--success); --c-soft: var(--success-soft); }
.opt-late     { --c: var(--warning); --c-soft: var(--warning-soft); }
.opt-half_day { --c: var(--warning); --c-soft: var(--warning-soft); }
.opt-absent   { --c: var(--danger);  --c-soft: var(--danger-soft); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt label {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
    border: 1px solid var(--border); border-radius: 999px; background: #fff;
    font-size: 0.88rem; font-weight: 500; cursor: pointer; user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.opt label .dot { margin: 0; background: var(--c); }
.opt label:hover { border-color: var(--c); }
.opt input:checked + label { border-color: var(--c); background: var(--c-soft); font-weight: 600; box-shadow: 0 0 0 1px var(--c) inset; }
.opt input:focus-visible + label { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }

/* ---- Time pickers ---- */
.tp-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tp { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px 12px; background: #FAFBFD; min-width: 0; }
.tp-title { display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; font-weight: 600; margin-bottom: 10px; }
.tp-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.tp-sel {
    width: 66px; padding: 10px 8px; border: 1px solid var(--border); border-radius: 8px;
    font: inherit; font-size: 0.95rem; font-weight: 600; background: #fff; font-variant-numeric: tabular-nums;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tp-sel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tp-colon { color: var(--text-muted); font-weight: 700; }
.tp-sub { margin-top: 10px; font-size: 0.76rem; color: var(--text-muted); }
.link-btn { background: none; border: none; padding: 0; font: inherit; font-size: 0.78rem; font-weight: 500; color: var(--accent-strong); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* AM / PM segmented toggle */
.seg { position: relative; display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; margin-left: 2px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 10px 13px; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); cursor: pointer; user-select: none; transition: background 0.15s ease, color 0.15s ease; }
.seg label:hover { color: var(--text); }
.seg input:checked + label { background: var(--sidebar); color: #fff; }
.seg input:focus-visible + label { box-shadow: 0 0 0 3px var(--accent-soft) inset; }

/* Live shift summary */
.shift-summary {
    margin-top: 16px; padding: 13px 16px; border-radius: 10px;
    background: var(--bg); border-left: 3px solid var(--accent);
}
.sum-range { font-size: 0.92rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.sum-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sum-chips:empty { display: none; }
.sum-chip { font-size: 0.74rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--border); }
.sum-dur  { background: var(--sidebar); color: #fff; border-color: var(--sidebar); }
.sum-next { background: rgba(135, 94, 176, 0.14); color: #6b4a93; border-color: transparent; }
.sum-live, .sum-good { background: var(--success-soft); color: var(--success); border-color: transparent; }
.sum-warn { background: var(--warning-soft); color: var(--accent-strong); border-color: transparent; }
.sum-bad  { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ---- Searchable employee dropdown ---- */
.combo { position: relative; }
.combo-input {
    padding-right: 40px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.combo-input.has-error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.combo-list {
    position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
    max-height: 272px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 14px 34px rgba(16, 27, 50, 0.16);
}
.combo-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.combo-item.is-active { background: var(--accent-soft); }
.combo-item[aria-selected="true"] .combo-name { color: var(--accent-strong); }
.combo-avatar {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--sidebar); color: #fff;
    display: grid; place-items: center; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
}
.combo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.combo-name { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-meta { font-size: 0.76rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-hrs { font-size: 0.74rem; color: var(--text-muted); white-space: nowrap; }
.combo-empty { padding: 14px 12px; text-align: center; font-size: 0.85rem; color: var(--text-muted); }
.combo-error { margin-top: 7px; font-size: 0.8rem; color: var(--danger); }

@media (max-width: 640px) {
    .af-body, .af-foot { padding-left: 18px; padding-right: 18px; }
    .tp-wrap { grid-template-columns: 1fr; }
    .af-date { max-width: none; }
}

/* ---- Error page (save failures) ---- */
.error-card { max-width: 560px; border-left: 4px solid var(--danger); }
.error-card h2 { font-size: 1.1rem; margin-bottom: 8px; }
.error-card p { margin: 0 0 18px; color: var(--text-muted); }
.error-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------------- Report filters ---------------- */
.card.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; padding: 14px 18px; margin-bottom: 16px; }
.filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.filter-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-right: 2px; }
.filter-to { font-size: 0.85rem; color: var(--text-muted); }
.filter-divider { width: 1px; align-self: stretch; background: var(--border); }
.filters select, .filters input[type="date"] {
    padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
    font: inherit; font-size: 0.88rem; background: #fff;
}
.filters select:focus, .filters input[type="date"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.quick { display: flex; gap: 6px; margin-left: auto; }
.quick-link {
    font-size: 0.8rem; font-weight: 600; text-decoration: none; padding: 6px 12px; border-radius: 999px;
    color: var(--text-muted); background: var(--bg); transition: background 0.15s ease, color 0.15s ease;
}
.quick-link:hover { color: var(--text); }
.quick-link.is-on { background: var(--sidebar); color: #fff; }

.range-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 6px; }
.range-pill {
    font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 1.05rem;
    padding: 4px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--text);
}
.range-meta { font-size: 0.84rem; color: var(--text-muted); }

@media (max-width: 860px) {
    .filter-divider { display: none; }
    .quick { margin-left: 0; }
}

@media (max-width: 640px) {
    .filter-label { flex-basis: 100%; }   /* label on its own line so ‹ month year › stay on one row */
}

/* ---------------- Report: regular / extra / total column groups ---------------- */
.report-table th.grp { text-align: center; letter-spacing: 0.08em; }
.report-table th.grp-extra { color: var(--accent-strong); background: rgba(232, 163, 61, 0.09); }
.report-table th.grp-reg   { color: var(--text); }
.report-table .grp-start   { border-left: 1px solid var(--border); }
.report-table .sub-head th { padding-top: 8px; padding-bottom: 8px; }
.report-table td.extra     { color: var(--accent-strong); }
.report-table .muted       { color: var(--text-muted); font-weight: 400; }
.report-table .days-reg    { font-size: 1.02rem; }
.report-table .days-extra  { font-size: 1.02rem; color: var(--accent-strong); }
.report-table .days        { font-size: 1.02rem; color: var(--text); }
.report-table tfoot td.extra { color: var(--accent-strong); }

/* ==========================================================
   Holidays / Sunday work
   ========================================================== */
.main.wide { max-width: none; }

.chip-sun { background: rgba(135, 94, 176, 0.14); color: #6b4a93; }
.chip-hol { background: rgba(0, 103, 138, 0.12); color: #00678A; }

/* report: purple = Sunday work, teal = government holiday work (the two colours from the logo) */
.report-table th, .report-table td { padding-left: 10px; padding-right: 10px; }
.report-table th.grp-sun { color: #6b4a93; background: rgba(135, 94, 176, 0.10); }
.report-table th.grp-hol { color: #00678A; background: rgba(0, 103, 138, 0.09); }
.report-table td.c-extra { color: var(--accent-strong); }
.report-table td.c-sun   { color: #6b4a93; }
.report-table td.c-hol   { color: #00678A; }
.report-table .days-sun, .report-table .days-hol, .report-table .days-total { font-size: 1.02rem; }
.report-table .days-total { color: var(--text); }
.report-table tfoot td.c-sun { color: #6b4a93; }
.report-table tfoot td.c-hol { color: #00678A; }

.period-days { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.hday { font-size: 0.8rem; font-weight: 600; padding: 4px 11px; border-radius: 999px; }
.hday-hol { background: rgba(0, 103, 138, 0.11); color: #00678A; }
.hday-sun { background: rgba(135, 94, 176, 0.13); color: #6b4a93; }

/* attendance form: note under the shift date */
.day-note { margin-top: 10px; padding: 9px 13px; border-radius: 8px; font-size: 0.83rem; font-weight: 500; line-height: 1.4; }
.day-note.is-hol { background: rgba(0, 103, 138, 0.10); color: #00678A; }
.day-note.is-sun { background: rgba(135, 94, 176, 0.12); color: #6b4a93; }

/* keep durations like "16 h 00 m" and names on one line; the table scrolls inside its box if it gets wide */
.report-table td { white-space: nowrap; }
.report-table td .sub { white-space: nowrap; }

/* ==========================================================
   Employee form sections + profile page
   ========================================================== */
.muted { color: var(--text-muted); font-weight: 400; }
.card.af.af-wide { max-width: 880px; }
.af-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.af-grid .af-field { margin-bottom: 0; }
.af-grid .af-field.full { grid-column: 1 / -1; }
.optional-tag {
    margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--bg);
    font-size: 0.66rem; letter-spacing: 0.04em; font-weight: 600; color: var(--text-muted); text-transform: uppercase;
}
.error-list { margin: 0 0 18px; padding-left: 20px; color: var(--text); line-height: 1.7; }
.name-link { color: inherit; font-weight: 600; text-decoration: none; }
.name-link:hover { color: var(--accent-strong); text-decoration: underline; }

.profile-head { display: flex; align-items: center; gap: 16px; margin: 6px 0 22px; flex-wrap: wrap; }
.profile-avatar {
    width: 56px; height: 56px; border-radius: 50%; background: var(--sidebar); color: #fff; flex-shrink: 0;
    display: grid; place-items: center; font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.1rem; letter-spacing: 0.02em;
}
.profile-id { flex: 1; min-width: 200px; }
.profile-id h1 { font-size: 1.5rem; }
.profile-sub { color: var(--text-muted); font-size: 0.9rem; margin-top: 2px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 980px; }
.info-card { padding: 20px 22px; }
.info-card.info-wide { grid-column: 1 / -1; }
.info-card h2 {
    font-family: 'IBM Plex Sans', sans-serif; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px;
}
.info-card dl { margin: 0; }
.info-row { display: flex; gap: 14px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 0.9rem; }
.info-row:first-child { border-top: none; padding-top: 0; }
.info-row dt { flex: 0 0 140px; color: var(--text-muted); }
.info-row dd { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.info-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.info-cols .info-row:nth-child(2) { border-top: none; padding-top: 0; }
.empty-note { margin: 0; color: var(--text-muted); font-size: 0.88rem; }
.empty-note a { color: var(--accent-strong); font-weight: 600; }
.secret { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

@media (max-width: 760px) {
    .af-grid, .info-grid, .info-cols { grid-template-columns: 1fr; }
    .info-cols .info-row:nth-child(2) { border-top: 1px solid var(--border); padding-top: 9px; }
    .info-row dt { flex-basis: 110px; }
}

/* ---------------- Amount input with currency prefix / period suffix ---------------- */
.affix-wrap { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 8px; background: #fff; overflow: hidden; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.affix-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.affix-wrap .af-input { flex: 1; min-width: 0; border: none; border-radius: 0; box-shadow: none; }
.affix-wrap .af-input:focus { box-shadow: none; }
.affix { display: flex; align-items: center; padding: 0 13px; background: var(--bg); color: var(--text-muted); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.affix-end:empty { display: none; }

/* ==========================================================
   Breaks (attendance form)
   ========================================================== */
.brk-block { margin-top: 18px; }
.brk-block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.brk-block-title { font-size: 0.82rem; font-weight: 600; }
.brk-block-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.brk-list { display: flex; flex-direction: column; gap: 10px; counter-reset: brk; }
.brk-row { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px 14px; background: #FAFBFD; counter-increment: brk; }
.brk-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.brk-title::before { content: "Break " counter(brk); font-size: 0.8rem; font-weight: 700; }
.brk-remove { color: var(--danger); }
.brk-times { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.brk-time { min-width: 0; }
.brk-label { font-size: 0.76rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.brk-empty { font-size: 0.84rem; color: var(--text-muted); padding: 2px 0 4px; }
.sum-break { background: rgba(0, 103, 138, 0.10); color: #00678A; border-color: transparent; }
@media (max-width: 640px) {
    .brk-times { grid-template-columns: 1fr; }
    .brk-block-head { flex-direction: column; }
}

/* ---------------- Report: break + salary columns ---------------- */
.report-table th.grp-break { color: var(--text-muted); background: rgba(107, 114, 128, 0.07); }
.report-table td.c-break   { color: var(--text-muted); }
.report-table th.grp-pay   { color: var(--success); background: var(--success-soft); }
.report-table .pay         { color: var(--success); font-size: 1.02rem; }

/* a wide table must scroll inside its own box, not stretch the whole page (flex children default to min-width:auto) */
.main { min-width: 0; }
