:root {
  --c-prod: #2a78d6; --c-unprod: #eb6834; --c-neutral: #1baf7a; --c-idle: #eda100;
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e3e6ef;
  --text: #171a26;
  --muted: #646b80;
  --primary: #4338ca;
  --primary-2: #6366f1;
  --primary-soft: #eef0ff;
  --ok: #0f9d58;
  --ok-soft: #e5f6ec;
  --warn: #b7791f;
  --warn-soft: #fdf3e1;
  --bad: #d93a3a;
  --bad-soft: #fdeaea;
  --info: #0b7fbf;
  --info-soft: #e4f3fb;
  --shadow: 0 1px 2px rgba(20, 24, 40, .05), 0 4px 16px rgba(20, 24, 40, .05);
  --radius: 14px;
  --sidebar: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1018; --surface: #161925; --surface-2: #1c2030; --border: #2a2f42;
    --text: #e8eaf2; --muted: #9aa1b8; --primary: #8b8ff8; --primary-2: #a5a8ff; --primary-soft: #23264a;
    --ok: #45c987; --ok-soft: #15301f; --warn: #e5ad4f; --warn-soft: #33281a; --bad: #f07272; --bad-soft: #3a1c1f;
    --info: #5bb8ea; --info-soft: #14293a; --shadow: 0 1px 2px rgba(0,0,0,.3);
    --c-prod: #3987e5; --c-unprod: #d95926; --c-neutral: #199e70; --c-idle: #c98500;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14.5px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Noto Sans", sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15.5px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
#print-root { display: none; }

/* layout */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px; font-weight: 700; font-size: 16px; }
.brand img, .brand .logo-dot { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; }
.brand .logo-dot { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; display: grid; place-items: center; font-size: 15px; }
.nav { overflow-y: auto; padding: 6px 10px 20px; flex: 1; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav a .ico { width: 20px; text-align: center; opacity: .85; }
.nav a .count { margin-left: auto; background: var(--bad); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; }
.main { margin-left: var(--sidebar); flex: 1; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .title { font-weight: 650; font-size: 16px; flex: 1; }
.menu-btn { display: none; }
.content { padding: 22px 24px 90px; max-width: 1280px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; flex: 1; }
.bottom-nav { display: none; }

/* cards & grid */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.tile .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); font-size: 12.5px; }
.tile.ok .v { color: var(--ok); } .tile.warn .v { color: var(--warn); } .tile.bad .v { color: var(--bad); } .tile.info .v { color: var(--info); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 10px; font: inherit; font-weight: 550;
  cursor: pointer; white-space: nowrap; transition: background .12s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 14px 18px; font-size: 16px; border-radius: 12px; }
.icon-btn { position: relative; border: 0; background: transparent; font-size: 19px; cursor: pointer; padding: 6px 8px; border-radius: 9px; color: var(--text); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 1px; right: 1px; background: var(--bad); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }

