/* ============================================================
   SiPohon Ambon — Design System
   Core tokens, typography, layout, utilities
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Serif:ital,wght@0,400;0,600;1,400&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Colors */
  --clr-bg:          hsl(220, 16%, 10%);
  --clr-surface:     hsl(220, 14%, 13%);
  --clr-surface-2:   hsl(220, 12%, 17%);
  --clr-surface-3:   hsl(220, 10%, 22%);
  --clr-border:      hsl(220, 10%, 26%);
  --clr-border-2:    hsl(220, 8%, 32%);

  --clr-text-primary:   hsl(220, 20%, 94%);
  --clr-text-secondary: hsl(220, 12%, 65%);
  --clr-text-muted:     hsl(220, 10%, 45%);

  /* Brand — Forest Green */
  --clr-brand:       hsl(145, 55%, 42%);
  --clr-brand-light: hsl(145, 55%, 52%);
  --clr-brand-dark:  hsl(145, 55%, 30%);
  --clr-brand-dim:   hsl(145, 55%, 42%, 0.15);

  /* Risk Colors */
  --clr-risk-extreme: hsl(0,   80%, 55%);
  --clr-risk-high:    hsl(25,  90%, 55%);
  --clr-risk-moderate:hsl(45, 100%, 52%);
  --clr-risk-low:     hsl(145, 60%, 45%);

  --clr-risk-extreme-dim: hsla(0,   80%, 55%, 0.15);
  --clr-risk-high-dim:    hsla(25,  90%, 55%, 0.15);
  --clr-risk-moderate-dim:hsla(45, 100%, 52%, 0.15);
  --clr-risk-low-dim:     hsla(145, 60%, 45%, 0.15);

  /* Status */
  --clr-status-pending:   hsl(45, 100%, 52%);
  --clr-status-progress:  hsl(205, 85%, 55%);
  --clr-status-done:      hsl(145, 60%, 45%);

  /* Typography */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Noto Serif', Georgia, serif;

  --fs-xs:   0.6875rem;  /* 11px */
  --fs-sm:   0.75rem;    /* 12px */
  --fs-base: 0.875rem;   /* 14px */
  --fs-md:   1rem;       /* 16px */
  --fs-lg:   1.125rem;   /* 18px */
  --fs-xl:   1.25rem;    /* 20px */
  --fs-2xl:  1.5rem;     /* 24px */
  --fs-3xl:  2rem;       /* 32px */

  --fw-light:   300;
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold:600;
  --fw-bold:    700;
  --fw-extrabold:800;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;

  /* Radius */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px hsla(220, 30%, 5%, 0.4);
  --shadow-md: 0 4px 12px hsla(220, 30%, 5%, 0.5);
  --shadow-lg: 0 8px 24px hsla(220, 30%, 5%, 0.6);
  --shadow-xl: 0 16px 48px hsla(220, 30%, 5%, 0.7);
  --shadow-brand: 0 4px 20px hsla(145, 55%, 42%, 0.3);

  /* Transitions */
  --t-fast: 120ms ease;
  --t-base: 200ms ease;
  --t-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 68px;
  --topbar-height: 60px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  background-color: var(--clr-bg);
  color: var(--clr-text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100dvh;
}

