/* ============================================================
   SIABSEN styles.css
   1. tokens  2. reset/base  3. app shell  4. components
   5. pages   6. utilities   7. responsive  8. dark theme
   Acuan: doc/redisgn/DESIGN.md
   ============================================================ */

/* ---------- 1. TOKENS ---------- */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/vendor/fonts/plus-jakarta-sans-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/vendor/fonts/plus-jakarta-sans-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/vendor/fonts/plus-jakarta-sans-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/vendor/fonts/plus-jakarta-sans-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/vendor/fonts/plus-jakarta-sans-latin-800-normal.woff2') format('woff2');
}

:root {
  color-scheme: light;

  /* Brand & feedback */
  --primary: #2563EB;
  --primary-700: #1D4ED8;
  --primary-50: #EFF6FF;
  --accent: #16A34A;
  --warning: #F59E0B;
  --danger: #DC2626;
  --info: #0891B2;

  /* Surfaces & text */
  --page-bg: #F5F7FB;
  --surface: #FFFFFF;
  --surface-muted: #F8FAFC;
  --border: #E2E8F0;
  --text: #0F172A;
  --muted: #64748B;

  /* Status kehadiran (badge/ikon/teks) */
  --st-hadir: #16A34A;
  --st-hadir-bg: #F0FDF4;
  --st-terlambat: #D97706;
  --st-terlambat-bg: #FFFBEB;
  --st-izin: #2563EB;
  --st-izin-bg: #EFF6FF;
  --st-sakit: #9333EA;
  --st-sakit-bg: #FAF5FF;
  --st-cuti: #0D9488;
  --st-cuti-bg: #F0FDFA;
  --st-alpha: #DC2626;
  --st-alpha-bg: #FEF2F2;
  --st-lembur: #1E40AF;
  --st-lembur-bg: #EFF6FF;
  --st-pulang-cepat: #A16207;
  --st-pulang-cepat-bg: #FEFCE8;
  --st-pending: #B45309;
  --st-pending-bg: #FFFBEB;

  /* Shape, shadow, spacing */
  --radius: 8px;
  --radius-badge: 999px;
  --shadow-card: 0 12px 28px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 16px 36px rgba(15, 23, 42, 0.10);
  --pad-app: 32px;
  --gap-cards: 16px;

  --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;

  /* Alias token legacy (dipangkas saat migrasi halaman selesai) */
  --color-primary: var(--primary);
  --color-primary-strong: var(--primary-700);
  --color-text: var(--text);
  --color-muted: var(--muted);
  --color-bg: var(--page-bg);
  --color-surface: var(--surface);
  --color-line: var(--border);
  --color-danger: var(--danger);
  --color-success: var(--accent);
  --shadow-soft: var(--shadow-card);
}

[data-theme="dark"] {
  color-scheme: dark;

  --primary: #60A5FA;
  --primary-700: #3B82F6;
  --primary-50: #172554;
  --accent: #4ADE80;
  --warning: #FBBF24;
  --danger: #F87171;
  --info: #22D3EE;

  --page-bg: #0B1120;
  --surface: #111827;
  --surface-muted: #1E293B;
  --border: #334155;
  --text: #F8FAFC;
  --muted: #CBD5E1;

  --st-hadir: #4ADE80;
  --st-hadir-bg: #052E16;
  --st-terlambat: #FBBF24;
  --st-terlambat-bg: #422006;
  --st-izin: #60A5FA;
  --st-izin-bg: #172554;
  --st-sakit: #C084FC;
  --st-sakit-bg: #3B0764;
  --st-cuti: #2DD4BF;
  --st-cuti-bg: #042F2E;
  --st-alpha: #F87171;
  --st-alpha-bg: #450A0A;
  --st-lembur: #93C5FD;
  --st-lembur-bg: #172554;
  --st-pulang-cepat: #FDE047;
  --st-pulang-cepat-bg: #422006;
  --st-pending: #FCD34D;
  --st-pending-bg: #451A03;

  --shadow-card: 0 12px 28px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.45);
}