/* forms */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 11px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; vertical-align: middle; accent-color: var(--primary); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text) !important; }
.img-field { display: flex; align-items: center; gap: 12px; }
.img-field img { max-height: 60px; max-width: 160px; border: 1px dashed var(--border); border-radius: 8px; padding: 4px; background: #fff; }
.section-title { grid-column: 1 / -1; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); margin-top: 6px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; }
.t th, .t td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover { background: var(--surface-2); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(10, 12, 20, .45); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(920px, 100%); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h2 { margin: 0; flex: 1; font-size: 17px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

/* toasts */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; animation: fade .2s; }
.toast.bad { background: var(--bad); color: #fff; } .toast.ok { background: var(--ok); color: #fff; }

/* punch card */
.punch { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: center; }
.clock { font-size: 40px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.state-pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; padding: 6px 12px; border-radius: 30px; }
.state-pill::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.state-working { background: var(--ok-soft); color: var(--ok); }
.state-break { background: var(--warn-soft); color: var(--warn); }
.state-out { background: var(--surface-2); color: var(--muted); }
.punch-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.ring-wrap { display: flex; align-items: center; gap: 18px; justify-content: center; }
.ring { position: relative; width: 150px; height: 150px; }
.ring svg { transform: rotate(-90deg); }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .center b { font-size: 22px; display: block; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.timeline li:last-child { border-bottom: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.selfie video, .selfie img { width: 100%; max-width: 320px; border-radius: 12px; background: #000; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: 11.5px; color: var(--muted); text-align: center; font-weight: 600; }
.cal .day { border: 1px solid var(--border); border-radius: 10px; padding: 6px 7px; min-height: 64px; font-size: 12px; cursor: pointer; background: var(--surface); }
.cal .day:hover { border-color: var(--primary-2); }
.cal .day .d { font-weight: 700; font-size: 13px; }
.cal .day.present { background: var(--ok-soft); }
.cal .day.absent { background: var(--bad-soft); }
.cal .day.leave { background: var(--info-soft); }
.cal .day.weekend, .cal .day.holiday { background: var(--surface-2); color: var(--muted); }
.cal .day.bonus { background: var(--primary-soft); }
.cal .day.blank { visibility: hidden; }

/* live */
.people { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.person { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; flex: none; object-fit: cover; }
.person .meta { min-width: 0; flex: 1; }
.person .name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* notifications */
.notif-panel { position: absolute; right: 16px; top: 54px; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 50px rgba(0,0,0,.18); z-index: 50; }
.notif { padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif.unread { background: var(--primary-soft); }
.notif .nt { font-weight: 650; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--primary-soft), transparent 50%), var(--bg); }
.auth .card { width: min(440px, 100%); padding: 28px; }
.auth.wide .card { width: min(760px, 100%); }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--border); }
.steps span.on { background: var(--primary); }

/* payslip */
.payslip { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 32px 36px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.payslip .ps-head { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid #222; padding-bottom: 14px; }
.payslip .ps-head img { max-height: 64px; max-width: 140px; }
.payslip .ps-head .co { flex: 1; }
.payslip .ps-head .co b { font-size: 20px; display: block; }
.payslip .ps-title { text-align: center; font-size: 15px; font-weight: 700; margin: 14px 0; letter-spacing: .04em; text-transform: uppercase; }
.payslip table { width: 100%; border-collapse: collapse; }
.payslip .info td { padding: 4px 6px; }
.payslip .info td:nth-child(odd) { color: #555; width: 22%; }
.payslip .info td:nth-child(even) { font-weight: 600; width: 28%; }
.payslip .att-wrap { overflow-x: auto; margin: 12px 0; }
.payslip .att { border: 1px solid #ccc; }
.payslip .att td, .payslip .att th { border: 1px solid #ccc; padding: 5px 6px; text-align: center; font-size: 12px; }
.payslip .att th { background: #f3f3f3; font-weight: 600; }
.payslip .money { border: 1px solid #999; margin-top: 10px; }
.payslip .money th { background: #f0f0f0; text-align: left; padding: 7px 8px; border: 1px solid #999; }
.payslip .money td { padding: 6px 8px; border-left: 1px solid #999; border-right: 1px solid #999; }
.payslip .money td.a { text-align: right; font-variant-numeric: tabular-nums; }
.payslip .money tr.tot td { border-top: 1px solid #999; font-weight: 700; background: #fafafa; }
.payslip .net { margin-top: 12px; border: 2px solid #222; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.payslip .net b { font-size: 19px; }
.payslip .sign { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 28px; gap: 16px; }
.payslip .sign .box { text-align: center; min-width: 200px; }
.payslip .sign img { max-height: 80px; max-width: 180px; display: block; margin: 0 auto 4px; }
.payslip .sign .line { border-top: 1px solid #444; padding-top: 4px; font-weight: 600; }
.payslip .foot { text-align: center; color: #777; font-size: 11px; margin-top: 18px; }

/* responsive */
@media (max-width: 960px) {
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .punch { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-block; }
  .topbar { padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
  .content { padding: 16px 14px 100px; }
  .g2, .g3, .g4, .form { grid-template-columns: minmax(0, 1fr); }
  .clock { font-size: 34px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; background: var(--surface);
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a { flex: 1; text-align: center; padding: 8px 2px 7px; font-size: 11px; color: var(--muted); font-weight: 600; }
  .bottom-nav a .ico { display: block; font-size: 19px; line-height: 1.3; }
  .bottom-nav a.active { color: var(--primary); }
  /* stacked tables on phones */
  table.t.stackable thead { display: none; }
  table.t.stackable tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  table.t.stackable td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 12px; text-align: right; }
  table.t.stackable td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; font-weight: 600; }
  .cal .day { min-height: 46px; padding: 4px; font-size: 10.5px; }
  .cal .day .x { display: none; }
  .payslip { padding: 18px 14px; }
  .payslip .att td, .payslip .att th { font-size: 10.5px; padding: 4px 3px; }
  .payslip .info td { display: inline-block; width: 50% !important; }
  .payslip .sign { flex-wrap: wrap; }
  #toasts { left: 14px; right: 14px; bottom: 80px; }
  .modal-back { place-items: end center; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
}

@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  .payslip { border: 0; padding: 0; max-width: none; }
}

/* productivity bars: 2px surface gaps between segments, 4px rounded data end */
.sbar { display: flex; gap: 2px; height: 12px; min-width: 120px; align-items: stretch; }
.sbar span { display: block; height: 100%; min-width: 0; }
.sbar span:last-child { border-radius: 0 4px 4px 0; }
.sbar .prod { background: var(--c-prod); } .sbar .unprod { background: var(--c-unprod); }
.sbar .neutral { background: var(--c-neutral); } .sbar .idle { background: var(--c-idle); }
.sbar-target { position: relative; }
.sbar-target::after { content: ''; position: absolute; top: -3px; bottom: -3px; left: var(--target); width: 2px; background: var(--text); opacity: .55; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 20px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chips button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
#viz-tip { position: fixed; z-index: 300; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.15); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; display: none; min-width: 160px; }
#viz-tip .r { display: flex; justify-content: space-between; gap: 14px; }

/* ---- ID card ---- */
.id-pair { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.idcard { width: 320px; height: 520px; border-radius: 16px; background: #fff; color: #15133a; border: 1px solid var(--line);
  box-shadow: 0 10px 30px -14px rgba(0,0,0,.4); overflow: hidden; display: flex; flex-direction: column; position: relative; }

/* 3D flip */
.id-flip-scene { width: 320px; height: 520px; margin: 0 auto; perspective: 1600px; }
.id-flip-inner { position: relative; width: 100%; height: 100%; transition: transform .75s cubic-bezier(.4,.15,.2,1); transform-style: preserve-3d; cursor: pointer; }
.id-flip-inner.flipped { transform: rotateY(180deg); }
.id-flip-scene .idcard { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 24px 50px -20px rgba(55,48,163,.55); }
.id-flip-scene .id-back { transform: rotateY(180deg); }
.id-foot-row { display: flex; justify-content: space-between; align-items: flex-end; }
.id-powered { text-align: center; font-size: 10px; letter-spacing: .4px; color: #8a8fb0; padding-top: 8px; }
.id-powered b { color: #4f46e5; }

/* polished profile photo (3D tilt) */
.photo3d { display: inline-block; border-radius: 18px; padding: 4px; background: linear-gradient(135deg, #6366f1, #10b981);
  box-shadow: 0 14px 28px -14px rgba(79,70,229,.6); transition: transform .35s ease; transform: perspective(700px) rotateY(0deg); }
.photo3d:hover { transform: perspective(700px) rotateY(12deg) translateY(-3px); }
.photo3d > * { border-radius: 14px !important; display: block; width: 84px !important; height: 84px !important; font-size: 30px !important; }
.id-top { background: linear-gradient(135deg, #3730a3, #6366f1); color: #fff; padding: 14px 16px; display: flex; gap: 10px; align-items: center; }
.id-logo { width: 38px; height: 38px; border-radius: 8px; background: #fff; object-fit: contain; }
.id-co { font-weight: 800; font-size: 16px; line-height: 1.1; }
.id-sub { font-size: 11px; opacity: .85; }
.id-body { text-align: center; padding: 16px; }
.id-photo { width: 120px; height: 140px; object-fit: cover; border-radius: 10px; border: 3px solid #eef0ff; margin: 0 auto 10px; display: block; }
.id-noimg { display: grid; place-items: center; background: #eef0ff; color: #4f46e5; font-size: 40px; font-weight: 800; }
.id-name { font-size: 20px; font-weight: 800; }
.id-desig { color: #6366f1; font-weight: 600; font-size: 13px; }
.id-code { margin-top: 4px; font-family: monospace; letter-spacing: 1px; background: #f1f2fb; display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 13px; }
.id-meta { padding: 0 16px; display: flex; flex-direction: column; gap: 6px; }
.idf { display: flex; justify-content: space-between; font-size: 12px; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.idf span { color: #6b7090; }
.id-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; background: #f7f8ff; }
.id-qr { width: 70px; height: 70px; }
.id-sign { text-align: center; font-size: 10px; color: #6b7090; }
.id-line { border-top: 1px solid #c7cadb; margin-top: 2px; padding-top: 2px; }
.id-back { padding: 18px; gap: 12px; }
.id-rules { font-size: 12px; color: #40455f; display: flex; flex-direction: column; gap: 8px; }
.id-addr { background: #f1f2fb; border-radius: 8px; padding: 10px; font-size: 12px; }
.id-qr-big { width: 120px; height: 120px; margin: 6px auto; display: block; }
.id-barcode { text-align: center; font-family: monospace; letter-spacing: 3px; font-size: 16px; border: 1px dashed var(--line); padding: 6px; border-radius: 6px; }
@media print { .id-print .id-pair { gap: 10mm; } .idcard { box-shadow: none; border: 1px solid #ccc; } }

/* ---- advanced dashboard ---- */
.adv-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.adv-kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; position: relative; overflow: hidden; }
.adv-kpi .v { font-size: 30px; font-weight: 800; font-family: 'Space Grotesk', system-ui, sans-serif; line-height: 1; }
.adv-kpi .l { color: var(--muted); font-size: 13px; margin-top: 6px; }
.adv-kpi .spark { position: absolute; right: 10px; top: 12px; opacity: .25; font-size: 30px; }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 760px) { .adv-grid { grid-template-columns: 1fr; } }
.donut-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.mbars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 8px; }
.mbar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.mbar-fill { width: 70%; max-width: 34px; border-radius: 5px 5px 2px 2px; min-height: 2px; transition: height .4s; }
.mbar-x { font-size: 11px; color: var(--muted); }

/* ============================================================ UI polish / impressive upgrade */
body {
  background:
    radial-gradient(1100px 480px at 100% -8%, color-mix(in srgb, var(--primary) 9%, transparent), transparent),
    radial-gradient(900px 480px at -8% 108%, color-mix(in srgb, var(--primary-2) 7%, transparent), transparent),
    var(--bg);
  background-attachment: fixed;
}
.sidebar { background: color-mix(in srgb, var(--surface) 96%, var(--primary) 4%); }
.brand { background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; }
.brand .logo-dot, .brand img { -webkit-text-fill-color: initial; }

/* cards lift + glow on hover */
.card { transition: transform .18s ease, box-shadow .22s ease, border-color .22s ease; animation: cardin .34s ease both; }
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  box-shadow: 0 2px 4px rgba(20,24,40,.05), 0 16px 34px -18px color-mix(in srgb, var(--primary) 50%, transparent); }
@keyframes cardin { from { opacity: 0; transform: translateY(10px); } }

/* gradient primary buttons with soft glow */
.btn { transition: background .12s, transform .12s ease, box-shadow .2s, filter .12s; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent;
  box-shadow: 0 6px 18px -9px color-mix(in srgb, var(--primary) 75%, transparent); }
.btn.primary:hover { transform: translateY(-1px); filter: brightness(1.06);
  box-shadow: 0 10px 26px -9px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn.lg { box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--primary) 70%, transparent); }

/* sidebar nav: smooth hover + gradient active pill with accent */
.nav a { transition: background .15s, color .15s, transform .12s; }
.nav a:hover { transform: translateX(2px); }
.nav a.active { position: relative;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 18%, transparent), color-mix(in srgb, var(--primary-2) 10%, transparent)); }
.nav a.active::before { content: ''; position: absolute; left: 1px; top: 22%; bottom: 22%; width: 3px; border-radius: 3px;
  background: linear-gradient(var(--primary), var(--primary-2)); }

/* tiles + KPI cards */
.tile { transition: transform .16s ease, box-shadow .2s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -18px color-mix(in srgb, var(--primary) 55%, transparent); }
.adv-kpi { transition: transform .18s ease, box-shadow .2s; }
.adv-kpi::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.adv-kpi:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -20px color-mix(in srgb, var(--primary) 55%, transparent); }
.adv-kpi .v { background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* slimmer, calmer scrollbars */
.nav::-webkit-scrollbar, .modal-body::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.nav::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 35%, transparent); border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .card:hover, .tile:hover, .adv-kpi:hover, .btn.primary:hover { transform: none; }
  .nav a:hover { transform: none; }
}

/* ---- Face Attendance kiosk ---- */
.kiosk-stage { max-width: 560px; margin: 0 auto; }
.kiosk-head { text-align: center; margin-bottom: 10px; }
.kiosk-clock { font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.kiosk-greet { color: var(--muted); font-size: 14px; margin-top: 4px; }
.kiosk-card { animation: none; }

/* Full-screen kiosk: hide the app chrome and fill the screen */
body.kiosk-mode .sidebar,
body.kiosk-mode .topbar,
body.kiosk-mode .bottom-nav,
body.kiosk-mode .trial-strip,
body.kiosk-mode .page-head,
body.kiosk-mode .content > p.muted { display: none !important; }
body.kiosk-mode .main { margin-left: 0 !important; }
body.kiosk-mode .content { padding: 0 !important; }
body.kiosk-mode .kiosk-stage { max-width: 760px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; }
body.kiosk-mode .kiosk-clock { font-size: 64px; }
body.kiosk-mode .kiosk-greet { font-size: 18px; }
