/* ==========================================================================
   Sistem Laporan Keuangan Multi-Perusahaan
   Executive Corporate Financial Dashboard Stylesheet
   Designed for High-Precision Financial Reporting (SAK / IFRS)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Brand Corporate Colors */
  --primary: #0a1f38;
  --primary-light: #163e69;
  --primary-dark: #061324;
  --secondary: #1d4ed8;
  --secondary-hover: #1e40af;
  --accent: #0284c7;
  
  /* Status Indicators */
  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #0284c7;
  --info-bg: #f0f9ff;
  
  /* Surfaces & Neutrals */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: #3b82f6;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Base Reset & Smooth Rendering */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

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

/* Tabular Numbers for all accounting & monetary values */
.font-mono, .amount-cell, .tabular-nums {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "zero" 1;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   NAVIGATION & TAB BAR STYLING
   ========================================================================== */
#navTabs {
  display: flex;
  gap: 4px;
  padding: 4px 2px;
  scrollbar-width: thin;
}

#navTabs::-webkit-scrollbar {
  height: 4px;
}
#navTabs::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 10px;
  color: #475569;
  background-color: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease-in-out;
  user-select: none;
}

.tab-btn:hover {
  color: #0f172a;
  background-color: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

.tab-btn.active, .tab-btn-active {
  font-weight: 700 !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #0a1f38 0%, #163e69 100%) !important;
  border-color: #0a1f38 !important;
  box-shadow: 0 4px 6px -1px rgba(10, 31, 56, 0.25), 0 2px 4px -2px rgba(10, 31, 56, 0.15) !important;
}

.tab-btn.tab-admin-highlight {
  background-color: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}
.tab-btn.tab-admin-highlight:hover {
  background-color: #e0e7ff;
  color: #3730a3;
}

/* ==========================================================================
   EXECUTIVE CARDS & METRICS
   ========================================================================== */
.card-executive {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card-executive:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

.kpi-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 20px 22px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.kpi-card.kpi-aktiva::before { background: linear-gradient(90deg, #10b981, #059669); }
.kpi-card.kpi-liabilitas::before { background: linear-gradient(90deg, #f59e0b, #d97706); }
.kpi-card.kpi-ekuitas::before { background: linear-gradient(90deg, #8b5cf6, #6d28d9); }
.kpi-card.kpi-laba::before { background: linear-gradient(90deg, #3b82f6, #1d4ed8); }
.kpi-card.kpi-rugi::before { background: linear-gradient(90deg, #ef4444, #dc2626); }

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px -5px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

/* ==========================================================================
   FINANCIAL REPORT TABLES (SAK / IFRS Standard)
   ========================================================================== */
.report-paper {
  background-color: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  padding: 32px;
  width: 100%;
}

@media (max-width: 640px) {
  .report-paper {
    padding: 16px;
  }
}

.report-header-formal {
  text-align: center;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 2px solid #0f2b48;
  position: relative;
}

.report-header-formal h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f2b48;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.report-header-formal h2 {
  font-size: 1.65rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.06em;
  margin-top: 4px;
  text-transform: uppercase;
}

.report-header-formal p {
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-header-formal .report-currency-note {
  font-size: 0.76rem;
  font-style: italic;
  font-weight: 500;
  color: #64748b;
  margin-top: 6px;
}

/* Financial Table Structure */
.financial-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  color: #1e293b;
}

.financial-table th {
  background-color: #f8fafc;
  color: #334155;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  padding: 12px 14px;
  border-top: 1px solid #cbd5e1;
  border-bottom: 2px solid #0f2b48;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.financial-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.financial-table tbody tr:hover td {
  background-color: rgba(241, 245, 249, 0.7);
}

/* Row Hierarchies */
.financial-table .row-header td {
  background-color: #f1f5f9;
  font-weight: 800;
  color: #0a1f38;
  padding-top: 16px;
  padding-bottom: 10px;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  letter-spacing: 0.08em;
  font-size: 0.88rem;
  text-transform: uppercase;
}

.financial-table .row-section td {
  font-weight: 700;
  color: #1e293b;
  padding-top: 12px;
  padding-bottom: 8px;
  background-color: rgba(248, 250, 252, 0.6);
  border-bottom: 1px solid #e2e8f0;
}

.financial-table .row-subtotal td {
  font-weight: 700;
  color: #0f172a;
  border-top: 1.5px solid #64748b;
  border-bottom: 1px solid #94a3b8;
  background-color: rgba(241, 245, 249, 0.75);
  padding-top: 10px;
  padding-bottom: 10px;
}

.financial-table .row-total td {
  font-weight: 800;
  color: #0a1f38;
  font-size: 0.95rem;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
  border-top: 2.5px solid #0a1f38;
  border-bottom: 3.5px double #0a1f38;
  padding-top: 12px;
  padding-bottom: 12px;
}

/* Amount Cells Alignment */
.amount-cell {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.row-subtotal .amount-cell {
  font-weight: 700;
  color: #0f172a;
}

.row-total .amount-cell {
  font-weight: 800;
  color: #0a1f38;
  font-size: 0.95rem;
}

/* Negative Amount Styling */
.amount-negative {
  color: #dc2626 !important;
  font-weight: 600;
}

/* CALK Interactive Note Badge */
.calk-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.calk-pill:hover {
  background-color: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(29, 78, 216, 0.2);
}

/* ==========================================================================
   STATUS BADGES & INDICATORS
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.badge-success {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-warning {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-danger {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-info {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-brand {
  background-color: #e0effe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ==========================================================================
   MODAL WINDOWS & DIALOGS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(10, 25, 47, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  animation: fadeIn 0.18s ease-out;
}

.modal-content {
  background-color: #ffffff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content-scroll {
  overflow-y: auto;
  flex: 1 1 auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Form Controls Inside Modals */
.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   OFFLINE & LOCAL BANNERS
   ========================================================================== */
#offlineBanner {
  background: linear-gradient(90deg, #fef3c7 0%, #fee2e2 100%);
  border-bottom: 1px solid #fcd34d;
  color: #78350f;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 500;
}

/* ==========================================================================
   PRINT STYLES FOR OFFICIAL HARDCOPY / PDF
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 15mm 12mm 15mm 12mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt !important;
  }

  .no-print, header, nav, #navTabs, .btn, .modal-overlay, #offlineBanner, .edit-col {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .report-paper {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  .tab-pane {
    display: block !important;
    page-break-after: always;
  }

  .financial-table {
    font-size: 8.5pt !important;
  }

  .financial-table th, .financial-table td {
    padding: 4px 6px !important;
  }
}

/* ==========================================================================
   FULLSCREEN & RESPONSIVE VIEWPORT STYLES
   ========================================================================== */
:fullscreen,
:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  background-color: var(--bg-main);
}

:fullscreen body,
:-webkit-full-screen body {
  min-height: 100vh;
  background-color: var(--bg-main);
}

:fullscreen .financial-table th,
:-webkit-full-screen .financial-table th {
  top: 0;
}

:fullscreen header,
:-webkit-full-screen header {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

