/**
 * PJU Banyuwangi — Tema Navy Blue (selaras welcome & login)
 * Pakai var(--*) saja, tidak hardcode warna.
 */

:root {
  /* Primary — Navy Blue */
  --color-primary: #1e3a5f;
  --color-primary-light: #2563eb;
  --color-primary-dark: #0f172a;
  --color-primary-muted: #1e3a5f18;

  /* Neutral */
  --color-bg: #f8fafc;
  --color-bg-secondary: #f0f4ff;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;

  /* Text */
  --color-text-primary: #0f172a;
  --color-text-secondary: #334155;
  --color-text-muted: #64748b;

  /* Accent — Amber (selaras login) */
  --color-accent-gold: #f59e0b;
  --color-accent-terracotta: #d97706;
  --color-accent-cream: #fffbeb;

  /* Semantic */
  --color-success: #15803d;
  --color-error: #b91c1c;
  --color-error-muted: #b91c1c15;

  /* Typography — font biasa, mudah dibaca (orang tua) */
  --font-display: Arial, Helvetica, sans-serif;
  --font-body: Arial, Helvetica, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;

  /* Radius & shadow */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.16);
  --transition: 150ms ease;
}

/* ---- Base ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--color-text-primary);
  line-height: 1.2;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}


button,
.btn {
  font-family: var(--font-body);
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-lg);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), color var(--transition);
}

button:hover,
.btn:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
  color: #fff;
}

/* ---- Theme utility classes ---- */
.bg-page { background: var(--color-bg); }
.bg-surface { background: var(--color-surface); }
.bg-primary { background: var(--color-primary); }
.bg-primary-muted { background: var(--color-primary-muted); }
.bg-secondary { background: var(--color-bg-secondary); }
.text-primary { color: var(--color-primary); }
.text-primary-dark { color: var(--color-primary-dark); }
.text-body { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.border-theme { border-color: var(--color-border); }
.font-display { font-family: var(--font-display); }
.font-body { font-family: var(--font-body); }

.divider-batik {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-primary), var(--color-accent-gold), var(--color-primary), transparent);
  border: none;
  margin: var(--space-xl) 0;
}

a:hover { color: var(--color-primary-light); }

.border-gandrung {
  border-left: 3px solid var(--color-primary);
  border-bottom: 1px solid var(--color-accent-gold);
  padding-left: var(--space-md);
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-lg);
  font-weight: 500;
  transition: background var(--transition), box-shadow var(--transition), color var(--transition);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
  color: #fff;
}

/* Pastikan teks tombol (Simpan, Batal, dll) tidak hilang saat hover */
button.btn-primary,
button.btn,
input[type="submit"].btn-primary,
input[type="submit"].btn {
  color: #fff;
}
button.btn-primary:hover,
button.btn:hover,
input[type="submit"].btn-primary:hover,
input[type="submit"].btn:hover {
  color: #fff;
}

.alert-success {
  background: var(--color-primary-muted);
  border: 1px solid var(--color-primary);
  color: var(--color-primary-dark);
  border-radius: var(--radius-md);
}

.alert-error {
  background: var(--color-error-muted);
  border: 1px solid var(--color-accent-terracotta);
  color: var(--color-error);
  border-radius: var(--radius-md);
}

.input-theme {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-theme:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-muted);
}

