/* ==========================================================================
   HRIS Wahana Artha — Design tokens & base styles
   Palette: single brand seed color (--brand) with derived shades.
   All UI elements consume these tokens — no ad-hoc colors elsewhere.
   ========================================================================== */

:root {
  --brand: #1E5AA8;          /* overridden inline per app_config.primary_color */
  --brand-contrast: #FFFFFF;
  --brand-50: #EAF1FA;
  --brand-100: #D2E2F4;
  --brand-600: #174A8C;
  --brand-700: #123B70;

  --surface: #FFFFFF;
  --surface-muted: #F4F6F9;
  --border: #E2E7EE;
  --text: #1F2937;
  --text-muted: #64748B;

  --success: #1F9D55;
  --success-bg: #E7F7EE;
  --warning: #B7791F;
  --warning-bg: #FEF3D6;
  --danger: #C0392B;
  --danger-bg: #FBEAE8;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 24px rgba(16, 24, 40, 0.12);

  --sidebar-width: 240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--surface-muted);
  -webkit-tap-highlight-color: transparent;
  min-width: 320px;
}

html { min-height: 100%; scroll-behavior: smooth; }
html { overflow-x: hidden; }
body { min-height: 100%; overflow-x: hidden; overflow-wrap: anywhere; }
body.nav-open { overflow: hidden; }
::selection { background: var(--brand); color: var(--brand-contrast); }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 12px; z-index: 100; padding: 10px 14px; background: var(--surface); border: 1px solid var(--brand); border-radius: var(--radius); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

a { color: var(--brand); text-decoration: none; }

/* ---------- App shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}
.mobile-header, .nav-backdrop { display: none; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }

.sidebar-logo-fallback {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--brand);
  color: var(--brand-contrast);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

.sidebar-title { font-weight: 700; font-size: 15px; color: var(--text); line-height: 1.2; }

.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px; font-weight: 500;
  background: none; border: none; width: 100%; text-align: left; cursor: pointer;
}

.nav-item:hover { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); color: var(--brand); }
.nav-item.active { background: var(--brand); color: var(--brand-contrast); }
.nav-item.active .nav-icon { color: var(--brand-contrast); }

.nav-icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--brand); }
.nav-item.active .nav-icon { color: var(--brand-contrast); }

.sidebar-footer { padding: 10px; border-top: 1px solid var(--border); }
.nav-logout { color: var(--danger); }
.nav-logout .nav-icon { color: var(--danger); }
.nav-logout:hover { background: var(--danger-bg); }

.main-content { flex: 1; min-width: 0; width: 100%; padding: 28px 32px 40px; max-width: 1164px; }

/* ---------- Guest layout (login / change password) ---------- */
.guest-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--brand) 8%, var(--surface-muted));
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
}

.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-logo { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 10px; }
.auth-logo-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 10px;
}
.auth-brand h1 { font-size: 18px; margin: 0 0 4px; color: var(--text); }
.auth-subtitle { font-size: 13px; color: var(--text-muted); margin: 0; }

.auth-form { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Forms ---------- */
.form-label { font-size: 13px; font-weight: 600; color: var(--text); margin: 12px 0 6px; }
.field-hint { margin: 6px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.form-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; color: var(--text); background: var(--surface);
}
.form-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.form-input::placeholder { color: #748196; opacity: 1; }
.form-input.is-invalid,
select.form-input.is-invalid,
textarea.form-input.is-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent) !important;
}
.field-error {
  display: block;
  font-size: 12px;
  color: var(--danger);
  font-weight: 500;
  margin-top: 5px;
  line-height: 1.35;
}

.input-with-icon { position: relative; }
.input-with-icon .input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-muted);
  pointer-events: none;
}
.input-with-icon .form-input { padding-left: 38px; }

