/* =====================================================================
   Crew HR — design system (light mode)
   Calm, simple SaaS styling. Navy + blue accents match the payslip.
   ===================================================================== */
:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e4e8ef;
    --border-strong: #d3d9e3;
    --text: #172b4d;
    --text-2: #475467;
    --muted: #7a8699;
    --navy: #152a4d;
    --primary: #2553c7;
    --primary-hover: #1d45ab;
    --primary-soft: #eef3fd;
    --green: #12805c;   --green-soft: #e8f6f0;
    --red: #c0362c;     --red-soft: #fdeeed;
    --amber: #a15c07;   --amber-soft: #fdf3e2;
    --blue: #2553c7;    --blue-soft: #eaf0fd;
    --teal: #0f7c79;    --teal-soft: #e5f5f4;
    --purple: #6a3fc8;  --purple-soft: #f1ecfc;
    --orange: #c2410c;  --orange-soft: #fdefe7;
    --gray: #5b6576;    --gray-soft: #eef1f5;
    /* chart series (validated: blue, orange, aqua, yellow) */
    --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
    --sidebar: 248px;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; color: var(--text); font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.strong { font-weight: 600; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-sm { width: 15px; height: 15px; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface);
    border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 40;
    transition: transform .2s ease, width .2s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 8px 18px; height: 64px; border-bottom: 1px solid var(--border); text-decoration: none; }
.sidebar-brand .brand-logo { height: 48px; width: auto; }
.sidebar-brand .brand-icon { display: none; width: 36px; height: 36px; }
body.sidebar-collapsed .sidebar-brand .brand-logo { display: none; }
body.sidebar-collapsed .sidebar-brand .brand-icon { display: block; }
.sidebar-brand .brand-text { line-height: 1.15; border-left: 1px solid var(--border); padding-left: 10px; }
.sidebar-brand strong { display: block; font-size: 14px; color: var(--navy); letter-spacing: .02em; }
.sidebar-brand span { font-size: 11.5px; color: var(--muted); }
.nav { padding: 10px 10px 20px; overflow-y: auto; flex: 1; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 6px; font-weight: 600; }
.nav a {
    display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm);
    color: var(--text-2); font-weight: 500; margin-bottom: 1px; white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav a .icon { color: inherit; opacity: .9; }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; transition: margin-left .2s ease; }

.topbar {
    position: sticky; top: 0; z-index: 30; height: 64px; background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(6px); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px; padding: 0 24px;
}
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search input { padding-left: 36px; background: var(--surface-2); }
.topbar .search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
    border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.user-btn:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 650; font-size: 12.5px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 72px; height: 72px; font-size: 22px; }
.user-meta { text-align: left; line-height: 1.2; }
.user-meta strong { display: block; font-size: 13px; }
.user-meta span { font-size: 11.5px; color: var(--muted); }

