/* assets/css/style.css */

/* =====================================================
   1. BASE
===================================================== */

body {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(
      circle at top left,
      rgba(59, 130, 246, 0.12),
      transparent 30%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(16, 185, 129, 0.1),
      transparent 30%
    ),
    linear-gradient(135deg, #eaf1f8 0%, #f4f7fb 55%, #edf4ff 100%);
  color: #0f172a;
}

.min-h-screen {
  background:
    radial-gradient(
      circle at top left,
      rgba(59, 130, 246, 0.12),
      transparent 30%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(16, 185, 129, 0.1),
      transparent 30%
    ),
    linear-gradient(135deg, #eaf1f8 0%, #f4f7fb 55%, #edf4ff 100%) !important;
}

main {
  color: #0f172a !important;
}

/* =====================================================
   2. SCROLLBAR
===================================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #e2e8f0;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* =====================================================
   3. DASHBOARD CARD
===================================================== */

.dashboard-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d5e0ec;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.dashboard-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1rem;
  bottom: 1rem;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2563eb, #10b981);
}

.dashboard-card-label {
  font-size: 0.7rem;
  color: #2563eb;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.dashboard-card-number {
  font-size: 2rem;
  line-height: 1;
  font-weight: 900;
  margin-top: 0.75rem;
}

.dashboard-card-number:not(.text-emerald-400):not(.text-blue-400):not(
    .text-amber-400
  ):not(.text-purple-400):not(.text-red-400):not(.text-rose-400) {
  color: #1d4ed8;
}

.dashboard-card-note {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.75rem;
}

.dashboard-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =====================================================
   4. METRIC PANEL
===================================================== */

.metric-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d5e0ec;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.metric-title {
  font-size: 0.85rem;
  font-weight: 900;
  color: #1e3a8a;
}

.metric-badge {
  font-size: 0.85rem;
  font-weight: 800;
}

.metric-note {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.75rem;
}

/* =====================================================
   5. PROGRESS BAR
===================================================== */

.progress-track,
.public-progress {
  width: 100%;
  height: 0.6rem;
  border-radius: 999px;
  background: #dbe4ef !important;
  overflow: hidden;
}

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

/* =====================================================
   6. CHART PANEL
===================================================== */

.chart-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d5e0ec;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.chart-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #d5e0ec;
}

.chart-panel-title {
  font-size: 0.9rem;
  font-weight: 900;
  color: #1e3a8a;
}

.chart-panel-subtitle {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.25rem;
  line-height: 1.4;
}

.chart-box {
  position: relative;
  width: 100%;
  height: 280px;
}

.chart-box-large {
  height: 420px;
}

.chart-empty {
  width: 100%;
  height: 280px;
  border-radius: 0.9rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

/* =====================================================
   7. TYPOGRAPHY AREA KONTEN
===================================================== */

main h2 {
  color: #1e3a8a !important;
}

main h3 {
  color: #1d4ed8 !important;
}

main h4 {
  color: #0f766e !important;
}

main .chart-panel-title,
main .metric-title {
  color: #1e3a8a !important;
}

main .chart-panel-subtitle,
main .dashboard-card-note,
main .metric-note {
  color: #64748b !important;
}

main .dashboard-card-label,
main label,
main .chart-panel-header p {
  color: #334155 !important;
}

/* Warna aksen angka tetap kuat */
main .text-emerald-400,
main .text-blue-400,
main .text-amber-400,
main .text-purple-400,
main .text-red-400,
main .text-rose-400 {
  font-weight: 800;
}

/* =====================================================
   8. COMPATIBILITY LAYER UNTUK TAILWIND GELAP DI MAIN
   Bagian ini boleh dihapus nanti setelah semua file PHP
   tidak lagi memakai bg-slate/text-slate gelap di area konten.
===================================================== */

main [class*="bg-slate-950"],
main [class*="bg-slate-900"],
main [class*="bg-slate-800"] {
  background-color: rgba(255, 255, 255, 0.94) !important;
}

main [class*="bg-slate-950/"],
main [class*="bg-slate-900/"],
main [class*="bg-slate-800/"] {
  background-color: rgba(255, 255, 255, 0.88) !important;
}

main [class*="border-slate-950"],
main [class*="border-slate-900"],
main [class*="border-slate-800"],
main [class*="border-slate-700"] {
  border-color: #d5e0ec !important;
}

main .text-white,
main .text-slate-100,
main .text-slate-200,
main .text-slate-300 {
  color: #0f172a !important;
}

main .text-slate-400,
main .text-slate-500,
main .text-slate-600 {
  color: #475569 !important;
}

/* =====================================================
   9. FORM DI AREA KONTEN
===================================================== */

main input,
main select,
main textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

main input:focus,
main select:focus,
main textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25) !important;
}