/* Password input wrapper & toggle */
.input-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.input-password-wrapper .form-input {
  padding-right: 40px;
}
.input-password-wrapper.input-with-icon .form-input {
  padding-left: 38px;
  padding-right: 40px;
}
.btn-password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm, 6px);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.btn-password-toggle:hover {
  color: var(--text);
  background-color: var(--surface-muted);
}
.btn-password-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.btn-password-toggle svg,
.btn-password-toggle i {
  width: 18px;
  height: 18px;
  display: block;
}

/* Hide native Edge / IE / browser password reveal & clear icons to prevent double icons */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="text"]::-ms-reveal,
input[type="text"]::-ms-clear {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  min-height: 40px; border: 1px solid transparent; cursor: pointer;
  text-align: center; line-height: 1.25;
}
.btn svg,
.btn i,
.btn .nav-icon {
  color: inherit;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btn-primary { background: var(--brand); color: var(--brand-contrast); }
.btn-primary:hover { filter: brightness(.9); }
.btn-primary:disabled { background: color-mix(in srgb, var(--brand) 22%, var(--surface)); color: var(--text-muted); cursor: not-allowed; filter: none; }
.btn-primary svg,
.btn-primary i,
.btn-primary .nav-icon {
  color: var(--brand-contrast) !important;
}
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-muted); }
.btn-block { width: 100%; margin-top: 18px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }

/* ---------- Alerts / badges ---------- */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-neutral { background: var(--surface-muted); color: var(--text-muted); }

/* ---------- Cards / page header ---------- */
.page-header { margin-bottom: 22px; }
.page-header h1 { font-size: 22px; margin: 0 0 4px; }
.page-header p { color: var(--text-muted); font-size: 14px; margin: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  min-width: 0; box-shadow: var(--shadow); padding: 20px;
}
.card > table { display: block; max-width: 100%; overflow-x: auto; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 6px;
}
.card-head h2 { font-size: 16px; margin: 0; }

.hint { font-size: 13px; color: var(--text-muted); margin: 0 0 14px; }
.empty-state { color: var(--text-muted); text-align: center; padding: 24px 0; margin: 0; }
.year-nav { display: flex; flex-wrap: wrap; gap: 6px; }

/* Inline (single-row) create forms used by schedule exceptions & holidays. */
.inline-form {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  padding: 14px; background: var(--surface-muted);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.inline-field { display: flex; flex-direction: column; flex: 1; min-width: 130px; }
.inline-field .form-label { margin: 0 0 6px; }
.inline-field-action { flex: 0 0 auto; min-width: 0; }

/* Checkbox styled as a compact toggle label. */
.switch { display: inline-flex; min-height: 40px; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; }

/* ---------- Navigation Ordering Component ---------- */
.nav-order-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}
.nav-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.nav-order-handle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}
.nav-order-actions {
  display: flex;
  gap: 4px;
}
.nav-order-actions .btn {
  padding: 2px 8px;
  min-height: 28px;
  font-size: 12px;
  line-height: 1;
}