.content { padding: 24px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.breadcrumb a { color: var(--muted); }

body.sidebar-collapsed .sidebar { width: 72px; }
body.sidebar-collapsed .main { margin-left: 72px; }
body.sidebar-collapsed .nav a span, body.sidebar-collapsed .nav-section, body.sidebar-collapsed .brand-text { display: none; }
body.sidebar-collapsed .nav a { justify-content: center; }
.backdrop { display: none; }

/* ---------- Cards & grid ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.card-body { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }

.stat { padding: 16px 18px; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-icon { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.stat-icon .icon { width: 16px; height: 16px; }
.tone-blue { background: var(--blue-soft); color: var(--blue); }
.tone-green { background: var(--green-soft); color: var(--green); }
.tone-red { background: var(--red-soft); color: var(--red); }
.tone-amber { background: var(--amber-soft); color: var(--amber); }
.tone-purple { background: var(--purple-soft); color: var(--purple); }
.tone-teal { background: var(--teal-soft); color: var(--teal); }
.tone-gray { background: var(--gray-soft); color: var(--gray); }

.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border); }
.mini-stats > div { padding: 12px 16px; border-right: 1px solid var(--border); }
.mini-stats > div:last-child { border-right: 0; }
.mini-stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 12px; color: var(--muted); }

.dl { display: grid; grid-template-columns: 170px 1fr; gap: 9px 16px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px;
    border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    font: 500 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(37, 83, 199, .25); outline-offset: 1px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--surface); border-color: #f0c5c1; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #0e6b4d; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12.5px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.active { background: var(--primary-soft); color: var(--primary); border-color: #c8d6f6; position: relative; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; }
.inline-form { display: inline; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 550; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.label-hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=month], input[type=time],
input[type=search], input[type=tel], input[type=url], input[type=file], input:not([type]), select, textarea {
    width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font: 14px var(--font); transition: border-color .12s, box-shadow .12s;
}
input[type=file] { padding: 7px 10px; height: auto; }
textarea { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8699' stroke-width='2.2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 83, 199, .12); outline: none; }
input[readonly], input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
.is-invalid { border-color: var(--red) !important; }
.field-error { color: var(--red); font-size: 12.5px; margin-top: 5px; }
.help { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.field { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; margin: 0; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.form-section { padding: 20px 20px 4px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: 0; }
.form-section-title { font-size: 14px; font-weight: 650; margin-bottom: 4px; }
.form-section-desc { color: var(--muted); font-size: 12.5px; margin-bottom: 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.input-group { position: relative; }
.input-group .addon { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.input-prefix input { padding-left: 38px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.filters .f { min-width: 150px; }
.filters .f-grow { flex: 1; min-width: 200px; }
.filters label { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th.num { text-align: right; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfd; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border); padding: 11px 14px; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn, .table .actions form + .btn, .table .actions .btn + form { margin-left: 4px; }
.table-compact td { padding: 8px 12px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.person .name { font-weight: 600; color: var(--text); display: block; }
.person .sub { font-size: 12px; color: var(--muted); }
.check-col { width: 36px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-teal { background: var(--teal-soft); color: var(--teal); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-gray { background: var(--gray-soft); color: var(--gray); }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 16px; font-size: 13.5px; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--green-soft); border-color: #bfe5d5; color: #0b5c42; }
.alert-error { background: var(--red-soft); border-color: #f3cbc7; color: #8f2a22; }
.alert-warning { background: var(--amber-soft); border-color: #f2d9ad; color: #7a4506; }
.alert-info { background: var(--blue-soft); border-color: #cbd8f6; color: #1d3f94; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert .close { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .6; font-size: 18px; line-height: 1; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 18px; overflow-x: auto; }
.tabs a { padding: 12px 12px; color: var(--text-2); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 48px 20px; }
.empty .empty-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.empty .empty-icon .icon { width: 24px; height: 24px; }
.empty h3 { font-size: 15px; margin-bottom: 4px; }
.empty p { color: var(--muted); max-width: 420px; margin: 0 auto 16px; }

/* ---------- Dropdown & dialog ---------- */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-menu .divider { height: 1px; background: var(--border); margin: 5px 0; }
.dropdown-head { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.notif-item { padding: 9px 10px; border-radius: 6px; display: block; color: var(--text); }
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-item small { display: block; color: var(--muted); }

dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 4px; }
.pagination a, .pagination span.cur { min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid var(--border); color: var(--text-2); }
.pagination span.cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination a:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- Workflow stepper (payroll) ---------- */
.steps { display: flex; gap: 0; padding: 16px 18px; overflow-x: auto; }
.step { flex: 1; min-width: 110px; position: relative; text-align: center; font-size: 12px; color: var(--muted); font-weight: 550; }
.step::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.step:first-child::before { display: none; }
.step .bubble { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 2px solid var(--border-strong); color: var(--muted); font-size: 12px; font-weight: 700; }
.step.done .bubble { background: var(--green); border-color: var(--green); color: #fff; }
.step.done::before, .step.current::before { background: var(--green); }
.step.current .bubble { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.step.done, .step.current { color: var(--text); }

/* ---------- Attendance grid ---------- */
.att-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.att-legend span { display: inline-flex; align-items: center; gap: 6px; }
.att-wrap { overflow: auto; max-height: calc(100vh - 290px); min-height: 280px; }
table.att { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.att th, .att td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; padding: 0; }
.att thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; font-weight: 600; color: var(--text-2); padding: 6px 0; min-width: 38px; }
.att thead th small { display: block; font-weight: 500; color: var(--muted); font-size: 10.5px; }
.att th.emp, .att td.emp { position: sticky; left: 0; background: var(--surface); z-index: 1; text-align: left; padding: 7px 12px; min-width: 210px; max-width: 240px; }
.att thead th.emp { z-index: 3; background: var(--surface-2); }
.att td.emp .name { font-weight: 600; font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att td.emp .sub { color: var(--muted); font-size: 11.5px; }
.att th.wk, .att td.wk { background: #f6f7fa; }
.att th.today { color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); }
.att td.sum { padding: 0 8px; font-weight: 600; color: var(--text-2); background: var(--surface-2); }
.cell { width: 38px; height: 36px; border: 0; background: transparent; cursor: pointer; font: 600 11px var(--font); color: var(--muted); padding: 0; display: block; }
.cell:hover { background: var(--primary-soft); }
.cell:disabled { cursor: not-allowed; }
.cell.na { background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 4px, #f2f4f7 4px, #f2f4f7 8px); cursor: default; }
.code { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 4px; border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; }
.code-green { background: var(--green-soft); color: var(--green); }
.code-red { background: var(--red-soft); color: var(--red); }
.code-blue { background: var(--blue-soft); color: var(--blue); }
.code-orange { background: var(--orange-soft); color: var(--orange); }
.code-amber { background: var(--amber-soft); color: var(--amber); }
.code-teal { background: var(--teal-soft); color: var(--teal); }
.code-purple { background: var(--purple-soft); color: var(--purple); }
.code-gray { background: var(--gray-soft); color: var(--gray); }
.code .part { font-size: 9px; }
.att-pop { position: absolute; z-index: 80; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px; width: 280px; }
.att-pop h4 { font-size: 13px; margin-bottom: 2px; }
.att-pop .muted { font-size: 12px; margin-bottom: 10px; }
.att-pop .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.att-pop .opts button { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); cursor: pointer; font: 12px var(--font); color: var(--text); text-align: left; }
.att-pop .opts button:hover, .att-pop .opts button.sel { border-color: var(--primary); background: var(--primary-soft); }
.att-pop .row { display: flex; gap: 6px; margin-top: 8px; }

/* ---------- Charts ---------- */
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 220px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); padding: 0 18px 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li { margin-bottom: 12px; }
.bar-list .bl-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.bar-list .bl-track { height: 8px; background: var(--gray-soft); border-radius: 4px; overflow: hidden; }
.bar-list .bl-fill { height: 100%; background: var(--series-1); border-radius: 4px; }

/* ---------- Progress ---------- */
.progress { height: 10px; background: var(--gray-soft); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: 6px; transition: width .3s ease; }

/* ---------- Activity ---------- */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.activity li:last-child { border-bottom: 0; }
.activity .dotc { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 7px; flex: none; }
.activity p { margin: 0; font-size: 13px; }
.activity small { color: var(--muted); }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth-side { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .05); }
.auth-side { background: radial-gradient(120% 90% at 0% 0%, #1f3a66 0%, var(--navy) 55%, #0e1d38 100%); }
.auth-side::before { content: ""; position: absolute; left: -90px; top: 38%; width: 240px; height: 240px; border-radius: 50%; background: rgba(143, 176, 245, .08); }
.auth-welcome { position: relative; z-index: 1; }
.auth-kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 12px !important; font-weight: 600; color: #8fb0f5 !important; margin: 0 0 10px !important; }
.auth-side h2 { color: #fff; font-size: 32px; line-height: 1.2; max-width: 440px; font-weight: 700; }
.auth-side p { color: #c3cde3; max-width: 420px; font-size: 15px; margin-top: 12px; }
.auth-side ul { list-style: none; padding: 0; margin: 32px 0 0; color: #dde4f2; display: grid; gap: 14px; max-width: 420px; }
.auth-side li { display: flex; gap: 14px; align-items: center; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 12px 14px; }
.auth-side li strong { display: block; color: #fff; font-size: 14.5px; font-weight: 600; }
.auth-side li small { display: block; color: #aebbd6; font-size: 13px; margin-top: 2px; }
.auth-ico { flex: none; width: 38px; height: 38px; border-radius: 10px; background: rgba(143, 176, 245, .16); display: inline-flex; align-items: center; justify-content: center; }
.auth-ico .icon { color: #a9c3fa; }
.auth-secure { display: flex; gap: 8px; align-items: flex-start; margin-top: 22px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2, #f4f6fb); color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.auth-secure .icon { flex: none; margin-top: 1px; color: var(--success, #1b8a5a); }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .logo-tile { background: #fff; border-radius: 10px; padding: 6px 8px; display: inline-flex; }
.auth-brand img { height: 88px; }
.auth-brand strong { font-size: 16px; letter-spacing: .04em; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-mobile-logo { display: none; height: 56px; margin-bottom: 24px; }
.auth-card .lead { color: var(--muted); margin-bottom: 26px; }
.auth-foot { color: #93a0bd; font-size: 12.5px; }
.minimal { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.minimal .card { width: 100%; max-width: 560px; }
.minimal.wide .card { max-width: 760px; }

/* ---------- Payslip preview ---------- */
.preview-frame { width: 100%; height: 80vh; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); width: var(--sidebar) !important; }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 35; }
    .main, body.sidebar-collapsed .main { margin-left: 0; }
    body.sidebar-collapsed .nav a span, body.sidebar-collapsed .nav-section, body.sidebar-collapsed .brand-text { display: revert; }
    body.sidebar-collapsed .sidebar-brand .brand-logo { display: block; }
    body.sidebar-collapsed .sidebar-brand .brand-icon { display: none; }
    .grid-3 { grid-template-columns: 1fr; }
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-mobile-logo { display: block; }
    .auth-main { align-items: flex-start; padding: 0 20px 32px; background: linear-gradient(180deg, #152a4d 0, #152a4d 150px, var(--surface) 150px); }
    .auth-card { margin-top: 40px; background: #fff; border-radius: 18px; padding: 24px 20px; box-shadow: 0 12px 36px rgba(21, 42, 77, .16); }
    .auth-card .auth-mobile-logo { height: 52px; margin: 0 0 18px; }
    .user-meta { display: none; }
}
@media (max-width: 720px) {
    .content { padding: 16px; }
    .topbar { padding: 0 12px; gap: 8px; }
    .grid-2, .grid-4, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .mini-stats { grid-template-columns: repeat(2, 1fr); }
    .dl { grid-template-columns: 1fr; gap: 2px; }
    .dl dd { margin-bottom: 8px; }
    .filters .f, .filters .f-grow { min-width: 100%; }
    .page-actions { width: 100%; }
    h1 { font-size: 19px; }
}
@media print {
    .sidebar, .topbar, .page-actions, .filters, .btn { display: none !important; }
    .main { margin: 0 !important; }
    body { background: #fff; }
    .card { box-shadow: none; }
}

/* ---------- SVG charts ---------- */
.svg-chart { display: block; overflow: visible; }
.svg-chart .grid { stroke: #edf0f4; stroke-width: 1; }
.svg-chart .grid.base { stroke: #cfd6e0; }
.svg-chart .ax { font-size: 10.5px; fill: var(--muted); font-family: var(--font); }
.svg-chart .mark { transition: opacity .12s; }
.svg-chart:hover .mark { opacity: .55; }
.svg-chart .mark:hover { opacity: 1; }
.chart-tip { position: fixed; z-index: 90; pointer-events: none; background: var(--navy); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; max-width: 260px; box-shadow: var(--shadow-lg); }

/* =====================================================================
   Employee portal — mobile app shell
   ===================================================================== */
body.app { background: #eef2f8; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.appbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
    height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0;
    background: var(--navy); color: #fff; box-shadow: 0 2px 10px rgba(21, 42, 77, .18);
}
.appbar-logo { width: 30px; height: 30px; background: #fff; border-radius: 8px; padding: 3px; }
.appbar-title { flex: 1; font-weight: 650; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-btn { position: relative; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: #fff; border-radius: 12px; }
.appbar-btn:hover { background: rgba(255, 255, 255, .1); text-decoration: none; }
.appbar-btn .dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; padding: 0 4px; }
.appbar-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .6); background: #3a5fb8; color: #fff; font: 600 13px var(--font); cursor: pointer; overflow: hidden; padding: 0; }
.appbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.app .dropdown-menu { color: var(--text); }
.app-main { max-width: 760px; margin: 0 auto; padding: 16px 14px 24px; }
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-around;
    background: #fff; border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 18px rgba(16, 24, 40, .06);
}
.tabbar a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; color: var(--muted); font-size: 11px; font-weight: 600; }
.tabbar a .icon { width: 22px; height: 22px; }
.tabbar a:hover { text-decoration: none; color: var(--text); }
.tabbar a.active { color: var(--primary); }
.tabbar a.active .icon { background: var(--primary-soft); border-radius: 10px; width: 44px; padding: 3px 11px; box-sizing: content-box; height: 20px; }

.app .card { border-radius: 16px; border-color: #e6ebf3; }
.app h2.section { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 4px 10px; font-weight: 650; }
.hero { border-radius: 20px; padding: 20px; color: #fff; background: linear-gradient(135deg, #152a4d 0%, #2553c7 100%); box-shadow: 0 10px 24px rgba(37, 83, 199, .25); }
.hero .hello { font-size: 14px; opacity: .8; }
.hero .name { font-size: 22px; font-weight: 700; margin: 2px 0 14px; }
.hero .clock { font-size: 34px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero .meta { font-size: 13px; opacity: .85; margin-top: 2px; }
.hero .btn-punch { margin-top: 16px; width: 100%; height: 52px; border-radius: 14px; border: 0; font: 700 16px var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: var(--navy); }
.hero .btn-punch.out { background: #fde7e5; color: #9b2c22; }
.hero .btn-punch[disabled] { opacity: .55; cursor: not-allowed; }
.hero .punch-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.hero .punch-row .btn-punch { margin-top: 0; }
.hero .punch-done { height: 52px; border-radius: 14px; background: rgba(255, 255, 255, .14); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 16px; }
.hero .punch-done small { display: block; font-size: 11px; font-weight: 500; opacity: .8; line-height: 1.1; }
.hero .punch-done .icon { color: #86efac; }
.hero .punch-done.out .icon { color: #fecaca; }
.hero .opens { margin-top: 10px; font-size: 13px; background: rgba(255, 255, 255, .14); padding: 8px 12px; border-radius: 12px; display: flex; align-items: center; gap: 6px; }
.hero .opens [data-countdown] { font-variant-numeric: tabular-nums; font-weight: 700; }
.cam-steps { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.cam-steps span { width: 28px; height: 5px; border-radius: 3px; background: var(--gray-soft); transition: background .2s; }
.cam-steps span[data-done="1"] { background: #22c55e; }
.cam-arrow { position: absolute; top: 50%; transform: translateY(-50%); font-size: 46px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.5); animation: cam-nudge 1s ease-in-out infinite; pointer-events: none; }
.cam-arrow.left { left: 6%; } .cam-arrow.right { right: 6%; }
@keyframes cam-nudge { 50% { transform: translate(var(--nudge, 0), -50%); } }
.cam-arrow.left { --nudge: -8px; } .cam-arrow.right { --nudge: 8px; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.hero .chip { font-size: 12px; background: rgba(255, 255, 255, .15); padding: 4px 10px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; }
.hero .chip.bad { background: rgba(239, 68, 68, .28); }
.hero .chip .icon { width: 14px; height: 14px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: #fff; border: 1px solid #e6ebf3; border-radius: 16px; padding: 14px; color: var(--text); display: block; }
.tile:hover { text-decoration: none; border-color: #c8d6f6; }
.tile .t-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.tile .t-value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.tile .t-sub { font-size: 12px; color: var(--muted); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { text-decoration: none; background: #fafbfd; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; display: block; }
.list-item .li-sub { font-size: 12.5px; color: var(--muted); display: block; }
.banner-task { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: #fff7e6; border: 1px solid #f5d9a3; color: #6b4304; margin-bottom: 14px; }
.banner-task:hover { text-decoration: none; }
.banner-task strong { display: block; }
.steps-v { list-style: none; margin: 0; padding: 0; }
.steps-v li { display: flex; gap: 12px; padding: 10px 0; }
.steps-v .n { width: 26px; height: 26px; border-radius: 50%; background: var(--gray-soft); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.steps-v .done .n { background: var(--green); color: #fff; }
.seg { display: flex; background: var(--gray-soft); padding: 4px; border-radius: 12px; gap: 4px; }
.seg label { flex: 1; margin: 0; text-align: center; padding: 8px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.seg input { display: none; }
.seg label:has(input:checked) { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.app .btn { height: 44px; border-radius: 12px; }
.app .btn-sm { height: 36px; }
.app .btn-xs { height: 30px; border-radius: 8px; }
.app input[type=text], .app input[type=email], .app input[type=date], .app input[type=time], .app input[type=tel], .app input[type=password], .app input:not([type]), .app select, .app textarea { height: 46px; border-radius: 12px; font-size: 15px; }
.app textarea { height: auto; }
.selfie-preview { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: var(--shadow); background: var(--gray-soft); }
@media (min-width: 900px) {
    body.app { padding-bottom: 88px; }
    .tabbar { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: 560px; border: 1px solid var(--border); border-radius: 20px; padding-bottom: 6px; }
}

/* ---------- Camera sheet ---------- */
.cam-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(8, 15, 30, .72); display: flex; align-items: flex-end; justify-content: center; }
.cam-sheet { width: 100%; max-width: 480px; background: #fff; border-radius: 22px 22px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 600px) { .cam-overlay { align-items: center; } .cam-sheet { border-radius: 22px; } }
.cam-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cam-close { border: 0; background: var(--gray-soft); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.cam-stage { position: relative; aspect-ratio: 4 / 3; background: #000; border-radius: 16px; overflow: hidden; }
.cam-stage video, .cam-stage .cam-shot { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam-stage .cam-shot { transform: none; }
.cam-ring { position: absolute; left: 50%; top: 48%; width: 52%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%); border: 3px dashed rgba(255, 255, 255, .7); border-radius: 50%; transition: border-color .2s; }
.cam-ring[data-ok="1"] { border: 3px solid #22c55e; }
.cam-status { text-align: center; margin: 12px 0; font-weight: 600; color: var(--text-2); min-height: 22px; }
.cam-status[data-tone="ok"] { color: var(--green); }
.cam-status[data-tone="warn"] { color: var(--amber); }
.cam-actions { display: flex; gap: 10px; }
.cam-actions .btn { flex: 1; height: 48px; border-radius: 14px; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--gray-soft); }

.nav-count { margin-left: auto; font-style: normal; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
body.sidebar-collapsed .nav-count { display: none; }

/* ---- Profile wizard (onboarding) ---------------------------------------------- */
.wz { margin-top: 12px; overflow: hidden; }
.wz-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.wz-n { width: 30px; height: 30px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: var(--gray-soft); color: var(--muted); }
.wz-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wz-t small { color: var(--muted); font-size: 12px; }
.wz-lock { color: var(--muted); }
.wz-body { padding: 0 16px 16px; }
.wz.current { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 83, 199, .12); }
.wz.current .wz-n { background: var(--primary); color: #fff; }
.wz.done .wz-n { background: var(--green); color: #fff; }
.wz.locked { opacity: .55; }
.wz.locked .wz-body { display: none; }
.wz.done .wz-body { padding-top: 0; }
.wz-req { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.wz-req span { display: inline-flex; align-items: center; gap: 5px; }
.wz-req .ok { color: var(--green); font-weight: 600; }
.wz-sub { font-size: 14px; margin: 16px 0 6px; }
.tabbar a.locked { opacity: .35; pointer-events: none; }

/* Install-the-app screen (employees in a normal browser tab) */
body.gated { overflow: hidden; }
body.gated .appbar, body.gated .app-main, body.gated .tabbar { visibility: hidden; }
.app-gate { position: fixed; inset: 0; z-index: 1000; overflow-y: auto; display: flex; justify-content: center; align-items: flex-start;
    padding: calc(28px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
    background: radial-gradient(120% 70% at 50% 0%, #1f3a66 0%, #152a4d 55%, #0e1d38 100%); }
.app-gate[hidden] { display: none; }
.app-gate-card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 28px 22px 18px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.app-gate-icon { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 6px 18px rgba(21, 42, 77, .25); }
.app-gate-card h1 { font-size: 21px; margin: 16px 0 8px; }
.app-gate-lead { color: var(--muted); font-size: 14.5px; line-height: 1.5; margin: 0 0 18px; }
.app-gate-install { height: 46px; margin-bottom: 14px; font-size: 15px; }
.app-gate-steps { text-align: left; background: var(--surface-2); border: 1px solid var(--border, #e3e8f0); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.app-gate-steps h2 { font-size: 14px; margin: 0 0 8px; }
.app-gate-steps ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.55; }
.app-gate-steps li + li { margin-top: 6px; }
.app-gate-steps .kbd { display: inline-block; min-width: 20px; padding: 0 5px; border: 1px solid var(--border, #d6dce8); border-radius: 5px; background: #fff; text-align: center; font-weight: 600; }
.app-gate-copy { height: 42px; }
.app-gate-note { color: var(--muted); font-size: 13px; margin: 14px 0 4px; }
.app-gate-signout { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 13px; padding: 6px; cursor: pointer; }

/* Salary: allowances inside the salary record, promotions */
.text-success { color: var(--green, #1b8a5a); font-weight: 600; }
.text-danger { color: var(--red, #c0392b); font-weight: 600; }
.allowance-rows { margin-top: 18px; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); }
.allowance-rows-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.allowance-row { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(140px, 1fr) minmax(190px, 1fr); gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.allowance-row .field-error { grid-column: 1 / -1; }
.allowance-row:not(.on) .input-prefix, .allowance-row:not(.on) select { opacity: .45; }
.allowance-name { font-weight: 600; }
.salary-now { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(260px, 1.4fr); gap: 20px; align-items: start; }
.salary-next { margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--blue, #2554c7); border-radius: 12px; background: var(--blue-soft, #eef3ff); }
.salary-next .salary-now-total { color: var(--blue, #2554c7); }
.salary-now-total { font-size: 28px; font-weight: 700; margin: 4px 0; color: var(--navy, #152a4d); }
.salary-lines { margin: 0; display: grid; gap: 6px; }
.salary-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.salary-lines dt { margin: 0; } .salary-lines dd { margin: 0; font-weight: 600; white-space: nowrap; }
@media (max-width: 760px) {
    .allowance-row, .salary-now { grid-template-columns: 1fr; }
    .allowance-rows-head { flex-direction: column; }
}
.receipt-closed { display: flex; gap: 14px; align-items: flex-start; }
/* Turn on notifications screen */
.push-gate-icon { display: inline-flex; width: 76px; height: 76px; border-radius: 22px; align-items: center; justify-content: center; background: var(--blue-soft, #eef3ff); }
.push-gate-icon .icon { width: 36px; height: 36px; color: var(--blue, #2554c7); }
.push-gate-status { color: var(--red, #c0362c); min-height: 1em; margin: 4px 0 10px; }
/* CNIC front + back */
.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.cnic-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.cnic-side { border: 1px dashed var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.cnic-side.done { border-style: solid; border-color: var(--green, #12805c); }
.cnic-title { font-weight: 600; font-size: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cnic-done { color: var(--green, #12805c); font-weight: 600; display: inline-flex; gap: 3px; align-items: center; }
.cnic-preview { display: block; width: 100%; max-height: 160px; object-fit: contain; border-radius: 8px; margin: 8px 0; background: #fff; }
.cnic-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cnic-buttons label { position: relative; cursor: pointer; margin: 0; }
@media (max-width: 520px) { .cnic-sides { grid-template-columns: 1fr; } }
.photo-current { display: flex; gap: 12px; align-items: flex-start; }
.photo-current img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); flex: none; }
/* Employee guide */
.guide-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.guide-head h1 { margin: 0 0 4px; }
.guide h2 { font-size: 17px; margin: 22px 0 8px; color: var(--navy, #152a4d); }
.guide h2:first-of-type { margin-top: 14px; }
.guide ul, .guide ol { padding-left: 20px; line-height: 1.6; }
.guide li { margin-bottom: 4px; }
.g-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.g-rules div { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.g-rules b { display: block; font-size: 18px; color: var(--blue, #2554c7); }
.g-rules span { font-size: 12.5px; color: var(--muted); }
.g-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.g-table th, .g-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.g-table th { background: var(--surface-2); }
.guide-app .guide-head { flex-direction: column; }
.doc-requests { border-left: 4px solid var(--amber, #b7791f); margin-bottom: 14px; }
.doc-request { padding: 8px 0; border-top: 1px dashed var(--border); }
.doc-request:first-of-type { border-top: 0; }
.g-note { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }

/* remote time tracker */
.tracker-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.tracker-clock { font-size: 34px; font-weight: 700; color: var(--primary); line-height: 1.2; font-variant-numeric: tabular-nums; }
.tracker-state { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tracker-state.on { background: #e5f6ee; border-color: #9fd9bd; color: #12805c; }
.tracker-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.tracker-last { margin-top: 12px; }
.tracker-last img { display: block; max-width: 100%; max-height: 260px; border: 1px solid var(--border); border-radius: 8px; margin-top: 6px; }
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.shot-grid-lg { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.shot { margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.shot figcaption { padding: 4px 8px; font-size: 12px; color: var(--muted); }
.shot-idle { border-color: #f0b44c; }
.shot-gone { aspect-ratio: 16 / 10; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.meter { height: 4px; background: var(--surface-2); border-radius: 2px; margin-top: 4px; min-width: 80px; }
.meter span { display: block; height: 100%; background: var(--primary); border-radius: 2px; }
.row-selected td { background: var(--surface-2); }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin-bottom: 6px; }
.btn-lg { padding: 11px 20px; font-size: 15px; }

/* announcements / notice board */
.notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice { display: block; text-decoration: none; color: inherit; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
a.notice:hover { border-color: var(--primary); }
.notice-pin { border-left: 4px solid #f0b44c; }
.notice-head { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--text); }
.notice-head b { flex: 1; }
.notice-body { margin-top: 4px; color: var(--text-2, var(--muted)); font-size: 14px; }
.notice-date { margin-top: 6px; font-size: 12px; color: var(--muted); }