/* ---------- LEGACY (CSS lama, dipangkas per migrasi halaman) ---------- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  color: var(--color-text);
  font-size: 2rem;
  letter-spacing: 0;
}

h2,
h3 {
  color: var(--color-text);
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.6;
}

.alert {
  margin: 0 0 16px;
  border: 1px solid #ffcdd2;
  border-radius: 6px;
  background: #ffebee;
  color: var(--color-danger);
  padding: 10px 12px;
}

.notice {
  margin: 0 0 16px;
  border: 1px solid #b8e6cf;
  border-radius: 6px;
  background: #e9f8f0;
  color: var(--color-success);
  padding: 10px 12px;
}

label {
  color: var(--color-text);
  font-weight: 700;
}

input,
select,
textarea {
  min-height: 44px;
  border: 1px solid #b8c7d6;
  border-radius: 6px;
  color: var(--color-text);
  font: inherit;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

.app-body {
  background: var(--color-bg);
}

.page-subtitle {
  max-width: 720px;
}

table {
  border-collapse: collapse;
  min-width: 680px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--color-line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* ---------- 2. RESET / BASE / TYPOGRAPHY (menimpa legacy) ---------- */

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 22px;
  transition: background-color 180ms ease, color 180ms ease;
}

h1 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 800;
  margin: 0 0 8px;
}

h2 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 700;
  margin: 0 0 8px;
}

h3 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  margin: 0 0 6px;
}

label {
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

small,
.caption {
  font-size: 12px;
  line-height: 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--primary-50);
  color: var(--text);
}

@media (min-width: 1024px) {
  h1 {
    font-size: 32px;
    line-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 4. COMPONENTS ---------- */

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-700);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-muted);
  border-color: var(--muted);
}

.btn-ghost {
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(0.92);
}

.btn-success {
  background: var(--accent);
  color: #FFFFFF;
}

.btn-success:hover:not(:disabled) {
  filter: brightness(0.92);
}

.btn-icon {
  min-height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: var(--radius);
  color: var(--muted);
}

.btn-icon:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--text);
}

.btn-lg {
  min-height: 56px;
  padding: 14px 26px;
  font-size: 16px;
  width: 100%;
}

.btn .spinner {
  display: none;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn.is-loading .spinner {
  display: inline-block;
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
  color: var(--primary);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Global loader / overlay progress */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: color-mix(in srgb, var(--page-bg) 82%, transparent);
  color: var(--text);
  font-weight: 600;
}

.app-loader[hidden] {
  display: none;
}

.app-loader-spinner {
  display: grid;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 0;
  animation: spinner-plncf9 3s infinite;
}

.app-loader-spinner::before,
.app-loader-spinner::after {
  content: '';
  grid-area: 1 / 1;
  border: 9px solid;
  border-radius: 50%;
  border-color: var(--primary) var(--primary) transparent transparent;
  mix-blend-mode: darken;
  animation: spinner-plncf9 1s infinite linear;
}

.app-loader-spinner::after {
  border-color: transparent transparent var(--border) var(--border);
  animation-direction: reverse;
}

[data-theme="dark"] .app-loader-spinner::before,
[data-theme="dark"] .app-loader-spinner::after {
  mix-blend-mode: screen;
}

@keyframes spinner-plncf9 {
  to {
    transform: rotate(1turn);
  }
}

.app-loader .app-loader-text {
  max-width: 280px;
  text-align: center;
}

/* Skeleton */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-muted);
  border-radius: var(--radius);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
}

.skeleton-card {
  height: 96px;
}

@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* Field / form */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field-label {
  color: var(--text);
}

.field-label .req {
  color: var(--danger);
}

.field input,
.field select,
.field textarea,
.input {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.field-error {
  display: none;
  color: var(--danger);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
}

.field.has-error .field-error {
  display: block;
}

.form-section {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.form-section-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 16px;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Card v2 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px;
}

.card-hover {
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.card-hover:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--muted);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
}