/* ---------- Attendance Calendar Component ---------- */
.attendance-calendar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.calendar-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.calendar-title-wrapper h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.calendar-icon {
  width: 20px;
  height: 20px;
  color: var(--brand);
}
.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm, 6px);
  font-size: 12px;
  color: var(--text);
  margin-bottom: 14px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-hadir { background: #10B981; }
.dot-terlambat { background: #F59E0B; }
.dot-izin { background: #3B82F6; }
.dot-alfa { background: #EF4444; }
.dot-holiday { background: #DC2626; }
.dot-off { background: #94A3B8; }

.calendar-grid-wrapper {
  width: 100%;
  overflow-x: auto;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(80px, 1fr));
  gap: 6px;
  min-width: 580px;
}
.calendar-day-header {
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.calendar-day-header.is-weekend {
  color: #EF4444;
}

.calendar-cell {
  min-height: 72px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.calendar-cell.is-empty {
  background: transparent;
  border: 1px dashed var(--border);
  opacity: 0.3;
  cursor: default;
}
.calendar-cell.calendar-day:hover:not(.is-empty) {
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.calendar-cell.is-today {
  border: 2px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 4%, var(--surface));
}
.calendar-cell.is-holiday {
  background: #FFF1F2;
  border-color: #FECDD3;
}
.calendar-cell.is-sunday {
  background: var(--surface-muted);
}
.calendar-cell.is-pre-join {
  background: var(--surface-muted);
  opacity: 0.65;
}

.calendar-day-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.calendar-cell.is-holiday .calendar-day-number,
.calendar-cell.is-sunday .calendar-day-number {
  color: #DC2626;
}
.calendar-holiday-star {
  font-size: 12px;
}

.calendar-day-status {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
  line-height: 1.25;
}
.badge-cal-hadir { background: #D1FAE5; color: #065F46; }
.badge-cal-terlambat { background: #FEF3C7; color: #92400E; }
.badge-cal-izin { background: #DBEAFE; color: #1E40AF; }
.badge-cal-alfa { background: #FEE2E2; color: #991B1B; }
.badge-cal-holiday { background: #FFE4E6; color: #9F1239; font-weight: 700; }
.badge-cal-off { background: var(--surface-muted); color: var(--text-muted); }
.badge-cal-muted { background: #F1F5F9; color: #64748B; font-style: italic; }

.row-highlight {
  animation: rowFlash 2s ease-out;
}
@keyframes rowFlash {
  0% { background-color: color-mix(in srgb, var(--brand) 30%, transparent); }
  100% { background-color: transparent; }
}

@media (max-width: 640px) {
  .calendar-grid {
    min-width: 480px;
    grid-template-columns: repeat(7, minmax(64px, 1fr));
    gap: 4px;
  }
  .calendar-cell {
    min-height: 58px;
    padding: 4px;
  }
  .calendar-day-status {
    font-size: 9.5px;
    padding: 1px 3px;
  }
}

/* ---------- Searchable Multi-Select Component ---------- */
.custom-multiselect {
  position: relative;
  display: inline-block;
  width: 100%;
}
.custom-multiselect.is-open {
  z-index: 100;
}
.inline-field:has(.custom-multiselect.is-open),
.inline-field:focus-within {
  z-index: 99;
}
.multiselect-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  min-height: 40px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.multiselect-trigger:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.multiselect-trigger[aria-expanded="true"],
.custom-multiselect.is-open .multiselect-trigger {
  border-color: var(--brand);
}
.multiselect-label-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.multiselect-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
}
.multiselect-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  line-height: 1.2;
}
.multiselect-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.multiselect-trigger[aria-expanded="true"] .multiselect-chevron,
.custom-multiselect.is-open .multiselect-chevron {
  transform: rotate(180deg);
}

.multiselect-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  width: max-content;
  max-width: min(320px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: dropdownFadeIn 0.15s ease-out;
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.custom-multiselect.is-open .multiselect-dropdown,
.multiselect-dropdown.open {
  display: flex !important;
}

.multiselect-search-wrapper {
  position: relative;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.multiselect-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}
.multiselect-search-input {
  width: 100%;
  padding: 6px 10px 6px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  color: var(--text);
  background: var(--surface-muted);
}
.multiselect-search-input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
}

.multiselect-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}
.multiselect-action-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.multiselect-action-btn:hover {
  text-decoration: underline;
}

.multiselect-options {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.multiselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.1s ease;
}
.multiselect-option:hover,
.multiselect-option.is-selected {
  background-color: var(--surface-muted);
}
.multiselect-option input[type="checkbox"] {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.multiselect-no-match {
  padding: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  display: none;
}
.multiselect-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 998;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  cursor: pointer;
}
.custom-multiselect.is-open .multiselect-backdrop {
  display: block;
}

.multiselect-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}
.multiselect-mobile-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.multiselect-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.multiselect-close-btn:hover {
  color: var(--text);
}

.multiselect-footer {
  padding: 8px 10px;
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.multiselect-cancel-btn {
  padding: 4px 10px;
  font-size: 12px;
  min-height: 28px;
}
.multiselect-apply-btn {
  padding: 4px 14px;
  font-size: 12px;
  min-height: 28px;
}

@media (max-width: 640px) {
  .multiselect-mobile-header {
    display: flex;
  }
  .custom-multiselect.is-open .multiselect-dropdown {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.35) !important;
    z-index: 1000 !important;
    max-height: 80vh !important;
  }
  .multiselect-options {
    max-height: 45vh;
  }
}
.table-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.table-link:hover {
  filter: brightness(0.85);
}
.nav-icon-inline {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
}

/* Multi-column form rows (leave request & employee form). */
.form-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.form-row:last-child { margin-bottom: 0; }
.form-col { display: flex; flex-direction: column; flex: 1; min-width: 150px; }
.form-col .form-label { margin-top: 0; }
.label-optional { font-weight: 400; color: var(--text-muted); }
textarea.form-input { resize: vertical; font-family: inherit; }
.form-input-sm { padding: 6px 10px; font-size: 13px; }

/* Approval table helpers. */
.cell-sub { font-size: 12px; color: var(--text-muted); }
.cell-reason { max-width: 260px; overflow-wrap: anywhere; }
.flag-reason { display: block; max-width: 34ch; margin-top: 5px; }
.attachment-link { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 2px; font-size: 12px; margin-left: 6px; text-decoration: underline; text-underline-offset: 3px; }
.decision-actions { display: flex; flex-direction: column; gap: 6px; min-width: 190px; }
.decision-actions form { display: flex; gap: 6px; align-items: center; }
.decision-actions .form-input-sm { flex: 1; min-width: 0; }
.btn-active { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }
.btn-active:hover { color: var(--brand-contrast); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.static-value { padding: 10px 0; font-size: 14px; color: var(--text-muted); }
.temp-password {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 15px; letter-spacing: 0.08em;
  background: var(--surface); padding: 3px 8px; border-radius: 6px;
  border: 1px solid var(--border);
}

/* App-config branding */
.color-row { display: flex; gap: 8px; align-items: center; }
.color-swatch { width: 42px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: none; cursor: pointer; flex-shrink: 0; }
.branding-preview {
  height: 90px; border: 1px dashed var(--border); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--surface-muted); margin-bottom: 6px;
}
.branding-preview img { max-height: 100%; max-width: 100%; object-fit: contain; }
.branding-empty { color: var(--text-muted); font-size: 13px; }
.branding-remove {
  display: inline-block; background: none; border: none; padding: 0 0 8px;
  color: var(--danger); font-size: 12px; cursor: pointer; text-decoration: underline;
}

/* Field-visit capture slots */
.visit-camera { margin: 12px 0; }
.capture-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.capture-slot { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 6px; }
.capture-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.capture-preview { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
.camera-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.capture-slot.has-capture { padding: 8px; background: var(--success-bg); border-radius: var(--radius); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-grid-compact { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow); }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: var(--brand); margin-top: 6px; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Clickable stat cards that jump to the relevant screen. */
.stat-card-link { display: block; color: inherit; transition: border-color .15s, box-shadow .15s; }
.stat-card-link:hover { border-color: var(--brand); box-shadow: var(--shadow-lg); }
.stat-card-attention { border-color: var(--warning); }

.review-form { display: flex; gap: 6px; align-items: center; min-width: 230px; }
.review-form .form-input-sm { flex: 1; min-width: 0; }

table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background-color: rgba(30, 90, 168, 0.025); }
tfoot th { border-top: 2px solid var(--border); border-bottom: none; color: var(--text); padding: 12px 14px; font-weight: 700; }
th.num, td.num { text-align: center; }
.row-muted td { background: var(--surface-muted); color: var(--text-muted); }

/* Sortable table headers */
th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color .15s ease, background-color .15s ease;
  position: relative;
}
th.sortable:hover {
  color: var(--brand);
  background-color: var(--brand-50);
}
th.sortable .th-content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
th.sortable.num .th-content {
  justify-content: center;
}
.sort-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.sort-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}
.sort-icon .sort-arrow-up,
.sort-icon .sort-arrow-down {
  transition: opacity .15s ease, stroke .15s ease, stroke-width .15s ease;
}

/* Neutral / Unsorted state: subtle dual arrows */
th.sortable[aria-sort="none"] .sort-icon .sort-arrow-up,
th.sortable[aria-sort="none"] .sort-icon .sort-arrow-down {
  stroke: #94a3b8;
  opacity: 0.45;
}
th.sortable:hover[aria-sort="none"] .sort-icon .sort-arrow-up,
th.sortable:hover[aria-sort="none"] .sort-icon .sort-arrow-down {
  stroke: var(--brand);
  opacity: 0.8;
}

/* Ascending state: Up arrow highlighted, Down arrow dimmed */
th.sortable[aria-sort="ascending"] {
  color: var(--brand);
  background-color: color-mix(in srgb, var(--brand) 8%, transparent);
}
th.sortable[aria-sort="ascending"] .sort-icon .sort-arrow-up {
  stroke: var(--brand);
  stroke-width: 3.2px;
  opacity: 1;
}
th.sortable[aria-sort="ascending"] .sort-icon .sort-arrow-down {
  stroke: #cbd5e1;
  opacity: 0.15;
}

/* Descending state: Down arrow highlighted, Up arrow dimmed */
th.sortable[aria-sort="descending"] {
  color: var(--brand);
  background-color: color-mix(in srgb, var(--brand) 8%, transparent);
}
th.sortable[aria-sort="descending"] .sort-icon .sort-arrow-down {
  stroke: var(--brand);
  stroke-width: 3.2px;
  opacity: 1;
}
th.sortable[aria-sort="descending"] .sort-icon .sort-arrow-up {
  stroke: #cbd5e1;
  opacity: 0.15;
}

/* Row Number column styling */
th.col-no, td.col-no {
  width: 54px;
  min-width: 54px;
  max-width: 64px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-weight: 500;
}

/* Modal Dialog */
.modal-dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 560px;
  width: calc(100% - 32px);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius);
}
.modal-close:hover {
  color: var(--danger);
  background: var(--danger-bg);
}
.modal-body {
  padding: 20px 24px;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Larger modal variant for content-heavy dialogs (e.g. session detail). */
.modal-dialog-lg {
  max-width: 860px;
}
.modal-dialog-lg .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

/* Trigger button for the per-row "Sesi" cell (locations.php-style inline modal). */
.session-cell-trigger {
  white-space: nowrap;
}

/* Session detail table, inside the session modal's body. */
.session-detail-table {
  width: 100%;
  border-collapse: collapse;
}
.session-detail-table th,
.session-detail-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  text-align: left;
  vertical-align: top;
}
.session-detail-table thead th {
  background: var(--surface-muted);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
}
.session-detail-table tbody tr:last-child td {
  border-bottom: none;
}

/* Action button groupings in tables - prevent 2-line wrapping */
.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.table-actions .btn {
  white-space: nowrap;
}

/* Wide report tables scroll horizontally instead of breaking the layout. */
.table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: var(--brand) var(--surface-muted); border-radius: var(--radius); }
.table-scroll table { min-width: 780px; }
.table-scroll-lg table { min-width: 960px; }
.table-scroll-xl table { min-width: 1100px; }
.table-scroll-compact table { min-width: 580px; }

/* Table Pagination styling */
.table-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px 4px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.table-pagination-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.table-pagination-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.table-pagination-size select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.table-pagination-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all .15s ease;
}
.page-btn:hover:not(:disabled):not(.active) {
  background: var(--brand-50);
  border-color: var(--brand-100);
  color: var(--brand);
}
.page-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--surface-muted);
}
.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 32px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Auto-filter indicator */
.card.table-filtering .table-scroll,
.card.table-filtering table,
.card.table-filtering .empty-state,
.card.table-filtering .attendance-calendar-card,
.stat-grid.table-filtering {
  opacity: 0.55;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

/* ---------- Check-in (camera) page ---------- */
.checkin-layout { display: flex; flex-direction: column; gap: 20px; max-width: 480px; }
.camera-frame {
  position: relative; width: 100%; aspect-ratio: 3/4;
  border-radius: var(--radius-lg); overflow: hidden;
  background: #0b1220; box-shadow: var(--shadow);
}
.camera-frame.is-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(30, 90, 168, 0.2) 0%, transparent 75%);
  animation: camera-pulse 2s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
}
@keyframes camera-pulse {
  from { opacity: 0.3; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1.02); }
}
.camera-frame video, .camera-frame canvas { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }
.camera-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; padding: 16px;
  pointer-events: none;
  z-index: 2;
}
.smile-status {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: rgba(15, 23, 42, 0.75); color: #fff; backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.25s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.smile-status.smiling { background: var(--success); transform: scale(1.04); }
.smile-status.loading { background: rgba(15, 23, 42, 0.85); border: 1px solid rgba(255, 255, 255, 0.18); }

.status-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: status-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes status-spin {
  to { transform: rotate(360deg); }
}

.location-info { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.location-info .nav-icon { width: 16px; height: 16px; }

.schedule-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 9%, var(--surface)); color: var(--text);
  font-size: 13px;
}
.schedule-banner .nav-icon { width: 18px; height: 18px; color: var(--brand); flex-shrink: 0; }
.schedule-banner strong { font-weight: 700; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }

