/* Phase 2 and 3 screens: stepper, profile, key-value lists, attendance grid, leave, timeline. */
[hidden] { display: none !important; }

.stepper { list-style: none; margin: 0 0 16px; padding: 0; display: flex; gap: 8px; overflow-x: auto; }
.stepper li { flex: 1 0 auto; }
.step-btn { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px;
    border-radius: 14px; border: 1px solid var(--border); background: var(--surface-solid); color: var(--text-muted);
    font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: border-color .2s, color .2s, background .2s; }
.step-btn:hover { border-color: rgba(22, 163, 74, .45); }
.step-btn.is-current { color: var(--brand-700); border-color: var(--brand-500); background: rgba(22, 163, 74, .1); }
.step-btn.is-done .step-num { background: var(--brand-500); color: #fff; }
.step-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px;
    background: var(--border); color: var(--text); flex: none; }
.step-btn.is-current .step-num { background: var(--grad-brand); color: #fff; }
.wizard-nav { align-items: center; gap: 10px; }
.spacer { flex: 1; }
.static-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 0 0 6px; }
.field textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--surface-solid); color: var(--text); font: inherit; font-size: 15px; resize: vertical; }
.field textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(22, 163, 74, .15); }
.field--sm input { min-width: 160px; }
.sub { margin-top: 18px; font-size: 15px; color: var(--brand-700); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.text-danger { color: var(--danger); font-weight: 700; }
.danger-text { color: var(--danger); }
.file-input { padding: 10px; border-radius: 12px; border: 1px dashed var(--border); width: 100%; background: var(--surface-solid); }
.file-pick { cursor: pointer; }
.ok-banner { background: rgba(22, 163, 74, .12); color: var(--brand-700); }
.row-bad td { background: rgba(220, 38, 38, .06); }
.simple-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.simple-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px;
    border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--border); }
.settings-grid { align-items: start; }
.weekdays { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 12px; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 16px; padding: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.profile-head__text { flex: 1; min-width: 200px; }
.profile-head__text h1 { margin: 2px 0 4px; font-size: 24px; }
.avatar--lg { width: 64px; height: 64px; font-size: 20px; flex: none; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 20px; margin: 0; }
.kv dt { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kv dd { margin: 3px 0 0; font-size: 15px; word-break: break-word; }
.kv .link { padding: 0 0 0 8px; font-size: 13px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; }
.timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 18px 4px; }
.timeline li::before { content: ''; position: absolute; left: 10px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--grad-brand); margin-top: 5px; flex: none;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, .15); }
.tl-detail { margin-top: 4px; font-size: 13px; color: var(--text); background: var(--surface-solid);
    border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; display: inline-block; }

