/* ============================================================
   PT BKM – Sistem Keuangan | Design System
   Warna disesuaikan dengan Dashboard Admin PT Berkah Karya Mansyur
   ============================================================ */

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

/* ── Reset & Root ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
  /* ── Sidebar (Premium Dark Forest Green) ── */
  --sidebar-bg:          #080d0a;
  --sidebar-header:      #050806;
  --sidebar-active:      #12231b;
  --sidebar-hover:       rgba(255,255,255,0.04);
  --sidebar-text:        #8ea395;
  --sidebar-text-active: #ffffff;
  --sidebar-border:      rgba(255,255,255,0.05);

  /* ── Konten Utama Gelap (Sleek Dark Financial Theme) ── */
  --bg-base:             #0b100d;
  --bg-surface:          #101814;
  --bg-card:             #14221a;
  --bg-card-hover:       #1b2d23;
  --bg-input:            #0d1411;
  --border:              rgba(255,255,255,0.07);
  --border-light:        #233f30;

  /* ── Warna Aksen Hijau Emerald (Brand Utama Baru) ── */
  --accent:              #10b981;
  --accent-light:        #34d399;
  --accent-dark:         #059669;
  --accent-glow:         rgba(16,185,129,0.18);
  --accent-bg:           rgba(16,185,129,0.08);

  /* ── Label Workspace (Emas Finansial / Biru Terang) ── */
  --admin-blue:          #34d399;
  --admin-blue-bg:       rgba(52,211,153,0.08);

  /* ── Warna Fungsional ── */
  --income:              #34d399;
  --income-bg:           rgba(52,211,153,0.12);
  --income-text:         #34d399;
  --expense:             #f87171;
  --expense-bg:          rgba(248,113,113,0.12);
  --expense-text:        #f87171;
  --profit:              #fbbf24;
  --profit-bg:           rgba(251,191,36,0.12);
  --profit-text:         #fbbf24;

  /* ── Teks (Terang untuk kontras skema gelap) ── */
  --text-primary:        #f3f4f6;
  --text-secondary:      #9ca3af;
  --text-muted:          #6b7280;
  --text-white:          #ffffff;

  /* ── Layout ── */
  --sidebar-w:      240px;
  --topbar-h:       60px;
  --radius:         10px;
  --radius-sm:      6px;
  --shadow-sm:      0 4px 20px rgba(0,0,0,0.3);
  --shadow:         0 10px 30px rgba(0,0,0,0.4);
  --shadow-card:    0 2px 8px rgba(0,0,0,0.2);

  --font-main:      'Plus Jakarta Sans', sans-serif;
  --font-display:   'Outfit', sans-serif;
  --transition:     0.2s cubic-bezier(0.4,0,0.2,1);
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  margin: 0;
  overflow: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }

/* ================================================================
   SIDEBAR – Dark Navy (seperti dashboard BKM)
   ================================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: none;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition);
  overflow: hidden;
}

/* Header sidebar dengan background lebih gelap */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  background: var(--sidebar-header);
  border-bottom: 1px solid var(--sidebar-border);
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 11px;
}

/* Logo BKM – lingkaran merah seperti di dashboard asli */
.logo-icon {
  width: 42px;
  height: 42px;
  background: #ef4444; /* Merah */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.logo-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.2;
}