.card-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Badge status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-badge);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--surface-muted);
  color: var(--muted);
}

.badge .icon {
  flex: none;
}

.badge-hadir { background: var(--st-hadir-bg); color: var(--st-hadir); }

.badge-terlambat { background: var(--st-terlambat-bg); color: var(--st-terlambat); }

.badge-izin { background: var(--st-izin-bg); color: var(--st-izin); }

.badge-sakit { background: var(--st-sakit-bg); color: var(--st-sakit); }

.badge-cuti { background: var(--st-cuti-bg); color: var(--st-cuti); }

.badge-alpha { background: var(--st-alpha-bg); color: var(--st-alpha); }

.badge-lembur { background: var(--st-lembur-bg); color: var(--st-lembur); }

.badge-pulang_cepat { background: var(--st-pulang-cepat-bg); color: var(--st-pulang-cepat); }

.badge-no_checkout { background: var(--st-pending-bg); color: var(--st-pending); }

.badge-pending { background: var(--st-pending-bg); color: var(--st-pending); }

.badge-approved { background: var(--st-hadir-bg); color: var(--st-hadir); }

.badge-rejected { background: var(--st-alpha-bg); color: var(--st-alpha); }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}

.empty-state .empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--muted);
}

.empty-state .empty-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.empty-state p {
  margin: 0;
  max-width: 360px;
}

/* KPI card */
.kpi {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px;
  min-height: 104px;
}

.kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--primary-50);
  color: var(--primary);
}

.kpi-icon.tone-success { background: var(--st-hadir-bg); color: var(--st-hadir); }

.kpi-icon.tone-warning { background: var(--st-terlambat-bg); color: var(--st-terlambat); }

.kpi-icon.tone-danger { background: var(--st-alpha-bg); color: var(--st-alpha); }

.kpi-icon.tone-info { background: var(--st-izin-bg); color: var(--st-izin); }

.kpi-icon.tone-muted { background: var(--surface-muted); color: var(--muted); }

.kpi-body {
  min-width: 0;
}

.kpi-value {
  font-size: 28px;
  line-height: 34px;
  font-weight: 800;
}

.kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.kpi-sub {
  margin-top: 2px;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted);
}

/* Filter panel */
.filter-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.filter-panel .field {
  margin-bottom: 0;
  min-width: 150px;
  flex: 1 1 150px;
}

.filter-panel .filter-actions {
  display: flex;
  gap: 8px;
}

/* Table v2 */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 20px;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-muted);
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: var(--surface-muted);
}

.table .cell-actions {
  text-align: right;
  white-space: nowrap;
}

/* Tabs / segmented control */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  max-width: 100%;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-card);
}

/* ---------- 6. UTILITIES ---------- */

.stack {
  display: grid;
  gap: var(--gap-cards);
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: var(--gap-cards);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.page-header .page-sub {
  margin: 0;
  color: var(--muted);
}

.text-muted {
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.mobile-only {
  display: none;
}

@media (max-width: 767px) {
  .mobile-only {
    display: block;
  }

  .desktop-only {
    display: none;
  }
}

/* SweetAlert2 theming via token */
.swal-popup {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  font-family: var(--font-sans) !important;
  box-shadow: var(--shadow-hover) !important;
}

.swal-title {
  font-size: 20px !important;
  font-weight: 700 !important;
}

.swal-text {
  font-size: 14px !important;
  line-height: 22px !important;
}

.swal-popup .swal2-actions {
  gap: 10px;
}

.swal-popup textarea.input {
  width: 100%;
  font-family: var(--font-sans);
}


/* ---------- 3. APP SHELL ---------- */

.app-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
  max-width: none;
  margin: 0;
}

.app-layout.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  transition: width 200ms ease;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 17px;
}

