/* ==========================================================================
   APBKal Kalurahan Sitimulyo - Stylesheet (OpenSID Tema Silir Harmonized)
   ========================================================================== */

:root {
  --primary: #0d8a72;
  --primary-dark: #096352;
  --primary-light: #e6f6f3;
  --secondary: #1e3a8a;
  --secondary-dark: #172554;
  --accent: #f59e0b;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Utility Animations */
.transition-all {
  transition: all 0.2s ease-in-out;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}
.badge-pad { background: #dcfce7; color: #15803d; }
.badge-dds { background: #dbeafe; color: #1d4ed8; }
.badge-add { background: #fef3c7; color: #b45309; }
.badge-pbh { background: #e0e7ff; color: #4338ca; }
.badge-pbp { background: #f3e8ff; color: #7e22ce; }
.badge-pbk { background: #ffe4e6; color: #be123c; }
.badge-dll { background: #f1f5f9; color: #475569; }
.badge-silpa { background: #ccfbf1; color: #0f766e; }

/* Status Badges */
.badge-increase { background: #dcfce7; color: #166534; }
.badge-decrease { background: #fee2e2; color: #991b1b; }
.badge-equal { background: #f1f5f9; color: #64748b; }

/* Table Styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-apbkal {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}
.table-apbkal th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.table-apbkal td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.table-apbkal tr:hover td {
  background-color: #f8fafc;
}

/* Card Hierarchy Row Highlights */
.row-level-1 { background-color: #f1f5f9; font-weight: 700; color: #0f172a; }
.row-level-2 { background-color: #f8fafc; font-weight: 600; color: #1e293b; }
.row-subtotal { background-color: #f8fafc; font-weight: 700; border-top: 1px dashed #cbd5e1; }

/* Number formatting */
.font-mono-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Modal Backdrop */
.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
}

/* Mobile Bottom Navigation */
@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}
@media (max-width: 767px) {
  .desktop-sidebar {
    display: none;
  }
  .main-content {
    padding-bottom: 5rem !important;
  }
}

/* ==========================================================================
   OFFICIAL GOVERNMENT PRINT STYLES (@media print)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 1.5cm 1.5cm 1.5cm 1.5cm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    line-height: 1.3 !important;
  }

  .no-print,
  .desktop-sidebar,
  .mobile-header,
  .mobile-bottom-nav,
  .navbar,
  button,
  .tab-buttons,
  .action-buttons,
  .filter-controls {
    display: none !important;
  }

  .main-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .print-area {
    display: block !important;
    width: 100% !important;
  }

  /* Formal Government Kop Surat Kalurahan Sitimulyo */
  .kop-surat {
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-bottom: 3px double #000000;
    padding-bottom: 10px;
    margin-bottom: 15px;
  }
  .kop-logo {
    width: 75px;
    height: 75px;
    margin-right: 15px;
  }
  .kop-text h3 {
    font-size: 13pt;
    font-weight: bold;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .kop-text h2 {
    font-size: 14pt;
    font-weight: bold;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .kop-text h1 {
    font-size: 16pt;
    font-weight: 800;
    margin: 2px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  .kop-text p {
    font-size: 9.5pt;
    margin: 0;
    font-style: italic;
  }

  .report-title {
    text-align: center;
    margin: 15px 0 20px 0;
  }
  .report-title h2 {
    font-size: 13pt;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  .report-title p {
    font-size: 10pt;
    font-weight: normal;
  }

  /* Formal Official Tables */
  table.print-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 20px !important;
  }
  table.print-table th,
  table.print-table td {
    border: 1px solid #000000 !important;
    padding: 5px 8px !important;
    font-size: 9.5pt !important;
  }
  table.print-table th {
    background-color: #f1f1f1 !important;
    text-align: center !important;
    font-weight: bold !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Signature Block */
  .signature-block {
    display: flex !important;
    justify-content: space-between;
    page-break-inside: avoid;
    margin-top: 35px;
    padding: 0 20px;
  }
  .signature-col {
    text-align: center;
    width: 42%;
  }
  .signature-space {
    height: 70px;
  }
  .signature-name {
    font-weight: bold;
    text-decoration: underline;
  }
  .signature-title {
    font-size: 10pt;
  }
}
