/* ====================================================================
   1. SISTEM WARNA KOGNITIF & VARIABEL CSS (NORDIC NEON & DEEP OBSIDIAN)
   ==================================================================== */
:root {
  --bg-main: #0B1120;
  --bg-panel: #1E293B;
  --bg-card-hover: #26354D;
  --bg-glass: rgba(30, 41, 59, 0.88);
  --border-subtle: #334155;
  --border-focus: #475569;
  --text-main: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  /* Kode Warna Klaster Keilmuan */
  --c-stat: #38BDF8;       /* Klaster Statistika Inti (6 Modul): Biru Elektrik */
  --c-stat-dim: rgba(56, 189, 248, 0.16);
  --c-econ: #34D399;       /* Klaster Ekonometrika & Ekonomi: Hijau Zamrud */
  --c-econ-dim: rgba(52, 211, 153, 0.16);
  --c-fin: #FBBF24;        /* Klaster Keuangan Kuantitatif, CFA & Pasar Modal: Kuning Amber/Emas */
  --c-fin-dim: rgba(251, 191, 36, 0.16);
  --c-audit: #FB7185;      /* Klaster Akuntansi, Audit & Pajak: Merah Koral */
  --c-audit-dim: rgba(251, 113, 133, 0.16);
  --c-logic: #C084FC;      /* Klaster Logika, Hukum (Jurimetrics) & Linguistik: Ungu/Magenta */
  --c-logic-dim: rgba(192, 132, 252, 0.16);

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  --font-math: 'Cambria Math', 'Latin Modern Math', Georgia, serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.45), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --transition-fast: 160ms cubic-bezier(0.4, 0, 0.2, 1);
  --nav-bottom-h: 68px;
}

/* ====================================================================
   2. RESET & MOBILE-FIRST BASE ARCHITECTURE (320px+)
   ==================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at 12% 14%, rgba(56, 189, 248, 0.07) 0%, transparent 36%),
    radial-gradient(circle at 88% 82%, rgba(192, 132, 252, 0.07) 0%, transparent 36%);
  padding-bottom: calc(var(--nav-bottom-h) + 28px);
}

img, svg, canvas, video {
  max-width: 100%;
  display: block;
  box-sizing: border-box;
}

h1 { font-size: clamp(1.4rem, 3.1vw, 2.25rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.22; }
h2 { font-size: clamp(1.15rem, 2.2vw, 1.55rem); font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; }
h3 { font-size: clamp(0.98rem, 1.6vw, 1.18rem); font-weight: 700; line-height: 1.35; }
p, li { font-size: clamp(0.85rem, 1.25vw, 0.96rem); color: var(--text-secondary); }
small { font-size: clamp(0.73rem, 1.05vw, 0.82rem); }

/* Target Sentuh Minimal 44x44px */
button, .btn, select, input[type="text"], input[type="number"], input[type="search"], .pill-filter-btn {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
}

button, .btn, select, input[type="text"], input[type="number"], input[type="search"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #263449;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: clamp(0.8rem, 1.15vw, 0.88rem);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
}

input[type="text"], input[type="number"], input[type="search"], textarea {
  cursor: text;
  width: 100%;
}

button:hover, .btn:hover, select:hover {
  border-color: var(--c-stat);
  background: rgba(56, 189, 248, 0.14);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #0284C7, #2563EB);
  border-color: var(--c-stat);
  color: #fff;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0369A1, #1D4ED8);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.btn-emerald {
  background: var(--c-econ-dim);
  border-color: var(--c-econ);
  color: var(--c-econ);
}

.btn-amber {
  background: var(--c-fin-dim);
  border-color: var(--c-fin);
  color: var(--c-fin);
}

.btn-coral {
  background: var(--c-audit-dim);
  border-color: var(--c-audit);
  color: var(--c-audit);
}

.btn-purple {
  background: var(--c-logic-dim);
  border-color: var(--c-logic);
  color: var(--c-logic);
}

/* ====================================================================
   3. TOPBAR, HERO PARTICLE CANVAS & GLOBAL LIVE SEARCH BAR
   ==================================================================== */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 14px;
}

.header-inner {
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--c-stat), var(--c-logic));
  display: grid;
  place-items: center;
  font-weight: 900;
  font-family: var(--font-math);
  font-size: 1.4rem;
  color: #0B1120;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
  flex-shrink: 0;
}

.desktop-nav {
  display: none;
  max-width: 1480px;
  margin: 8px auto 0;
  padding-top: 8px;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
  gap: 6px;
  overflow-x: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
}