/* ---------- Enhanced Checkin & Guide UI ---------- */
.checkin-layout-enhanced {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 960px;
}

@media (min-width: 768px) {
  .checkin-layout-enhanced {
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
    align-items: start;
  }
}

.checkin-card-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkin-card-main h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkin-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.checkin-date-badge .nav-icon-inline {
  width: 15px;
  height: 15px;
  color: var(--brand);
}

.checkin-status-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
}

.checkin-status-banner.is-active {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--text);
}

.checkin-status-banner.is-active .status-icon {
  color: var(--brand);
}

.checkin-status-banner.is-completed {
  background: var(--success-bg);
  border-color: color-mix(in srgb, var(--success) 25%, transparent);
  color: #14532d;
}

.checkin-status-banner.is-completed .status-icon {
  color: var(--success);
}

.checkin-status-banner.is-locked {
  background: var(--warning-bg);
  border-color: color-mix(in srgb, var(--warning) 25%, transparent);
  color: #78350f;
}

.checkin-status-banner.is-locked .status-icon {
  color: var(--warning);
}

.status-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.location-box-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  transition: all .2s ease;
}

.location-box-pill.is-loading {
  background: color-mix(in srgb, var(--warning, #f59e0b) 6%, var(--surface));
  border-color: color-mix(in srgb, var(--warning, #f59e0b) 35%, var(--border));
}

.location-box-pill.is-loading .location-pulse {
  background: var(--warning, #f59e0b);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: location-pulse-warning 1.5s infinite;
}

.location-box-pill.is-ready {
  background: color-mix(in srgb, var(--success, #16a34a) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--success, #16a34a) 35%, var(--border));
}

.location-box-pill.is-ready .location-pulse {
  background: var(--success, #16a34a);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  animation: location-pulse-anim 2s infinite;
}

.location-box-pill.is-error {
  background: color-mix(in srgb, var(--danger, #dc2626) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--danger, #dc2626) 35%, var(--border));
  color: var(--text);
  flex-wrap: wrap;
}

.location-box-pill.is-error .location-pulse {
  background: var(--danger, #dc2626);
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
  animation: none;
}

.location-retry-btn {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm, 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all .15s ease;
}

.location-retry-btn:hover {
  background: var(--surface-muted);
  border-color: var(--brand);
  color: var(--brand);
}

.location-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(31, 157, 85, 0.7);
  animation: location-pulse-anim 2s infinite;
}

@keyframes location-pulse-anim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(31, 157, 85, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(31, 157, 85, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(31, 157, 85, 0); }
}

@keyframes location-pulse-warning {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.btn-checkin-primary {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 25%, transparent);
}

.btn-checkin-primary.mode-masuk {
  background: var(--brand);
  color: var(--brand-contrast);
}

.btn-checkin-primary.mode-masuk:hover:not(:disabled) {
  filter: brightness(.92);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 35%, transparent);
}

.btn-checkin-primary.mode-keluar {
  background: #C0392B;
  color: #FFFFFF;
}

.btn-checkin-primary.mode-keluar:hover:not(:disabled) {
  background: #A93226;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(192, 57, 43, 0.35);
}

/* 2-Button Explicit Checkin Actions Grid */
.checkin-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .checkin-actions-grid {
    grid-template-columns: 1fr;
  }
}

.btn-checkin-btn {
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}

.btn-checkin-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-checkin-btn.btn-masuk-primary {
  background: var(--brand);
  color: var(--brand-contrast);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 28%, transparent);
}

.btn-checkin-btn.btn-masuk-primary:hover:not(:disabled) {
  filter: brightness(.92);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 38%, transparent);
}

.btn-checkin-btn.btn-masuk-muted {
  background: var(--surface-muted);
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-checkin-btn.btn-masuk-muted:hover:not(:disabled) {
  color: var(--brand);
  border-color: var(--brand);
}

.btn-checkin-btn.btn-keluar-primary {
  background: #C0392B;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(192, 57, 43, 0.28);
}

.btn-checkin-btn.btn-keluar-primary:hover:not(:disabled) {
  background: #A93226;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(192, 57, 43, 0.38);
}

.btn-checkin-btn.btn-keluar-muted {
  background: var(--surface-muted);
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-checkin-btn.btn-keluar-muted:hover:not(:disabled) {
  color: #C0392B;
  border-color: #C0392B;
}

.btn-checkin-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none !important;
}

/* Sessions Card */
.sessions-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}

.sessions-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sessions-card-header h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: border-color .15s ease;
}

.session-row-item:last-child {
  margin-bottom: 0;
}

.session-row-item.is-running {
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
  background: color-mix(in srgb, var(--brand) 4%, var(--surface));
}

.session-no-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}

.session-time-block {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.session-duration-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.sessions-total-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
  border-radius: var(--radius);
  font-size: 13px;
}

.sessions-total-label {
  font-weight: 600;
  color: var(--text);
}

.sessions-total-val {
  font-weight: 700;
  color: var(--brand);
}

.sessions-empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Quick guide accordion on checkin */
.checkin-guide-accordion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.checkin-guide-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  background: var(--surface);
  list-style: none;
}

.checkin-guide-summary::-webkit-details-marker {
  display: none;
}

.checkin-guide-summary:hover {
  background: var(--surface-muted);
}

.checkin-guide-content {
  padding: 0 18px 16px;
  border-top: 1px solid var(--border);
}

.checkin-guide-list {
  margin: 12px 0 0;
  padding-left: 18px;
  line-height: 1.65;
  font-size: 13px;
  color: var(--text);
}

.checkin-guide-list li {
  margin-bottom: 6px;
}

.checkin-guide-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}

/* ---------- Guide Page & Outline System ---------- */
.guide-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1080px;
}

.guide-outline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.guide-outline-card {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: all .18s ease;
  position: relative;
}

.guide-outline-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.08);
  color: var(--brand);
}

