/* ======================================================
   web/css/style.css — Tema Figma Bot_Wa (Asterisk)
   Poppins (heading) + Montserrat (body) + Material Symbols
   ====================================================== */

[x-cloak] { display: none !important; }

#app-shell { --support-banner-height: 0px; padding-top: var(--support-banner-height); }
#app-shell .app-support-banner { position: fixed; inset: 0 0 auto; z-index: 60; width: 100%; }
#app-shell .app-sidebar { top: var(--support-banner-height); height: calc(100dvh - var(--support-banner-height)); }
#app-shell .app-header { top: var(--support-banner-height); }
#app-shell .app-mobile-drawer { top: var(--support-banner-height); height: calc(100dvh - var(--support-banner-height)); }

html, body { overflow-x: hidden; max-width: 100vw; }

@media (max-width: 767px) {
  .system-admin button,
  .system-admin select,
  .system-admin input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
    min-height: 44px;
  }
  .system-admin button[aria-label],
  .system-admin button[class~="w-8"],
  .system-admin button[class~="w-9"] { min-width: 44px; }
  .system-admin :is(button, a, input, select, textarea):focus-visible {
    outline: 2px solid #3965FB;
    outline-offset: 2px;
  }
  .system-admin .admin-mobile-wrap { min-width: 0; overflow-wrap: anywhere; }
  .system-admin .fixed.inset-0.flex.items-center.justify-center {
    align-items: flex-end;
    padding: 0;
  }
  .system-admin .fixed.inset-0.flex.items-center.justify-center > div:not(.fixed) {
    width: 100%;
    max-width: 100vw;
    max-height: calc(100dvh - 0.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 1rem 1rem 0 0;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}
/* Tipografi Tunggal: Plus Jakarta Sans untuk Seluruh Aplikasi */
body, .font-body, .font-sans, h1, h2, h3, h4, .font-heading, .font-display {
  min-width: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Data angka, nomor HP, waktu, jam, tabel & PIN menggunakan Plus Jakarta Sans dengan angka tabular sejajar */
.font-mono, .font-jbmono, time, [data-time] {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* Snippet blok kode teknis pemrograman murni jika ada tag code/pre */
code, kbd, samp, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-variant-numeric: tabular-nums;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal; font-style: normal; font-size: 24px; line-height: 1;
  letter-spacing: normal; text-transform: none;
  font-feature-settings: 'liga'; -webkit-font-feature-settings: 'liga';
  display: inline-block; width: 1em; height: 1em; overflow: hidden;
  white-space: nowrap; word-wrap: normal; direction: ltr;
  -webkit-font-smoothing: antialiased; vertical-align: middle;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.line-clamp-1, .line-clamp-2 {
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}
.line-clamp-1 { -webkit-line-clamp: 1; }
.line-clamp-2 { -webkit-line-clamp: 2; }

button:focus-visible, a:focus-visible, select:focus-visible,
textarea:focus-visible, input:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
.km-assignment-menu summary:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
nav button { min-height: 44px; }

/* ======================================================
   Sidebar Smooth Transitions & Collapsed State
   Ergonomic cubic-bezier easing with coordinated fade timing
   ====================================================== */
.sidebar-label {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 180ms cubic-bezier(0.4, 0, 0.2, 1) 70ms,
              max-width 280ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 180ms cubic-bezier(0.4, 0, 0.2, 1) 70ms;
}

.sidebar-collapsed .sidebar-label {
  flex: none;
  max-width: 0;
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
  transition: opacity 100ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
              max-width 280ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 100ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}

.sidebar-section {
  flex-shrink: 0;
  max-height: 160px;
  opacity: 1;
  overflow: visible;
  transition: opacity 160ms cubic-bezier(0.4, 0, 0.2, 1) 60ms,
              max-height 280ms cubic-bezier(0.4, 0, 0.2, 1),
              margin 280ms cubic-bezier(0.4, 0, 0.2, 1),
              padding 280ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 160ms cubic-bezier(0.4, 0, 0.2, 1) 60ms;
}

.sidebar-collapsed .sidebar-section {
  flex-shrink: 0;
  min-height: 0 !important;
  max-height: 0 !important;
  opacity: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  outline-width: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  transform: translateY(-4px) scale(0.96);
  transition: opacity 100ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
              max-height 280ms cubic-bezier(0.4, 0, 0.2, 1),
              margin 280ms cubic-bezier(0.4, 0, 0.2, 1),
              padding 280ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 100ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}

.sidebar-footer-text, .sidebar-badge {
  opacity: 1;
  max-width: 140px;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 160ms cubic-bezier(0.4, 0, 0.2, 1) 60ms,
              max-width 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed .sidebar-footer-text,
.sidebar-collapsed .sidebar-badge {
  opacity: 0 !important;
  max-width: 0 !important;
  pointer-events: none !important;
  transition: opacity 100ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
              max-width 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed nav button {
  justify-content: center !important;
  gap: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow: hidden;
}

.sidebar-collapsed nav button img { flex-shrink: 0; }
.sidebar-collapsed .sidebar-footer { justify-content: center !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-subtle); }
::-webkit-scrollbar-thumb { background: var(--disabled); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ======================================================
   Dark Mode Engine: Asterisk Midnight Indigo
   ====================================================== */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease !important;
}

html.dark body {
  background-color: var(--canvas) !important;
  color: var(--ink) !important;
}

/* Shell & Container Adapters */
html.dark #app-shell {
  background-color: var(--canvas);
  color: var(--ink);
}
html.dark .app-header {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
}
html.dark .app-sidebar {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
}
html.dark .app-mobile-drawer {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
}
html.dark .app-bottom-nav {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
}

/* Card, Modal, & Surface Adapters */
html.dark .bg-white,
html.dark .ui-card {
  background-color: var(--surface) !important;
}

html.dark .bg-\[\#F8FAFC\],
html.dark .bg-\[\#F6F7FB\],
html.dark .bg-\[\#FAFCFE\],
html.dark .bg-\[\#F2F5FA\],
html.dark .bg-slate-50 {
  background-color: var(--surface-subtle) !important;
}

html.dark .hover\:bg-slate-50:hover,
html.dark .hover\:bg-slate-100:hover,
html.dark .hover\:bg-\[\#F8FAFC\]:hover {
  background-color: var(--surface-subtle) !important;
}

/* Text & Headings */
html.dark .text-\[\#1D1B3A\],
html.dark .text-\[\#0F172A\],
html.dark .text-\[\#1F1F1F\],
html.dark .text-slate-900,
html.dark .text-slate-800 {
  color: var(--ink) !important;
}

html.dark .text-\[\#667085\],
html.dark .text-\[\#64748B\],
html.dark .text-slate-500,
html.dark .text-slate-600 {
  color: var(--muted) !important;
}

/* Borders */
html.dark .border-\[\#EEEEEE\],
html.dark .border-\[\#F1F5F9\],
html.dark .border-\[\#D7DDE7\],
html.dark .border-slate-200,
html.dark .border-slate-100 {
  border-color: var(--border) !important;
}

html.dark .border-\[\#CBD5E1\],
html.dark .border-slate-300 {
  border-color: var(--border-control) !important;
}

html.dark hr,
html.dark .divide-border > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--border) !important;
}

/* Form Controls in Dark Mode */
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html.dark select,
html.dark textarea {
  background-color: var(--surface-subtle) !important;
  color: var(--ink) !important;
  border-color: var(--border-control) !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: var(--muted) !important;
  opacity: 0.75;
}

/* Modals & Popovers */
html.dark [role="dialog"],
html.dark [role="menu"],
html.dark .ui-dialog {
  background-color: var(--surface) !important;
  border-color: var(--border-card) !important;
  color: var(--ink) !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6) !important;
}

/* Badges & Pills in Dark Mode */
html.dark .bg-\[\#EFF4FF\] {
  background-color: rgba(79, 117, 255, 0.16) !important;
}
html.dark .text-\[\#3965FB\] {
  color: var(--primary) !important;
}
html.dark .border-\[\#D1E0FF\] {
  border-color: rgba(79, 117, 255, 0.3) !important;
}
html.dark .bg-\[\#FFFAEB\] {
  background-color: rgba(245, 158, 11, 0.15) !important;
}
html.dark .text-\[\#B54708\] {
  color: #FBBF24 !important;
}
html.dark .bg-\[\#ECFDF3\],
html.dark .bg-\[\#EBFDF2\] {
  background-color: rgba(16, 185, 129, 0.15) !important;
}
html.dark .text-\[\#027A48\] {
  color: #34D399 !important;
}
html.dark .border-\[\#A6F4C5\] {
  border-color: rgba(16, 185, 129, 0.3) !important;
}
html.dark .bg-\[\#FEF3F2\] {
  background-color: rgba(239, 68, 68, 0.15) !important;
}
html.dark .text-\[\#B42318\] {
  color: #F87171 !important;
}
html.dark .bg-\[\#EEF2FF\],
html.dark .bg-\[\#EFF6FF\] {
  background-color: rgba(79, 117, 255, 0.16) !important;
}
html.dark .text-\[\#1D4ED8\] {
  color: #93C5FD !important;
}
html.dark .border-\[\#BFDBFE\] {
  border-color: rgba(79, 117, 255, 0.25) !important;
}

/* Shell Layout Containers in Dark Mode */
html.dark .app-sidebar,
html.dark .app-header,
html.dark .app-mobile-drawer,
html.dark nav[aria-label="Navigasi bawah"] {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
}
html.dark .app-loading-curtain {
  background-color: var(--canvas) !important;
}

/* Table Dark Styling */
html.dark table thead th {
  background-color: var(--surface-subtle) !important;
  color: var(--muted) !important;
  border-color: var(--border) !important;
}
html.dark table tbody tr {
  border-color: var(--border) !important;
}
html.dark table tbody tr:hover {
  background-color: var(--surface-subtle) !important;
}

