/* SIMISP UI/UX Prototype — Refined Operational Glass + Anti-Slop
   Sesuai DESIGN_SYSTEM.md */

:root {
  --bg-canvas: #f8fafc;
  --emerald-primary: #059669;
  --emerald-hover: #047857;
  --teal-accent: #0d9488;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-solid: #e2e8f0;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
}

.font-mono-code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Kanvas ambient sangat halus untuk mendukung efek glass tanpa visual noise */
.simisp-canvas {
  background-color: #f8fafc;
  background-image:
    radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.075) 0px, transparent 45%),
    radial-gradient(at 100% 0%, rgba(13, 148, 136, 0.06) 0px, transparent 40%);
  background-attachment: fixed;
}

/* Controlled Glassmorphism: hanya untuk Topbar, Sidebar, KPI Cards, & Modal */
.glass-panel {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 10px 25px -5px rgba(15, 23, 42, 0.05),
    inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

/* Solid surface untuk tabel akuntansi, form input, dan teks panjang */
.solid-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

/* Desktop Collapsible Sidebar (Expanded 256px <-> Collapsed Icon Rail 68px) */
@media (min-width: 1024px) {
  #desktop-sidebar {
    width: 16rem;
    transition: width 180ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  #main-shell {
    padding-left: 16rem;
    transition: padding-left 180ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  body.sidebar-collapsed #desktop-sidebar {
    width: 4.25rem;
  }
  body.sidebar-collapsed #main-shell {
    padding-left: 4.25rem;
  }
  body.sidebar-collapsed #desktop-sidebar .sidebar-label,
  body.sidebar-collapsed #desktop-sidebar .sidebar-section-title,
  body.sidebar-collapsed #desktop-sidebar .sidebar-badge,
  body.sidebar-collapsed #desktop-sidebar .brand-text {
    display: none;
  }
  body.sidebar-collapsed #desktop-sidebar .sidebar-header {
    justify-content: center;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  body.sidebar-collapsed #desktop-sidebar .sidebar-brand {
    display: none;
  }
  body.sidebar-collapsed #desktop-sidebar .sidebar-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
  body.sidebar-collapsed #desktop-sidebar .sidebar-collapse-icon {
    transform: rotate(180deg);
  }
}

/* Native <dialog> modal styling + light dismiss backdrop */
dialog.simisp-dialog {
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: visible;
}

dialog.simisp-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Watermark pattern overlay untuk preview KTP view-only */
.ktp-watermark-overlay {
  background-image: repeating-linear-gradient(
    -28deg,
    rgba(15, 23, 42, 0.07) 0px,
    rgba(15, 23, 42, 0.07) 1px,
    transparent 1px,
    transparent 42px
  );
}

/* Subtle scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