.nav-link.active {
  color: var(--c-stat);
  background: var(--c-stat-dim);
  border-color: rgba(56, 189, 248, 0.45);
}

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-bottom-h);
  background: rgba(11, 17, 32, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  z-index: 120;
  padding: 4px;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.64rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 4px 2px;
  text-align: center;
  line-height: 1.1;
}

.mobile-nav-item svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.mobile-nav-item.active {
  color: var(--c-stat);
  background: var(--c-stat-dim);
}

/* ====================================================================
   4. HERO COMMAND HEADER & ANALYTICS WIDGET
   ==================================================================== */
.app-container {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 12px;
}

.hero-command-box {
  position: relative;
  background: linear-gradient(155deg, rgba(30, 41, 59, 0.92) 0%, rgba(11, 17, 32, 0.96) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

#canvasHeroConstellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.65;
}

.hero-content-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
}

.search-command-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 14px;
}

.search-command-bar input {
  padding: 12px 115px 12px 42px;
  font-size: 0.95rem;
  background: rgba(7, 11, 20, 0.9);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  color: var(--text-main);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}

.search-command-bar input:focus {
  outline: none;
  border-color: var(--c-stat);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
}

.search-icon-left {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  stroke: var(--c-stat);
  pointer-events: none;
}

.kbd-shortcut-hint {
  position: absolute;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  pointer-events: none;
}

.filter-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pill-filter-btn {
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.pill-filter-btn.active {
  background: var(--c-stat-dim);
  border-color: var(--c-stat);
  color: var(--c-stat);
  font-weight: 700;
}

/* Widget Analitik Global & Radar Multi-Disiplin */
.analytics-widget-card {
  background: rgba(11, 17, 32, 0.86);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.radar-mini-box {
  width: 100%;
  height: 215px;
  background: #070B14;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.kpi-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.kpi-box {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
}

.kpi-box small {
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  font-weight: 700;
  display: block;
}

.kpi-box strong {
  font-family: var(--font-mono);
  font-size: 1rem;
}

/* ====================================================================
   5. INTERACTIVE APP CARDS GRID (KARTU PELUNCUR PINTAR)
   ==================================================================== */
.cluster-section-hdr {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 22px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: 16px;
}

.app-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
}

.app-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  border-color: var(--border-focus);
}

.app-card-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.app-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.app-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.12);
}

.app-icon-box svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 999px;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.feature-tag {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(11, 17, 32, 0.75);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.progress-wrap {
  background: rgba(11, 17, 32, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
}

.progress-bar-track {
  width: 100%;
  height: 7px;
  background: #0B1120;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 5px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.card-actions-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr auto;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
}

/* ====================================================================
   6. SLIDE-OVER QUICK-TOOLS DRAWER & INTERACTIVE MODALS
   ==================================================================== */
.fab-quick-tools {
  position: fixed;
  bottom: 82px;
  right: 16px;
  z-index: 130;
  border-radius: 999px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #0284C7, #7C3AED);
  border: 1px solid #38BDF8;
  color: #fff;
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.45);
  font-weight: 800;
}

.drawer-backdrop, .modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.78);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.drawer-backdrop.open, .modal-backdrop.open {
  display: flex;
}

.quick-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 440px);
  background: #0F172A;
  border-left: 1px solid var(--border-focus);
  z-index: 210;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: -15px 0 35px rgba(0, 0, 0, 0.65);
}

.modal-card {
  width: min(100%, 680px);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scratchpad-area {
  width: 100%;
  min-height: 150px;
  background: #070B14;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  resize: vertical;
}

/* Toast Notification */
#toastNotification {
  position: fixed;
  bottom: 84px;
  left: 16px;
  z-index: 999;
  background: #0F172A;
  border: 1px solid var(--c-econ);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.25s ease;
}
#toastNotification.show {
  opacity: 1;
  transform: translateY(0);
}

/* ====================================================================
   7. PROGRESSIVE MEDIA QUERIES (TABLET, LAPTOP, ULTRA-WIDE)
   ==================================================================== */
@media (min-width: 768px) {
  .app-container {
    padding: 20px;
  }
  .hero-command-box {
    padding: 26px 24px;
  }
  .analytics-widget-card {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
  }
}

@media (min-width: 1024px) {
  body {
    padding-bottom: 40px;
  }
  .desktop-nav {
    display: flex;
  }
  .mobile-bottom-nav {
    display: none;
  }
  .hero-content-grid {
    grid-template-columns: 1.25fr 0.75fr;
  }
  .fab-quick-tools {
    bottom: 24px;
    right: 24px;
  }
  #toastNotification {
    bottom: 24px;
  }
}

@media (min-width: 1440px) {
  .app-container {
    padding: 28px 32px;
  }
}