/* ── App Shell ──────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  height: 100dvh;
  transition: grid-template-columns var(--t-slow);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed) 1fr;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  grid-row: 1 / -1;
  background: var(--clr-surface);
  border-right: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  position: relative;
  transition: width var(--t-slow);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  height: var(--topbar-height);
  border-bottom: 1px solid var(--clr-border);
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--clr-brand-dark), var(--clr-brand));
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-brand);
}

.sidebar-logo .logo-icon svg {
  width: 20px; height: 20px;
  color: white;
}

.sidebar-logo .logo-text {
  overflow: hidden;
  transition: opacity var(--t-base), width var(--t-slow);
}

.sidebar-logo .logo-text h1 {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--clr-text-primary);
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.sidebar-logo .logo-text span {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: var(--sp-4) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--clr-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t-base);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--clr-text-secondary);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.nav-item:hover {
  background: var(--clr-surface-2);
  color: var(--clr-text-primary);
}

.nav-item.active {
  background: var(--clr-brand-dim);
  color: var(--clr-brand-light);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  background: var(--clr-brand);
  border-radius: 0 var(--r-full) var(--r-full) 0;
}

.nav-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

.nav-item .nav-label {
  transition: opacity var(--t-base);
}

.nav-badge {
  margin-left: auto;
  background: var(--clr-risk-extreme);
  color: white;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  padding: 1px 6px;
  border-radius: var(--r-full);
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: opacity var(--t-base);
}

.sidebar-footer {
  padding: var(--sp-4) var(--sp-3);
  border-top: 1px solid var(--clr-border);
  overflow: hidden;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast);
}

.user-profile:hover { background: var(--clr-surface-2); }

.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--clr-brand-dark), var(--clr-brand));
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: white;
  flex-shrink: 0;
}

.user-info {
  overflow: hidden;
  transition: opacity var(--t-base);
}

.user-info .user-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}

.user-info .user-role {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
  white-space: nowrap;
}

/* Collapsed sidebar */
.app-shell.sidebar-collapsed .sidebar-logo .logo-text,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .nav-section-label,
.app-shell.sidebar-collapsed .nav-badge,
.app-shell.sidebar-collapsed .user-info {
  opacity: 0;
  pointer-events: none;
  width: 0;
}

.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-left: var(--sp-3);
  padding-right: var(--sp-3);
}

.app-shell.sidebar-collapsed .sidebar-logo {
  justify-content: center;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--sp-6);
  z-index: 90;
}

.topbar-toggle {
  width: 36px; height: 36px;
  border: none;
  background: var(--clr-surface-2);
  color: var(--clr-text-secondary);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}

.topbar-toggle:hover {
  background: var(--clr-surface-3);
  color: var(--clr-text-primary);
}

.topbar-title {
  flex: 1;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--clr-text-primary);
}

.topbar-title span {
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  color: var(--clr-text-muted);
  margin-left: var(--sp-2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  font-family: var(--font-sans);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--clr-brand);
  color: white;
  box-shadow: 0 2px 8px hsla(145, 55%, 42%, 0.35);
}

.btn-primary:hover {
  background: var(--clr-brand-light);
  box-shadow: 0 4px 16px hsla(145, 55%, 42%, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--clr-surface-2);
  color: var(--clr-text-secondary);
  border: 1px solid var(--clr-border);
}

.btn-secondary:hover {
  background: var(--clr-surface-3);
  color: var(--clr-text-primary);
  border-color: var(--clr-border-2);
}

.btn-ghost {
  background: transparent;
  color: var(--clr-text-secondary);
}

.btn-ghost:hover {
  background: var(--clr-surface-2);
  color: var(--clr-text-primary);
}

.btn-danger {
  background: hsla(0, 80%, 55%, 0.15);
  color: var(--clr-risk-extreme);
  border: 1px solid hsla(0, 80%, 55%, 0.25);
}

.btn-danger:hover {
  background: hsla(0, 80%, 55%, 0.25);
}

.btn-sm { padding: var(--sp-1) var(--sp-3); font-size: var(--fs-xs); }
.btn-lg { padding: var(--sp-3) var(--sp-6); font-size: var(--fs-base); }
.btn-icon { padding: var(--sp-2); gap: 0; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.card-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.card-title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--clr-text-primary);
  flex: 1;
}

.card-subtitle {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
  margin-top: 2px;
}

.card-body {
  padding: var(--sp-5) var(--sp-6);
}

