/* ==========================================================================
   TDA-OS Design System — Modern Professional
   ========================================================================== */
:root {
  --primary: #2E3192;
  --primary-d: #1a1d5c;
  --primary-l: #4a4db8;
  --primary-50: rgba(46, 49, 146, .06);
  --primary-100: rgba(46, 49, 146, .12);
  --primary-ring: rgba(46, 49, 146, .22);
  --secondary: #C9A227;
  --secondary-d: #9a7b0a;
  --sidebar-bg: #12143a;
  --sidebar-bg-dark: #0a0c28;
  --sidebar-accent: #8b8ee8;
  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --info: #0369a1;
  --info-bg: #e0f2fe;
  --bg: #eef1f6;
  --bg-alt: #e4e9f0;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .09);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
  --shadow-xl: 0 20px 48px rgba(15, 23, 42, .16);
  --sidebar-w: 260px;
  --transition: .18s cubic-bezier(.4, 0, .2, 1);
  --scrollbar-size: 5px;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(46, 49, 146, .25);
  --scrollbar-thumb-hover: rgba(46, 49, 146, .42);
  --scrollbar-thumb-sidebar: rgba(255, 255, 255, .2);
  --scrollbar-thumb-sidebar-hover: rgba(255, 255, 255, .36);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -.01em;
}
h1,h2,h3,h4,h5 {
  font-family: "Poppins", "Inter", sans-serif;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.025em;
  line-height: 1.3;
}
a { color: var(--primary); text-decoration: none; font-weight: 500; }
a:hover { color: var(--primary-d); text-decoration: none; }
code, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* ----------------------------- Layout ----------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #fff;
  position: fixed; top: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column;
  z-index: 40;
  transition: transform var(--transition);
  border-right: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 4px 0 24px rgba(0, 0, 0, .18);
}
.sidebar.open { z-index: 55; }
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .15);
}
.sidebar__logo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.sidebar__logo {
  height: 36px;
  width: auto;
  max-width: 72px;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
  opacity: .95;
}
.sidebar__brand-info {
  min-width: 0;
  flex: 1;
  line-height: 1.35;
}
.sidebar__brand-jenis {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .5);
  font-weight: 600;
}
.sidebar__brand-nama {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.01em;
}
.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb-sidebar) var(--scrollbar-track);
}
.sidebar__nav::-webkit-scrollbar { width: var(--scrollbar-size); }
.sidebar__nav::-webkit-scrollbar-track { background: var(--scrollbar-track); }
.sidebar__nav::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb-sidebar);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.sidebar__nav::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-sidebar-hover); }
.sidebar__nav a {
  display: flex; align-items: center; gap: 12px;
  margin: 2px 12px; padding: 9px 12px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: none;
  transition: background var(--transition), color var(--transition);
}
.sidebar__nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar__nav a.active {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--sidebar-accent);
}
.sidebar__nav .nav-section {
  padding: 18px 20px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .38);
  font-weight: 700;
}
.sidebar__footer {
  flex-shrink: 0;
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.sidebar__logout {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 12px;
  padding: 9px 12px;
  color: rgba(255, 255, 255, .65);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.sidebar__logout:hover {
  background: rgba(185, 28, 28, .18);
  color: #fca5a5;
  text-decoration: none;
}

/* CSS-only sidebar icons */
.nav-ico { width: 18px; height: 18px; flex-shrink: 0; position: relative; display: inline-block; opacity: .92; }
.nav-ico::before, .nav-ico::after { content: ''; position: absolute; box-sizing: border-box; }
.nav-ico--dashboard::before { inset: 0; border: 2px solid currentColor; border-radius: 3px; opacity: .35; }
.nav-ico--dashboard::after { width: 6px; height: 6px; top: 3px; left: 3px; background: currentColor; border-radius: 1px; box-shadow: 7px 0 0 currentColor, 0 7px 0 currentColor, 7px 7px 0 currentColor; }
.nav-ico--pelayan::before { width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; top: 0; left: 5px; }
.nav-ico--pelayan::after { width: 14px; height: 7px; border: 2px solid currentColor; border-bottom: none; border-radius: 8px 8px 0 0; bottom: 0; left: 2px; }
.nav-ico--struktur::before { width: 2px; height: 14px; background: currentColor; left: 8px; top: 2px; }
.nav-ico--struktur::after { width: 12px; height: 2px; background: currentColor; top: 5px; left: 3px; box-shadow: -4px 8px 0 currentColor, 8px 8px 0 currentColor; }
.nav-ico--divisi::before { width: 14px; height: 10px; border: 2px solid currentColor; border-radius: 2px 2px 0 0; top: 4px; left: 2px; }
.nav-ico--divisi::after { width: 8px; height: 2px; background: currentColor; top: 2px; left: 5px; border-radius: 1px 1px 0 0; }
.nav-ico--jabatan::before { width: 12px; height: 8px; border: 2px solid currentColor; border-radius: 50% 50% 2px 2px; top: 1px; left: 3px; }
.nav-ico--jabatan::after { width: 6px; height: 4px; border: 2px solid currentColor; border-top: none; bottom: 1px; left: 6px; }
.nav-ico--program::before { width: 14px; height: 2px; background: currentColor; top: 3px; left: 2px; box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor; border-radius: 1px; }
.nav-ico--program::after { width: 4px; height: 4px; border: 2px solid currentColor; border-radius: 50%; top: 1px; left: 1px; box-shadow: 0 5px 0 -1px currentColor, 0 10px 0 -1px currentColor; }
.nav-ico--kegiatan::before { width: 14px; height: 12px; border: 2px solid currentColor; border-radius: 2px; top: 3px; left: 2px; }
.nav-ico--kegiatan::after { width: 2px; height: 4px; background: currentColor; top: 0; left: 8px; box-shadow: -3px 0 0 currentColor, 3px 0 0 currentColor; }
.nav-ico--kalender::before { width: 14px; height: 12px; border: 2px solid currentColor; border-radius: 2px; top: 4px; left: 2px; }
.nav-ico--kalender::after { width: 14px; height: 2px; background: currentColor; top: 4px; left: 2px; }
.nav-ico--absensi::before { width: 8px; height: 14px; border: 2px solid currentColor; border-radius: 1px; top: 1px; left: 5px; transform: rotate(45deg); border-top: none; border-left: none; }
.nav-ico--kpi::before { width: 2px; height: 14px; background: currentColor; bottom: 0; left: 3px; box-shadow: 5px -4px 0 currentColor, 10px -8px 0 currentColor; }
.nav-ico--kas::before { width: 14px; height: 10px; border: 2px solid currentColor; border-radius: 2px; top: 4px; left: 2px; }
.nav-ico--kas::after { width: 8px; height: 2px; background: currentColor; top: 2px; left: 5px; border-radius: 2px; }
.nav-ico--keuangan::before { width: 12px; height: 12px; border: 2px solid currentColor; border-radius: 50%; top: 3px; left: 3px; }
.nav-ico--keuangan::after { width: 6px; height: 2px; background: currentColor; top: 8px; left: 6px; }
.nav-ico--surat::before { width: 14px; height: 10px; border: 2px solid currentColor; border-radius: 1px; top: 4px; left: 2px; }
.nav-ico--surat::after { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 4px solid currentColor; top: 4px; left: 4px; }
.nav-ico--proposal::before { width: 11px; height: 14px; border: 2px solid currentColor; border-radius: 1px; top: 1px; left: 4px; }
.nav-ico--proposal::after { width: 6px; height: 2px; background: currentColor; top: 6px; left: 6px; box-shadow: 0 4px 0 currentColor; }
.nav-ico--laporan::before { width: 12px; height: 14px; border: 2px solid currentColor; border-radius: 1px; top: 1px; left: 3px; }
.nav-ico--laporan::after { width: 6px; height: 2px; background: currentColor; top: 5px; left: 6px; box-shadow: 0 3px 0 currentColor, 0 6px 0 currentColor; }
.nav-ico--member::before { width: 7px; height: 7px; border: 2px solid currentColor; border-radius: 50%; top: 0; left: 1px; box-shadow: 8px 0 0 -1px currentColor; }
.nav-ico--member::after { width: 16px; height: 6px; border: 2px solid currentColor; border-bottom: none; border-radius: 6px 6px 0 0; bottom: 0; left: 1px; }
.nav-ico--mitra::before { width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; top: 5px; left: 0; }
.nav-ico--mitra::after { width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; top: 5px; right: 0; }
.nav-ico--aset::before { width: 14px; height: 10px; border: 2px solid currentColor; border-radius: 2px; top: 5px; left: 2px; }
.nav-ico--aset::after { width: 6px; height: 2px; background: currentColor; top: 2px; left: 5px; border-radius: 1px; }
.nav-ico--notifikasi::before { width: 12px; height: 10px; border: 2px solid currentColor; border-radius: 4px 4px 2px 2px; top: 2px; left: 3px; }
.nav-ico--notifikasi::after { width: 4px; height: 2px; background: currentColor; bottom: 1px; left: 7px; border-radius: 0 0 2px 2px; }
.nav-ico--audit::before { width: 10px; height: 10px; border: 2px solid currentColor; border-radius: 50%; top: 1px; left: 1px; }
.nav-ico--audit::after { width: 2px; height: 5px; background: currentColor; bottom: 2px; right: 3px; transform: rotate(-45deg); transform-origin: bottom; }
.nav-ico--periode::before { width: 14px; height: 10px; border: 2px solid currentColor; border-radius: 2px; top: 5px; left: 2px; }
.nav-ico--periode::after { width: 14px; height: 2px; background: currentColor; top: 5px; left: 2px; }
.nav-ico--pengaturan::before { width: 12px; height: 12px; border: 2px solid currentColor; border-radius: 50%; top: 3px; left: 3px; }
.nav-ico--pengaturan::after { width: 4px; height: 4px; background: currentColor; border-radius: 50%; top: 7px; left: 7px; box-shadow: 0 -9px 0 -1px currentColor, 0 9px 0 -1px currentColor, -9px 0 0 -1px currentColor, 9px 0 0 -1px currentColor; }
.nav-ico--menu::before { width: 14px; height: 2px; background: currentColor; top: 4px; left: 2px; border-radius: 1px; box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor; }
.nav-ico--keluar::before { width: 9px; height: 12px; border: 2px solid currentColor; border-right: none; top: 3px; left: 2px; border-radius: 1px 0 0 1px; }
.nav-ico--keluar::after { width: 7px; height: 2px; background: currentColor; top: 8px; left: 9px; border-radius: 1px; box-shadow: 4px -3px 0 currentColor, 4px 3px 0 currentColor; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; transition: margin-left var(--transition); }
.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 30;
}
.topbar__left { display:flex; align-items:center; gap: 16px; }
.topbar__title { font-family:"Poppins",sans-serif; font-weight:700; font-size:17px; letter-spacing:-.02em; color:var(--text); }
.topbar__user { display:flex; align-items:center; gap:12px; position: relative; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-d) 100%);
  color: #fff;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:14px;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-light), var(--shadow-xs);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
}
.user-menu { position: relative; }
.user-menu__toggle {
  transition: box-shadow .15s, transform .15s;
}
.user-menu__toggle:hover,
.user-menu__toggle:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-ring);
  outline: none;
}
.user-menu__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.98);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 60;
}
.user-menu.is-open .user-menu__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.user-menu__head {
  padding: 10px 12px 8px;
  line-height: 1.35;
}
.user-menu__head strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}
.user-menu__head span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  text-transform: capitalize;
}
.user-menu__item {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.user-menu__item:hover,
.user-menu__item:focus-visible {
  background: var(--primary-50);
  color: var(--primary);
  text-decoration: none;
  outline: none;
}
.user-menu__item--danger { color: var(--danger); }
.user-menu__item--danger:hover,
.user-menu__item--danger:focus-visible {
  background: rgba(192, 57, 43, .08);
  color: var(--danger);
}
.user-menu__item--btn {
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.user-menu__divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}
.content { padding: 28px; flex: 1; }

.impersonate-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 11px 28px;
  background: linear-gradient(90deg, var(--warning-bg) 0%, rgba(46, 49, 146, .06) 100%);
  border-bottom: 1px solid rgba(180, 83, 9, .25);
  font-size: 13px;
  font-weight: 500;
}
.impersonate-banner__text strong { color: var(--primary); }
.impersonate-banner__meta {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
}
.impersonate-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.impersonate-tab.is-active {
  background: var(--primary-50);
  color: var(--primary);
  border-color: var(--primary-ring);
  font-weight: 700;
}

