/* ============================================================
   MYZK-RKAS BENDAHARA SEKOLAH - MODERN DESIGN SYSTEM
   Cloudflare Pages & Worker D1 / R2 Ready
   ============================================================ */

:root {
  --primary: #1d72fe;
  --primary-hover: #155dd1;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --success: #10b981;
  --success-light: #ecfdf5;
  --success-text: #047857;

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-text: #b91c1c;

  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-text: #b45309;

  --purple: #8b5cf6;
  --purple-light: #f5f3ff;

  --info: #0284c7;
  --info-light: #f0f9ff;

  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 4px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.02);
  --shadow-hover: 0 8px 20px rgba(15, 23, 42, 0.08);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --sidebar-width: 250px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 40;
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 20px 20px 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.brand-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e3a8a;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-nav {
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.nav-item.active {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(29, 114, 254, 0.25);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: stroke 0.15s ease;
}

.nav-item.active svg {
  stroke: #ffffff;
}

.nav-badge {
  margin-left: auto;
  background-color: var(--danger);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-app);
}

/* Topbar */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  max-width: 480px;
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #475569;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: none;
}

.menu-toggle:hover {
  background: #f1f5f9;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: #94a3b8;
}

.search-input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-full);
  padding: 9px 14px 9px 42px;
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 114, 254, 0.12);
}

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