/* ── Risk Badges ────────────────────────────────────────────── */
.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.risk-extreme { background: var(--clr-risk-extreme-dim); color: var(--clr-risk-extreme); border: 1px solid hsla(0, 80%, 55%, 0.3); }
.risk-high    { background: var(--clr-risk-high-dim);    color: var(--clr-risk-high);    border: 1px solid hsla(25, 90%, 55%, 0.3); }
.risk-moderate{ background: var(--clr-risk-moderate-dim);color: var(--clr-risk-moderate);border: 1px solid hsla(45, 100%, 52%, 0.3); }
.risk-low     { background: var(--clr-risk-low-dim);     color: var(--clr-risk-low);     border: 1px solid hsla(145, 60%, 45%, 0.3); }

/* ── Status Badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}

.status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pending  { background: hsla(45,100%,52%,0.12); color: var(--clr-status-pending);  }
.status-pending::before  { background: var(--clr-status-pending); box-shadow: 0 0 0 2px hsla(45,100%,52%,0.3); }

.status-progress { background: hsla(205,85%,55%,0.12); color: var(--clr-status-progress); }
.status-progress::before { background: var(--clr-status-progress); animation: pulse 1.5s infinite; }

.status-done     { background: hsla(145,60%,45%,0.12); color: var(--clr-status-done); }
.status-done::before     { background: var(--clr-status-done); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 hsla(205,85%,55%,0.5); }
  50%       { box-shadow: 0 0 0 4px hsla(205,85%,55%,0); }
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  padding: var(--sp-5) var(--sp-6);
  position: relative;
  overflow: hidden;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--clr-border-2);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--accent, var(--clr-brand));
}

.stat-card .stat-icon {
  width: 40px; height: 40px;
  background: var(--accent-dim, var(--clr-brand-dim));
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent, var(--clr-brand));
  margin-bottom: var(--sp-4);
}

.stat-card .stat-icon svg { width: 20px; height: 20px; }

.stat-value {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-extrabold);
  color: var(--clr-text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  margin-top: var(--sp-1);
  font-weight: var(--fw-medium);
}

.stat-change {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  margin-top: var(--sp-3);
}

.stat-change.up   { color: var(--clr-risk-low); }
.stat-change.down { color: var(--clr-risk-extreme); }
.stat-change svg  { width: 12px; height: 12px; }

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  background: var(--clr-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--clr-surface-3) transparent;
}

*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--clr-surface-3);
  border-radius: var(--r-full);
}
*::-webkit-scrollbar-thumb:hover { background: var(--clr-border-2); }

/* ── Tooltips ───────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--clr-surface-3);
  color: var(--clr-text-primary);
  font-size: var(--fs-xs);
  padding: 5px 10px;
  border-radius: var(--r-md);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
  z-index: 999;
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-md);
}

.app-shell:not(.sidebar-collapsed) [data-tooltip]::after { display: none; }

.app-shell.sidebar-collapsed [data-tooltip]:hover::after { opacity: 1; }

/* ── Search Input ───────────────────────────────────────────── */
.search-input {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-full);
  padding: var(--sp-2) var(--sp-4);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.search-input:focus-within {
  border-color: var(--clr-brand);
  box-shadow: 0 0 0 3px var(--clr-brand-dim);
}

.search-input svg {
  width: 15px; height: 15px;
  color: var(--clr-text-muted);
  flex-shrink: 0;
}

.search-input input {
  background: none;
  border: none;
  outline: none;
  font-size: var(--fs-sm);
  color: var(--clr-text-primary);
  font-family: var(--font-sans);
  width: 200px;
}

.search-input input::placeholder { color: var(--clr-text-muted); }

/* ── Notifications bell ─────────────────────────────────────── */
.notif-btn {
  width: 36px; height: 36px;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--t-fast);
  color: var(--clr-text-secondary);
}

.notif-btn:hover { background: var(--clr-surface-3); color: var(--clr-text-primary); }

.notif-btn .badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 16px; height: 16px;
  background: var(--clr-risk-extreme);
  border-radius: var(--r-full);
  font-size: 9px;
  font-weight: var(--fw-bold);
  color: white;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--clr-surface);
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-12);
  text-align: center;
  color: var(--clr-text-muted);
}

.empty-state svg { width: 48px; height: 48px; opacity: 0.4; }