.brand-logo {
  display: block;
  width: 38px;
  height: 38px;
  flex: none;
  background: none !important;
  color: inherit;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  padding: 0;
}

.brand > .brand-logo {
  width: 38px !important;
  height: 38px !important;
  max-width: 38px;
  max-height: 38px;
}

.brand-logo-lg {
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
}

.brand-name {
  min-width: 0;
}

.brand-name strong {
  display: block;
  font-size: 15px;
  line-height: 20px;
  white-space: nowrap;
}

.brand-name small {
  color: var(--muted);
  white-space: nowrap;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-link .icon {
  flex: none;
}

.nav-link:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav-link.active {
  background: var(--primary-50);
  color: var(--primary);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--primary);
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 800;
}

.user-block-info {
  min-width: 0;
}

.user-block-info strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-block-info span {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-collapsed .nav-label,
.sidebar-collapsed .brand-name,
.sidebar-collapsed .user-block-info {
  display: none;
}

.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 0;
}

.sidebar-collapsed .user-block {
  justify-content: center;
  padding: 8px;
}

.sidebar-collapsed .sidebar-top {
  flex-direction: column;
}

.sidebar-collapsed [data-sidebar-toggle] .icon {
  transform: rotate(180deg);
}

.app-main {
  min-width: 0;
  padding: 24px 28px 90px;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-titles {
  min-width: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.hamburger {
  display: none;
}

.notif-indicator {
  position: relative;
}

.notif-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-badge);
  background: var(--danger);
  color: #FFFFFF;
  font-size: 10px;
  line-height: 16px;
  font-weight: 800;
  text-align: center;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  list-style: none;
  cursor: pointer;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 8px;
}

.user-menu-panel .menu-user {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.user-menu-panel .menu-user strong {
  display: block;
  font-size: 13px;
}

.user-menu-panel .menu-user span {
  color: var(--muted);
  font-size: 12px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--surface-muted);
}

.menu-item.danger {
  color: var(--danger);
}

/* Drawer mobile */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.45);
}

.drawer-overlay[hidden] {
  display: none;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  width: min(320px, 86vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-hover);
  padding: 18px;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 200ms ease, visibility 200ms ease;
}