/* ---- Layout (tanpa bergantung Tailwind CDN) ---- */
.min-h-screen { min-height: 100vh; }
.max-w-6xl { max-width: 72rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-sm { max-width: 24rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.p-8 { padding: 2rem; }
.p-6 { padding: 1.5rem; }
.p-4 { padding: 1rem; }
.flex { display: flex; }
.inline { display: inline; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.border-b { border-bottom-width: 1px; }
.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: 0.75rem; }
.overflow-x-auto { overflow-x: auto; }
.overflow-hidden { overflow: hidden; }
.w-full { width: 100%; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.list-disc { list-style-type: disc; }
.list-inside { list-style-position: inside; }
.grid { display: grid; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.whitespace-nowrap { white-space: nowrap; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: var(--transition); }
.hover\:text-body:hover { color: var(--color-text-primary); }
.hover\:text-primary-dark:hover { color: var(--color-primary-dark); }
.hover\:underline:hover { text-decoration: underline; }
.hover\:bg-page\/50:hover { background: var(--color-bg-secondary); }
.underline-offset-2 { text-underline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.last\:border-0:last-child { border-width: 0; }
tr.last\:border-0:last-child { border-bottom-width: 0; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.inline-flex { display: inline-flex; }
.flex-1 { flex: 1 1 0%; }
.min-w-\[10rem\] { min-width: 10rem; }
.max-w-\[14rem\] { max-width: 14rem; }

@media (min-width: 640px) {
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:col-span-2 { grid-column: span 2 / span 2; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- Form styling (elegant, modern) ---- */
.form-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: var(--space-xl);
  width: 100%;
  max-width: 42rem;
}
.form-card-wide {
  width: 100%;
  max-width: none;
}

.form-section {
  margin-bottom: var(--space-xl);
}
.form-section:last-of-type { margin-bottom: 0; }
.form-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.form-group {
  margin-bottom: var(--space-md);
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
}
.form-label .required { color: var(--color-primary); }
.input-theme,
select.input-theme,
textarea.input-theme {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea.input-theme { min-height: 5rem; resize: vertical; }
.input-theme::placeholder { color: var(--color-text-muted); }
input[type="radio"].input-theme,
input[type="checkbox"].input-theme {
  width: auto;
  accent-color: var(--color-primary);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-outline:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-text-muted);
  color: var(--color-text-primary);
}
.btn-outline:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  align-items: center;
}
.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  color: var(--color-text-primary);
  cursor: pointer;
}

.map-wrap {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: var(--color-bg);
}

/* ---- Page header ---- */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.2;
}
.page-subtitle { font-size: 0.875rem; color: var(--color-text-muted); margin-top: 0.25rem; }
.page-back {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.page-back:hover { color: var(--color-primary); }

/* ---- Beranda: hero & stats ---- */
.hero {
  text-align: center;
  padding: var(--space-2xl) 0 var(--space-xl);
  margin-bottom: var(--space-xl);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}
.hero-desc {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.stat-cards { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); }
@media (min-width: 768px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
.features-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); }
@media (min-width: 640px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: var(--space-xl);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-muted);
}
.stat-card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-sm);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.2;
}
.stat-chart { height: 10rem; display: flex; align-items: flex-end; justify-content: center; margin-top: var(--space-lg); }

.cta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
  margin-top: var(--space-xl);
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: white;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.cta-btn:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
}

/* ---- Auth (login/register) ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: var(--color-bg);
}
.auth-card {
  width: 100%;
  max-width: 24rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  padding: var(--space-xl);
}
.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: 0.25rem;
}
.auth-desc { font-size: 0.875rem; color: var(--color-text-muted); text-align: center; margin-bottom: var(--space-xl); }
.auth-form .form-group { margin-bottom: var(--space-lg); }
.auth-form .btn-primary { width: 100%; padding: 0.75rem; font-weight: 500; margin-top: 0.25rem; }
.auth-footer { text-align: center; margin-top: var(--space-lg); font-size: 0.875rem; color: var(--color-text-muted); }
.auth-footer a { color: var(--color-primary); font-weight: 500; }

/* ---- Header nav ---- */
.app-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.app-header-inner {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}
@media (min-width: 640px) {
  .app-header-inner { padding-left: 1.5rem; padding-right: 1.5rem; }
}
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  min-height: 3.5rem;
}
.app-brand {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-decoration: none;
}
.app-brand:hover { color: var(--color-primary); }
.app-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  font-size: 0.875rem;
}
.app-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}
.app-links a:hover,
.app-links a.active { color: var(--color-primary); }
.app-links a.active { font-weight: 600; }
.btn-logout {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
  transition: color 0.15s ease;
}
.btn-logout:hover { color: var(--color-primary-dark); }

/* ---- Layout Sidebar & Navbar — NAVY BLUE (selaras welcome & login) ---- */
/* Warna eksplisit agar override cache/Tailwind */
.sidebar-bwi a {
  color: inherit;
  text-decoration: none;
}

