:root {
    --ink: #111827;
    --ink-soft: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #ffffff;
    --canvas: #f5f7fb;
    --primary: #1d4ed8;
    --primary-dark: #153ea9;
    --primary-soft: #eaf0ff;
    --gold: #c99319;
    --gold-soft: #fff7dc;
    --success: #0f9f6e;
    --success-soft: #e9fbf4;
    --danger: #d92d4a;
    --danger-soft: #fff0f3;
    --warning: #c77908;
    --warning-soft: #fff7e8;
    --neutral-soft: #f1f5f9;
    --sidebar: 276px;
    --radius: 18px;
    --shadow: 0 12px 34px rgba(15, 23, 42, .08);
    --shadow-sm: 0 4px 16px rgba(15, 23, 42, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.min-w-0 { min-width: 0; }
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-sm { font-size: 12px; }
.fw-600 { font-weight: 600; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.gap-2 { gap: 12px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    color: #dbe5f5;
    background:
        radial-gradient(circle at 10% 0, rgba(59, 130, 246, .20), transparent 35%),
        linear-gradient(180deg, #111827 0%, #0b1220 100%);
    box-shadow: 14px 0 40px rgba(15, 23, 42, .12);
}
.brand {
    min-height: 84px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}
.brand img, .portal-brand img {
    width: 46px;
    height: 46px;
    padding: 4px;
    border-radius: 13px;
    background: #fff;
    object-fit: contain;
}
.brand strong, .portal-brand strong { display: block; font-size: 16px; letter-spacing: -.2px; }
.brand span, .portal-brand span { display: block; color: #93a4bd; font-size: 10px; letter-spacing: .5px; text-transform: uppercase; }
.side-nav { flex: 1; overflow-y: auto; padding: 12px; }
.side-nav::-webkit-scrollbar { width: 5px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 10px; }
.nav-caption {
    display: block;
    margin: 18px 12px 7px;
    color: #718096;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.25px;
    text-transform: uppercase;
}
.side-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 43px;
    margin: 3px 0;
    padding: 9px 13px;
    border-radius: 12px;
    color: #c7d2e4;
    transition: .18s ease;
}
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.065); }
.side-nav a.active { color: #fff; background: linear-gradient(105deg, #1d4ed8, #2563eb); box-shadow: 0 8px 22px rgba(29,78,216,.32); }
.side-nav a.active::before { content: ""; position: absolute; left: -12px; width: 3px; height: 24px; border-radius: 0 4px 4px 0; background: #f5c451; }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; font-size: 16px; font-weight: 700; }
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 12px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    background: rgba(255,255,255,.045);
}
.sidebar-user strong { font-size: 12px; color: #fff; }
.sidebar-user span { display: block; color: #8ea1bb; font-size: 10px; }
.main-area { min-height: 100vh; margin-left: var(--sidebar); display: flex; flex-direction: column; }
.topbar {
    position: sticky;
    z-index: 40;
    top: 0;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 28px;
    border-bottom: 1px solid rgba(226,232,240,.85);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 13px; }
.eyebrow { margin: 0; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: 21px; line-height: 1.25; letter-spacing: -.4px; }
.content-area { width: 100%; max-width: 1620px; flex: 1; margin: 0 auto; padding: 26px 28px 36px; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; padding: 20px 28px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.hamburger, .sidebar-close { display: none !important; }
.icon-button {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    transition: .18s ease;
}
.icon-button:hover { color: var(--primary); border-color: #b9c9f5; background: var(--primary-soft); }
.hamburger span { width: 18px; height: 2px; margin: 2px; display: block; border-radius: 5px; background: currentColor; }
.avatar {
    width: 38px; height: 38px; flex: 0 0 auto; display: inline-grid; place-items: center;
    color: #fff; border-radius: 50%; background: linear-gradient(135deg, #1d4ed8, #0f9f6e);
    font-size: 12px; font-weight: 800;
}
.avatar-sm { width: 34px; height: 34px; font-size: 11px; }
.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: 9px; list-style: none; cursor: pointer; font-weight: 600; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-popover {
    position: absolute; z-index: 70; top: calc(100% + 12px); right: 0; width: 220px;
    padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow);
}
.user-popover strong, .user-popover small { display: block; }
.user-popover small { margin: 2px 0 14px; color: var(--muted); }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.4px; }
.page-head p { max-width: 740px; margin: 0; color: var(--muted); }
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.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-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.card {
    min-width: 0;
    padding: 20px;
    border: 1px solid rgba(226,232,240,.95);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.card-head h3 { margin: 0; font-size: 16px; letter-spacing: -.15px; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.stat-card { position: relative; overflow: hidden; min-height: 128px; }
.stat-card::after { content: ""; position: absolute; right: -34px; bottom: -45px; width: 120px; height: 120px; border-radius: 50%; background: var(--primary-soft); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--primary); border-radius: 12px; background: var(--primary-soft); font-size: 18px; font-weight: 800; }
.stat-card strong { position: relative; z-index: 1; display: block; margin-top: 10px; font-size: 26px; line-height: 1; letter-spacing: -.8px; }
.stat-card small { position: relative; z-index: 1; display: block; margin-top: 6px; color: var(--muted); }
.metric { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.metric:last-child { border: 0; padding-bottom: 0; }
.metric:first-child { padding-top: 0; }
.metric strong { font-size: 15px; }
.progress { height: 9px; overflow: hidden; border-radius: 999px; background: #eaf0f7; }
.progress > span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #2dd4bf); }
.progress.danger > span { background: linear-gradient(90deg, #f97316, var(--danger)); }
.progress.gold > span { background: linear-gradient(90deg, #d99a16, #f7c948); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); background: #f8fafc; font-size: 10px; font-weight: 800; letter-spacing: .65px; text-transform: uppercase; }
tbody tr:hover { background: #fbfcff; }
tbody tr:last-child td { border-bottom: 0; }
td.wrap-cell { min-width: 220px; white-space: normal; }
.table-person { display: flex; align-items: center; gap: 10px; }
.table-person img { width: 38px; height: 38px; object-fit: cover; border-radius: 11px; background: var(--neutral-soft); }
.table-person strong, .table-person small { display: block; }
.table-person small { color: var(--muted); }
.empty-state { padding: 44px 24px !important; text-align: center; color: var(--muted); white-space: normal; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); }

.btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    font-weight: 700;
    font-size: 12px;
    transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-sm { min-height: 34px; padding: 7px 11px; font-size: 11px; border-radius: 9px; }
.btn-lg { min-height: 50px; padding: 12px 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { color: #fff; border-color: var(--primary); background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { color: #fff; border-color: var(--success); background: var(--success); }
.btn-danger { color: #fff; border-color: var(--danger); background: var(--danger); }
.btn-warning { color: #593700; border-color: #efc26c; background: #ffd987; }
.btn-soft { color: var(--primary); border-color: transparent; background: var(--primary-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.button-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px;
    border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .15px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { color: #087653; background: var(--success-soft); }
.badge-danger { color: #b4233b; background: var(--danger-soft); }
.badge-warning { color: #9b5c00; background: var(--warning-soft); }
.badge-neutral { color: #506075; background: var(--neutral-soft); }
.alert {
    position: relative; display: flex; align-items: flex-start; gap: 11px;
    margin-bottom: 18px; padding: 13px 44px 13px 14px; border: 1px solid; border-radius: 13px;
}
.alert > span { width: 23px; height: 23px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.alert button[data-dismiss] { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: inherit; font-size: 20px; }
.alert-success { color: #076a4a; border-color: #bcebd9; background: var(--success-soft); }
.alert-success > span { color: #fff; background: var(--success); }
.alert-danger { color: #9f1d34; border-color: #f2c0ca; background: var(--danger-soft); }
.alert-danger > span { color: #fff; background: var(--danger); }
.alert-warning { color: #835000; border-color: #f0d291; background: var(--warning-soft); }
.alert-info { color: #16449f; border-color: #bfd1f8; background: var(--primary-soft); }
.block-code { display: block; max-width: 100%; margin-top: 5px; overflow-wrap: anywhere; color: var(--ink); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-group { min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
label { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 750; }
label .required { color: var(--danger); }
.form-control, .form-select {
    width: 100%; min-height: 42px; padding: 9px 12px; color: var(--ink);
    border: 1px solid #cfd8e6; border-radius: 10px; outline: 0; background: #fff;
    transition: border .15s, box-shadow .15s;
}
textarea.form-control { min-height: 110px; resize: vertical; }
.form-control:focus, .form-select:focus { border-color: #7ca0ef; box-shadow: 0 0 0 3px rgba(29,78,216,.10); }
.form-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.input-group { display: flex; }
.input-group .form-control { border-radius: 10px 0 0 10px; }
.input-group .btn { border-radius: 0 10px 10px 0; }
.checkbox { display: flex; align-items: flex-start; gap: 8px; }
.checkbox input { margin-top: 3px; }
.checkbox label { margin: 0; font-weight: 500; }
.filter-bar {
    display: flex; align-items: end; gap: 10px; flex-wrap: wrap;
    margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
}
.filter-bar .form-group { min-width: 160px; flex: 1; }
.filter-bar .form-group.search { min-width: 240px; flex: 2; }
.section-divider { margin: 24px 0 17px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 13px; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 2px; }
.tab-button { white-space: nowrap; padding: 9px 13px; color: var(--muted); border: 0; border-radius: 10px; background: transparent; font-size: 12px; font-weight: 750; }
.tab-button.active { color: var(--primary); background: var(--primary-soft); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.modal {
    position: fixed; z-index: 100; inset: 0; display: none; align-items: center; justify-content: center;
    padding: 20px; background: rgba(15,23,42,.60); backdrop-filter: blur(4px);
}
.modal.open { display: flex; }
.modal-dialog { width: min(600px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 20px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.modal-header, .modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 0; }
.modal-footer { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }
.modal-body { padding: 20px; }

.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; min-height: 44px; padding: 0 0 17px 39px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; z-index: 1; left: 5px; top: 3px; width: 18px; height: 18px; border: 4px solid #fff; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px #b9ccfa; }
.timeline strong, .timeline small { display: block; }
.timeline small { color: var(--muted); }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px 24px; margin: 0; }
.detail-list div { min-width: 0; padding-bottom: 9px; border-bottom: 1px dashed var(--line); }
.detail-list dt { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.detail-list dd { margin: 3px 0 0; overflow-wrap: anywhere; font-weight: 600; }

.simple-chart { height: 220px; display: flex; align-items: flex-end; gap: 12px; padding-top: 18px; }
.chart-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.chart-bars { width: min(38px, 70%); height: calc(var(--value, 0) * 1%); min-height: 3px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #3b82f6, #1d4ed8); position: relative; }
.chart-bars.alt { background: linear-gradient(180deg, #2dd4bf, #0f9f6e); }
.chart-col small { color: var(--muted); font-size: 10px; }
.chart-value { color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.donut-legend { display: grid; gap: 10px; }
.legend-item { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 9px; }
.legend-color { width: 10px; height: 10px; border-radius: 3px; background: var(--color); }

.portal-body { padding-bottom: 80px; background: #f4f7fb; }
.portal-header {
    position: sticky; z-index: 50; top: 0; height: 72px; display: flex; align-items: center; justify-content: space-between;
    padding: 10px max(18px, calc((100% - 1120px)/2)); border-bottom: 1px solid rgba(226,232,240,.9); background: rgba(255,255,255,.94); backdrop-filter: blur(14px);
}
.portal-brand { display: flex; align-items: center; gap: 11px; }
.portal-brand img { width: 44px; height: 44px; }
.portal-brand span { color: var(--muted); }
.portal-header-actions { display: flex; align-items: center; gap: 9px; }
.portal-main { width: min(1120px, calc(100% - 36px)); min-height: calc(100vh - 160px); margin: 0 auto; padding: 24px 0 30px; }
.portal-bottom-nav {
    position: fixed; z-index: 55; left: 50%; bottom: 14px; transform: translateX(-50%);
    width: min(560px, calc(100% - 24px)); display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 7px; border: 1px solid rgba(226,232,240,.85); border-radius: 20px;
    background: rgba(255,255,255,.96); box-shadow: 0 14px 45px rgba(15,23,42,.18); backdrop-filter: blur(14px);
}
.portal-bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px; color: #7b8aa0; border-radius: 13px; }
.portal-bottom-nav a span { height: 22px; display: grid; place-items: center; font-weight: 800; }
.portal-bottom-nav a small { font-size: 9px; font-weight: 700; }
.portal-bottom-nav a.active { color: var(--primary); background: var(--primary-soft); }
.welcome-card {
    position: relative; overflow: hidden; min-height: 205px; display: flex; align-items: center;
    padding: 28px; color: #fff; border-radius: 24px;
    background: linear-gradient(120deg, #111827 0%, #173c7b 62%, #1d4ed8 100%); box-shadow: var(--shadow);
}
.welcome-card::before, .welcome-card::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.07); }
.welcome-card::before { width: 260px; height: 260px; right: -80px; top: -120px; }
.welcome-card::after { width: 170px; height: 170px; right: 160px; bottom: -130px; }
.welcome-content { position: relative; z-index: 1; max-width: 650px; }
.welcome-card h2 { margin: 7px 0 8px; font-size: clamp(24px, 5vw, 34px); line-height: 1.15; }
.welcome-card p { margin: 0; color: #d7e4f7; }
.quick-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 11px; }
.quick-action {
    min-height: 105px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 12px; text-align: center; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm);
}
.quick-action span { width: 42px; height: 42px; display: grid; place-items: center; color: var(--primary); border-radius: 13px; background: var(--primary-soft); font-size: 17px; font-weight: 800; }
.quick-action strong { font-size: 10px; }
.attendance-hero {
    padding: 26px; text-align: center; color: #fff; border-radius: 24px;
    background: radial-gradient(circle at 20% 10%, rgba(45,212,191,.25), transparent 30%), linear-gradient(135deg, #0f172a, #1e3a8a);
    box-shadow: var(--shadow);
}
.clock { margin: 5px 0 2px; font-size: clamp(42px, 12vw, 70px); font-weight: 250; letter-spacing: -3px; line-height: 1; }
.camera-box { position: relative; width: min(480px, 100%); aspect-ratio: 4/3; margin: 18px auto; overflow: hidden; border: 3px solid rgba(255,255,255,.25); border-radius: 22px; background: #05080d; }
.camera-box video, .camera-box img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-box canvas { display: none; }
.camera-guide { position: absolute; inset: 10% 22%; border: 2px dashed rgba(255,255,255,.75); border-radius: 46%; pointer-events: none; }
.gps-status { width: min(560px, 100%); display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; margin: 13px auto; color: #dbeafe; font-size: 11px; }
.event-buttons { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.event-buttons .btn { min-width: 160px; }

.employee-card {
    position: relative; width: min(560px, 100%); aspect-ratio: 1.586; overflow: hidden;
    padding: 26px; color: #fff; border-radius: 24px; background:
        radial-gradient(circle at 90% 10%, rgba(201,147,25,.42), transparent 28%),
        radial-gradient(circle at 0 100%, rgba(29,78,216,.55), transparent 38%),
        linear-gradient(135deg, #0b1220, #162542);
    box-shadow: 0 25px 60px rgba(15,23,42,.25);
}
.employee-card::after { content: "CJ"; position: absolute; right: -16px; bottom: -55px; color: rgba(255,255,255,.045); font-size: 190px; font-weight: 900; line-height: 1; }
.id-top, .id-main, .id-footer { position: relative; z-index: 1; }
.id-top { display: flex; align-items: center; justify-content: space-between; }
.id-top img { width: 55px; height: 55px; padding: 5px; border-radius: 14px; background: #fff; object-fit: contain; }
.id-top strong { display: block; font-size: 18px; }
.id-top span { color: #a9bdd9; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; }
.id-main { display: flex; align-items: center; gap: 18px; margin-top: 22px; }
.id-photo { width: 94px; height: 112px; object-fit: cover; border: 3px solid rgba(255,255,255,.7); border-radius: 16px; background: #e2e8f0; }
.id-photo-placeholder { display: grid; place-items: center; color: var(--ink); font-size: 30px; font-weight: 800; }
.id-name { font-size: 22px; line-height: 1.1; }
.id-position { margin-top: 4px; color: #f4ca64; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.id-number { margin-top: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 1.2px; }
.id-footer { position: absolute; left: 26px; right: 26px; bottom: 20px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 15px; align-items: end; }
.id-footer small { display: block; color: #91a5c0; font-size: 8px; text-transform: uppercase; }
.id-footer strong { font-size: 10px; }
.id-qr { width: 58px; height: 58px; padding: 3px; background: #fff; border-radius: 6px; }
.id-qr img, .id-qr canvas { width: 100% !important; height: 100% !important; }

.public-body { background: #fff; }
.public-header { position: sticky; z-index: 50; top: 0; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.public-nav { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.public-nav nav { display: flex; align-items: center; gap: 18px; font-weight: 650; }
.hero { padding: 80px 0 70px; background: radial-gradient(circle at 80% 20%, #dbeafe, transparent 28%), linear-gradient(180deg, #f8fbff, #fff); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 55px; }
.hero h1 { margin: 12px 0 18px; font-size: clamp(38px, 6vw, 66px); line-height: 1.02; letter-spacing: -2.7px; }
.hero p { max-width: 650px; color: var(--muted); font-size: 17px; }
.hero-badge { display: inline-flex; padding: 7px 12px; color: var(--primary); border-radius: 999px; background: var(--primary-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.hero-panel { padding: 28px; border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: var(--shadow); }
.hero-panel img { width: 110px; display: block; margin: 0 auto 18px; }
.career-section { padding: 65px 0; }
.career-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.job-card { display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.job-card h3 { margin: 12px 0 6px; font-size: 18px; }
.job-card p { flex: 1; color: var(--muted); }
.job-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.public-footer { padding: 25px 0; color: #9aacbf; background: #0f172a; }
.public-footer .container { display: flex; align-items: center; gap: 12px; }
.public-footer img { width: 34px; height: 34px; padding: 4px; border-radius: 8px; background: #fff; object-fit: contain; }

.auth-body {
    min-height: 100vh; display: grid; place-items: center; padding: 25px;
    background: radial-gradient(circle at 15% 10%, rgba(59,130,246,.18), transparent 28%),
        radial-gradient(circle at 85% 85%, rgba(45,212,191,.13), transparent 28%), #f4f7fb;
}
.auth-card { width: min(440px, 100%); padding: 34px; text-align: center; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.auth-logo { width: 120px; height: 120px; margin: 0 auto 12px; object-fit: contain; }
.auth-card h1 { margin: 0; font-size: 26px; }
.auth-card > p { margin: 5px auto 25px; color: var(--muted); }
.auth-card .form-group { text-align: left; }
.auth-demo { margin-top: 20px; padding: 13px; text-align: left; border-radius: 12px; background: #f8fafc; color: var(--muted); font-size: 10px; }
.auth-demo code { color: var(--ink); }

.payslip { position: relative; overflow: hidden; }
.payslip-watermark { position: absolute; z-index: 0; inset: 50% auto auto 50%; width: 370px; opacity: .035; transform: translate(-50%,-50%) rotate(-18deg); pointer-events: none; }
.payslip > *:not(.payslip-watermark) { position: relative; z-index: 1; }
.signature-pad { width: 100%; height: 190px; touch-action: none; border: 1px dashed #94a3b8; border-radius: 12px; background: #fff; }
.document-sheet { width: min(850px, 100%); margin: 0 auto; padding: 60px 65px; color: #111; background: #fff; box-shadow: var(--shadow); font-family: Georgia, "Times New Roman", serif; font-size: 13px; }
.document-sheet h2, .document-sheet h3, .document-sheet h4 { text-align: center; }
.document-header { display: flex; align-items: center; gap: 20px; padding-bottom: 14px; border-bottom: 3px double #111; font-family: Inter, sans-serif; }
.document-header img { width: 78px; }
.document-header h2 { margin: 0; text-align: left; }
.document-header p { margin: 3px 0 0; }

@media (max-width: 1200px) {
    .grid-5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .quick-actions { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-105%); transition: transform .22s ease; }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-overlay { position: fixed; z-index: 55; inset: 0; display: none; background: rgba(15,23,42,.55); }
    .sidebar-open .sidebar-overlay { display: block; }
    .sidebar-close { display: inline-grid !important; margin-left: auto; color: #fff; border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.07); }
    .main-area { margin-left: 0; }
    .hamburger { display: inline-grid !important; }
    .topbar { height: 72px; padding: 10px 17px; }
    .topbar h1 { max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
    .content-area { padding: 20px 17px 32px; }
    .app-footer { padding-inline: 17px; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .form-grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-panel { display: none; }
    .career-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
    body { font-size: 13px; }
    .container { width: min(100% - 28px, 1180px); }
    .hide-mobile { display: none !important; }
    .content-area { padding: 17px 13px 30px; }
    .page-head { display: block; margin-bottom: 16px; }
    .page-head h2 { font-size: 19px; }
    .page-actions { justify-content: flex-start; margin-top: 13px; }
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; gap: 13px; }
    .span-2, .span-3 { grid-column: auto; }
    .stat-grid-mobile { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .stat-card { min-height: 110px; padding: 15px; }
    .stat-card strong { font-size: 22px; }
    .card { padding: 16px; border-radius: 15px; }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; gap: 13px; }
    .form-group.full { grid-column: auto; }
    .filter-bar { display: grid; grid-template-columns: 1fr 1fr; }
    .filter-bar .form-group, .filter-bar .form-group.search { min-width: 0; }
    .filter-bar .search { grid-column: 1 / -1; }
    .detail-list { grid-template-columns: 1fr; }
    .app-footer { display: block; text-align: center; }
    .app-footer span { display: block; margin: 2px; }
    .portal-header { height: 64px; padding: 8px 14px; }
    .portal-brand img { width: 38px; height: 38px; }
    .portal-brand strong { font-size: 14px; }
    .portal-main { width: calc(100% - 26px); padding-top: 16px; }
    .portal-bottom-nav { bottom: max(8px, env(safe-area-inset-bottom)); }
    .welcome-card { min-height: 180px; padding: 20px; border-radius: 20px; }
    .quick-actions { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
    .quick-action { min-height: 88px; padding: 9px 4px; }
    .quick-action span { width: 36px; height: 36px; }
    .attendance-hero { padding: 18px 12px; border-radius: 20px; }
    .event-buttons { display: grid; grid-template-columns: 1fr 1fr; }
    .event-buttons .btn { min-width: 0; }
    .employee-card { padding: 17px; border-radius: 18px; }
    .id-top img { width: 42px; height: 42px; }
    .id-main { gap: 12px; margin-top: 12px; }
    .id-photo { width: 68px; height: 82px; border-radius: 11px; }
    .id-name { font-size: 16px; }
    .id-position { font-size: 9px; }
    .id-number { margin-top: 7px; font-size: 10px; }
    .id-footer { left: 17px; right: 17px; bottom: 12px; gap: 7px; }
    .id-footer strong { font-size: 8px; }
    .id-qr { width: 44px; height: 44px; }
    .public-nav nav > a:not(.btn) { display: none; }
    .hero { padding: 55px 0; }
    .hero h1 { letter-spacing: -1.8px; }
    .career-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 27px 20px; }
    .document-sheet { padding: 30px 22px; }
}

@media print {
    .sidebar, .topbar, .app-footer, .portal-header, .portal-bottom-nav, .no-print, .alert, .page-head, .public-header, .public-footer { display: none !important; }
    body, .admin-body, .portal-body { padding: 0; background: #fff; }
    .main-area { margin: 0; }
    .content-area, .portal-main { width: 100%; max-width: none; margin: 0; padding: 0; }
    .card, .document-sheet { border: 0; box-shadow: none; }
    .document-sheet { width: 100%; padding: 18mm; }
    .print-only { display: block !important; }
}
.print-only { display: none; }