.guide-outline-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.guide-outline-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-50);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-outline-icon svg,
.guide-outline-icon i {
  width: 17px;
  height: 17px;
}

.guide-outline-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.guide-outline-card:hover .guide-outline-num {
  color: var(--brand);
}

.guide-outline-card-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
  line-height: 1.35;
}

.guide-outline-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.guide-content-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 960px) {
  .guide-content-split {
    grid-template-columns: 260px 1fr;
    align-items: start;
  }
}

.guide-sticky-sidebar {
  position: sticky;
  top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  display: none;
}

@media (min-width: 960px) {
  .guide-sticky-sidebar {
    display: block;
  }
}

.guide-sidebar-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.guide-nav-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: all .15s ease;
}

.guide-nav-item a:hover {
  background: var(--brand-50);
  color: var(--brand);
}

.guide-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--surface-muted);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.guide-nav-item a:hover .guide-nav-badge {
  background: var(--brand);
  color: var(--brand-contrast);
}

.guide-section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  scroll-margin-top: 24px;
}

.guide-section-card:last-child {
  margin-bottom: 0;
}

.guide-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.guide-section-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-section-icon svg,
.guide-section-icon i {
  width: 19px;
  height: 19px;
}

.guide-section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.guide-section-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 10px;
}

.guide-section-card p:last-child {
  margin-bottom: 0;
}