.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 18px; font-weight: 500; }
.breadcrumb a { color: var(--muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--primary); }

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border-light);
  cursor: pointer;
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  padding: 6px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: var(--primary-50);
  border-color: var(--primary-ring);
  color: var(--primary);
  outline: none;
}
.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main { margin-left: 0; }

.sidebar-backdrop { display:none; position:fixed; inset:0; background:rgba(15, 23, 42, .6); backdrop-filter: blur(2px); z-index: 50; }
body.sidebar-open { overflow:hidden; }
body.sidebar-open .sidebar-backdrop { display:block; }
body.sidebar-open .sidebar { transform:none; }
body.sidebar-open .mobile-nav { display: none; }

/* ----------------------------- Mobile bottom nav ----------------------------- */
.mobile-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -8px 32px rgba(15, 23, 42, .1);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  align-items: stretch;
  gap: 4px;
}
.mobile-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 4px;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.mobile-nav__item .nav-ico { width: 20px; height: 20px; opacity: .7; }
.mobile-nav__item:hover,
.mobile-nav__item:focus-visible {
  color: var(--primary);
  background: var(--primary-50);
  text-decoration: none;
  outline: none;
}
.mobile-nav__item.active {
  color: var(--primary);
  background: var(--primary-50);
  font-weight: 700;
}
.mobile-nav__item.active .nav-ico { opacity: 1; }
.mobile-nav__item--menu.is-open {
  color: var(--primary);
  background: var(--primary-100);
}
.mobile-nav__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.1;
  letter-spacing: .01em;
}