/* Attendance grid */
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 4px 0 12px; font-size: 13px; color: var(--text-muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.grid-wrap { max-height: 70vh; }
.grid-table { font-size: 13px; }
.grid-table th, .grid-table td { padding: 6px 4px; text-align: center; min-width: 40px; }
.grid-table .sticky-col { position: sticky; left: 0; z-index: 2; background: var(--surface-solid); text-align: left;
    min-width: 170px; box-shadow: 4px 0 8px -6px rgba(0, 0, 0, .18); }
.grid-table thead .sticky-col { z-index: 3; }
.day-h small { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.cell { display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 5px; border-radius: 7px;
    font-size: 11px; font-weight: 700; }
.c-ok { background: rgba(22, 163, 74, .18); color: #15803D; }
.c-warn { background: rgba(245, 158, 11, .2); color: #B45309; }
.c-bad { background: rgba(220, 38, 38, .14); color: #B91C1C; }
.c-info { background: rgba(14, 165, 233, .16); color: #0369A1; }
.c-hol { background: rgba(124, 58, 237, .15); color: #6D28D9; }
.c-off { background: rgba(100, 116, 139, .14); color: var(--text-muted); }
.c-empty { background: transparent; color: var(--text-muted); }
:root[data-theme="dark"] .c-ok { color: #86EFAC; }
:root[data-theme="dark"] .c-warn { color: #FCD34D; }
:root[data-theme="dark"] .c-bad { color: #FCA5A5; }
:root[data-theme="dark"] .c-info { color: #7DD3FC; }
:root[data-theme="dark"] .c-hol { color: #C4B5FD; }

/* Mobile: step bar and profile */
@media (max-width: 720px) {
    .stepper { gap: 6px; }
    .step-btn { padding: 6px 8px; font-size: 13px; }
    .step-btn span:last-child { display: none; }
    .step-btn.is-current span:last-child { display: inline; }
    .wizard-nav .btn { flex: 1; }
    .spacer { display: none; }
    .grid-table .sticky-col { min-width: 120px; }
    .profile-head { padding: 16px; }
}

/* Phase 4 and 5 additions */
.kpi.is-focus { border-color: rgba(22, 163, 74, .5); box-shadow: 0 12px 30px -14px rgba(22, 163, 74, .5); }
.kpi em + em { display: block; }
.ok-banner { background: rgba(22, 163, 74, .12); }
.profile-head .pill { vertical-align: middle; font-size: 12px; }
.table td .btn--sm { min-height: 36px; }
@media (max-width: 720px) {
    .profile-head .page-actions { width: 100%; }
    .profile-head .page-actions .btn { flex: 1 1 auto; }
}

/* Phase 6 and 7: dashboard charts, reports, ops */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: growY .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 70ms); }
.chart .axis { font-size: 11px; fill: var(--text-muted); }
.chart .val { font-size: 11px; fill: var(--text); font-weight: 700; }
.bar-g { transition: opacity .2s; }
.bar-g:hover .bar { filter: brightness(1.12) drop-shadow(0 6px 10px rgba(22, 163, 74, .35)); }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.donut-wrap { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: center; }
.donut { width: 180px; height: 180px; }
.donut .seg { transition: stroke-width .2s; animation: donutIn 1s ease both; }
.donut .seg:hover { stroke-width: 30; }
.donut-n { font-size: 26px; font-weight: 800; fill: var(--text); }
.donut-l { font-size: 11px; fill: var(--text-muted); }
@keyframes donutIn { from { opacity: 0; } to { opacity: 1; } }
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.legend-list li { display: flex; align-items: center; gap: 8px; }
.legend-list i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hbar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.hbar-track { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; transform-origin: left; animation: growX .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.dash-charts > .card { min-width: 0; }
.reports { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.rp-list { max-height: 78vh; overflow: auto; }
.rp-table th { padding: 0; }
.th-sort { background: none; border: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; padding: 12px 14px; width: 100%; text-align: left; }
.th-sort:hover { color: var(--brand-700); }
.rp-table td { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
    .reports { grid-template-columns: 1fr; }
    .rp-list { max-height: none; }
    .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
}
@media print {
    .sidebar, .topbar, .bottom-nav, .toolbar, .inline-form, .rp-list, .crumbs, .tabs, .page-actions, .icon-btn, .btn { display: none !important; }
    .main, .view { padding: 0 !important; }
    .rp-table td, .rp-table th { white-space: normal; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    .chart .bar, .hbar-fill, .donut .seg { animation: none !important; }
}

/* 4.0.1 layout fixes: hint text no longer overlaps inputs; static labels are not absolutely positioned;
   modals scroll inside the viewport on laptops and phones. */
.field__hint, .field small.hint {
    display: block;
    position: static;
    margin: 4px 4px 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted);
}
.field > label.static-label {
    position: static;
    display: block;
    margin: 0 0 6px;
    pointer-events: auto;
    font-size: 12px;
}
.field input[type="file"], .file-input {
    min-height: 0;
    padding: 10px;
    font-size: 14px;
}
.modal {
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal header, .modal footer { flex: none; }
.modal footer { flex-wrap: wrap; }
.modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 4px 4px 0;
    overscroll-behavior: contain;
}
.login__card { max-height: calc(100vh - 32px); overflow-y: auto; }

/* 4.0.3: no link underlines, smaller Reports sidebar text, highlighted employee codes */
a, a:hover, a:focus, a:visited, button, .btn, .link, .link:hover, .nav__item, .brand, .tab, .role-item, .th-sort, .emp-code {
    text-decoration: none !important;
}
.rp-list { padding: 10px 8px; }
.rp-list .nav__title { font-size: 10px; margin: 12px 8px 4px; }
.rp-list .role-item { padding: 7px 10px; }
.rp-list .role-item strong { font-size: 12.5px; font-weight: 600; line-height: 1.35; display: block; }

.emp-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--brand-700);
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.16), rgba(163, 230, 53, 0.22));
    border: 1px solid rgba(22, 163, 74, 0.45);
    box-shadow: 0 4px 12px -8px rgba(22, 163, 74, 0.8);
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}
.emp-code:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -8px rgba(22, 163, 74, 0.9);
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.26), rgba(163, 230, 53, 0.32));
}
.emp-code::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}
.emp-code--static { font-size: 12px; padding: 3px 10px; }
:root[data-theme="dark"] .emp-code { color: #86EFAC; }