.logo-sub {
  font-size: 11px;
  color: var(--sidebar-text);
  margin-top: 2px;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.sidebar-close:hover { background: var(--sidebar-hover); }

/* Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(163,179,204,0.5);
  padding: 4px 10px 8px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 1px;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--text-white);
}

/* Active menu – highlight seperti dashboard BKM */
.nav-item.active {
  background: var(--sidebar-active);
  color: var(--text-white);
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Sidebar Footer – "Ke Website" style */
.sidebar-footer {
  padding: 12px 10px;
  background: var(--sidebar-header);
  border-top: 1px solid var(--sidebar-border);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: var(--text-white); }
.user-role { font-size: 11px; color: var(--sidebar-text); }

/* ================================================================
   MAIN WRAPPER & TOPBAR – Putih terang
   ================================================================ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  height: 100vh;
  width: calc(100% - var(--sidebar-w));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  box-shadow: var(--shadow-sm);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-base);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
}

.notif-bell {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.notif-bell:hover { border-color: var(--accent); color: var(--accent); }

/* ================================================================
   CONTENT AREA
   ================================================================ */
.content-area {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

/* Label "ADMIN WORKSPACE" style */
.page-header {
  margin-bottom: 22px;
}

.admin-workspace-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--admin-blue);
  margin-bottom: 4px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ================================================================
   CARDS – DASHBOARD (putih dengan shadow ringan)
   ================================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  padding: 24px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

[data-theme="dark"] .card {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.card-income::before  { background: var(--income); }
.card-expense::before { background: var(--expense); }
.card-profit::before  { background: var(--profit); }
.card-count::before   { background: var(--accent); }

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-light);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-income .card-icon  { background: var(--income-bg);  color: var(--income-text); }
.card-expense .card-icon { background: var(--expense-bg); color: var(--expense-text); }
.card-profit .card-icon  { background: var(--profit-bg);  color: var(--profit-text); }
.card-count .card-icon   { background: var(--accent-bg);  color: var(--accent); }

.card-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 5px;
  line-height: 1;
}

.card-change {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ================================================================
   CHART SECTION
   ================================================================ */
.chart-section {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-container {
  position: relative;
  height: 220px;
}

.select-sm {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--font-main);
}

/* Recent list */
.recent-list { display: flex; flex-direction: column; gap: 8px; }

.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.recent-item:hover { background: var(--bg-card-hover); }

.recent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.recent-dot.in  { background: var(--income); }
.recent-dot.out { background: var(--expense); }

.recent-info { flex: 1; min-width: 0; }
.recent-desc { font-size: 12.5px; color: var(--text-primary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-date { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.recent-amount { font-size: 12.5px; font-weight: 700; }
.recent-amount.in  { color: var(--income-text); }
.recent-amount.out { color: var(--expense-text); }

.empty-state-sm {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 0;
}

/* ================================================================
   FORM – Putih bersih
   ================================================================ */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

.full-width { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.required { color: var(--expense); }

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: var(--font-main);
  transition: all var(--transition);
  outline: none;
  width: 100%;
}

.form-control:focus {
  border-color: var(--accent);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control.is-invalid { border-color: var(--expense); }
.form-control option { background: var(--bg-card); color: var(--text-primary); }

.input-nominal-wrap { position: relative; }

.input-prefix {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  border-right: 1px solid var(--border);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.with-prefix { padding-left: 54px; }

.form-error {
  font-size: 12px;
  color: var(--expense);
  min-height: 16px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-main);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

/* Hijau Emerald sebagai primary */
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 12px rgba(16,185,129,0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--bg-base);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* Tombol hapus merah */
.btn-danger {
  background: var(--expense);
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { width: 30px; height: 30px; padding: 0; justify-content: center; border-radius: var(--radius-sm); }

/* ================================================================
   TABLE – Bersih putih seperti dashboard BKM
   ================================================================ */
.table-responsive {
  overflow-x: auto;
  border-radius: 12px;
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
}
.table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-weight: 500;
}
.table tr:last-child td {
  border-bottom: none;
}
.table tbody tr {
  transition: background-color 0.2s ease;
}
.table tbody tr:hover {
  background: rgba(16, 185, 129, 0.03);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead th {
  background: var(--bg-base);
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover { background: var(--bg-card-hover); }

/* Tfoot grand total */
.data-table tfoot td {
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.05);
  border-top: 2px solid var(--accent);
  font-size: 13.5px;
  color: var(--text-primary);
}

.grand-total-row td { font-weight: 700; }

.empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 16px !important;
  font-size: 14px;
}

/* ── Table Card wrapper ── */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  width: 100%;
}

/* Badges – seperti "Selesai" di dashboard BKM */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-income  { background: var(--income-bg);  color: var(--income-text); }
.badge-expense { background: var(--expense-bg); color: var(--expense-text); }

/* ================================================================
   FILTER BAR
   ================================================================ */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.filter-select { min-width: 150px; }
.filter-date   { min-width: 170px; }

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px 9px 34px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: var(--font-main);
  transition: all var(--transition);
  outline: none;
  width: 100%;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-surface);
}

/* ================================================================
   SUMMARY STRIP (Laporan)
   ================================================================ */
.summary-strip {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.strip-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.strip-divider {
  width: 1px;
  height: 44px;
  background: var(--border);
  margin: 0 24px;
}

.strip-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.strip-val {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.strip-in  .strip-val { color: var(--income-text); }
.strip-out .strip-val { color: var(--expense-text); }
.strip-net .strip-val { color: var(--profit-text); }

/* ================================================================
   ALERT
   ================================================================ */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 500;
}

.alert-success {
  background: var(--income-bg);
  border: 1px solid rgba(22,163,74,0.3);
  color: var(--income-text);
}

.alert-error {
  background: var(--expense-bg);
  border: 1px solid rgba(220,38,38,0.3);
  color: var(--expense-text);
}

/* ================================================================
   MODAL
   ================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: modalIn 0.18s ease;
}

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

.modal-icon { font-size: 36px; margin-bottom: 12px; }
.modal-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.modal-text  { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* ================================================================
   PRINT
   ================================================================ */
.print-only {
  display: none;
}

@media print {
  .sidebar, .topbar, .filter-bar, .btn-ghost, .btn-primary, .hamburger { display: none !important; }
  .main-wrapper { margin: 0; width: 100% !important; max-width: 100% !important; }
  .content-area { padding: 0 !important; }
  body { background: white !important; color: black !important; }
  
  .print-only {
    display: block !important;
  }
  
  /* Kop Laporan */
  .print-header {
    text-align: center;
    border-bottom: 2px solid #1e293b;
    padding-bottom: 12px;
    margin-bottom: 24px;
  }
  .print-logo {
    display: inline-block;
    background: var(--accent);
    color: white;
    font-weight: 800;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 50%;
    margin-bottom: 8px;
  }
  .print-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
  }
  .print-header p {
    font-size: 12px;
    color: #64748b;
  }
  
  /* Tanda Tangan Section */
  .signature-section {
    display: flex !important;
    justify-content: flex-end;
    margin-top: 50px;
    page-break-inside: avoid;
  }
  .signature-box {
    text-align: center;
    width: 250px;
    font-size: 13.5px;
    color: #1e293b;
  }
  .signature-box .signature-space {
    height: 75px;
  }
  .signature-box .manager-name {
    font-weight: 700;
    text-decoration: underline;
  }
  
  /* Table optimization for print */
  .table-card {
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
  }
  .data-table thead th {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-bottom: 1px solid #cbd5e1 !important;
  }
  .data-table tbody td {
    border-bottom: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
  }
  .data-table tfoot td {
    background: #f8fafc !important;
    border-top: 2px solid #cbd5e1 !important;
  }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1100px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-section { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.3); }
  .sidebar-close { display: block; }
  .hamburger { display: flex; }
  .main-wrapper { margin-left: 0; width: 100%; }
  .cards-grid { grid-template-columns: 1fr; }
  .content-area { padding: 16px; }
  .topbar { padding: 0 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .summary-strip { flex-direction: column; padding: 16px; gap: 14px; }
  .strip-divider { width: 100%; height: 1px; margin: 0; }
}

/* Overlay mobile */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 199;
}

.overlay.show { display: block; }

/* Warna teks nominal */
.text-income  { color: var(--income-text);  font-weight: 600; }
.text-expense { color: var(--expense-text); font-weight: 600; }
.text-profit  { color: var(--profit-text);  font-weight: 700; }
.text-loss    { color: var(--expense-text); font-weight: 700; }

/* ================================================================
   THEME TOGGLE SWITCH
   ================================================================ */
html.theme-light {
  /* ── Konten Utama Terang (Sleek Light Financial Theme) ── */
  --bg-base:             #f0f4f1;
  --bg-surface:          #ffffff;
  --bg-card:             #ffffff;
  --bg-card-hover:       #f6faf7;
  --bg-input:            #f4f8f5;
  --border:              #e1e9e3;
  --border-light:        #cbd8d0;

  /* ── Warna Aksen Mode Terang ── */
  --accent:              #059669;
  --accent-light:        #10b981;
  --accent-dark:         #047857;
  --accent-glow:         rgba(5,150,105,0.12);
  --accent-bg:           rgba(5,150,105,0.06);

  /* ── Teks Mode Terang ── */
  --text-primary:        #111d17;
  --text-secondary:      #405047;
  --text-muted:          #788a80;

  /* ── Shadow adjustment for Light Mode ── */
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
  --shadow:         0 4px 12px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.02);
  --shadow-card:    0 1px 3px rgba(0,0,0,0.05);
}

.theme-toggle-wrap {
  display: flex;
  align-items: center;
  margin-right: 12px;
}

.theme-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.theme-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-toggle-track {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 34px;
  transition: background var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.theme-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  z-index: 1;
  transition: color var(--transition);
}

/* Default state: Dark mode (Sun icon is glowing/active, Moon icon is dimmed) */
.theme-toggle input:not(:checked) ~ .theme-toggle-track .icon-sun {
  color: var(--accent);
}

.theme-toggle input:checked ~ .theme-toggle-track .icon-moon {
  color: var(--accent);
}

.theme-toggle-thumb {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-white);
  border-radius: 50%;
  transition: transform var(--transition), background-color var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

/* Checked state: Light mode (thumb slides to the right) */
.theme-toggle input:checked ~ .theme-toggle-track .theme-toggle-thumb {
  transform: translateX(24px);
  background-color: #ffffff;
}

/* Update default scrollbar in light mode */
.theme-light ::-webkit-scrollbar-thumb { background: #cbd8d0; }

/* ================================================================
   PROFILE DROPDOWN
   ================================================================ */
.profile-dropdown-wrap {
  position: relative;
  margin-left: 8px;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  outline: none;
}

.profile-btn:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.profile-btn .profile-avatar {
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.profile-name {
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-chevron {
  color: var(--text-muted);
  transition: transform var(--transition);
}

.profile-btn.active .profile-chevron {
  transform: rotate(180deg);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 200px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  padding: 6px 0;
  z-index: 150;
  animation: dropdownIn 0.15s ease;
}

.profile-menu.show {
  display: flex;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.profile-menu-header {
  padding: 8px 14px 6px;
  display: flex;
  flex-direction: column;
}

.profile-menu-header strong {
  font-size: 13px;
  color: var(--text-primary);
}

.profile-menu-header span {
  font-size: 11px;
  color: var(--text-muted);
}

.profile-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  transition: all var(--transition);
}

.profile-menu-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.profile-menu-item svg {
  color: var(--text-muted);
}

.profile-menu-item.logout-btn:hover {
  color: var(--expense);
}

.profile-menu-item.logout-btn:hover svg {
  color: var(--expense);
}



/* ── Toast Greeting ── */
.toast-greeting {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(16,185,129,0.18), 0 2px 8px rgba(0,0,0,0.4);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s ease;
  pointer-events: none;
  max-width: 320px;
}
.toast-greeting.toast-in {
  transform: translateX(0);
  opacity: 1;
}
.toast-greeting.toast-out {
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s ease-in, opacity 0.35s ease-in;
}
.toast-greeting-wave {
  font-size: 20px;
  animation: waveHand 1.2s ease-in-out 0.5s 2;
  display: inline-block;
  transform-origin: 70% 80%;
}
@keyframes waveHand {
  0%   { transform: rotate(0deg); }
  15%  { transform: rotate(14deg); }
  30%  { transform: rotate(-8deg); }
  45%  { transform: rotate(14deg); }
  60%  { transform: rotate(-4deg); }
  75%  { transform: rotate(10deg); }
  100% { transform: rotate(0deg); }
}

/* ── Logout Modal Animation ── */
#logoutModal {
  opacity: 0;
  transition: opacity 0.25s ease;
}
#logoutModal.modal-show {
  opacity: 1;
}
#logoutModal.modal-show #logoutModalBox,
#logoutModal.modal-show .modal {
  animation: modalBounceIn 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
#logoutModal.modal-hide {
  opacity: 0;
  transition: opacity 0.28s ease;
}
@keyframes modalBounceIn {
  0%   { transform: scale(0.8) translateY(-20px); opacity: 0; }
  100% { transform: scale(1) translateY(0);       opacity: 1; }
}

/* ── Pagination ── */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.pagination-info {
  font-size: 12px;
  color: var(--text-muted);
}
.pagination-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  line-height: 1;
}
.page-btn:hover:not(.page-btn-disabled):not(.page-btn-active) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}
.page-btn-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: default;
  font-weight: 600;
}
.page-btn-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.page-ellipsis {
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 2px;
  user-select: none;
}

/* ── Riwayat Transaksi – Filter Multi-baris ── */
.riwayat-filter {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}
.filter-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-row-date {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.filter-sep {
  font-size: 12px;
  color: var(--text-muted);
  padding-bottom: 10px;
  white-space: nowrap;
  font-style: italic;
}
.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

/* ── content-area scrollbar ── */
.content-area::-webkit-scrollbar { width: 5px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }

/* ── fix mobile responsive ── */
@media (max-width: 768px) {
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-sep { display: none; }
  .riwayat-filter { gap: 12px; }
}