.drawer.open {
  transform: none;
  visibility: visible;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

/* Bottom nav (mobile only) */
.bottom-nav {
  display: none;
}

/* ---------- 7. RESPONSIVE SHELL ---------- */

@media (max-width: 1023px) {
  .app-layout,
  .app-layout.sidebar-collapsed {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .sidebar .nav-label,
  .sidebar .brand-name,
  .sidebar .user-block-info,
  .sidebar [data-sidebar-toggle] {
    display: none;
  }

  .sidebar .nav-link {
    justify-content: center;
    padding: 0;
  }

  .sidebar .user-block {
    justify-content: center;
    padding: 8px;
  }

  .app-main {
    padding: 20px 20px 90px;
  }
}

@media (max-width: 767px) {
  .app-layout,
  .app-layout.sidebar-collapsed {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .hamburger {
    display: inline-flex;
  }

  .app-main {
    padding: 16px 14px 96px;
  }

  .topbar h1 {
    font-size: 20px;
    line-height: 26px;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  .bottom-nav-group {
    display: flex;
    flex: 1 1 0;
    align-items: flex-end;
    gap: 2px;
  }

  .bottom-nav-link {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    padding: 4px 2px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 11px;
    line-height: 14px;
    font-weight: 700;
    text-align: center;
  }

  .bottom-nav-link.active {
    color: var(--primary);
    background: var(--primary-50);
  }

  /* Tombol Absensi: FAB bulat menonjol di tengah (pola QRIS) */
  .bottom-nav-fab {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 64px;
    padding: 0 6px 4px;
    color: var(--primary);
    font-size: 11px;
    line-height: 14px;
    font-weight: 800;
    text-align: center;
  }

  .bottom-nav-fab-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-top: -26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: 4px solid var(--surface);
    box-shadow: 0 10px 20px -6px rgba(37, 99, 235, 0.55),
      0 4px 10px rgba(15, 23, 42, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .bottom-nav-fab:active .bottom-nav-fab-circle {
    transform: scale(0.94);
    box-shadow: 0 6px 14px -6px rgba(37, 99, 235, 0.55),
      0 2px 6px rgba(15, 23, 42, 0.18);
  }
}

/* Theme toggle icon visibility */
[data-theme="light"] .theme-icon-dark {
  display: none;
}

[data-theme="dark"] .theme-icon-light {
  display: none;
}

.theme-icon-light,
.theme-icon-dark {
  display: inline-flex;
  align-items: center;
}

/* ---------- 5. PAGES: AUTH ---------- */

.auth-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  background: var(--page-bg);
}

.auth-brand {
  display: none;
  background: var(--primary-50);
  border-right: 1px solid var(--border);
}

.auth-brand-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
  padding: 48px 32px;
  height: 100%;
}

.brand-mark-lg {
  width: 56px;
  height: 56px;
  font-size: 26px;
  border-radius: 14px;
  margin-bottom: 8px;
}

.auth-app-name {
  margin: 0;
  font-size: 28px;
  line-height: 34px;
  font-weight: 800;
}

.auth-school {
  margin: 0;
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
}

.auth-tagline {
  margin: 6px 0 14px;
  color: var(--muted);
}

.auth-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
}

.auth-points .icon {
  color: var(--primary);
  flex: none;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: min(100%, 420px);
  padding: 28px 24px;
}

.auth-mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-mobile-brand strong {
  display: block;
  font-size: 15px;
  line-height: 18px;
}

.auth-mobile-brand small {
  color: var(--muted);
}

.auth-sub {
  margin: 0 0 16px;
  color: var(--muted);
}

.auth-link {
  margin: 16px 0 0;
  text-align: center;
  font-weight: 600;
}

.auth-link a {
  color: var(--primary);
}

@media (min-width: 1024px) {
  .auth-layout {
    grid-template-columns: 1.1fr 1fr;
  }

  .auth-brand {
    display: block;
  }

  .auth-mobile-brand {
    display: none;
  }

  .auth-card {
    padding: 36px 32px;
  }
}

/* ---------- 5. PAGES: ABSENSI ---------- */

.attendance-page {
  max-width: 640px;
}

.today-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
}

.today-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.today-meta dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 700;
}

.today-late {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0;
  color: var(--st-terlambat);
  font-weight: 600;
  font-size: 13px;
}

.gps-card {
  padding: 14px 16px;
}

.gps-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gps-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--radius);
  background: var(--primary-50);
  color: var(--primary);
}

.gps-info {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gps-info strong {
  font-size: 14px;
}

.gps-info span {
  font-size: 12px;
  line-height: 16px;
}

.photo-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 64px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  padding: 12px;
  text-align: center;
  transition: border-color 160ms ease, color 160ms ease;
}

.photo-drop:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.photo-preview {
  margin-top: 10px;
  max-width: 160px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.done-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.shortcut strong {
  display: block;
  font-size: 14px;
}

.shortcut span {
  font-size: 12px;
}

@media (min-width: 768px) {
  .today-meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- 5. PAGES: DASHBOARD ADMIN ---------- */

.chart-card {
  display: flex;
  flex-direction: column;
}

.chart-box {
  position: relative;
  flex: 1;
  min-height: 240px;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius);
  transition: background-color 160ms ease;
}

.action-row:hover {
  background: var(--surface-muted);
}

.action-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}