.guide-callout-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  border-left: 3px solid var(--brand);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  margin-top: 14px;
}

.guide-callout-box .nav-icon-inline {
  width: 16px;
  height: 16px;
  color: var(--brand);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Base focus & media queries */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 52%, white);
  outline-offset: 2px;
}

@media (pointer: coarse) {
  .btn, .nav-item, .attachment-link, .branding-remove, .menu-toggle { min-height: 44px; }
  .btn-sm { padding: 9px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

@media (max-width: 720px) {
  .app-shell { flex-direction: column; padding-top: calc(65px + env(safe-area-inset-top)); }
  .mobile-header { position: fixed; inset: 0 0 auto; z-index: 40; display: flex; min-height: calc(64px + env(safe-area-inset-top)); align-items: center; justify-content: flex-start; gap: 12px; padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .mobile-brand { display: flex; min-width: 0; flex: 1; align-items: center; gap: 10px; }
  .mobile-brand .sidebar-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-toggle { display: inline-flex; width: 44px; height: 44px; flex: 0 0 44px; align-items: center; justify-content: center; padding: 0; color: var(--text); background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius); }
  .menu-toggle svg { width: 24px; height: 24px; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 45; width: 100%; height: 100%; border: 0; background: rgba(15, 23, 42, .48); opacity: 0; pointer-events: none; transition: opacity .18s ease-out; }
  .nav-open .nav-backdrop { display: block; opacity: 1; pointer-events: auto; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(86vw, 320px); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); border-right: 1px solid var(--border); visibility: hidden; transform: translateX(-100%); transition: transform .2s ease-out, visibility 0s linear .2s; box-shadow: var(--shadow-lg); overflow-y: auto; }
  .nav-open .sidebar { visibility: visible; transform: translateX(0); transition-delay: 0s; }
  .sidebar-nav { flex: none; }
  .sidebar-footer { margin-top: auto; }
  .main-content { padding: 22px max(16px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .page-header { margin-bottom: 18px; }
  .page-header h1 { font-size: 21px; }
  .page-header p { line-height: 1.55; }
  .card { padding: 16px; border-radius: 14px; }
  .card-head { align-items: flex-start; }
  .inline-form { padding: 12px; }
  .inline-field { min-width: min(100%, 150px); }
  .inline-field-action, .inline-field-action .btn { width: 100%; }
  .form-col { min-width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
  .stat-card { min-width: 0; padding: 14px; }
  .stat-card .stat-value { font-size: 23px; }
  .year-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .year-nav .btn { flex: 0 0 auto; }
  .table-scroll { margin-inline: -16px; padding-inline: 16px; }
  .table-scroll::after { content: "Geser tabel untuk melihat kolom lain"; display: block; position: sticky; left: 0; width: max-content; padding: 8px 0 12px; color: var(--text-muted); font-size: 12px; }
  .decision-actions, .review-form { min-width: 260px; }
  .capture-row { flex-direction: column; }
  .capture-slot { min-width: 100%; }
  .camera-frame { max-height: 68vh; }
  .auth-card { padding: 28px 22px; }
}

@media (min-width: 721px) and (max-width: 1024px) {
  :root { --sidebar-width: 210px; }
  .main-content { padding: 24px; }
  .nav-item { gap: 9px; padding-inline: 10px; font-size: 13px; }
}
