/* ═══════════════════════════════════════════════════════════════════════════
   INDOSEAS HRIS — Component Stylesheet
   Layout  → Tailwind (layout_header / layout_footer)
   This file → CSS vars (backward compat) + reusable component classes
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. CSS Variables — backward compat for module inline var() ───────────── */
:root {
  /* Primary */
  --primary:        #174A60;
  --primary-d:      #12394f;
  --primary-hover:  #12394f;
  --primary-active: #0f2e42;
  --primary-l:      #e8f4f9;
  --primary-soft:   #e8f4f9;
  --teal:           #2880a0;

  /* Backgrounds */
  --bg:       #ffffff;
  --bg-soft:  #f5f8fa;
  --bg-muted: #e8f4f9;
  --card:     #ffffff;

  /* Text */
  --text:       #15232B;
  --text-soft:  #5F717C;
  --text-faint: #8A9AA4;
  --muted:      #5F717C;

  /* Borders */
  --border: #dde8ee;
  --line:   #dde8ee;

  /* Status */
  --success:     #1F7A5A;
  --success-l:   #E8F5EF;
  --success-soft:#E8F5EF;
  --warning:     #B7791F;
  --warning-soft:#FFF4E5;
  --warn:        #B7791F;
  --warn-l:      #FFF4E5;
  --danger:      #C44536;
  --danger-l:    #FCEDEA;
  --danger-soft: #FCEDEA;
  --info:        #2F6F8A;
  --info-l:      #EAF4F8;
  --info-soft:   #EAF4F8;

  /* Layout refs (used by attendance JS / toast positioning) */
  --topbar-h:        56px;
  --bn-h:            56px;
  --mobile-status-h: 44px;
  --mobile-safe-b:   34px;
  --mobile-nav-h:    80px;

  /* Radii & shadow */
  --radius:    10px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow:    0 1px 3px rgba(21,35,43,.04), 0 4px 14px rgba(21,35,43,.03);
  --shadow-md: 0 4px 20px rgba(21,35,43,.09);
}