.mini-title {
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mini-title:first-child {
  margin-top: 0;
}

.mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-list li {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.mini-list strong {
  font-size: 13px;
}

.mini-list span {
  font-size: 12px;
}

/* ---------- 5. PAGES: RIWAYAT & DETAIL ---------- */

.attendance-history-page {
  display: grid;
  gap: 20px;
}

.history-filter-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
  gap: 16px;
  margin: 0;
  padding: 20px;
  border-radius: 12px;
}

.history-filter-heading {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.history-filter-heading h2 {
  margin: 0 0 2px;
  font-size: 16px;
  line-height: 24px;
}

.history-filter-heading p {
  font-size: 12px;
  line-height: 18px;
}

.history-filter-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-50);
  color: var(--primary);
}

.history-filter-panel .field {
  min-width: 0;
}

.history-filter-panel .filter-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.attendance-history-page .history-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.history-summary .kpi {
  min-height: 92px;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
}

.history-summary .kpi-icon {
  width: 38px;
  height: 38px;
}

.history-summary .kpi-value {
  font-size: 24px;
  line-height: 30px;
}

.history-data-card {
  overflow: hidden;
  padding: 0;
  border-radius: 12px;
}

.history-data-card > .card-header {
  margin: 0;
  padding: 20px;
}

.history-data-card > .empty-state {
  padding: 32px 20px 36px;
  border-top: 1px solid var(--border);
}

.history-table-wrap {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

.history-table th:first-child,
.history-table td:first-child {
  padding-left: 20px;
}

.history-table th:last-child,
.history-table td:last-child {
  padding-right: 20px;
}

.history-table td {
  padding-block: 14px;
}

.history-date {
  font-weight: 700;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item a {
  display: flex;
  height: 100%;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--history-tone, var(--primary));
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.history-item a:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-card);
}

.history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.history-item-date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.history-item-meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.history-item-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--surface-muted);
}

.history-item-meta small,
.history-item-meta strong {
  display: block;
}

.history-item-meta small {
  color: var(--muted);
  font-size: 10px;
  line-height: 14px;
}

.history-item-meta strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-meta-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--history-tone, var(--primary)) 13%, var(--surface));
  color: var(--history-tone, var(--primary));
}

.attendance-history-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0 20px 4px;
}

.history-item {
  min-width: 0;
  --history-tone: var(--primary);
}

.history-status-hadir { --history-tone: var(--st-hadir); }

.history-status-terlambat { --history-tone: var(--st-terlambat); }

.history-status-izin { --history-tone: var(--st-izin); }

.history-status-sakit { --history-tone: var(--st-sakit); }

.history-status-cuti { --history-tone: var(--st-cuti); }

.history-status-alpha { --history-tone: var(--st-alpha); }

.history-data-card > .pagination {
  margin: 18px 20px 20px;
}

.history-item-detail {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: 100%;
  margin: auto 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

@media (min-width: 1024px) {
  .attendance-history-page .history-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .attendance-history-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .attendance-history-page {
    gap: 14px;
  }

  .history-filter-panel {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .history-filter-heading {
    padding-bottom: 14px;
  }

  .history-filter-panel .filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .history-filter-panel .filter-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .history-summary .kpi {
    min-height: 86px;
    padding: 12px;
  }

  .history-summary .kpi-icon {
    width: 34px;
    height: 34px;
  }

  .history-summary .kpi-value {
    font-size: 21px;
    line-height: 27px;
  }

  .history-summary .kpi-label {
    font-size: 11px;
    line-height: 16px;
  }

  .history-data-card > .card-header {
    padding: 16px 18px;
  }

  .attendance-history-list {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 16px 2px;
  }

  .history-data-card > .pagination {
    margin: 14px 16px 16px;
  }
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.detail-page {
  max-width: 860px;
}

.detail-photo {
  display: block;
  width: 100%;
  max-width: 260px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.gps-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin: 0 0 12px;
}

.flagged-note {
  color: var(--st-terlambat);
  font-weight: 700;
}

.correction-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--st-pending-bg);
  color: var(--st-pending);
  font-weight: 600;
  font-size: 13px;
}

/* ---------- 5. PAGES: PENGAJUAN & APPROVAL ---------- */

.inline-form {
  display: inline-flex;
}

.approval-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.approval-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.approval-badges {
  justify-content: flex-start;
  margin-bottom: 8px;
}

.approval-title {
  margin: 0 0 4px;
  font-size: 15px;
}

.approval-reason {
  margin: 0 0 8px;
}

.approval-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin: 0 0 10px;
}

