/**======================================================================
 * SIPULUNG — Sistem Pelaporan Kecamatan Ma'rang
 * Kabupaten Pangkajene dan Kepulauan (Pangkep)
 * File: marang-theme.css
 * Deskripsi: Override tema modern ber-kontras tajam & mobile-first responsive
 * Palet: High-Contrast Royal Navy Blue, Deep Charcoal (#020617), Pure White
 * Standard: WCAG AAA High Contrast Accessibility & Mobile-First UX
 *======================================================================*/

:root {
  --marang-primary: #1E3A8A;
  --marang-primary-hover: #172554;
  --marang-primary-light: #2563EB;
  --marang-primary-lighter: #EFF6FF;
  --marang-primary-dark: #0A192F;
  --marang-secondary: #1E293B;
  --marang-accent: #B45309;
  --marang-success: #047857;
  --marang-warning: #B45309;
  --marang-danger: #B91C1C;
  --marang-info: #0369A1;
  --marang-dark: #020617;
  --marang-body-bg: #F1F5F9;
  --marang-card-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  --marang-border: #94A3B8;
  --marang-text-main: #020617;
  --marang-text-sub: #1E293B;
  --marang-text-muted: #334155;
}

/* ==========================================================================
   1. TIPOGRAFI BER-KONTRAS TINGGI, TAJAM & KUAT (WCAG AAA STANDARD)
   ========================================================================== */
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  background-color: var(--marang-body-bg);
  color: #020617 !important; /* Hitam pekat solid super tajam */
  font-size: 0.95rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: #020617 !important; /* Deep Solid Black */
  font-weight: 700 !important;
  letter-spacing: -0.3px;
}

p {
  color: #0F172A !important;
  font-weight: 450;
}

/* Penajaman text-muted & text-secondary agar tajam di layar HP */
.text-muted {
  color: #334155 !important; /* Slate 700 yang sangat jelas terbaca */
  font-weight: 500 !important;
}

.text-secondary {
  color: #1E293B !important;
  font-weight: 500 !important;
}

.text-dark {
  color: #020617 !important;
}

small, .small {
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
}

/* Label & Form Controls Berkualitas Tajam & Solid */
.form-label, label {
  color: #020617 !important;
  font-weight: 700 !important;
  font-size: 0.9rem;
  margin-bottom: 6px;
  display: inline-block;
}

.form-control, .form-select {
  color: #020617 !important;
  font-weight: 600 !important;
  border: 1.5px solid #64748B !important; /* Garis batas tegas */
  border-radius: 10px !important;
  padding: 10px 14px;
  font-size: 0.95rem;
  background-color: #FFFFFF;
  transition: all 0.2s ease-in-out;
}

.form-control:focus, .form-select:focus {
  border-color: #1D4ED8 !important;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.25) !important;
  color: #000000 !important;
  background-color: #FFFFFF !important;
}

.form-control::placeholder {
  color: #64748B !important;
  font-weight: 500;
  opacity: 1;
}

.input-group-text {
  background-color: #E2E8F0 !important;
  border: 1.5px solid #64748B !important;
  color: #020617 !important;
  font-weight: 700;
}

/* ==========================================================================
   2. SIDEBAR NAVIGASI BER-KONTRAS TINGGI
   ========================================================================== */
.pc-sidebar {
  background: #0A192F !important; /* Deep Navy Solid */
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.pc-sidebar .m-header {
  background: #071324 !important;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.15);
  padding: 18px 20px;
}

.pc-sidebar .pc-caption label {
  color: #93C5FD !important; /* Biru terang menyala untuk judul kategori */
  font-size: 11px;
  font-weight: 800 !important;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.pc-sidebar .pc-link {
  color: #FFFFFF !important; /* Putih terang tajam */
  font-weight: 600 !important;
  padding: 11px 16px;
  margin: 4px 10px;
  border-radius: 10px;
  font-size: 0.92rem;
  transition: all 0.15s ease-in-out;
}

.pc-sidebar .pc-link .pc-micon {
  margin-right: 12px;
  font-size: 1.35rem;
  color: #93C5FD !important;
}

.pc-sidebar .pc-navbar > .pc-item:hover > .pc-link {
  background: rgba(59, 130, 246, 0.25) !important;
  color: #FFFFFF !important;
}

.pc-sidebar .pc-navbar > .pc-item.active > .pc-link {
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.45);
}

.pc-sidebar .pc-navbar > .pc-item.active > .pc-link .pc-micon {
  color: #FFFFFF !important;
}

.pc-sidebar .badge {
  font-weight: 800 !important;
  font-size: 0.75rem;
}

/* ==========================================================================
   3. HEADER TOPBAR & NAVIGATION
   ========================================================================== */
.pc-header {
  background: #FFFFFF !important;
  border-bottom: 2px solid #CBD5E1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  min-height: 64px;
}

.pc-header .pc-head-link {
  color: #020617 !important;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 700;
}

.pc-header .pc-head-link:hover {
  background-color: #E2E8F0;
  color: #1D4ED8 !important;
}

.pc-header .pc-head-link i {
  font-size: 1.4rem;
  stroke-width: 2.2;
}

/* ==========================================================================
   4. KARTU, METRICS & BOX
   ========================================================================== */
.card {
  border: 1.5px solid #94A3B8 !important; /* Border kontras tegas */
  border-radius: 14px !important;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.08) !important;
  margin-bottom: 24px;
  background: #FFFFFF;
}