/* ── 2. Reset extras ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ── 3. Scrollbar hide utility (Tailwind plugin not available in CDN) ──────── */
.scrollbar-hide { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ── 4. Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: #ffffff;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:last-child { margin-bottom: 0; }
.card h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
a.card:hover, .card-hoverable:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
a.card:active, .card-hoverable:active { transform: translateY(0); }

/* Card accent borders (left) */
.card-accent-warn    { border-left: 3px solid var(--warning); }
.card-accent-success { border-left: 3px solid var(--success); }
.card-accent-danger  { border-left: 3px solid var(--danger); }
.card-accent-info    { border-left: 3px solid var(--info); }
.card-accent-primary { border-left: 3px solid var(--primary); }

/* Stat card */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.card.stat { text-align: center; padding: 14px 10px; cursor: default; }
.card.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-label {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.stat-value {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -.3px;
}
.stat-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* Metric card (left accent + large number) */
.metric-card {
  background: #fff;
  border: 0.5px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.metric-card .metric-val {
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -.3px;
}
.metric-card .metric-lbl {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-soft);
  margin-top: 3px;
}

/* Grid layouts */
.grid       { display: grid; gap: 14px; margin-bottom: 14px; }
.grid.two   { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: 1fr 1fr 1fr; }
.full-row   { grid-column: 1 / -1; }

/* ── 5. Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: middle;
  background: var(--primary);
  color: #fff;
  transition: background .14s, box-shadow .14s, transform .1s, opacity .14s;
  position: relative;
  overflow: hidden;
}
.btn:hover    { background: var(--primary-hover); box-shadow: 0 3px 10px rgba(23,74,96,.22); }
.btn:active   { background: var(--primary-active); transform: scale(.975); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-block { width: 100%; justify-content: center; }

/* Outlined */
.btn-outline {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  background: var(--bg-soft);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(23,74,96,.08);
}
.btn-outline:active { background: var(--bg-muted); transform: scale(.975); }

/* Soft */
.btn-soft {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
}
.btn-soft:hover { background: #d0e4ee; }

/* Status variants */
.btn-danger  { background: var(--danger); }
.btn-danger:hover  { background: #b03020; box-shadow: 0 3px 10px rgba(196,69,54,.22); }
.btn-success { background: var(--success); }
.btn-success:hover { background: #196649; box-shadow: 0 3px 10px rgba(31,122,90,.22); }
.btn-warn, .btn-warning { background: var(--warning); color: #fff; }
.btn-warn:hover { background: #9e6918; }

/* Sizes */
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-xs { padding: 3px 8px;  font-size: 11px; border-radius: 5px; }

/* Ripple */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  transform: scale(0);
  animation: ripple .45s linear;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ── 6. Forms ──────────────────────────────────────────────────────────────── */
.grid-form, .stack { display: grid; gap: 12px; }
label { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.3; }

.input, textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder, textarea::placeholder { color: var(--text-faint); }
.input:hover, textarea:hover, select:hover { border-color: var(--text-faint); }
.input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23,74,96,.1);
}
.input:disabled, textarea:disabled, select:disabled {
  background: var(--bg-soft);
  color: var(--text-faint);
  cursor: not-allowed;
  border-color: var(--line);
}
.input-readonly { background: var(--bg-soft) !important; font-weight: 700; cursor: default; pointer-events: none; }
textarea { min-height: 90px; resize: vertical; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235F717C' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}
.checkboxes { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.checkboxes label { font-weight: 500; display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* ── 7. Badges & Status Chips ──────────────────────────────────────────────── */
/* Reference: colored bg + matching dark text, border-radius 99px */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--primary-soft);
  color: var(--primary);
}
.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .65;
  flex-shrink: 0;
}
.badge.ok      { background: var(--success-soft); color: #0f5c3e; }
.badge.bad     { background: var(--danger-soft);  color: #8b2112; }
.badge.warn    { background: var(--warning-soft); color: #7c5412; }
.badge.info    { background: var(--info-soft);    color: var(--info); }
.badge.neutral { background: #f0f3f5; color: var(--text-soft); }

/* Chip variant (no dot) */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
}
.chip.ok      { background: var(--success-soft); color: #0f5c3e; }
.chip.bad     { background: var(--danger-soft);  color: #8b2112; }
.chip.warn    { background: var(--warning-soft); color: #7c5412; }
.chip.info    { background: var(--info-soft);    color: var(--info); }
.chip.neutral { background: #f0f3f5; color: var(--text-soft); }

/* ── 8. Alerts / Flash ─────────────────────────────────────────────────────── */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
  border-left: 3px solid currentColor;
  overflow: hidden;
  max-height: 200px;
  transition: opacity .35s, max-height .35s, padding .35s, margin .35s;
}
.alert-success { background: var(--success-soft); color: #0f5c3e; }
.alert-danger  { background: var(--danger-soft);  color: #8b2112; }
.alert-info    { background: var(--info-soft);    color: var(--info); }
.alert-warning { background: var(--warning-soft); color: #7c5412; }

/* ── 9. Tables ─────────────────────────────────────────────────────────────── */
/* Reference: 12px, alternating hover #f5fbff, 0.5px row dividers */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
  background: #fff;
}
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 480px; }
.table-wrap thead { background: #f5f8fa; }
.table-wrap th {
  padding: 10px 13px;
  border-bottom: 0.5px solid var(--border);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-soft);
  white-space: nowrap;
  user-select: none;
}
.table-wrap td {
  padding: 10px 13px;
  border-bottom: 0.5px solid var(--border);
  vertical-align: middle;
  font-size: 12.5px;
  color: var(--text);
}
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tbody tr { transition: background .12s; }
.table-wrap tbody tr:hover { background: #f5fbff; }
.td-actions { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }

/* ── 10. Lists ─────────────────────────────────────────────────────────────── */
.list-item {
  padding: 11px 0;
  border-bottom: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background .12s;
}
.list-item:last-child { border-bottom: none; }

.request-card {
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  transition: background .12s, box-shadow .15s;
}
.request-card:hover { background: #f5fbff; box-shadow: var(--shadow); }

/* ── 11. Tabs / Filter chips ───────────────────────────────────────────────── */
.section-tabs {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  background: #f5f8fa;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
}
.tab-btn {
  padding: 6px 13px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-soft);
  transition: background .13s, color .13s, box-shadow .13s;
  white-space: nowrap;
}
.tab-btn:hover  { background: #fff; color: var(--text); }
.tab-btn.active {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(23,74,96,.08);
}
.tab-pane        { display: none; }
.tab-pane.active { display: block; }

.filter-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-chip {
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: all .13s;
  white-space: nowrap;
}
.filter-chip:hover  { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.filter-chip.active { border-color: var(--primary); background: var(--primary); color: #fff; }

/* ── 12. KPI / Progress ────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi-box {
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s;
}
.kpi-box:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-val { font-size: 22px; font-weight: 500; line-height: 1.15; }
.kpi-lbl { color: var(--text-soft); font-size: 10.5px; margin-top: 5px; font-weight: 600; }

.progress-bar  { height: 5px; background: var(--bg-muted); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.progress-fill.ok   { background: var(--success); }
.progress-fill.warn { background: var(--warning); }
.progress-fill.bad  { background: var(--danger); }

/* ── 13. Toast ─────────────────────────────────────────────────────────────── */
.att-toast {
  position: fixed;
  bottom: calc(var(--bn-h) + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding: 11px 20px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  box-shadow: var(--shadow-md);
  z-index: 9999;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  max-width: 90vw;
  pointer-events: none;
}
.att-toast.show    { opacity: 1; transform: translateX(-50%) translateY(0); }
.att-toast-ok      { background: var(--success); }
.att-toast-err     { background: var(--danger); }

/* ── 14. Attendance ────────────────────────────────────────────────────────── */

/* ─ Hero Clock Card (premium two-panel) ─────────────────────────────────── */
.att-hero-card {
  display: flex;
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 28px rgba(23,74,96,.10), 0 1px 4px rgba(27,45,58,.05);
  overflow: hidden;
  margin-bottom: 20px;
}

.att-hero-left {
  background: linear-gradient(145deg, #174A60 0%, #2277a0 55%, #2880a0 100%);
  color: #fff;
  padding: 28px 28px 28px 24px;
  min-width: 210px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.att-hero-left::before {
  content: '';
  position: absolute;
  top: -40px; right: -30px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}
.att-hero-left::after {
  content: '';
  position: absolute;
  bottom: -50px; left: -20px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  pointer-events: none;
}

.att-hero-clock-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255,255,255,.55);
}
.att-hero-clock {
  font-size: 46px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  color: #fff;
  line-height: 1;
  font-family: 'SF Mono', ui-monospace, 'Fira Code', monospace;
}
.att-hero-date {
  font-size: 12px;
  color: rgba(255,255,255,.65);
  font-weight: 500;
  margin-top: 2px;
}
.att-hero-sched {
  font-size: 11px;
  color: rgba(255,255,255,.50);
  margin-top: 10px;
  line-height: 1.55;
}
.att-hero-sched strong { color: rgba(255,255,255,.8); }

.att-hero-right {
  flex: 1;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.att-hero-times {
  display: flex;
  align-items: stretch;
  gap: 12px;
}
.att-hero-time-box {
  flex: 1;
  text-align: center;
  padding: 14px 12px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  transition: background .18s, border-color .18s;
}
.att-hero-time-box.done {
  background: var(--success-soft);
  border-color: rgba(31,122,90,.18);
}
.att-hero-time-icon {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 5px;
}
.att-hero-time-box.done .att-hero-time-icon { color: var(--success); }
.att-hero-time-label {
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-faint);
  margin-bottom: 5px;
}
.att-hero-time-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  line-height: 1.1;
}
.att-hero-time-sub {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--text-soft);
}
.att-hero-time-divider {
  width: 1px;
  background: var(--border);
  margin: 8px 0;
  flex-shrink: 0;
  align-self: stretch;
}

/* Responsive: stack on narrow desktop / tablet */
@media (max-width: 900px) {
  .att-hero-card { flex-direction: column; }
  .att-hero-left { max-width: none; padding: 22px 24px 18px; }
  .att-hero-clock { font-size: 38px; }
  .att-hero-right { padding: 18px 24px 22px; }
  .att-hero-time-val { font-size: 24px; }
}

/* Legacy classes kept for mobile partial */
.att-clock-card { text-align: center; padding: 26px 20px 20px; }
.att-clock {
  font-size: 52px; font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: 3px; color: var(--primary); line-height: 1;
  font-family: 'SF Mono', ui-monospace, 'Fira Code', monospace;
}
.att-date    { font-size: 12.5px; color: var(--text-soft); margin-top: 7px; font-weight: 500; }
.att-subtext { font-size: 12.5px; color: var(--text-soft); margin: 16px 0 10px; }
.att-status-row { display: flex; justify-content: center; gap: 28px; margin: 18px 0; flex-wrap: wrap; }
.att-info-box   { text-align: center; }
.att-info-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint); }
.att-info-val   { font-size: 24px; font-weight: 500; margin: 4px 0; color: var(--text); }
.att-btn-row    { margin-top: 6px; display: flex; justify-content: flex-start; gap: 10px; flex-wrap: wrap; align-items: center; }

.att-btn-checkin {
  background: linear-gradient(135deg, #1F7A5A, #168a60);
  font-size: 14.5px; padding: 13px 30px; border-radius: 10px;
  box-shadow: 0 4px 14px rgba(31,122,90,.3);
}
.att-btn-checkin:hover { background: linear-gradient(135deg, #196649, #1a7a58); box-shadow: 0 4px 18px rgba(31,122,90,.4); }
.att-btn-checkout {
  background: linear-gradient(135deg, #174A60, #2277a0);
  font-size: 14.5px; padding: 13px 30px; border-radius: 10px;
  box-shadow: 0 4px 14px rgba(23,74,96,.3);
}
.att-btn-checkout:hover { box-shadow: 0 4px 18px rgba(23,74,96,.4); }

/* Attendance status badge with pulse */
.att-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 99px;
  font-size: 12px; font-weight: 700;
}
.att-status-badge.present { background: var(--success-soft); color: #0f5c3e; }
.att-status-badge.late    { background: var(--warning-soft); color: #7c5412; }
.att-status-badge.absent  { background: var(--danger-soft);  color: #8b2112; }
.att-status-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%,100% { opacity:1; } 50% { opacity:.35; } }

/* Dark mode: hero card */
.dark .att-hero-left {
  background: linear-gradient(145deg, #0c2a3a 0%, #133351 55%, #163e55 100%);
}
.dark .att-hero-time-box { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.08); }
.dark .att-hero-time-box.done { background: rgba(31,122,90,.18); border-color: rgba(31,122,90,.25); }

/* ── 15. Attendance Modal ──────────────────────────────────────────────────── */
.att-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 9999;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(4px);
}
.att-modal-overlay.open { display: flex; }
.att-modal-box {
  background: #fff;
  border-radius: 18px 18px 0 0;
  width: 100%; max-width: 480px;
  padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 92vh; overflow-y: auto;
  animation: slide-up .26s cubic-bezier(.4,0,.2,1);
}
@keyframes slide-up {
  from { transform: translateY(50px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.att-modal-title { font-size: 16px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.att-modal-geo   { font-size: 11.5px; color: var(--text-soft); text-align: center; margin-bottom: 14px; }
.att-video {
  width: 100%; border-radius: 10px; background: #111;
  max-height: 260px; object-fit: cover; display: block;
}
.att-cam-btns { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.modal-handle {
  width: 34px; height: 4px; background: var(--border);
  border-radius: 999px; margin: 0 auto 16px;
}

/* ── 16. Login page ────────────────────────────────────────────────────────── */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: linear-gradient(145deg, #174A60 0%, #0f2e42 55%, #0c2438 100%);
  padding: 20px;
}
.login-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 28px 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.06);
}
.login-brand {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.login-tagline { color: var(--text-soft); font-size: 13px; margin-bottom: 22px; }
.mini-note     { margin-top: 14px; color: var(--text-faint); font-size: 12px; text-align: center; }

/* ── 17. Welcome banner (dashboard) ───────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, #174A60 0%, #0f2e42 100%);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 14px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.welcome-banner::before {
  content: '';
  position: absolute; top: -30px; right: -30px;
  width: 150px; height: 150px;
  background: rgba(255,255,255,.04);
  border-radius: 50%; pointer-events: none;
}
.welcome-date   { font-size: 12px; opacity: .6; font-weight: 500; }
.welcome-name   { font-size: 20px; font-weight: 700; margin-top: 3px; letter-spacing: -.2px; }
.welcome-status { opacity: .75; margin-top: 4px; font-size: 13px; }

/* ── 18. Quick actions ─────────────────────────────────────────────────────── */
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.quick-action-item {
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transition: background .15s, box-shadow .15s, transform .15s;
  cursor: pointer;
}
.quick-action-item:hover {
  background: var(--primary-soft);
  border-color: rgba(23,74,96,.2);
  box-shadow: 0 4px 14px rgba(23,74,96,.08);
  transform: translateY(-1px);
}
.quick-action-item:active { transform: translateY(0); box-shadow: none; }
.quick-action-icon  { font-size: 24px; line-height: 1; display: block; }
.quick-action-label { font-size: 11.5px; font-weight: 700; color: var(--text); line-height: 1.2; }

/* ── 19. Mobile App Layout ─────────────────────────────────────────────────── */
.mobile-only { display: none; }
.desktop-only { display: block; }

.mobile-page {
  display: grid;
  gap: 18px;
}

.mobile-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mobile-page-header.sticky {
  position: sticky;
  top: calc(max(var(--mobile-status-h), env(safe-area-inset-top, 0px)) + 4px);
  z-index: 8;
  margin: 0 -4px;
  padding: 10px 4px 12px;
  background: rgba(245,248,250,.92);
  backdrop-filter: blur(14px);
}

.mobile-header-copy { min-width: 0; }
.mobile-overline {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.mobile-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-top: 3px;
}
.mobile-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
}

.mobile-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 0.5px solid var(--border);
  background: #fff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  position: relative;
  flex-shrink: 0;
}
.mobile-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.mobile-badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #fff;
}

.mobile-hero-card {
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(23,74,96,.16);
}

.mobile-hero-card.soft {
  background: var(--primary);
}

.mobile-hero-top,
.mobile-hero-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mobile-hero-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: rgba(255,255,255,.68);
}

.mobile-hero-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  margin-top: 4px;
}

.mobile-hero-text {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,.85);
}

.mobile-hero-pill {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.mobile-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.mobile-section-title h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.mobile-section-title p {
  margin: 0;
  font-size: 11px;
  color: var(--text-faint);
}

.mobile-link-inline {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal, #2880a0);
}

.mobile-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mobile-quick-action {
  min-height: 72px;
  border-radius: 14px;
  background: #fff;
  border: 0.5px solid var(--border);
  padding: 10px 6px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.mobile-quick-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.mobile-quick-icon svg {
  width: 18px;
  height: 18px;
}

.mobile-quick-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.mobile-h-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.mobile-h-scroll::-webkit-scrollbar { display: none; }

.mobile-summary-card,
.mobile-day-pill {
  scroll-snap-align: start;
  flex-shrink: 0;
}

.mobile-summary-card {
  min-width: 120px;
  max-width: 140px;
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.mobile-summary-card .label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
}

.mobile-summary-card .value {
  margin-top: 5px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.mobile-summary-card .meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-soft);
}

.mobile-day-pill {
  width: 52px;
  min-height: 72px;
  border-radius: 14px;
  border: 0.5px solid var(--border);
  background: #fff;
  padding: 8px 4px;
  display: grid;
  place-items: center;
  gap: 2px;
  text-align: center;
  box-shadow: var(--shadow);
}

.mobile-day-pill .weekday {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-faint);
}

.mobile-day-pill .date {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.mobile-day-pill .state {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-soft);
}

.mobile-day-pill.is-today {
  background: var(--primary);
  color: #fff;
  border-color: rgba(23,74,96,.45);
}
.mobile-day-pill.is-today .weekday,
.mobile-day-pill.is-today .date,
.mobile-day-pill.is-today .state { color: #fff; }

.mobile-day-pill.state-present { border-color: rgba(31,122,90,.28); }
.mobile-day-pill.state-late { border-color: rgba(183,121,31,.28); }
.mobile-day-pill.state-none { opacity: .78; }

.mobile-card-list {
  display: grid;
  gap: 12px;
}

.mobile-list-card,
.mobile-action-card,
.mobile-form-card,
.mobile-info-card {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.mobile-list-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mobile-list-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.mobile-list-meta,
.mobile-list-desc {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.45;
}

.mobile-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 8px;
}

.mobile-kv .label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.mobile-kv .value {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.mobile-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.mobile-pill-link {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.mobile-profile-header {
  background: var(--primary);
  border-radius: 14px;
  color: #fff;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 24px rgba(23,74,96,.16);
}

.mobile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

.mobile-profile-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}

.mobile-profile-role {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255,255,255,.78);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.mobile-info-list {
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mobile-info-row,
.mobile-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--border);
}

.mobile-info-row:last-child,
.mobile-action-row:last-child { border-bottom: none; }

.mobile-info-row .key,
.mobile-action-row .key {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: .03em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.mobile-info-row .val,
.mobile-action-row .val {
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-action-row .val::after {
  content: '›';
  margin-left: 10px;
  font-size: 18px;
  color: var(--text-faint);
  vertical-align: middle;
}

#bottomNav {
  display: none;
}

#bottomNav .mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  gap: 2px;
  align-items: stretch;
  background: rgba(255,255,255,.97);
  border-top: 0.5px solid var(--border);
  box-shadow: 0 -6px 20px rgba(21,35,43,.06);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
}

.mobile-nav-item {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border-radius: 12px;
  color: var(--text-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px 6px;
  font-size: 10px;
  font-weight: 700;
  transition: color .15s ease, background .15s ease;
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
  display: block;
}

.mobile-nav-item.active {
  color: var(--primary);
  background: rgba(23,74,96,.06);
}

.mobile-nav-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: transparent;
}

.mobile-nav-item.active .mobile-nav-dot {
  background: var(--primary);
}

/* ── Mobile Logo Header ──────────────────────────────────────────────────── */
.mobile-logo-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}
.mobile-logo-bar img {
  height: 28px;
  width: auto;
  display: block;
}
.mobile-logo-bar .mobile-logo-text {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: .02em;
  line-height: 1;
}
.mobile-logo-bar .mobile-logo-sub {
  font-size: 9px;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* ── Mobile Logout Button ────────────────────────────────────────────────── */
.mobile-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 0.5px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s, transform .1s;
}
.mobile-logout-btn:active {
  background: #f5c8c2;
  transform: scale(.98);
}
.mobile-logout-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Mobile Menu Grid ────────────────────────────────────────────────────── */
.mobile-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.mobile-menu-item {
  border-radius: 14px;
  background: var(--card);
  border: 0.5px solid var(--border);
  padding: 14px 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
  min-height: 80px;
}
.mobile-menu-item .mobile-menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-menu-item .mobile-menu-icon svg {
  width: 18px;
  height: 18px;
}
.mobile-menu-item .mobile-menu-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

/* ── Mobile Stepper Form ─────────────────────────────────────────────────── */
.mobile-stepper {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.mobile-stepper-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 16px;
}
.mobile-stepper-step {
  display: flex;
  align-items: center;
  flex: 1;
}
.mobile-stepper-step:last-child {
  flex: 0;
}
.mobile-stepper-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-faint);
  flex-shrink: 0;
  transition: all .2s;
}
.mobile-stepper-step.active .mobile-stepper-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.mobile-stepper-step.done .mobile-stepper-dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.mobile-stepper-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
}
.mobile-stepper-step.done .mobile-stepper-line {
  background: var(--success);
}
.mobile-stepper-panel {
  display: none;
}
.mobile-stepper-panel.active {
  display: block;
}
.mobile-stepper-panel .grid-form {
  display: grid;
  gap: 14px;
}
.mobile-stepper-nav {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.mobile-stepper-nav .btn {
  flex: 1;
}
.mobile-step-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.mobile-step-desc {
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 12px;
  line-height: 1.4;
}
.mobile-step-summary {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 14px;
  display: grid;
  gap: 8px;
}
.mobile-step-summary .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.mobile-step-summary .row .k {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.mobile-step-summary .row .v {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

/* ── Mobile Dashboard Illustration Card ──────────────────────────────────── */
.mobile-illust-card {
  border-radius: 14px;
  overflow: hidden;
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow);
}
.mobile-illust-card .mobile-illust-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.mobile-illust-card .mobile-illust-body {
  padding: 14px 16px;
  background: var(--card);
}
.mobile-illust-card .mobile-illust-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.mobile-illust-card .mobile-illust-desc {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.45;
}

/* Dark mode stepper + illust */
.dark .mobile-stepper { background: var(--card); border-color: var(--border); }
.dark .mobile-stepper-dot { background: var(--bg-muted); border-color: var(--border); }
.dark .mobile-step-summary { background: var(--bg-muted); }
.dark .mobile-illust-card { border-color: var(--border); }
.dark .mobile-illust-card .mobile-illust-body { background: var(--card); }

/* ── 20. Misc utilities ────────────────────────────────────────────────────── */
hr { border: none; border-top: 0.5px solid var(--border); margin: 14px 0; }
.muted  { color: var(--text-soft); }
.faint  { color: var(--text-faint); }
.color-ok   { color: var(--success); }
.color-warn { color: var(--warning); }
.color-bad  { color: var(--danger); }
.text-primary { color: var(--primary); }

.empty-state       { text-align: center; padding: 36px 20px; color: var(--text-faint); }
.empty-state-icon  { font-size: 36px; margin-bottom: 10px; }
.empty-state-title { font-weight: 700; color: var(--text-soft); margin-bottom: 5px; font-size: 14px; }
.empty-state-desc  { font-size: 13px; }

.info-strip {
  background: var(--info-soft);
  border: 0.5px solid rgba(47,111,138,.18);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 12.5px;
  color: var(--info);
  margin-bottom: 12px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-soft);
  padding-bottom: 9px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 12px;
}

.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flex-gap     { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clean-list   { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.clean-list li { padding-left: 14px; position: relative; font-size: 13px; }
.clean-list li::before { content: ''; position: absolute; left: 4px; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary-soft); border: 1px solid var(--primary); }

/* ── 21. Desktop Reference Shell ──────────────────────────────────────────── */
@media (min-width: 768px) {
  body {
    background: var(--bg-soft);
  }

  .desktop-shell {
    background: var(--bg-soft);
  }

  .desktop-sidebar {
    background: #fff;
    border-right: 0.5px solid var(--border);
    box-shadow: none;
  }

  .desktop-brand {
    background: #fff;
  }

  .desktop-brand-mark {
    border-radius: 8px;
  }

  .desktop-logo-mark {
    width: 28px;
    height: 28px;
    display: block;
  }

  .desktop-logo-wordmark {
    height: 22px;
    width: auto;
    display: block;
  }

  .desktop-logo-compact {
    height: 20px;
    width: auto;
    display: block;
  }

  .sb-nav-link {
    color: var(--text-soft);
  }

  .sb-nav-link:hover {
    background: var(--bg-soft);
    color: var(--text);
  }

  .sb-nav-link[aria-current="page"] {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 500;
  }

  .desktop-main {
    background: var(--bg-soft);
  }

  .desktop-topbar {
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(221,232,238,.9);
  }

  .desktop-search input {
    border-radius: 18px 0 0 18px !important;
    border-right: none !important;
    background: #fff !important;
  }

  .desktop-search button {
    border-radius: 0 18px 18px 0 !important;
    border-left: none !important;
    background: var(--bg-soft) !important;
  }

  .desktop-search input[readonly] {
    background: var(--bg-soft) !important;
    color: var(--text-faint) !important;
    cursor: not-allowed;
  }

  .desktop-search button:disabled {
    opacity: .6;
    cursor: not-allowed;
  }

  .desktop-page-body {
    padding: 20px 24px !important;
    max-width: none;
  }

  .desktop-only .card,
  .desktop-only .table-wrap,
  .desktop-only .kpi-box,
  .desktop-only .request-card,
  .desktop-only .metric-card {
    border-radius: 10px;
    box-shadow: none;
  }

  .desktop-only .card {
    padding: 14px 16px;
  }

  .desktop-only .card.stat {
    text-align: left;
    padding: 14px 16px;
    border-left: 3px solid var(--teal);
    border-radius: 0 10px 10px 0;
  }

  .desktop-only .stat-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
  }

  .desktop-only .stat-value {
    font-size: 24px;
    font-weight: 500;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
  }

  .desktop-only .btn {
    padding: 7px 14px;
    border-radius: 20px;
    border: 0.5px solid var(--border);
    font-size: 12px;
    font-weight: 500;
    box-shadow: none;
  }

  .desktop-only .btn:hover {
    box-shadow: none;
  }

  .desktop-only .btn-outline {
    background: var(--card);
    color: var(--text);
  }

  .desktop-only .table-wrap thead {
    background: var(--bg-soft);
  }

  .desktop-only .table-wrap th {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-soft);
  }

  .desktop-only .table-wrap td {
    font-size: 12px;
  }

  .desktop-only .table-wrap tbody tr:hover {
    background: var(--bg-soft);
  }

  .desktop-only .input,
  .desktop-only textarea,
  .desktop-only select {
    border-radius: 8px;
    box-shadow: none;
  }

  .desktop-only .section-tabs {
    background: transparent;
    border: none;
    padding: 0;
    gap: 8px;
  }

  .desktop-only .tab-btn {
    border-radius: 999px;
    border: 0.5px solid var(--border);
    background: #fff;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
  }

  .desktop-only .tab-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: none;
  }
}

/* ── 21. Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .mobile-only { display: block; }
  .desktop-only { display: none !important; }

  #appBody {
    background: var(--bg-soft);
  }

  .page-body {
    padding-top: calc(max(var(--mobile-status-h), env(safe-area-inset-top, 0px)) + 12px) !important;
    padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 24px) !important;
  }

  #bottomNav {
    display: block;
  }

  .card {
    border-radius: 14px;
  }

  .cards { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .grid.two   { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: 1fr 1fr; }
  .kpi-grid   { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .card { padding: 12px 13px; border-radius: 9px; }
  .cards { gap: 7px; }
  .stat-value { font-size: 20px; }

  .att-clock { font-size: 40px; }
  .att-info-val { font-size: 20px; }
  .att-btn-checkin, .att-btn-checkout { width: 100%; max-width: 260px; font-size: 14px; padding: 12px 20px; }

  .btn { padding: 8px 13px; font-size: 13px; }
  .input, textarea, select { font-size: 16px; } /* prevent iOS zoom */

  .grid.three { grid-template-columns: 1fr 1fr; }
  .kpi-val { font-size: 18px; }
  .welcome-name { font-size: 17px; }
  .quick-action-icon  { font-size: 20px; }
  .quick-action-label { font-size: 10.5px; }

  .login-card { padding: 22px 18px; border-radius: 12px; }
  .att-modal-box { border-radius: 16px 16px 0 0; }

  .mobile-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-kv { grid-template-columns: 1fr 1fr; }
  .mobile-summary-card { min-width: 120px; }
}

@media (min-width: 768px) {
  .quick-actions { grid-template-columns: repeat(6, 1fr); }
}

@media (min-width: 1280px) {
  .page-body:not(.desktop-page-body) { max-width: 1200px; margin: 0 auto; }
}

/* ── 22. Desktop sidebar collapsed state ──────────────────────────────────── */
/* Toggle via JS: document.body.classList.add/remove('sb-collapsed')          */

/* Hide all labelled text & section dividers when collapsed */
body.sb-collapsed .sb-text    { display: none !important; }
body.sb-collapsed .sb-divider { display: none !important; }
body.sb-collapsed .desktop-brand { justify-content: center; padding-left: 0; padding-right: 0; }
body.sb-collapsed .desktop-logo-mark { width: 30px; height: 30px; }

/* Allow sidebar overflow so tooltips peek out */
body.sb-collapsed #sidebar { overflow: visible; }

/* Tooltip: hidden by default, shown on nav-link hover when collapsed */
body.sb-collapsed .sb-tooltip           { display: none; }
body.sb-collapsed .sb-nav-link:hover .sb-tooltip { display: block !important; }

/* ── 23. Dark mode CSS variable overrides ─────────────────────────────────── */
/* Applied via .dark class on <html id="htmlRoot">, toggled by hrisToggleTheme() */
.dark {
  --bg:          #0f1d24;
  --bg-soft:     #162330;
  --bg-muted:    #1e2f3c;
  --card:        #162330;
  --text:        #e2edf2;
  --text-soft:   #8aabb8;
  --text-faint:  #5a7585;
  --muted:       #8aabb8;
  --border:      #253a47;
  --line:        #253a47;
  --primary-l:   #1a3344;
  --primary-soft:#1a3344;
}

/* Dark mode: component overrides using CSS vars (Tailwind handles its own) */
.dark .card,
.dark .table-wrap,
.dark .input,
.dark textarea,
.dark select       { background: var(--card); color: var(--text); border-color: var(--border); }
.dark .desktop-sidebar,
.dark .desktop-topbar,
.dark #profileDropdown { background: var(--card); border-color: var(--border); }
.dark .desktop-search button { background: var(--bg-muted) !important; }
.dark .sb-nav-link:hover { background: var(--bg-muted); color: var(--text); }
.dark .sb-nav-link[aria-current="page"] { background: rgba(40,128,160,.16); color: #7ad2ed; }
.dark .table-wrap thead { background: var(--bg-muted); }
.dark .alert-success    { background: #0d2e1f; }
.dark .alert-danger     { background: #2c1410; }
.dark .alert-info       { background: #0e2330; }
.dark .alert-warning    { background: #2a1e08; }

/* ══════════════════════════════════════════════════════════════════════════
   INDOSEAS HRIS — Additions v2
   (appended — tidak mengubah rule yang sudah ada)
══════════════════════════════════════════════════════════════════════════ */

/* ── Sidebar group label ──────────────────────────────────────────────────── */
.sb-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-faint);
  padding: 8px 20px 4px;
  white-space: nowrap;
  overflow: hidden;
  display: block;
  transition: opacity .15s;
}

/* ── Dark mode: topbar + dropdown + inputs ────────────────────────────────── */
.dark body { background: var(--bg-soft); }
.dark #appBody { background: var(--bg-soft); }

.dark .desktop-topbar {
  background: var(--card) !important;
  border-color: var(--border) !important;
}
.dark .desktop-topbar input[type="text"] {
  background: var(--bg-muted) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.dark #profileDropdown {
  background: var(--card) !important;
  border-color: var(--border) !important;
}
.dark #profileDropdown a { color: var(--text) !important; }
.dark #profileDropdown a:hover { background: var(--bg-muted) !important; }
.dark #profileDropdown .text-red-500 { color: #f87171 !important; }
.dark #profileDropdown .hover\:bg-red-50:hover { background: rgba(220,38,38,.12) !important; }

.dark .desktop-sidebar { background: var(--card) !important; border-color: var(--border) !important; }
.dark .desktop-brand   { background: var(--card) !important; border-color: var(--border) !important; }
.dark .desktop-logo-wordmark,
.dark .desktop-logo-compact { filter: brightness(1.18) saturate(1.06); }
.dark #langBtn {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text-soft) !important;
}
.dark #themeToggleBtn,
.dark #desktopHamburger { background: transparent !important; color: var(--text-soft) !important; }
.dark #profileBtn { background: var(--primary) !important; color: #fff !important; }
.dark .desktop-main    { background: var(--bg-soft) !important; }
.dark .desktop-page-body { background: var(--bg-soft) !important; }

/* Welcome banner dark */
.dark .rounded-2xl[style*="background:var(--primary)"],
.dark [style*="background:var(--primary)"] { background: #0f3349 !important; }

/* Quick action cards dark */
.dark .card { background: var(--card); border-color: var(--border); }
.dark .card h3 { color: var(--text); }
.dark .stat-value { color: var(--text); }
.dark .stat-label { color: var(--text-soft); }

/* Form inputs dark */
.dark .input,
.dark textarea,
.dark select {
  background: var(--bg-muted) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.dark .input::placeholder { color: var(--text-faint) !important; }

/* Table dark */
.dark .table-wrap thead { background: var(--bg-muted) !important; }
.dark .table-wrap th     { color: var(--text-soft) !important; }
.dark .table-wrap td     { color: var(--text) !important; border-color: var(--border) !important; }
.dark .table-wrap tbody tr:hover td { background: var(--bg-muted) !important; }

/* Section title dark */
.dark .section-title { color: var(--text-soft); border-color: var(--border); }

/* Alert dark */
.dark .alert-success { background: #0d2e1f; color: #6ee7b7; border-color: #1a5c3a; }
.dark .alert-danger  { background: #2c1410; color: #fca5a5; border-color: #6b2020; }
.dark .alert-info    { background: #0e2330; color: #93c5fd; border-color: #1e4060; }
.dark .alert-warning { background: #2a1e08; color: #fcd34d; border-color: #5c3c10; }

/* Footer dark */
.dark footer { background: var(--card); border-color: var(--border); color: var(--text-faint); }

/* Mobile dark */
.dark .mobile-hero-card { background: #0f3349; }
.dark .mobile-nav { background: var(--card); border-color: var(--border); }
.dark .mobile-page-header { background: var(--card); border-color: var(--border); }
.dark .mobile-list-card,
.dark .mobile-form-card,
.dark .mobile-info-card,
.dark .mobile-action-card { background: var(--card); border-color: var(--border); }
.dark .mobile-quick-action { background: var(--card); border-color: var(--border); }
.dark .mobile-day-pill { background: var(--bg-muted); border-color: var(--border); }
.dark .mobile-list-title { color: var(--text); }
.dark .mobile-list-meta,
.dark .mobile-list-desc { color: var(--text-soft); }
.dark .mobile-menu-item { background: var(--card); border-color: var(--border); }
.dark .mobile-logout-btn { background: rgba(196,69,54,.12); border-color: rgba(196,69,54,.3); }
.dark .mobile-info-list { background: var(--card); border-color: var(--border); }
.dark .mobile-profile-header { background: #0f3349; }

/* ══════════════════════════════════════════════════════════════════════════
   INDOSEAS HRIS — Modern Component Library v3
   New components for dashboard redesign + attendance cleanup
══════════════════════════════════════════════════════════════════════════ */

/* ── Text color utilities (replace inline style="color:var(--x)") ────────── */
.text-ok   { color: var(--success)  !important; }
.text-warn { color: var(--warning)  !important; }
.text-bad  { color: var(--danger)   !important; }

/* ── Grid utilities (replace inline grid-template-columns) ───────────────── */
.grid-3col     { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.grid-2col     { display: grid; grid-template-columns: 1fr 1fr;     gap: 12px; margin-bottom: 16px; }
.grid-auto-150 { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.grid-auto-130 { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }

/* Misc inline style replacements */
.text-center { text-align: center; }
.text-xs     { font-size: 11.5px !important; }
.mt-2        { margin-top: 8px; }

/* ── Tab system (base styles) ────────────────────────────────────────────── */
.section-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.section-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 8px 14px; font-size: 13px; font-weight: 600;
  color: var(--text-soft); background: transparent; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  margin-bottom: -1px; transition: color .14s, border-color .14s;
  white-space: nowrap; flex-shrink: 0;
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane       { display: none; }
.tab-pane.active { display: block; }

/* ── Filter chips ────────────────────────────────────────────────────────── */
.filter-chips {
  display: flex; align-items: center;
  gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 13px; border: 1px solid var(--border);
  border-radius: 99px; font-size: 12px; font-weight: 600;
  color: var(--text-soft); background: #fff; cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
  white-space: nowrap; user-select: none;
}
.filter-chip:hover  { background: var(--bg-soft); color: var(--text); }
.filter-chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

/* ── Welcome banner v2 (.wb) ─────────────────────────────────────────────── */
.wb {
  position: relative;
  background: linear-gradient(130deg, #174A60 0%, #2880a0 55%, #1b5a7a 100%);
  border-radius: 16px; padding: 22px 26px; margin-bottom: 20px;
  color: #fff; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; overflow: hidden;
}
.wb::before {
  content: ''; position: absolute; top: -50px; right: -50px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.05); pointer-events: none;
}
.wb::after {
  content: ''; position: absolute; bottom: -70px; right: 60px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.04); pointer-events: none;
}
.wb-body   { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wb-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.16); border: 2px solid rgba(255,255,255,.28);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; flex-shrink: 0;
}
.wb-date   { font-size: 12px; opacity: .65; margin-bottom: 2px; font-weight: 500; }
.wb-name   { font-size: 21px; font-weight: 800; letter-spacing: -.4px; line-height: 1.15; }
.wb-status { font-size: 13px; opacity: .82; margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.wb-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; color: var(--primary);
  border: none; padding: 10px 20px; border-radius: 20px;
  font-size: 13px; font-weight: 700;
  white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: transform .15s, box-shadow .15s; flex-shrink: 0;
}
.wb-btn:hover        { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.20); color: var(--primary); }
.wb-btn-glass        { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); color: #fff; }
.wb-btn-glass:hover  { background: rgba(255,255,255,.22); color: #fff; }
.wb-done {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.88); padding: 8px 16px; border-radius: 20px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; flex-shrink: 0;
}

/* ── KPI strip with icons (.kpi-strip, .kpi-ic) ──────────────────────────── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.kpi-strip-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-ic {
  background: #fff; border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 15px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--shadow);
  transition: box-shadow .18s, transform .18s;
}
.kpi-ic:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-ic-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.kpi-ic-body  { min-width: 0; flex: 1; }
.kpi-ic-val   { font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -.6px; color: var(--text); }
.kpi-ic-label { font-size: 11px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.kpi-ic-sub   { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* ── Quick action grid v2 (.qa-grid, .qa-card) ───────────────────────────── */
.qa-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.qa-card {
  background: #fff; border: 0.5px solid var(--border); border-radius: 12px;
  padding: 16px 10px 14px; display: flex; flex-direction: column;
  align-items: center; gap: 9px; text-align: center;
  text-decoration: none; color: var(--text);
  box-shadow: var(--shadow);
  transition: box-shadow .18s, transform .18s;
  cursor: pointer;
}
.qa-card:hover  { box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--text); }
.qa-card:active { transform: translateY(0); box-shadow: var(--shadow); }
.qa-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: transform .18s;
}
.qa-card:hover .qa-icon { transform: scale(1.08); }
.qa-label { font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.2; }

/* ── Section head (.section-head) ────────────────────────────────────────── */
.section-head {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px; margin-bottom: 12px;
}
.section-head h3 {
  font-size: 13.5px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 7px; margin: 0;
}
.section-head-icon { font-size: 13px; }
.section-action {
  font-size: 12px; font-weight: 700; color: var(--teal);
  text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.section-action:hover { opacity: .75; }

/* ── Info card (.info-card) ──────────────────────────────────────────────── */
.info-card {
  background: #fff; border: 0.5px solid var(--border); border-radius: var(--radius);
  padding: 14px 15px; box-shadow: var(--shadow); margin-bottom: 10px;
}
.info-card:last-child { margin-bottom: 0; }
.info-card-header { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.info-card-icon {
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
}
.info-card-overline { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint); }
.info-card-title { font-size: 13px; font-weight: 700; color: var(--text); }
.info-card-desc  { font-size: 12px; color: var(--text-soft); margin-top: 4px; line-height: 1.5; }
.info-card-link  {
  font-size: 12px; font-weight: 700; color: var(--teal); margin-top: 8px;
  display: inline-flex; align-items: center; gap: 4px; text-decoration: none;
}
.info-card-link:hover { opacity: .75; }

/* ── Alert card (.alert-card) ────────────────────────────────────────────── */
.alert-card {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: #fff; border: 0.5px solid var(--border); box-shadow: var(--shadow);
  margin-bottom: 10px; transition: box-shadow .18s, transform .18s;
}
.alert-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); color: var(--text); }
.alert-card-icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.alert-card-val  { font-size: 14px; font-weight: 800; color: var(--text); }
.alert-card-desc { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }

/* ── Admin KPI grid (.admin-kpi-grid) ────────────────────────────────────── */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px;
}
.admin-kpi-item {
  background: var(--bg-soft); border: 0.5px solid var(--border);
  border-radius: 10px; padding: 13px 14px; text-align: center;
  transition: background .15s;
}
.admin-kpi-item:hover { background: #e0eef6; }
.admin-kpi-val {
  font-size: 30px; font-weight: 800; line-height: 1;
  color: var(--text); letter-spacing: -.6px;
}
.admin-kpi-lbl {
  font-size: 10.5px; font-weight: 600; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: .5px; margin-top: 6px;
}

/* ── Page header (.page-header) ──────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.page-header h1 { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.3px; line-height: 1.2; margin: 0; }
.page-header p  { font-size: 13px; color: var(--text-soft); margin: 4px 0 0; }
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Attendance: photo modal & helpers ───────────────────────────────────── */
.att-photo-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.82); z-index: 9999;
  align-items: center; justify-content: center;
}
.att-photo-preview {
  max-width: 90vw; max-height: 85vh;
  border-radius: 16px; object-fit: cover;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
.att-modal-loading { padding: 24px 0; font-size: 32px; text-align: center; }
.att-nocam-msg {
  background: var(--bg-soft); border-radius: 12px;
  padding: 14px; text-align: center; color: var(--text-soft);
  font-size: 13px; margin: 12px 0;
}
.att-complete-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--success-soft); color: #0f5c3e;
  font-size: 14px; font-weight: 700;
  padding: 10px 20px; border-radius: 99px;
}
.att-modal-submit { width: 100%; padding: 14px; margin-top: 12px; font-size: 15px; }
.att-modal-cancel { width: 100%; margin-top: 8px; }

/* ── Dark mode additions for v3 components ───────────────────────────────── */
.dark .wb  { background: linear-gradient(130deg, #0f3349 0%, #1b5a7a 55%, #0f3349 100%); }
.dark .kpi-ic, .dark .qa-card, .dark .info-card, .dark .alert-card {
  background: var(--card); border-color: var(--border);
}
.dark .admin-kpi-item { background: var(--bg-muted); border-color: var(--border); }
.dark .admin-kpi-item:hover { background: #1e3040; }
.dark .filter-chip  { background: var(--card);  border-color: var(--border); color: var(--text-soft); }
.dark .filter-chip.active { background: #1a3344; border-color: var(--primary); }
.dark .tab-btn { color: var(--text-faint); }
.dark .tab-btn:hover { color: var(--text); }
.dark .tab-btn.active { color: #7ad2ed; border-bottom-color: #7ad2ed; }
.dark .info-card-overline { color: var(--text-faint); }
.dark .section-action { color: #7ad2ed; }

/* ══════════════════════════════════════════════════════════════════════════
   INDOSEAS HRIS — Global Fixes v4
   1. Mobile overflow-x fix
   2. Typography & readability improvements
   3. Auth page (login / forgot password)
   4. Form field components (.form-field, .input-wrap, .input-pfx, etc.)
══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Mobile horizontal overflow fix ───────────────────────────────────── */
html, body              { overflow-x: hidden; }
#appShell, #mainContent { overflow-x: hidden; }
.page-body              { overflow-x: hidden; }

/* ── 2. Responsive typography — adaptive scale across all devices ─────────── */
:root {
  --fs-body:  clamp(13px, 1.4vw, 14.5px);
  --fs-sm:    clamp(11.5px, 1.2vw, 12.5px);
  --fs-h3:    clamp(13.5px, 1.45vw, 15px);
  --fs-h2:    clamp(16px, 1.8vw, 19px);
  --fs-h1:    clamp(20px, 2.2vw, 24px);
}
body {
  font-size: var(--fs-body);
  line-height: 1.56;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
.card h3, h3 { font-size: var(--fs-h3); }
label, .form-label {
  font-size: clamp(12.5px, 1.3vw, 13.5px);
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.input, textarea, select {
  font-size: clamp(13px, 1.35vw, 14px);
  padding: 10px 13px;
}
.table-wrap th  { font-size: clamp(10.5px, 1.1vw, 11.5px); }
.table-wrap td  { font-size: clamp(12.5px, 1.3vw, 13.5px); }
.badge          { font-size: clamp(11px, 1.1vw, 12px); }
.btn            { font-size: clamp(13px, 1.35vw, 14px); }
.stat-value, .kpi-val { font-size: clamp(20px, 2vw, 26px); }
.muted, .kpi-lbl { font-size: clamp(11px, 1.1vw, 12px); }

/* ── 3. Auth pages (.auth-page, .auth-shell, .auth-brand, .auth-card) ────── */
.auth-page {
  min-height: 100vh;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.auth-shell {
  display: flex;
  width: 100%;
  max-width: 860px;
  min-height: 540px;
  background: #fff;
  border-radius: 20px;
  border: 0.5px solid var(--border);
  box-shadow: 0 8px 40px rgba(27,45,58,.10), 0 2px 10px rgba(27,45,58,.06);
  overflow: hidden;
}

/* Brand panel */
.auth-brand {
  width: 340px;
  flex-shrink: 0;
  background: linear-gradient(155deg, #174A60 0%, #2880a0 60%, #1b5a7a 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255,255,255,.06); pointer-events: none;
}
.auth-brand::after {
  content: ''; position: absolute; bottom: -80px; left: -40px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,.04); pointer-events: none;
}
.auth-brand-inner    { flex: 1; z-index: 1; position: relative; }
.auth-brand-logo     { height: 20px; width: auto; filter: brightness(0) invert(1); margin-bottom: 14px; }
.auth-brand-logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.auth-brand-mark     { width: 44px; height: 44px; filter: brightness(0) invert(1); flex-shrink: 0; }
.auth-brand-name     { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.auth-brand-title    { font-size: 20px; font-weight: 900; letter-spacing: .5px; color: #fff; }
.auth-brand-subtitle { font-size: 10px; font-weight: 700; letter-spacing: 3px; color: rgba(255,255,255,.6); }
.auth-brand-tagline  { font-size: 13px; opacity: .75; margin-bottom: 28px; font-weight: 500; line-height: 1.55; }
.auth-brand-list     { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-brand-list li  { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; opacity: .88; }
.auth-brand-list li i { font-size: 13px; }
.auth-brand-footer   { z-index: 1; position: relative; margin: 0; }
.built-by            { display: inline-flex; align-items: center; gap: 8px; }
.built-by--stacked   { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.built-by-label      { font-size: 11px; font-weight: 600; letter-spacing: .03em; line-height: 1; white-space: nowrap; }
.built-by-label--sidebar { font-size: 10px; color: var(--text-faint); }
.built-by-logo-wrap  { display: inline-flex; align-items: center; flex-shrink: 0; }
.built-by-logo-wrap--pill {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 24px rgba(12,34,47,.18);
}
.built-by-logo       { display: block; width: auto; max-width: 100%; object-fit: contain; }
.built-by-logo--auth { height: 13px; }
.built-by-logo--sidebar { height: 16px; }
.auth-brand-footer .built-by-label { color: rgba(255,255,255,.74); }

/* Form panel */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 44px;
}
.auth-form-inner    { width: 100%; max-width: 340px; }
.auth-mobile-logo { margin-bottom: 26px; }
.auth-mobile-logo .auth-brand-mark        { width: 36px; height: 36px; filter: none; }
.auth-mobile-logo .auth-brand-logo-row    { margin-bottom: 0; }
.auth-mobile-logo .auth-brand-title       { color: #174A60; }
.auth-mobile-logo .auth-brand-subtitle    { color: #246ea0; }
.auth-title         { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -.4px; margin: 0 0 5px; line-height: 1.2; }
.auth-subtitle      { font-size: 14.5px; color: var(--text-soft); margin: 0 0 24px; line-height: 1.5; }

/* Auth form */
.auth-form          { display: flex; flex-direction: column; gap: 18px; }
.auth-btn           { width: 100%; padding: 13px; font-size: 15px; margin-top: 4px; border-radius: 10px; justify-content: center; }

/* Auth divider */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 16px; color: var(--text-faint);
  font-size: 12px; font-weight: 600;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-demo-btn   { width: 100%; justify-content: center; font-size: 13.5px; }
.auth-note       { text-align: center; font-size: 12px; color: var(--text-faint); margin-top: 26px; line-height: 1.5; }

/* ── 4. Form field components ────────────────────────────────────────────── */
/* .form-field = vertical stack (label + input-wrap) */
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-label { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.3; }

/* Input with prefix icon */
.input-wrap       { position: relative; }
.input-pfx-icon   {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); font-size: 13px; pointer-events: none; z-index: 1;
}
.input-pfx        { padding-left: 40px !important; }
.input-sfx        { padding-right: 44px !important; }
/* Suffix action button (eye toggle) */
.input-sfx-btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-faint); font-size: 16px; line-height: 1;
  padding: 6px; transition: color .15s; z-index: 1;
  min-width: 32px; min-height: 32px; display: flex; align-items: center; justify-content: center;
}
.input-sfx-btn:hover { color: var(--text-soft); }

/* ── Auth responsive (mobile) ────────────────────────────────────────────── */
@media (max-width: 767px) {
  .auth-page       { padding: 0; align-items: stretch; }
  .auth-shell      { max-width: 100%; min-height: 100dvh; border-radius: 0; border: none; box-shadow: none; }
  .auth-form-panel { padding: 40px 24px 32px; align-items: flex-start; }
  .auth-form-inner { max-width: 100%; }
  .auth-title      { font-size: 26px; }
  .auth-subtitle   { font-size: 15px; }
}

/* ── Forgot password: clean up inline style remnants ────────────────────── */
.fp-step-wrap     { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.fp-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.fp-step-num.active   { background: var(--primary); color: #fff; }
.fp-step-num.done     { background: var(--success-soft); color: var(--success); }
.fp-step-num.inactive { background: var(--bg-soft); color: var(--text-faint); border: 1px solid var(--border); }
.fp-step-label        { font-size: 13px; font-weight: 500; color: var(--text-soft); }
.fp-step-label.active { color: var(--text); font-weight: 600; }
.fp-card-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin: 0 auto 12px; flex-shrink: 0;
}

/* ── Improved mobile tap targets globally ────────────────────────────────── */
@media (max-width: 767px) {
  .btn         { min-height: 44px; font-size: 14.5px; padding: 10px 16px; }
  .input, textarea, select { min-height: 44px; font-size: 16px; /* prevent iOS zoom */ }
  .mobile-nav-item { min-height: 48px; }
  .tab-btn     { min-height: 44px; padding: 10px 16px; font-size: 13.5px; }
  .filter-chip { min-height: 38px; padding: 8px 14px; font-size: 13px; }
}

/* Forgot password page helpers */
.fp-page-wrap    { max-width: 480px; margin: 0 auto; }
.fp-step-wrap    { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.fp-step-line    { flex: 1; height: 1px; background: var(--border); min-width: 20px; }
.fp-card-head    { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.fp-card-icon    { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.fp-card-title   { font-size: 14.5px; font-weight: 700; color: var(--text); }
.fp-card-desc    { font-size: 13px; color: var(--text-soft); margin-top: 3px; line-height: 1.45; }
.fp-icon-header  { text-align: center; margin-bottom: 20px; }
.fp-icon-header .fp-card-icon { margin: 0 auto 12px; }
.fp-icon-title   { font-size: 15px; font-weight: 700; color: var(--text); }
.fp-icon-sub     { font-size: 13px; color: var(--text-soft); margin-top: 4px; }

/* ── Dark mode: auth page ────────────────────────────────────────────────── */
.dark .auth-page   { background: var(--bg-soft); }
.dark .auth-shell  { background: var(--card); border-color: var(--border); }
.dark .auth-form-panel input { background: var(--bg-muted) !important; color: var(--text) !important; }
.dark .auth-title  { color: var(--text); }
.dark .auth-subtitle { color: var(--text-soft); }

/* ── Layout utilities ────────────────────────────────────────────────────── */
.form-inline        { display: inline; }
.empty-state        { text-align: center; padding: 40px; }
.page-toolbar       { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.stat-row           { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.card-head-row      { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.filter-form        { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filter-label       { font-size: 12px; display: block; margin-bottom: 3px; color: var(--text-soft); }
.dept-bar-row       { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dept-bar-name      { width: 120px; font-size: 13px; flex-shrink: 0; }
.dept-bar-count     { width: 30px; font-size: 13px; text-align: right; flex-shrink: 0; }
.report-export-row  { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.notif-unread       { background: var(--primary-soft); }
.dark .notif-unread { background: rgba(23,74,96,.18); }

/* ── Mobile utility overrides ────────────────────────────────────────────── */
/* Light button on gradient hero card backgrounds */
.mobile-btn-light {
  background: #fff !important;
  color: var(--primary) !important;
  border-color: transparent !important;
}
/* Ghost button on gradient hero card backgrounds */
.mobile-btn-ghost {
  background: rgba(255,255,255,.14) !important;
  border-color: rgba(255,255,255,.25) !important;
  color: #fff !important;
}
/* Large value text in mobile summary cards */
.val-lg { font-size: 18px; font-weight: 700; }

/* ══════════════════════════════════════════════════════════════════════════
   INDOSEAS HRIS — Design System v5
   1. Logo utilities (webp sidebar/auth)
   2. Empty state components
   3. Announcement card list
   4. UI polish: sidebar, topbar, cards, tables
══════════════════════════════════════════════════════════════════════════ */

/* ── 0. SPA page transition ──────────────────────────────────────────────── */
/* Top progress bar (appears automatically on .spa-loading) */
#pageBody::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--primary);
  width: 0;
  z-index: 9999;
  transition: none;
  pointer-events: none;
}
#pageBody.spa-loading::before {
  width: 70%;
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}
/* Fade content during transition */
#pageBody.spa-loading {
  opacity: .6;
  pointer-events: none;
  transition: opacity .15s ease;
}
#pageBody {
  transition: opacity .2s ease;
}

/* ── 1. Logo utilities ───────────────────────────────────────────────────── */
/* Sidebar brand logo (webp replaces mark.svg + text) */
.desktop-brand-logo {
  height: 28px;
  width: auto;
  max-width: 152px;
  object-fit: contain;
  object-position: left center;
  display: block;
  transition: max-width .18s ease;
}
body.sb-collapsed .desktop-brand-logo {
  max-width: 34px;
}
body.sb-collapsed .desktop-brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

/* Auth brand panel logo (dark gradient background) */
.auth-brand-logo-img {
  height: 38px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  display: block;
  margin-bottom: 20px;
}
/* Mobile form panel logo (light/white background) */
.auth-mobile-brand-img {
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
  margin-bottom: 24px;
}
.dark .auth-brand-logo-img { filter: brightness(0) invert(1); }

/* ── 2. Empty state components ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state-icon  { font-size: 34px; color: var(--text-faint); margin-bottom: 12px; line-height: 1; }
.empty-state-title { font-size: 14px; font-weight: 700; color: var(--text-soft); margin-bottom: 5px; }
.empty-state-desc  { font-size: 13px; color: var(--text-faint); line-height: 1.55; max-width: 320px; margin: 0 auto; }

/* ── 3. Announcement card list ───────────────────────────────────────────── */
.ann-list { display: grid; gap: 12px; }
.ann-item {
  background: #fff;
  border: 0.5px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .18s, transform .18s;
}
.ann-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.ann-item-header {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px;
}
.ann-item-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.ann-item-meta { flex: 1; min-width: 0; }
.ann-item-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 5px; }
.ann-item-date {
  font-size: 11px; color: var(--text-faint);
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.ann-item-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  line-height: 1.35; margin-bottom: 8px;
}
.ann-item-body {
  font-size: 13px; color: var(--text-soft); line-height: 1.65;
}
.ann-item--pinned { border-left-width: 4px; }

/* Dark mode announcements */
.dark .ann-item { background: var(--card); border-color: var(--border); border-left-color: var(--primary); }
.dark .ann-item-icon { background: rgba(23,74,96,.22); color: #7ad2ed; }

/* ── 4. UI polish ─────────────────────────────────────────────────────────── */
/* Sidebar active link: stronger left indicator */
@media (min-width: 768px) {
  .sb-nav-link[aria-current="page"] {
    position: relative;
  }
  .sb-nav-link[aria-current="page"]::before {
    content: '';
    position: absolute;
    left: -8px; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 18px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
  }
  body.sb-collapsed .sb-nav-link[aria-current="page"]::before {
    left: -6px;
  }
}

/* Card header title alignment fix */
.card > h3:first-child { margin-top: 0; }

/* Section divider line between content groups */
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Topbar search refined */
@media (min-width: 768px) {
  .desktop-search input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(23,74,96,.08) !important;
  }
}

/* Responsive grid: auto fit on narrow screens */
@media (max-width: 1024px) {
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .kpi-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ann-item  { padding: 13px 14px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE & MOBILE OVERFLOW FIXES v5
   Prevents horizontal scroll and broken grids at all breakpoints.
══════════════════════════════════════════════════════════════════════════ */

/* ── Global overflow guard ──────────────────────────────────────────────── */
* { min-width: 0; } /* Prevents flex/grid children from breaking out */

/* ── Mobile: force table-wrap to stay within viewport ──────────────────── */
@media (max-width: 767px) {
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Grid: always single column on small mobile */
  .grid.two   { grid-template-columns: 1fr !important; }
  .grid.three { grid-template-columns: 1fr !important; }
  .grid-3col  { grid-template-columns: 1fr !important; }
  .grid-2col  { grid-template-columns: 1fr !important; }

  /* Cards: contain text */
  .card, .metric-card, .kpi-ic, .request-card { min-width: 0; }

  /* Prevent form layouts from overflowing */
  .grid-form, .stack, .filter-form { grid-template-columns: 1fr; }

  /* Attendance hero: full column stack */
  .att-hero-card { flex-direction: column; }
  .att-hero-left { max-width: none; }

  /* Page header: stack vertically */
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-header-actions { width: 100%; }
  .page-header-actions .btn { flex: 1; justify-content: center; }

  /* Quick actions: always 3 columns */
  .qa-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .qa-card { padding: 12px 8px 10px; }
  .qa-icon { width: 38px; height: 38px; font-size: 16px; }
  .qa-label { font-size: 11px; }

  /* Admin KPI grid: 2 columns */
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  /* Cards grid: 2 columns */
  .cards { grid-template-columns: repeat(2, 1fr); }

  /* Section tabs: scrollable */
  .section-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0; }

  /* Ensure buttons don't overflow */
  .btn-group { flex-wrap: wrap; }
  .btn-group .btn { min-width: 80px; }

  /* Welcome banner: stack */
  .wb { flex-direction: column; align-items: flex-start; gap: 14px; }
  .wb-btn { align-self: stretch; justify-content: center; }
  .wb-done { align-self: stretch; justify-content: center; }

  /* Page body padding */
  .desktop-page-body { padding: 14px 12px !important; }
}

/* ── Tablet (768–1024): 2-col grid for some areas ───────────────────────── */
@media (min-width: 768px) and (max-width: 1024px) {
  .grid.three { grid-template-columns: 1fr 1fr; }
  .grid-3col  { grid-template-columns: 1fr 1fr; }
  .cards      { grid-template-columns: repeat(2, 1fr); }
  .admin-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Large desktop: full layout ─────────────────────────────────────────── */
@media (min-width: 1280px) {
  .qa-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-strip { grid-template-columns: repeat(4, 1fr); }
}

/* ── Filter form: responsive wrap ───────────────────────────────────────── */
.filter-form > * { min-width: 120px; flex: 1 1 auto; }
@media (max-width: 640px) {
  .filter-form { flex-direction: column; }
  .filter-form > * { width: 100%; min-width: 0; }
}

/* ── TD actions: prevent overflow ───────────────────────────────────────── */
.td-actions { white-space: nowrap; }

/* ── Page toolbar: stack on mobile ──────────────────────────────────────── */
@media (max-width: 480px) {
  .page-toolbar { flex-direction: column; align-items: flex-start; }
  .page-toolbar > *:last-child { align-self: stretch; }
}