.approval-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

@media (max-width: 767px) {
  .approval-item {
    grid-template-columns: 1fr;
  }

  .approval-actions {
    flex-direction: row;
  }

  .approval-actions form,
  .approval-actions .btn {
    flex: 1;
  }
}

/* ---------- 5. PAGES: KARYAWAN ---------- */

.reveal-card {
  padding: 0;
  overflow: visible;
}

.reveal-trigger {
  list-style: none;
  margin: 14px 16px;
  display: inline-flex;
  cursor: pointer;
}

.reveal-trigger::-webkit-details-marker {
  display: none;
}

.reveal-body {
  padding: 4px 20px 20px;
  border-top: 1px solid var(--border);
}

.assign-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.assign-form select {
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
}

.employee-item-actions {
  margin-top: 10px;
}

/* Modal edit dengan backdrop eksplisit agar konsisten lintas browser. */
.employee-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}

.employee-edit-modal[hidden] {
  display: none;
}

.employee-edit-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.62);
  cursor: pointer;
}

.employee-edit-panel {
  position: relative;
  width: min(540px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
  animation: employee-modal-in 180ms ease-out;
}

body.employee-modal-open {
  overflow: hidden;
}

@keyframes employee-modal-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.employee-edit-form {
  display: flex;
  max-height: calc(100dvh - 32px);
  flex-direction: column;
}

.employee-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 18px;
  border-top: 4px solid var(--primary);
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.employee-edit-header h2 {
  margin: 2px 0 4px;
  font-size: 20px;
  line-height: 28px;
}

.employee-edit-header p {
  font-size: 13px;
  line-height: 20px;
}

.employee-edit-eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.employee-edit-close {
  flex: none;
  margin: -4px -6px 0 0;
}

.employee-edit-body {
  overflow-y: auto;
  padding: 20px 22px 6px;
}

.employee-edit-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--primary-50);
}

.employee-edit-summary strong,
.employee-edit-summary span:not(.avatar) {
  display: block;
}

.employee-edit-summary strong {
  margin-bottom: 1px;
  font-size: 14px;
}

.employee-edit-summary span:not(.avatar) {
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

.employee-edit-avatar {
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 16px;
}

.employee-edit-fields {
  display: grid;
  gap: 2px;
}

.employee-edit-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ---------- Employees: card grid + paginasi ---------- */

.btn-sm {
  min-height: 38px;
  padding: 7px 12px;
  font-size: 12px;
}

.employee-email {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  word-break: break-word;
}

.employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  align-items: start;
  gap: 20px;
}

.employee-profile-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.09);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.employee-profile-card:hover {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
  box-shadow: var(--shadow-hover);
}

.employee-profile-card.is-inactive {
  opacity: 0.78;
}

.employee-profile-cover {
  position: relative;
  height: 128px;
  overflow: hidden;
  margin: 9px 9px 0;
  border-radius: 22px;
  background: var(--primary-50);
}

.employee-cover-shape {
  position: absolute;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
}

.employee-cover-shape-one {
  width: 150px;
  height: 150px;
  top: -82px;
  left: -22px;
}

.employee-cover-shape-two {
  width: 190px;
  height: 190px;
  right: -68px;
  bottom: -132px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.employee-profile-edit {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.13);
}

.employee-profile-avatar-shell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  margin: -54px auto 0;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(var(--primary), var(--accent), var(--warning), var(--primary));
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
}

.employee-profile-photo,
.employee-profile-initial {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border: 5px solid var(--surface);
  border-radius: 50%;
  background: var(--primary-50);
}

.employee-profile-photo {
  object-fit: cover;
}