.sidebar-bwi {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #1e3a5f 100%) !important;
  color: #e0e7ff !important;
  border-right: 1px solid rgba(245, 158, 11, 0.25) !important;
}
.sidebar-bwi .sidebar-logo {
  border-bottom: 1px solid rgba(245, 158, 11, 0.3) !important;
}
.sidebar-bwi .sidebar-logo-icon {
  background: #1e3a5f !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35) !important;
}
.sidebar-bwi .nav-divider {
  color: #f59e0b !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25) !important;
  letter-spacing: 0.05em;
}

.sidebar-bwi .nav-link {
  color: #c7d2fe !important;
  transition: background 0.2s ease;
}
.sidebar-bwi .nav-link span,
.sidebar-bwi .nav-link i { color: inherit !important; }
.sidebar-bwi .nav-link:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}
.sidebar-bwi .nav-link:hover span,
.sidebar-bwi .nav-link:hover i { color: #fff !important; }
.sidebar-bwi .nav-link.active {
  background: #1e3a5f !important;
  color: #fff !important;
  border-left: 3px solid #f59e0b !important;
}
.sidebar-bwi .nav-link.active span,
.sidebar-bwi .nav-link.active i { color: #fff !important; }

.sidebar-bwi .dropdown-btn {
  color: #c7d2fe !important;
  transition: background 0.2s ease;
}
.sidebar-bwi .dropdown-btn span,
.sidebar-bwi .dropdown-btn i { color: inherit !important; }
.sidebar-bwi .dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}
.sidebar-bwi .dropdown-sub a {
  color: #a5b4fc !important;
  text-decoration: none;
}
.sidebar-bwi .dropdown-sub a:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.sidebar-bwi .sidebar-user {
  border-top: 1px solid rgba(245, 158, 11, 0.25) !important;
}
.sidebar-bwi .sidebar-user .dropdown-menu {
  background: #1e293b !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
.sidebar-bwi .sidebar-user .dropdown-menu a {
  color: #c7d2fe !important;
}
.sidebar-bwi .sidebar-user .dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}
.sidebar-bwi .sidebar-user .dropdown-menu button {
  color: #fca5a5 !important;
}
.sidebar-bwi .sidebar-user .dropdown-menu button:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fecaca !important;
}

/* Navbar — Navy (eksplisit) */
.navbar-bwi {
  background: #0f172a !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2) !important;
  color: #e0e7ff !important;
}
.navbar-bwi .nav-title { color: #e0e7ff !important; }
.navbar-bwi .nav-subtitle { color: rgba(224, 231, 255, 0.75) !important; }

.navbar-bwi .nav-icon-btn {
  color: #c7d2fe !important;
  transition: background 0.2s ease, color 0.2s ease;
}
.navbar-bwi .nav-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}

.navbar-bwi .nav-user-btn {
  background: transparent !important;
  color: #c7d2fe !important;
  transition: background 0.2s ease, color 0.2s ease;
}
.navbar-bwi .nav-user-name,
.navbar-bwi .nav-chevron { color: #c7d2fe !important; }
.navbar-bwi .nav-user-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}
.navbar-bwi .nav-user-btn:hover .nav-user-name,
.navbar-bwi .nav-user-btn:hover .nav-chevron { color: #fff !important; }

.navbar-bwi .avatar-bwi {
  background: #1e3a5f !important;
  color: #fff !important;
}
.navbar-bwi .notif-panel {
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12) !important;
  background: #ffffff !important;
}
.navbar-bwi .notif-panel .text-body { color: #0f172a !important; }
.navbar-bwi .notif-panel .text-muted { color: #64748b !important; }
.navbar-bwi .user-dropdown {
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12) !important;
  background: #ffffff !important;
}
.navbar-bwi .user-dropdown a {
  color: #0f172a !important;
}
.navbar-bwi .user-dropdown a:hover {
  background: #f0f4ff !important;
  color: #1e3a5f !important;
}
.navbar-bwi .user-dropdown .logout-btn {
  color: #334155 !important;
}
.navbar-bwi .user-dropdown .logout-btn:hover {
  background: rgba(185, 28, 28, 0.08) !important;
  color: #b91c1c !important;
}