main option {
  background-color: #ffffff;
  color: #0f172a;
}

/* =====================================================
   10. TABEL
===================================================== */

main table thead tr {
  background-color: #eef3f8 !important;
}

main table tbody tr:hover {
  background-color: #eff6ff !important;
}

main table th {
  color: #475569 !important;
}

main table td {
  color: #334155;
}

/* =====================================================
   11. CUSTOM CHART LEGEND
===================================================== */

.custom-chart-legend {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.55rem 0.9rem;
}

.custom-chart-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #334155;
  background: rgba(248, 250, 252, 0.75);
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 0.75rem;
  padding: 0.55rem 0.65rem;
}

.custom-chart-legend-color {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.custom-chart-legend-text {
  flex: 1;
}

.custom-chart-legend-name {
  font-weight: 700;
  color: #1e293b;
}

.custom-chart-legend-value {
  font-weight: 800;
  color: #0f766e;
  white-space: nowrap;
}

/* =====================================================
   12. KETERANGAN INDIKATOR DAMPAK
===================================================== */

main .rounded-xl ol li {
  color: #334155;
}

main .rounded-xl h4 {
  color: #1e3a8a !important;
}

/* =====================================================
   13. SIDEBAR BLUE TEAL THEME
===================================================== */

aside {
  background: linear-gradient(
    180deg,
    #0ea5e9 0%,
    #0284c7 45%,
    #0f766e 100%
  ) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 12px 0 35px rgba(14, 165, 233, 0.18) !important;
}

aside .text-white,
aside h1,
aside h2,
aside h3,
aside .font-bold,
aside .font-black {
  color: #ffffff !important;
}

aside .text-slate-400,
aside .text-slate-500,
aside p {
  color: rgba(255, 255, 255, 0.78) !important;
}

aside a {
  color: rgba(255, 255, 255, 0.86) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

aside a:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

aside a.bg-slate-800,
aside a.bg-slate-800\/80,
aside a[class*="bg-slate"],
aside a.active {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18) !important;
}

aside svg {
  color: #ffffff !important;
  opacity: 0.95;
}

aside a[href*="logout"] {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(254, 202, 202, 0.35) !important;
  color: #ffffff !important;
}

aside a[href*="logout"]:hover {
  background: rgba(239, 68, 68, 0.32) !important;
}

/* =====================================================
   14. HEADER LIGHT BLUE THEME
===================================================== */

header {
  background: linear-gradient(
    135deg,
    #38bdf8 0%,
    #0ea5e9 45%,
    #14b8a6 100%
  ) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 12px 35px rgba(14, 165, 233, 0.18) !important;
}

header h1,
header h2,
header h3,
header .text-white,
header .font-bold,
header .font-black {
  color: #ffffff !important;
}

header p,
header .text-slate-400,
header .text-slate-500 {
  color: rgba(255, 255, 255, 0.82) !important;
}

header .bg-slate-800,
header .bg-slate-900,
header [class*="bg-slate"] {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

header svg {
  color: #ffffff !important;
  opacity: 0.95;
}

header a,
header button {
  color: #ffffff !important;
}

header a:hover,
header button:hover {
  background: rgba(255, 255, 255, 0.16) !important;
}

/* =====================================================
   15. RESPONSIVE
===================================================== */

@media (max-width: 1024px) {
  aside {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
  }

  aside nav {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  aside nav a {
    flex: 0 0 auto;
  }
}

@media (max-width: 768px) {
  .dashboard-card {
    padding: 1rem;
  }

  .dashboard-card-number {
    font-size: 1.7rem;
  }

  .dashboard-card-label {
    font-size: 0.65rem;
  }

  .dashboard-card-note {
    font-size: 0.68rem;
  }

  .metric-panel {
    padding: 1rem;
  }

  .chart-panel {
    padding: 1rem;
  }

  .chart-panel-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .chart-panel-title {
    font-size: 0.82rem;
  }

  .chart-panel-subtitle {
    font-size: 0.68rem;
  }

  .chart-box,
  .chart-empty {
    height: 240px;
  }

  .chart-box-large {
    height: 340px;
  }

  .custom-chart-legend {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 720px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .dashboard-card-number {
    font-size: 1.5rem;
  }

  .chart-box,
  .chart-empty {
    height: 220px;
  }

  .metric-title {
    font-size: 0.78rem;
  }

  .metric-note {
    font-size: 0.68rem;
  }
}