.employee-profile-initial {
  color: var(--primary);
  font-size: 34px;
  font-weight: 800;
}

.employee-profile-identity {
  min-width: 0;
  padding: 18px 22px 0;
  text-align: center;
}

.employee-profile-identity h3 {
  margin: 0 0 5px;
  overflow: hidden;
  font-size: 20px;
  line-height: 28px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-profile-identity p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.employee-profile-identity .employee-email {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-profile-identity .employee-email:hover {
  color: var(--primary);
}

.employee-profile-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.badge-role {
  max-width: 124px;
  text-align: center;
}

.role-admin { background: var(--primary-50); color: var(--primary-700); }

.role-headmaster { background: var(--st-lembur-bg); color: var(--st-lembur); }

.role-employee { background: var(--surface-muted); color: var(--muted); }

.employee-profile-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 16px 0;
  padding: 16px 8px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-muted);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.05);
}

.employee-profile-meta > div {
  position: relative;
  min-width: 0;
  padding: 0 8px;
  text-align: center;
}

.employee-profile-meta > div + div {
  border-left: 1px solid var(--border);
}

.employee-profile-meta dt {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.employee-profile-meta dd {
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-profile-schedule {
  padding: 18px 18px 20px;
}

.employee-profile-schedule .field-label {
  display: block;
  margin-bottom: 7px;
}

.employee-profile-schedule .assign-form,
.employee-profile-schedule select {
  width: 100%;
}

.employee-profile-schedule select {
  flex: 1;
  min-width: 0;
}

.employee-profile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 9px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.employee-profile-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.employee-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.employee-status > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.employee-status.is-active {
  color: var(--accent);
}

.employee-status.is-active > span {
  background: var(--accent);
}

.employee-status.is-inactive {
  color: var(--danger);
}

.employee-status.is-inactive > span {
  background: var(--danger);
}

.employee-profile-actions {
  display: flex;
  gap: 8px;
}

.employee-profile-actions .inline-form {
  display: flex;
}

.employee-deactivate-button {
  color: var(--danger);
}

.employee-deactivate-button:hover:not(:disabled) {
  background: var(--st-alpha-bg);
  color: var(--danger);
}

/* Paginasi */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.pagination-summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.page-nav {
  color: var(--muted);
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: var(--muted);
}

@media (max-width: 767px) {
  .employee-grid {
    grid-template-columns: 1fr;
  }

  .pagination {
    justify-content: center;
  }
}

@media (max-width: 479px) {
  .employee-edit-modal {
    align-items: end;
    padding: 8px;
  }

  .employee-edit-panel {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }

  .employee-edit-form {
    max-height: calc(100dvh - 16px);
  }

  .employee-edit-header {
    padding: 18px 16px 14px;
  }

  .employee-edit-body {
    padding: 16px 16px 2px;
  }

  .employee-edit-footer {
    padding: 14px 16px;
  }

  .employee-edit-footer .btn {
    flex: 1;
    padding-inline: 12px;
  }

  .employee-profile-actions .btn {
    min-height: 44px;
  }

  .employee-profile-card {
    border-radius: 22px;
  }

  .employee-profile-cover {
    height: 116px;
    border-radius: 17px;
  }

  .employee-profile-meta {
    margin-inline: 12px;
  }
}

/* ---------- 5. PAGES: PENGATURAN ---------- */

.settings-tabs {
  display: flex;
}

.tab-panel {
  margin-bottom: 16px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.checkbox-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ---------- 5. PAGES: AUDIT & PROFIL ---------- */

.audit-diff summary {
  list-style: none;
  cursor: pointer;
}

.audit-diff summary::-webkit-details-marker {
  display: none;
}

.json-preview {
  max-width: 420px;
  max-height: 240px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
  font-size: 11px;
  line-height: 16px;
}

.profile-page {
  max-width: 860px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.profile-avatar-initial {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.profile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
}

.profile-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-list dd {
  margin: 2px 0 0;
  font-weight: 600;
}