.empty-state h3 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--clr-text-secondary);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 220px;
  }
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 0 1fr !important;
  }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform var(--t-slow);
  }

  .app-shell.mobile-open .sidebar {
    transform: translateX(0);
  }

  .search-input input { width: 140px; }
}

/* ── Custom Alert, Confirm & Prompt Modals ──────────────────── */
.custom-alert-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: var(--sp-4);
}

.custom-alert-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.custom-alert-modal {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.custom-alert-overlay.open .custom-alert-modal {
  transform: scale(1) translateY(0);
}

.custom-alert-header {
  padding: var(--sp-5) var(--sp-6) var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--clr-text-primary);
}

.custom-alert-body {
  padding: var(--sp-2) var(--sp-6) var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--clr-text-secondary);
  line-height: 1.6;
}

.custom-alert-input-wrapper {
  margin-top: var(--sp-4);
}

.custom-alert-footer {
  padding: var(--sp-4) var(--sp-6) var(--sp-5);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  border-top: 1px solid var(--clr-border);
  background: var(--clr-surface-2);
}

/* ── Kanban Cards Unified Anti-Truncation & Elevate Styling ──── */
.kanban-card {
  word-break: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

/* ── Terjadwal & Kalender Dispatch Styling ───────────────────── */
.sched-preset-btn {
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  transition: all 0.15s ease;
}

.sched-preset-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.sched-preset-btn.active {
  background: #3b82f6 !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.schedule-tab-btn {
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.schedule-tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.schedule-tab-btn.active {
  background: rgba(59, 130, 246, 0.2) !important;
  color: #93c5fd !important;
  border: 1px solid rgba(59, 130, 246, 0.4) !important;
  font-weight: 800 !important;
}

.calendar-day-cell:hover {
  transform: scale(1.02);
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.schedule-agenda-card {
  word-break: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.schedule-agenda-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

/* ── Modal Overlay Safety Rule ────────────────────────────── */
.detail-modal-overlay:not(.open) {
  display: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.detail-modal-overlay.open {
  display: flex !important;
  pointer-events: all !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ============================================================
   SiPohon Ambon — Global Preloader & Shimmer Skeleton System
   ============================================================ */

/* 1. Shimmer Keyframe Animation */
@keyframes sipohonShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.2), inset 0 0 15px rgba(34, 197, 94, 0.1);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.5), inset 0 0 20px rgba(34, 197, 94, 0.25);
    transform: scale(1.04);
  }
}

/* 2. Skeleton Elements */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.09) 37%,
    rgba(255, 255, 255, 0.03) 63%
  ) !important;
  background-size: 400% 100% !important;
  animation: sipohonShimmer 1.4s ease infinite !important;
  color: transparent !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  user-select: none !important;
  pointer-events: none !important;
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  min-width: 60px;
}

.skeleton-title {
  height: 24px;
  border-radius: 6px;
  width: 140px;
}

.skeleton-card {
  border-radius: 12px;
  min-height: 80px;
}

/* 3. Global Full-Page Preloader Overlay */
#app-preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: radial-gradient(circle at center, #131d2e 0%, #0b111c 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.45s ease;
}

#app-preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-brand-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.preloader-logo-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.1);
  border: 2px solid rgba(34, 197, 94, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin-bottom: 18px;
  animation: pulseGlow 2.2s infinite ease-in-out;
  position: relative;
}

.preloader-logo-ring::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(34, 197, 94, 0.3);
  animation: spinRing 8s linear infinite;
}

@keyframes spinRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.preloader-title {
  font-size: 19px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
  margin: 0 0 6px 0;
}

.preloader-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 24px 0;
  max-width: 280px;
}

.preloader-progress-track {
  width: 220px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.preloader-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, #22c55e, #10b981, #06b6d4);
  border-radius: 999px;
  animation: preloaderBar 1.6s ease-in-out infinite alternate;
}

@keyframes preloaderBar {
  0% { left: 0%; width: 20%; }
  50% { width: 55%; }
  100% { left: 75%; width: 25%; }
}