.card-header {
  background-color: #F8FAFC !important;
  border-bottom: 2px solid #CBD5E1 !important;
  padding: 16px 20px;
}

.card-header .card-title,
.card-header h5 {
  font-weight: 800 !important;
  font-size: 1.1rem;
  color: #020617 !important;
}

.metric-card {
  border-radius: 14px;
  padding: 20px;
  background: #FFFFFF;
  border: 1.5px solid #94A3B8;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  transition: all 0.2s ease-in-out;
}

.metric-card:hover {
  border-color: #475569;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.metric-card h3 {
  font-weight: 800 !important;
  font-size: 2.2rem;
  color: #020617 !important;
  margin-bottom: 0;
  line-height: 1.2;
}

.metric-card p {
  color: #1E293B !important;
  font-weight: 700 !important;
  font-size: 0.9rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.metric-card .icon-shape {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

/* ==========================================================================
   5. TABEL BER-KONTRAS TAJAM & READABLE
   ========================================================================== */
.table {
  color: #020617 !important;
  border-color: #CBD5E1;
}

.table thead th {
  background-color: #E2E8F0 !important;
  color: #020617 !important; /* Hitam pekat */
  font-weight: 800 !important;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2.5px solid #64748B !important;
  padding: 14px 16px;
  vertical-align: middle;
}

.table tbody td {
  padding: 14px 16px;
  color: #020617 !important;
  font-weight: 550;
  border-bottom: 1.5px solid #E2E8F0;
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: #F1F5F9 !important;
}

/* Badges Kontras Tinggi */
.badge {
  font-weight: 700 !important;
  letter-spacing: 0.3px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
}

.badge.bg-success { background-color: #047857 !important; color: #FFFFFF !important; }
.badge.bg-danger { background-color: #B91C1C !important; color: #FFFFFF !important; }
.badge.bg-primary { background-color: #1D4ED8 !important; color: #FFFFFF !important; }
.badge.bg-info { background-color: #0284C7 !important; color: #FFFFFF !important; }
.badge.bg-warning { background-color: #B45309 !important; color: #FFFFFF !important; }
.badge.bg-secondary { background-color: #475569 !important; color: #FFFFFF !important; }
.badge.bg-purple { background-color: #6D28D9 !important; color: #FFFFFF !important; }

/* Subtitle & Info Badges */
.badge.bg-light,
.badge.border {
  background-color: #F8FAFC !important;
  color: #020617 !important;
  border: 1.5px solid #64748B !important;
}

/* Tombol Berbobot Kuat & Jelas */
.btn {
  font-weight: 700 !important;
  border-radius: 10px;
  padding: 9px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}

.btn-primary {
  background-color: #1D4ED8 !important;
  border-color: #1D4ED8 !important;
  color: #FFFFFF !important;
  box-shadow: 0 3px 8px rgba(29, 78, 216, 0.3);
}

.btn-primary:hover {
  background-color: #1E40AF !important;
  border-color: #1E40AF !important;
  color: #FFFFFF !important;
}

.btn-secondary {
  background-color: #334155 !important;
  border-color: #334155 !important;
  color: #FFFFFF !important;
}

.btn-secondary:hover {
  background-color: #1E293B !important;
  border-color: #1E293B !important;
}

.btn-success {
  background-color: #047857 !important;
  border-color: #047857 !important;
  color: #FFFFFF !important;
}

.btn-danger {
  background-color: #B91C1C !important;
  border-color: #B91C1C !important;
  color: #FFFFFF !important;
}

.btn-outline-secondary {
  color: #020617 !important;
  border: 1.5px solid #64748B !important;
  background-color: #FFFFFF;
}

.btn-outline-secondary:hover {
  background-color: #020617 !important;
  color: #FFFFFF !important;
  border-color: #020617 !important;
}

/* Tombol Light Action di Tabel dengan Teks Kontras Tinggi */
.btn-light-primary {
  background-color: #EFF6FF !important;
  color: #1D4ED8 !important;
  border: 1.5px solid #93C5FD !important;
}
.btn-light-primary:hover {
  background-color: #1D4ED8 !important;
  color: #FFFFFF !important;
}

.btn-light-warning {
  background-color: #FFFBEB !important;
  color: #92400E !important;
  border: 1.5px solid #FCD34D !important;
}
.btn-light-warning:hover {
  background-color: #D97706 !important;
  color: #FFFFFF !important;
}

.btn-light-danger {
  background-color: #FEF2F2 !important;
  color: #991B1B !important;
  border: 1.5px solid #FCA5A5 !important;
}
.btn-light-danger:hover {
  background-color: #DC2626 !important;
  color: #FFFFFF !important;
}

.btn-light-success {
  background-color: #ECFDF5 !important;
  color: #065F46 !important;
  border: 1.5px solid #6EE7B7 !important;
}
.btn-light-success:hover {
  background-color: #059669 !important;
  color: #FFFFFF !important;
}

/* Alert Box dengan Teks Sangat Kontras & Jelas */
.alert {
  border-width: 1.5px !important;
  border-radius: 12px !important;
  font-weight: 550;
  color: #020617 !important;
}

.alert-success {
  background-color: #DCFCE7 !important;
  border-color: #86EFAC !important;
  color: #064E3B !important;
}

.alert-danger {
  background-color: #FEE2E2 !important;
  border-color: #FCA5A5 !important;
  color: #7F1D1D !important;
}

.alert-warning {
  background-color: #FEF3C7 !important;
  border-color: #FCD34D !important;
  color: #78350F !important;
}

.alert-info {
  background-color: #E0F2FE !important;
  border-color: #7DD3FC !important;
  color: #0C4A6E !important;
}

/* ==========================================================================
   6. OPTIMASI MOBILE FIRST & LAYAR SENTUH RESPONSIVE
   ========================================================================== */

/* Area Sentuh Minimal (Touch Target Ergonomi Standar Mobile 44px) */
.btn, .form-control, .form-select, .pc-head-link {
  min-height: 44px;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Scrollbar Tabel Custom & Petunjuk Scroll Horizontal di HP */
.table-responsive {
  position: relative;
  -webkit-overflow-scrolling: touch;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  background-color: #FFFFFF;
}

.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #94A3B8;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #64748B;
}

/* Responsivitas Tablet & Ponsel (< 992px) */
@media (max-width: 991.98px) {
  .pc-container {
    margin-left: 0 !important;
    padding: 14px 10px !important;
  }

  .pc-content {
    padding: 0 !important;
  }

  /* Header Topbar Mobile */
  .pc-header {
    padding: 0 12px !important;
  }

  /* Prevent Safari & Chrome Mobile unwanted zoom on input focus */
  .form-control, .form-select {
    font-size: 16px !important;
  }

  /* Tombol Header Actions Responsif */
  .page-header-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 12px !important;
  }

  .page-header-actions .btn {
    flex: 1 1 calc(50% - 8px);
    font-size: 0.875rem !important;
    padding: 8px 12px !important;
  }

  /* Welcome Card & Alert di Mobile */
  .card-body.p-4 {
    padding: 16px !important;
  }

  /* Metric cards di mobile */
  .metric-card {
    padding: 16px !important;
    margin-bottom: 12px;
  }

  .metric-card h3 {
    font-size: 1.85rem;
  }

  /* Table horizontal scroll */
  .table-responsive table {
    min-width: 680px; /* Jamin konten tabel tidak terdesak */
  }

  /* Modal di Mobile */
  .modal-dialog {
    margin: 12px auto;
    max-width: calc(100% - 24px);
  }

  .modal-body {
    padding: 16px !important;
  }
}

/* Responsivitas Layar Sangat Kecil / Smartphone (< 576px) */
@media (max-width: 575.98px) {
  body {
    font-size: 0.9rem;
  }

  h4, .h4 {
    font-size: 1.3rem !important;
  }

  h5, .h5 {
    font-size: 1.1rem !important;
  }

  /* Stack button penuh di layar kecil */
  .page-header-actions .btn {
    flex: 1 1 100% !important;
  }

  .metric-card .icon-shape {
    width: 46px;
    height: 46px;
    font-size: 1.35rem;
  }

  .metric-card h3 {
    font-size: 1.6rem;
  }

  /* Card Auth Login */
  .auth-card {
    max-width: 100% !important;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  }

  .auth-header {
    padding: 24px 16px 18px !important;
  }

  /* Form & Filter */
  .filter-form-mobile {
    gap: 8px;
  }

  .badge {
    font-size: 0.75rem;
    padding: 5px 8px;
  }
}