.icon-button {
  background: none;
  border: none;
  position: relative;
  padding: 8px;
  border-radius: var(--radius-full);
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.icon-button:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.icon-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: var(--danger);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Page Body Container */
.page-container {
  padding: 24px 28px 48px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1440px;
  width: 100%;
}

/* Greeting Section */
.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-left h1 {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-left p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-period-select {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(29, 114, 254, 0.3);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   KPI METRIC CARDS (ROW 1)
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.kpi-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-wrap.green {
  background: #dcfce7;
  color: #10b981;
}

.kpi-icon-wrap.blue {
  background: #dbeafe;
  color: #2563eb;
}

.kpi-icon-wrap.red {
  background: #fee2e2;
  color: #ef4444;
}

.kpi-icon-wrap.purple {
  background: #ede9fe;
  color: #8b5cf6;
}

.kpi-icon-wrap svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-top: 2px;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.kpi-trend.up {
  color: var(--success);
}

.kpi-trend.down {
  color: var(--danger);
}

.budget-subtext {
  font-size: 0.76rem;
  color: var(--text-subtle);
}

.budget-progress-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.progress-bar-bg {
  flex: 1;
  height: 7px;
  background-color: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #8b5cf6;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-percentage {
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
}

/* ============================================================
   CHARTS SECTION (ROW 2)
   ============================================================ */
.charts-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

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

.chart-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-right: 6px;
}

.legend-dot.blue { background-color: #2563eb; }
.legend-dot.red { background-color: #f87171; }

.chart-canvas-container {
  width: 100%;
  height: 250px;
  position: relative;
}

/* Donut Layout */
.donut-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 250px;
  gap: 16px;
}

.donut-visual {
  position: relative;
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-center-text {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.donut-center-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.donut-center-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.donut-legend-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
}

.legend-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
}

.legend-item-pct {
  color: var(--text-muted);
  font-weight: 700;
}

/* ============================================================
   BOTTOM SECTION 2-COLUMN GRIDS (ROWS 3 & 4)
   ============================================================ */
.section-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
}

.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.header-badge {
  background-color: var(--danger);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.card-link:hover {
  text-decoration: underline;
}

/* Transaksi Terbaru Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.custom-table th {
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid #f1f5f9;
  background-color: #fafbfc;
}

.custom-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.custom-table tbody tr:hover {
  background-color: #f8fafc;
}

.trx-date-col {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.trx-type-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.trx-type-icon.in {
  background: #ecfdf5;
  color: var(--success);
}

.trx-type-icon.out {
  background: #fef2f2;
  color: var(--danger);
}

.badge-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
}

.badge-tag.pemasukan {
  background-color: #ecfdf5;
  color: #059669;
}

.badge-tag.pengeluaran {
  background-color: #fef2f2;
  color: #dc2626;
}

.nominal-text {
  font-weight: 700;
  white-space: nowrap;
}

.btn-action-more {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: var(--radius-sm);
}

.btn-action-more:hover {
  background: #f1f5f9;
  color: #334155;
}

/* Action Buttons (Edit & Delete) */
.btn-action-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-icon-action {
  border: none;
  background: none;
  cursor: pointer;
  padding: 5px 9px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  font-size: 0.76rem;
  font-weight: 700;
}

.btn-icon-action.edit {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}
.btn-icon-action.edit:hover {
  background: #2563eb;
  color: #ffffff;
}

.btn-icon-action.delete {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.btn-icon-action.delete:hover {
  background: #dc2626;
  color: #ffffff;
}

/* Tagihan Belum Lunas List */
.unpaid-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.unpaid-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  transition: all 0.15s ease;
}

.unpaid-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.unpaid-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.student-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.student-class {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.due-date-pill {
  font-size: 0.75rem;
  color: #e11d48;
  font-weight: 600;
  margin-top: 2px;
}

.unpaid-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.unpaid-amount {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.btn-tagih {
  background: #ffffff;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tagih:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Notifikasi & Persetujuan List */
.notification-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.notification-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.notif-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-icon-box.blue {
  background: #eff6ff;
  color: #2563eb;
}

.notif-icon-box.yellow {
  background: #fffbeb;
  color: #d97706;
}

.notif-icon-box.red {
  background: #fef2f2;
  color: #ef4444;
}

.notif-content {
  flex: 1;
}

.notif-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.notif-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.notif-time {
  font-size: 0.72rem;
  color: var(--text-subtle);
  white-space: nowrap;
}

/* Kas & Bank List */
.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  cursor: pointer;
  transition: all 0.15s ease;
}

.account-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.account-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-icon.green {
  background: #ecfdf5;
  color: #10b981;
}

.account-icon.blue {
  background: #eff6ff;
  color: #2563eb;
}

.account-icon.indigo {
  background: #f0fdf4;
  color: #047857;
}

.account-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.account-no {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.account-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-balance {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.arrow-icon {
  color: #94a3b8;
}

/* ============================================================
   MODAL DIALOGS
   ============================================================ */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: min(92vh, 760px);
  margin: auto;
}

.modal-dialog form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

@keyframes modalPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}

.modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

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

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 114, 254, 0.15);
}

.type-segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.type-btn {
  border: none;
  background: none;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #64748b;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.type-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: var(--shadow-sm);
}

.file-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  background: #fafbfc;
  transition: all 0.2s ease;
}

.file-dropzone:hover {
  background: #f0fdf4;
  border-color: var(--success);
}

.dropzone-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.modal-footer {
  padding: 13px 20px;
  border-top: 1px solid var(--border-color);
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-secondary:hover {
  background: #f1f5f9;
}

/* ============================================================
   OTHER VIEWS (TAB PAGES: KAS, PEMASUKAN, PENGELUARAN, ETC.)
   ============================================================ */
.view-panel {
  display: none;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ============================================================ */
@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .charts-grid,
  .section-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .menu-toggle {
    display: block;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 12px 16px;
  }
  .page-container {
    padding: 16px;
  }
  .donut-wrapper {
    flex-direction: column;
    height: auto;
    gap: 24px;
  }
}

/* Print Styles */
@media print {
  .sidebar, .topbar, .hero-actions, .btn-action-more, .btn-tagih {
    display: none !important;
  }
  .page-container {
    padding: 0;
  }
  body {
    background: #ffffff;
  }
}

/* Banner Notifikasi Tagihan Bulan Baru */
.banner-info-box {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
  animation: fadeIn 0.3s ease;
}

.banner-info-content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #1e3a8a;
  font-size: 0.9rem;
}

.banner-info-content strong {
  color: #1d4ed8;
}

.banner-pulse-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