/* ----------------------------- Cards/Grid ----------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
  background: linear-gradient(180deg, #fafbfc 0%, var(--surface) 100%);
}
.card__title { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.card__body { padding: 22px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px){ .grid-4 { grid-template-columns: repeat(2,1fr);} .grid-3{grid-template-columns:repeat(2,1fr);} }
@media (max-width: 720px){ .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

.stat {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.stat__label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat__value { font-size: 28px; font-weight: 800; font-family:"Poppins",sans-serif; margin-top: 6px; letter-spacing: -.03em; color: var(--text); }
.stat__icon { float:right; width:46px;height:46px;border-radius:var(--radius);display:flex;align-items:center;justify-content:center;font-size:20px; }

/* ----------------------------- Dashboard ----------------------------- */
.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px 30px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-d) 60%, #0f1240 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
  pointer-events: none;
}
.dash-hero__greet { margin: 0 0 4px; font-size: 13px; color: rgba(255,255,255,.75); font-weight: 500; }
.dash-hero__title { margin: 0; font-size: 24px; font-weight: 800; font-family: "Poppins", sans-serif; color: #fff; letter-spacing: -.03em; }
.dash-hero__meta { margin: 8px 0 0; font-size: 12.5px; color: rgba(255,255,255,.65); font-weight: 500; }
.dash-hero__score { text-align: center; flex-shrink: 0; }
.dash-hero__score-label { display: block; font-size: 11px; color: #fff; opacity: .75; margin-top: 6px; }
.dash-score { position: relative; width: 72px; height: 72px; margin: 0 auto; }
.dash-score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dash-score__track { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 3; }
.dash-score__fill { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.dash-score__value {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; font-family: "Poppins", sans-serif;
}
.stat--link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.stat--link:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--primary-ring);
  text-decoration: none;
  color: inherit;
}
.stat__of { font-size: 16px; font-weight: 500; color: var(--muted); }
.stat__value--sm { font-size: 20px; }
.stat__hint { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.dash-quick {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.dash-quick__label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; flex-shrink: 0; }
.dash-quick__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-quick__btn {
  display: inline-flex;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
}
.dash-quick__btn:hover { background: var(--primary-50); border-color: var(--primary); color: var(--primary); text-decoration: none; }
.dash-grid-main { grid-template-columns: 2fr 1fr; }
.dash-grid-sub { grid-template-columns: 1fr 1fr; }
.dash-finance__row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13.5px; }
.dash-finance__row--total { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); margin-bottom: 0; font-weight: 600; }
.dash-finance__in { color: var(--success); }
.dash-finance__out { color: var(--danger); }
.dash-finance__bar {
  display: flex;
  gap: 4px;
  height: 8px;
  margin: 4px 0 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef1f4;
}
.dash-finance__bar-in { background: var(--success); border-radius: 999px; min-width: 2px; transition: width .3s; }
.dash-finance__bar-out { background: var(--danger); border-radius: 999px; min-width: 2px; transition: width .3s; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.dash-list__item:last-child { border-bottom: none; padding-bottom: 0; }
.dash-list__item:first-child { padding-top: 0; }
.dash-list__date {
  flex-shrink: 0;
  width: 44px;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 4px;
  line-height: 1.2;
}
.dash-list__day { display: block; font-size: 16px; font-weight: 700; font-family: "Poppins", sans-serif; color: var(--primary); }
.dash-list__mon { display: block; font-size: 10px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.dash-list__body { min-width: 0; flex: 1; }
.dash-list__title { display: block; font-weight: 600; font-size: 13.5px; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-list__title:hover { color: var(--primary); text-decoration: none; }
.dash-list__meta { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.dash-list__badge { flex-shrink: 0; }
.dash-divisi__name { display: inline-flex; align-items: center; gap: 8px; }
.dash-divisi__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dash-divisi__meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.alert__link { margin-left: 8px; font-weight: 600; color: inherit; text-decoration: underline; }
@media (max-width: 980px) {
  .dash-grid-main, .dash-grid-sub { grid-template-columns: 1fr; }
  .dash-hero__title { font-size: 18px; }
}

/* ----------------------------- Buttons ----------------------------- */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(46, 49, 146, .2);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  letter-spacing: -.01em;
}
.btn:hover {
  background: var(--primary-d);
  box-shadow: 0 2px 8px rgba(46, 49, 146, .28);
  text-decoration:none;
  color: #fff;
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn--secondary {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(154, 123, 10, .25);
}
.btn--secondary:hover { background: var(--secondary-d); color: #fff; }
.btn--ghost {
  background: var(--surface);
  color: var(--text-secondary);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.btn--ghost:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn--danger { background: var(--danger); box-shadow: 0 1px 2px rgba(185, 28, 28, .2); }
.btn--danger:hover { background: #991b1b; }
.btn--success { background: var(--success); box-shadow: 0 1px 2px rgba(21, 128, 61, .2); }
.btn--success:hover { background: #166534; }
.btn--sm { padding: 6px 12px; font-size: 12px; }
.btn--block { width: 100%; justify-content: center; }
.btn--icon { padding: 7px 10px; }

/* ----------------------------- Icon action buttons ----------------------------- */
.actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.icon-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none;
  transition: var(--transition);
  flex-shrink: 0;
}
.icon-act__svg { width: 16px; height: 16px; display: block; pointer-events: none; }
.icon-act:hover { transform: translateY(-2px); text-decoration: none; color: inherit; box-shadow: var(--shadow-xs); }
.icon-act:active { transform: translateY(0); }

.icon-act--edit { background: var(--info-bg); color: var(--info); border-color: rgba(3, 105, 161, .15); }
.icon-act--hapus { background: var(--danger-bg); color: var(--danger); border-color: rgba(185, 28, 28, .15); }
.icon-act--lihat, .icon-act--detail, .icon-act--kelola, .icon-act--preview { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.icon-act--kartu { background: var(--success-bg); color: var(--success); border-color: rgba(21, 128, 61, .15); }
.icon-act--file { background: var(--info-bg); color: var(--info); border-color: rgba(3, 105, 161, .15); }
.icon-act--upload { background: var(--warning-bg); color: var(--warning); border-color: rgba(180, 83, 9, .15); }
.icon-act--toggle { background: var(--bg-alt); color: var(--muted); border-color: var(--border-light); }
.icon-act--realisasi, .icon-act--aktifkan { background: var(--success-bg); color: var(--success); border-color: rgba(21, 128, 61, .15); }
.icon-act--riwayat { background: var(--warning-bg); color: var(--warning); border-color: rgba(180, 83, 9, .15); }
.icon-act--proposal { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.icon-act--impersonate { background: var(--warning-bg); color: var(--warning); border-color: rgba(180, 83, 9, .15); }

table.data td.col-no { width: 48px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.org-popover__actions { display: flex; gap: 8px; margin-top: 8px; }

/* Kegiatan gallery & cover */
.keg-row { display: flex; align-items: center; gap: 10px; }
.keg-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }
.keg-hero { overflow: hidden; }
.keg-hero__cover { width: 100%; max-height: 280px; overflow: hidden; background: #eef1f6; border-bottom: 1px solid var(--border); }
.keg-hero__cover img { width: 100%; height: 100%; max-height: 280px; object-fit: cover; display: block; }
.keg-galeri { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.keg-galeri__item { position: relative; border: 1px solid var(--border-light); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); transition: var(--transition); }
.keg-galeri__item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.keg-galeri__item--cover { border-color: var(--secondary); box-shadow: 0 0 0 2px rgba(201,162,39,.3), var(--shadow); }
.keg-galeri__link { display: block; aspect-ratio: 4/3; background: #eef1f6; }
.keg-galeri__link img { width: 100%; height: 100%; object-fit: cover; display: block; }
.keg-galeri__badge { position: absolute; top: 8px; left: 8px; background: var(--secondary); color: var(--primary-d); font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.keg-galeri__caption { padding: 8px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.keg-galeri__actions { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); background: #fbfcfd; }
.keg-galeri-empty { padding: 28px 16px; }

/* ----------------------------- Forms ----------------------------- */
.form-group { margin-bottom: 18px; }
.form-row { display:grid; gap:18px; grid-template-columns: repeat(2,1fr); }
.form-row-3 { display:grid; gap:18px; grid-template-columns: repeat(3,1fr); }
@media (max-width:720px){ .form-row,.form-row-3{ grid-template-columns:1fr; } }
label { display:block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text-secondary); letter-spacing: -.01em; }
.req { color: var(--danger); font-weight: 700; }
.input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: var(--shadow-xs);
}
.input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
.input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
  background: #fff;
}
textarea { resize: vertical; min-height: 96px; }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(185, 28, 28, .15); }
.help { font-size: 12px; color: var(--muted); margin-top: 5px; font-weight: 500; }

/* ----------------------------- Select2 (TDA theme) ----------------------------- */
.select2-container { width: 100% !important; font-family: inherit; }
.select2-container--default .select2-selection--single {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 38px;
  padding-left: 14px;
  padding-right: 34px;
  font-size: 14px;
  color: var(--text);
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--muted); }
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
  right: 8px;
}
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.select2-container--default .select2-selection--single .select2-selection__clear {
  margin-right: 6px;
  color: var(--muted);
  font-size: 16px;
}
.select2-dropdown {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  overflow: hidden;
  z-index: 1105;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.select2-container--default .select2-results__option {
  padding: 8px 12px;
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--primary);
  color: #fff;
}
.select2-container--default .select2-results__option--selected {
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 600;
}
.select2-hidden-accessible { position: absolute !important; width: 1px !important; }

/* ----------------------------- Tables / DataTable ----------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
.table-wrap::after { content:''; position:absolute; top:0; right:0; bottom:0; width:24px; pointer-events:none;
  background: linear-gradient(to right, transparent, rgba(248,249,250,.9)); opacity:0; transition:.2s; }
.table-wrap.is-scrollable::after { opacity:1; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; min-width: 520px; }
table.data th, table.data td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
table.data th {
  background: var(--bg);
  font-weight: 700;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  position: sticky; top: 0; z-index: 1;
  border-bottom: 2px solid var(--border);
}
table.data tbody tr { transition: background var(--transition); }
table.data tbody tr:nth-child(even) { background: rgba(238, 241, 246, .45); }
table.data tbody tr:hover { background: var(--primary-50); }
table.data td.actions { white-space: nowrap; }
.dt-toolbar { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:14px; }
.dt-toolbar .input { max-width:280px; min-width:180px; flex:1; }
.dt-pager { display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding-top:14px; border-top:1px solid var(--border-light); margin-top:14px; }
.dt-pager .btn[disabled] { opacity:.4; cursor:not-allowed; }
.empty { text-align:center; padding: 48px 24px; color: var(--muted); font-weight: 500; }
.empty-ico { width:40px; height:40px; margin:0 auto 10px; border:2px dashed var(--border); border-radius:8px; position:relative; opacity:.5; }
.empty-ico::before { content:''; position:absolute; width:16px; height:2px; background:var(--muted); top:50%; left:50%; transform:translate(-50%,-50%); }

/* ----------------------------- Tabs ----------------------------- */
.tabs-bar { display:flex; gap:4px; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; padding: 4px; background: var(--bg); border-radius: var(--radius); }
.tabs-bar::-webkit-scrollbar { display:none; }
.tabbtn {
  border:none;
  border-bottom: none;
  border-radius: var(--radius-sm);
  padding:10px 16px;
  background:transparent;
  cursor:pointer;
  font-weight:600;
  color:var(--muted);
  font-size:13px;
  white-space:nowrap;
  font-family:inherit;
  transition: var(--transition);
}
.tabbtn:hover { color:var(--primary); background: var(--surface); }
.tabbtn.active { background: var(--surface); color:var(--primary); box-shadow: var(--shadow-xs); font-weight: 700; }
.tab { display:none; }
.tab.active { display:block; }
.card__head.tabs-head { padding:12px 16px; background: var(--bg); border-bottom: 1px solid var(--border-light); }

/* ----------------------------- Badges ----------------------------- */
.badge {
  display:inline-flex; align-items:center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1px solid transparent;
}
.badge--success { background: var(--success-bg); color: var(--success); border-color: rgba(21, 128, 61, .2); }
.badge--danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(185, 28, 28, .2); }
.badge--warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(180, 83, 9, .2); }
.badge--info { background: var(--info-bg); color: var(--info); border-color: rgba(3, 105, 161, .2); }
.badge--muted { background: var(--bg-alt); color: var(--muted); border-color: var(--border-light); }
.badge--primary { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }

/* ----------------------------- Mitra tahap checklist ----------------------------- */
.table-wrap--mitra .tahap-group-head { text-align: center; font-size: 12px; letter-spacing: .02em; }
.table-wrap--mitra .tahap-head { text-align: center; font-size: 11px; white-space: nowrap; padding: 6px 4px; color: var(--muted); font-weight: 600; }
.table-wrap--mitra .tahap-cell { text-align: center; padding: 6px 4px; width: 58px; vertical-align: middle; }
.mitra-tahap-cell-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mitra-tahap-cell { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin: 0; }
.mitra-tahap-cell__input { width: 17px; height: 17px; margin: 0; cursor: pointer; accent-color: var(--success); }
.mitra-tahap-doc { display: inline-flex; align-items: center; gap: 2px; padding: 1px 4px; border: none; background: transparent; cursor: pointer; border-radius: 4px; font-size: 11px; color: var(--muted); line-height: 1; }
.mitra-tahap-doc:hover { background: var(--bg-alt, #f4f4f5); color: var(--text); }
.mitra-tahap-doc__ico { font-size: 12px; line-height: 1; }
.mitra-tahap-doc__count { display: inline-flex; align-items: center; justify-content: center; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: var(--primary); color: #fff; font-size: 9px; font-weight: 600; }
.mitra-tahap-list { display: grid; gap: 4px; }
.mitra-tahap-list--form { gap: 8px; }
.mitra-tahap-list__item { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.35; color: var(--muted); cursor: pointer; margin: 0; user-select: none; }
.mitra-tahap-list__item input { width: 15px; height: 15px; margin-top: 1px; flex-shrink: 0; accent-color: var(--success); cursor: pointer; }
.mitra-tahap-list__item span { flex: 1; }
.mitra-tahap-list__item--done { color: var(--text, #1a1a1a); font-weight: 500; }
.mitra-tahap-form-doc { margin-left: auto; flex-shrink: 0; font-size: 11px !important; padding: 2px 8px !important; }
.mitra-dok-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mitra-dok-card .card__body { padding: 10px; }
.mitra-dok-thumb { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; display: block; }
.mitra-dok-file { display: flex; align-items: center; justify-content: center; height: 100px; border-radius: 6px; background: var(--bg-alt, #f4f4f5); text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; }
.mitra-dok-caption { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----------------------------- Alerts / Toast ----------------------------- */
.alert {
  padding: 13px 18px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 500;
  border:1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert--success { background:var(--success-bg); color:#14532d; border-color:rgba(21,128,61,.25); }
.alert--danger { background:var(--danger-bg); color:#7f1d1d; border-color:rgba(185,28,28,.25); }
.alert--info { background:var(--info-bg); color:#0c4a6e; border-color:rgba(3,105,161,.25); }
.alert--warning { background:var(--warning-bg); color:#78350f; border-color:rgba(180,83,9,.25); }
#toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 9999; display:flex; flex-direction:column; gap:10px; }
.toast {
  background: var(--text);
  color:#fff;
  padding: 13px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  font-size:13.5px;
  font-weight: 600;
  min-width:260px;
  animation: slidein .3s cubic-bezier(.4,0,.2,1);
  border-left: 4px solid rgba(255,255,255,.3);
}
.toast--success { background: var(--success); border-left-color: #4ade80; }
.toast--danger { background: var(--danger); border-left-color: #fca5a5; }
.toast--info { background: var(--info); border-left-color: #7dd3fc; }
@keyframes slidein { from { transform: translateX(48px); opacity:0; } to { transform:none; opacity:1; } }

/* ----------------------------- Modal ----------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(4px); display:none; align-items:center; justify-content:center; z-index: 1000; padding: 24px; }
.modal-backdrop.open { display: flex; }
.modal {
  background:var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 640px; max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.modal::-webkit-scrollbar { width: var(--scrollbar-size); height: var(--scrollbar-size); }
.modal::-webkit-scrollbar-track { background: var(--scrollbar-track); }
.modal::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.modal::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
.modal__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display:flex; justify-content:space-between; align-items:center;
  background: linear-gradient(180deg, #fafbfc 0%, var(--surface) 100%);
}
.modal__head h3 { font-size: 16px; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.modal__body { padding: 22px; }
.modal__foot {
  padding: 16px 22px;
  border-top: 1px solid var(--border-light);
  display:flex; justify-content:flex-end; gap:10px;
  background: var(--bg);
}
.modal--sm { max-width: 420px; }
.modal--lg { max-width: 820px; }
.modal--success .modal__head { background: var(--success); border-bottom-color: rgba(255,255,255,.15); color: #fff; }
.modal--success .modal__head h3 { color: #fff; }
.modal--success .modal__head .close-x { color: rgba(255,255,255,.85); }
.modal--success .modal__foot { border-top-color: #bfe3cd; background: #f6fbf8; }
.modal--danger .modal__head { background: var(--danger); border-bottom-color: rgba(255,255,255,.15); color: #fff; }
.modal--danger .modal__head h3 { color: #fff; }
.modal--danger .modal__head .close-x { color: rgba(255,255,255,.85); }
.modal--danger .modal__foot { border-top-color: #f3c4be; background: #fdf8f7; }
.close-x {
  background: var(--bg);
  border: 1px solid var(--border-light);
  font-size:18px;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  cursor:pointer;
  color:var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.close-x:hover { background: var(--danger-bg); color: var(--danger); border-color: rgba(185,28,28,.2); }

/* ----------------------------- Form sections ----------------------------- */
.form-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border-light); }
.form-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.form-section__title {
  font-family: "Poppins", sans-serif; font-size: 12px; font-weight: 700;
  color: var(--primary); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px;
}

/* ----------------------------- Input prefix (currency) ----------------------------- */
.input-prefix { display: flex; align-items: stretch; }
.input-prefix__label {
  display: flex; align-items: center; padding: 0 14px; background: var(--bg);
  border: 1px solid var(--border); border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.input-prefix .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; box-shadow: none; }

/* ----------------------------- Month picker ----------------------------- */
.month-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.month-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
@media (max-width: 720px) { .month-grid { grid-template-columns: repeat(4, 1fr); } }
.month-chip { cursor: pointer; margin: 0; }
.month-chip input { position: absolute; opacity: 0; pointer-events: none; }
.month-chip span {
  display: block; text-align: center; padding: 9px 4px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-light); background: var(--surface); font-size: 12px; font-weight: 600;
  transition: var(--transition); user-select: none; box-shadow: var(--shadow-xs);
}
.month-chip input:checked + span {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(46,49,146,.25);
}
.month-chip:hover span { border-color: var(--primary); color: var(--primary); }

/* ----------------------------- Program rencana ----------------------------- */
.prog-rencana { min-width: 148px; max-width: 200px; }
.prog-rencana__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.prog-rencana__freq { font-size: 11.5px; font-weight: 600; color: var(--text, #1a1a1a); }
.prog-rencana__count { font-size: 10px; font-weight: 600; color: var(--muted); background: var(--bg-alt, #f4f4f5); padding: 1px 6px; border-radius: 10px; }
.prog-rencana__bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: #eef1f4; }
.prog-rencana__bar--lg { height: 12px; border-radius: 6px; }
.prog-rencana__seg { flex: 1; background: #e2e6ea; transition: background .15s; }
.prog-rencana__seg.is-active { background: var(--primary); }
.prog-rencana__seg:nth-child(3),
.prog-rencana__seg:nth-child(6),
.prog-rencana__seg:nth-child(9) { margin-right: 3px; }
.prog-rencana__seg:first-child { border-radius: 4px 0 0 4px; }
.prog-rencana__seg:last-child { border-radius: 0 4px 4px 0; }
.prog-rencana__summary { display: block; margin-top: 4px; font-size: 10.5px; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-rencana--lg { max-width: none; }
.prog-rencana--lg .prog-rencana__freq { font-size: 13px; }
.prog-rencana--lg .prog-rencana__summary { font-size: 12px; white-space: normal; }
.data .rencana-cell { min-width: 160px; }

/* Legacy timeline (detail fallback) */
.prog-timeline { display: flex; gap: 2px; flex-wrap: nowrap; margin-top: 4px; }
.prog-timeline__dot {
  width: 18px; height: 18px; border-radius: 4px; font-size: 8px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: #eef1f4; color: var(--muted); line-height: 1;
}
.prog-timeline__dot.is-active { background: var(--primary); color: #fff; }
.prog-timeline--lg .prog-timeline__dot { width: auto; min-width: 42px; height: 28px; font-size: 11px; padding: 0 4px; border-radius: 6px; }

/* ----------------------------- Detail view ----------------------------- */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; margin-bottom: 18px; }
@media (max-width: 720px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-grid__label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; font-weight: 700; }
.detail-grid__value { font-size: 14px; font-weight: 600; color: var(--text); }
.detail-block { margin-top: 18px; }
.detail-block__label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.detail-block p { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; color: var(--text-secondary); }

/* ----------------------------- Auth pages ----------------------------- */
.auth-body {
  background: linear-gradient(160deg, #0a0c28 0%, #12143a 25%, var(--primary-d) 50%, var(--primary) 75%, #1e2170 100%);
  overflow-x: hidden;
}
.auth-nodes-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: .85;
}
.auth-wrap {
  position: relative; z-index: 1;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
}
.auth-center { width: 100%; max-width: 440px; animation: authFadeIn .5s cubic-bezier(.4,0,.2,1) both; }
@keyframes authFadeIn { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px 36px 36px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,.08);
  border: 1px solid var(--border-light);
}
.auth-card__brand { text-align: center; margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--border-light); }
.auth-card__logo { height: 48px; width: auto; max-width: 240px; object-fit: contain; margin-bottom: 16px; }
.auth-card__brand h1 { font-size: 22px; margin: 0; letter-spacing: -.03em; font-weight: 800; }
.auth-card__tagline { font-size: 13px; color: var(--muted); margin: 6px 0 0; line-height: 1.45; font-weight: 500; }
.auth-title { font-size: 24px; margin: 0 0 6px; text-align: center; letter-spacing: -.03em; font-weight: 800; }
.auth-sub { color: var(--muted); font-size: 14px; text-align: center; margin: 0 0 24px; font-weight: 500; }
.auth-form { margin-top: 4px; }
.auth-form .form-group { margin-bottom: 18px; }
.auth-form label { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--text-secondary); }
.input--auth { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; border-color: var(--border); background: var(--bg); }
.input--auth:focus { background: #fff; box-shadow: 0 0 0 3px var(--primary-ring); border-color: var(--primary); }
.input--auth::placeholder { color: #94a3b8; }
.btn--login { padding: 13px 18px; font-size: 14px; border-radius: var(--radius-sm); margin-top: 8px; font-weight: 700; letter-spacing: -.01em; }
.auth-demo-modal__hint { font-size: 13px; color: var(--muted); margin: 0 0 16px; line-height: 1.5; font-weight: 500; }
.auth-demo-link {
  display: inline-block; margin-top: 10px; padding: 0; border: none; background: none;
  color: var(--primary); font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.auth-demo-link:hover { color: var(--primary-d); }
.auth-demo-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.auth-demo-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border-light); background: var(--bg);
  cursor: pointer; text-align: left; font-family: inherit; transition: var(--transition); width: 100%;
  box-shadow: var(--shadow-xs);
}
.auth-demo-item:hover { border-color: var(--primary); background: var(--surface); box-shadow: var(--shadow); }
.auth-demo-item__jenis { font-size: 11px; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; }
.auth-demo-item__email { font-size: 13px; color: var(--text); word-break: break-all; font-weight: 500; }
.auth-demo-item__pass { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, monospace; }
.auth-help { text-align: center; margin: 24px 0 0; font-size: 13px; color: var(--muted); line-height: 1.55; font-weight: 500; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 12px; color: rgba(255,255,255,.55); font-weight: 500; letter-spacing: .01em; }
@media (max-width: 480px) {
  .auth-card { padding: 32px 24px 28px; border-radius: var(--radius-lg); }
}

.text-muted { color: var(--muted); font-weight: 500; }
.text-right { text-align: right; } .text-center { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.flex { display:flex; } .items-center{align-items:center} .justify-between{justify-content:space-between} .gap-2{gap:8px} .gap-3{gap:16px}
.flex-wrap{flex-wrap:wrap}
.w-full{width:100%}
.empty { text-align:center; padding: 40px 20px; color: var(--muted); }
.empty .ico { font-size: 40px; opacity:.4; }

/* progress bar */
.progress { height: 8px; background: var(--bg-alt); border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(15,23,42,.06); }
.progress > span { display:block; height:100%; background: linear-gradient(90deg, var(--success) 0%, #22c55e 100%); border-radius: 999px; transition: width .4s cubic-bezier(.4,0,.2,1); }

/* chips/filters */
.filters { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.filters .input, .filters select { width:auto; min-width:0; flex: 0 1 auto; }
.filters > input[type="search"].input { min-width: 180px; flex: 1 1 200px; max-width: 300px; }
.filters select { min-width: 140px; max-width: 240px; }
.filters .search-act { flex: 0 0 auto; }

/* Search + tombol aksi — selalu satu baris */
.search-act {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.search-act .input,
.search-act input[type="search"],
.search-act select {
  width: auto;
  min-width: 140px;
  max-width: 280px;
  flex: 0 1 220px;
}
.search-act .btn,
.search-act a.btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Toolbar: judul kiri, pencarian+aksi kanan */
.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar-row > :first-child:not(.search-act) { min-width: 0; }
.toolbar-row .search-act { margin-left: auto; }
.card__head .search-act { margin-left: 0; }
.card__head .filters .search-act { margin-left: auto; }
.org-filter.is-active { background: var(--primary-50); border-color: var(--primary); color: var(--primary); font-weight: 700; }

@media (max-width: 980px){
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .content {
    padding: 20px;
    padding-bottom: calc(20px + 72px + env(safe-area-inset-bottom, 0px));
  }
  .topbar { padding: 0 20px; height: 60px; }
  .dt-toolbar .input { max-width:100%; }
  .grid[style*="420px"] { grid-template-columns: 1fr !important; }
  .grid[style*="280px"] { grid-template-columns: 1fr !important; }
  .mobile-nav { display: flex; }
}

/* ----------------------------- Org Chart Canvas ----------------------------- */
.org-viewport {
  position: relative;
  height: min(68vh, 620px);
  min-height: 320px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: grab;
  user-select: none;
  box-shadow: inset 0 2px 8px rgba(15,23,42,.04);
}
.org-viewport--dragging { cursor: grabbing; }
.org-canvas {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.org-lines {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  overflow: visible;
}
.org-lines line {
  stroke: #b8c4d0;
  stroke-width: 2;
  stroke-linecap: round;
}
.org-nodes { position: relative; }
.org-node {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.org-node:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary-ring);
  z-index: 2;
}
.org-node--member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  height: 72px;
  border: 1px solid var(--border);
}
.org-node__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.org-node__avatar--letter {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}
.org-node__body { min-width: 0; flex: 1; }
.org-node__name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-node__role { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-node--divisi {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 44px;
  border: 2px solid var(--primary);
  font-weight: 600;
  font-size: 12.5px;
}
.org-node__divisi-bar { width: 4px; height: 24px; border-radius: 2px; flex-shrink: 0; }
.org-node__divisi-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-node--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  background: rgba(255,255,255,.6);
  color: var(--muted);
  font-size: 12px;
  height: 52px;
}
.org-node--empty:hover { border-color: var(--primary); color: var(--primary); }
.org-empty { text-align: center; padding: 60px 20px; color: var(--muted); width: 100%; }
.org-empty .ico { font-size: 40px; opacity: .4; margin-bottom: 8px; }
.org-toolbar { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.org-hint { font-size: 12px; margin: 10px 0 0; text-align: center; }

/* DnD & interactivity */
.org-viewport--dnd { cursor: grabbing; }
.org-viewport--dnd .org-node--member { pointer-events: none; }
.org-node--member { cursor: grab; }
.org-node--member:active { cursor: grabbing; }
.org-node--dragging { opacity: .35; transform: scale(.96); }
.org-node__grip {
  color: var(--muted); font-size: 14px; line-height: 1; flex-shrink: 0;
  opacity: .45; cursor: grab; user-select: none; padding: 0 2px;
}
.org-node:hover .org-node__grip { opacity: .85; color: var(--primary); }
.org-node__grip--col { margin-right: 2px; }
.org-node--selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(46,49,146,.15), var(--shadow-lg);
}
.org-ghost {
  position: fixed; z-index: 9998; pointer-events: none;
  transform: translate(-50%, -50%) rotate(-2deg);
  opacity: .92; box-shadow: var(--shadow-lg);
}
.org-dropzone { transition: background .15s, outline .15s; border-radius: 10px; }
.org-dropzone--active {
  background: rgba(46,49,146,.07);
  outline: 2px dashed var(--primary);
  outline-offset: 4px;
}
.org-inti-zone {
  text-align: center; padding: 16px 20px 20px; margin-bottom: 8px;
  border: 2px solid var(--border); border-radius: 12px;
  background: rgba(255,255,255,.7);
}
.org-inti-zone__label {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 13px; margin-bottom: 16px; color: var(--text);
}
.org-inti__ketua { display: flex; justify-content: center; margin-bottom: 12px; }
.org-inti__row { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; }
.org-cols-row { position: relative; display: flex; justify-content: center; gap: 28px; flex-wrap: nowrap; padding-top: 12px; }
.org-col {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 8px 14px; border-radius: 10px;
  border-top: 3px solid var(--border);
  background: rgba(255,255,255,.5);
  transition: transform .12s, box-shadow .12s;
}
.org-col--dragging { box-shadow: var(--shadow-lg); background: var(--surface); }
.org-col--over { outline: 2px dashed var(--secondary); outline-offset: 3px; }
.org-col__body { display: flex; flex-direction: column; gap: 10px; min-height: 52px; }
.org-node--divisi { cursor: grab; position: relative; width: 100%; }
.org-node--divisi:active { cursor: grabbing; }
.org-node--empty-inti { margin: 0 auto; max-width: 240px; }

/* Popover */
.org-popover {
  position: fixed; z-index: 9999; width: 220px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 12px 14px;
  animation: orgPop .15s ease;
}
@keyframes orgPop { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }
.org-popover__name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.org-popover__role { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.org-popover__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.org-popover__actions .btn { flex: 1; min-width: 0; font-size: 12px; padding: 6px 10px; }

/* ----------------------------- Laporan page ----------------------------- */
.laporan-tabs { flex-wrap: wrap; }
.laporan-panel { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
@media (max-width: 900px) { .laporan-panel { grid-template-columns: 1fr; } }
.laporan-panel__intro { min-width: 0; }
.laporan-panel__icon {
  width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 14px;
}
.laporan-panel__title { margin: 0; font-size: 18px; font-weight: 600; }
.laporan-panel__desc { margin: 8px 0 12px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.laporan-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.laporan-tag {
  font-size: 11.5px; padding: 4px 10px; border-radius: 20px; background: var(--bg-alt, #f4f4f5);
  color: var(--text); border: 1px solid var(--border);
}
.laporan-source { font-size: 12px; color: var(--muted); margin: 0; }
.laporan-panel__form {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
}
.laporan-dl { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.laporan-dl__btn { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; justify-content: center; }
.laporan-dl__fmt {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35);
}
.btn--secondary .laporan-dl__fmt { background: rgba(0,0,0,.06); border-color: var(--border); }
.laporan-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.45; }
.laporan-preview { font-size: 12.5px; color: var(--muted); margin: 0 0 4px; }
.laporan-keu-mini { font-size: 14px; }
.laporan-footnote { font-size: 12.5px; color: var(--muted); margin-top: 14px; text-align: center; }
.tabs-head { flex-wrap: wrap; gap: 12px; }
.tabs-head .tabs-bar { margin-left: auto; }
@media (max-width: 720px) { .tabs-head .tabs-bar { margin-left: 0; width: 100%; } }

/* Legacy report styles */
.report-card .card__head { align-items: flex-start; }
.report-block { margin-bottom: 14px; }
.report-block:last-of-type { margin-bottom: 0; }
.report-block__label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin-bottom: 6px;
}
.report-list, .report-steps {
  margin: 0; padding-left: 18px; font-size: 13px; color: var(--text); line-height: 1.55;
}
.report-list li + li, .report-steps li + li { margin-top: 4px; }
.report-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.form-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.45; }

.api-doc-link-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--primary-50, #eff6ff); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.check-label { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 6px; }
.check-label input { margin-top: 3px; }
