/* ==========================================================================
   Management Finance v2.0 - Design System & Styling
   ========================================================================== */

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

:root {
  /* Colors */
  --bg-base: #0b0f19;
  --bg-surface: rgba(22, 28, 45, 0.7);
  --bg-surface-solid: #161c2d;
  --bg-card: rgba(30, 41, 59, 0.4);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-primary-glow: rgba(99, 102, 241, 0.15);

  --accent-success: #10b981;
  --accent-success-glow: rgba(16, 185, 129, 0.15);
  
  --accent-danger: #f43f5e;
  --accent-danger-glow: rgba(244, 63, 94, 0.15);

  --accent-warning: #f59e0b;
  --accent-warning-glow: rgba(245, 158, 11, 0.15);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Font Families */
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --sidebar-width: 280px;
  --header-height: 80px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* Light Theme Override (Optional, controlled via class on body) */
body.light-theme {
  --bg-base: #f8fafc;
  --bg-surface: rgba(255, 255, 255, 0.75);
  --bg-surface-solid: #ffffff;
  --bg-card: rgba(241, 245, 249, 0.6);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(79, 70, 229, 0.5);
  
  --accent-primary: #4f46e5;
  --accent-primary-hover: #3730a3;
  --accent-primary-glow: rgba(79, 70, 229, 0.1);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- LOGIN PAGE --- */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 20%, rgba(15, 23, 42, 1) 0%, rgba(30, 27, 75, 1) 100%);
  padding: 20px;
}

.login-card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px var(--accent-primary-glow);
  text-align: center;
  transition: transform var(--transition-normal);
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #a855f7 100%);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
  color: #fff;
}

.login-logo svg {
  width: 32px;
  height: 32px;
}

.login-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px 12px 42px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
  background: rgba(15, 23, 42, 0.8);
}

.login-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-title);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: all var(--transition-fast);
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.login-btn:active {
  transform: translateY(0);
}

.login-alert {
  background: var(--accent-danger-glow);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-danger);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13.5px;
  display: none;
}

/* --- APP LAYOUT --- */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface-solid);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-logo {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #a855f7 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

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

.sidebar-logo-text {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sidebar-logo-text span {
  color: var(--accent-primary);
}

.sidebar-nav {
  padding: 24px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14.5px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-primary-glow);
  color: var(--accent-primary);
  font-weight: 600;
}

.sidebar-profile {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.profile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-role {
  font-size: 12px;
  color: var(--text-secondary);
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  background: var(--accent-danger-glow);
  color: var(--accent-danger);
}

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

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.main-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background-color: var(--bg-surface-solid);
}

.header-title-section h1 {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-date {
  font-size: 14px;
  color: var(--text-secondary);
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

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

/* Page Containers */
.page-container {
  padding: 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.page {
  display: none;
  animation: fadeIn 0.4s ease;
}

.page.active {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

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

/* --- DASHBOARD VIEW --- */

/* Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.metric-card {
  background: var(--bg-surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.metric-card.saldo::before { background: var(--accent-primary); }
.metric-card.setoran::before { background: var(--accent-success); }
.metric-card.pengeluaran::before { background: var(--accent-danger); }

.metric-card.saldo {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(30, 41, 59, 0.7) 100%);
  border-color: rgba(99, 102, 241, 0.2);
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-value {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.metric-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.saldo .metric-icon-wrapper {
  background: var(--accent-primary-glow);
  color: var(--accent-primary);
}

.setoran .metric-icon-wrapper {
  background: var(--accent-success-glow);
  color: var(--accent-success);
}

.pengeluaran .metric-icon-wrapper {
  background: var(--accent-danger-glow);
  color: var(--accent-danger);
}

.metric-icon-wrapper svg {
  width: 24px;
  height: 24px;
}

/* Branch Cards Grid */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title svg {
  color: var(--accent-primary);
  width: 20px;
  height: 20px;
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.branch-card {
  background: var(--bg-surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.branch-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
}

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

.branch-name {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.branch-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
}

.branch-card-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.branch-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 14.5px;
}

.branch-detail-label {
  color: var(--text-secondary);
}

.branch-detail-val {
  font-weight: 600;
}

.branch-detail-val.in {
  color: var(--accent-success);
}

.branch-detail-val.out {
  color: var(--accent-danger);
}

.branch-detail-val.bal {
  color: var(--accent-primary);
}

.branch-card-action {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  margin-top: 4px;
}

.btn-detail {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-detail:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

/* Charts Grid */
.charts-grid-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-wrapper {
  position: relative;
  height: 300px;
  width: 100%;
}

/* --- COMMON UI ELEMENTS --- */

/* Data Table UI */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  backdrop-filter: blur(8px);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.data-table th {
  background: rgba(15, 23, 42, 0.5);
  padding: 16px 20px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 500;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.badge.pemasukan {
  background-color: var(--accent-success-glow);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge.pengeluaran {
  background-color: var(--accent-danger-glow);
  color: var(--accent-danger);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.badge.cat {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  text-transform: none;
}

.badge.cat-gaji {
  background-color: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge.cat-iklan {
  background-color: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge.cat-endorse {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.cat-operasional {
  background-color: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.badge.branch-badge {
  background: var(--accent-primary-glow);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
  text-transform: none;
  font-size: 13px;
}

/* Actions Button Group */
.table-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover.edit {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-primary-glow);
}

.btn-icon:hover.delete {
  border-color: var(--accent-danger);
  color: var(--accent-danger);
  background: var(--accent-danger-glow);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

/* Button UI */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-title);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

.btn-danger {
  background: var(--accent-danger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
  background: #e11d48;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

/* --- TRANSAKSI VIEW --- */

/* Filter Controls Box */
.filters-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: end;
}

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

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select, .filter-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
  transition: all var(--transition-fast);
}

.filter-select:focus, .filter-input:focus {
  border-color: var(--accent-primary);
  background: rgba(15, 23, 42, 0.6);
}

.filter-actions {
  display: flex;
  gap: 12px;
}

/* --- REPORTS VIEW --- */
.reports-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.report-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-summary-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.report-summary-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* --- ANALYSIS VIEW --- */
.analysis-progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin-top: 6px;
  overflow: hidden;
}

.analysis-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-normal);
}

.percentage-badge {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12.5px;
}

.percentage-badge.safe {
  background-color: var(--accent-success-glow);
  color: var(--accent-success);
}

.percentage-badge.warning {
  background-color: var(--accent-warning-glow);
  color: var(--accent-warning);
}

.percentage-badge.critical {
  background-color: var(--accent-danger-glow);
  color: var(--accent-danger);
}

/* --- MODALS --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 550px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

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

.modal-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  padding: 30px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 20px 30px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Category Management Form */
.category-manager-box {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.category-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-height: 80px;
}

.category-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.btn-tag-delete {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 2px;
}

.btn-tag-delete:hover {
  background: var(--accent-danger-glow);
  color: var(--accent-danger);
}

.btn-tag-delete svg {
  width: 14px;
  height: 14px;
}

/* Form Helper Classes */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group-full {
  grid-column: span 2;
}

.input-addon-wrapper {
  display: flex;
}

.input-addon {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 0 16px;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14.5px;
}

.input-addon-wrapper .form-input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding-left: 14px;
}

/* Radio Card Types Selection */
.transaction-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.type-radio-card {
  position: relative;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition-fast);
}

.type-radio-card input {
  position: absolute;
  opacity: 0;
}

.type-radio-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.in-card .type-radio-card-icon {
  background: var(--accent-success-glow);
  color: var(--accent-success);
}

.out-card .type-radio-card-icon {
  background: var(--accent-danger-glow);
  color: var(--accent-danger);
}

.type-radio-card-info {
  display: flex;
  flex-direction: column;
}

.type-radio-title {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-primary);
}

.type-radio-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

.type-radio-card:hover {
  background: rgba(255, 255, 255, 0.02);
}

.in-card input:checked ~ .type-radio-card-inner {
  color: var(--accent-success);
}
.in-card:has(input:checked) {
  border-color: var(--accent-success);
  background: rgba(16, 185, 129, 0.05);
}

.out-card:has(input:checked) {
  border-color: var(--accent-danger);
  background: rgba(244, 63, 94, 0.05);
}

/* Empty State Styling */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 320px;
}

/* Responsive Styles */
@media (max-width: 1200px) {
  .metrics-grid, .branch-grid {
    grid-template-columns: 1fr 1fr;
  }
  .charts-grid-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .hamburger-btn {
    display: flex !important;
  }
  .reports-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .metrics-grid, .branch-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-group-full {
    grid-column: span 1;
  }
  .page-container {
    padding: 20px;
  }
  .main-header {
    padding: 0 20px;
  }
  .filters-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Hamburger Menu */
.hamburger-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.hamburger-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* Print CSS Stylesheet */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12px !important;
  }
  
  /* Hide interactive/navigational elements */
  .sidebar,
  .sidebar-overlay,
  .main-header,
  .filters-card,
  .btn,
  .btn-icon,
  .table-actions,
  .modal-overlay,
  .branch-card-action,
  .theme-toggle-btn {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .page-container {
    padding: 0 !important;
    gap: 20px !important;
  }

  .page {
    display: block !important;
  }

  /* Force display of printed section */
  .print-header {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    border-bottom: 2px solid #000;
    padding-bottom: 15px;
    margin-bottom: 20px;
    text-align: center;
  }

  .print-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #000;
  }

  .print-header p {
    font-size: 14px;
    color: #555;
  }

  /* Table styles for print */
  .data-table {
    border: 1px solid #ccc !important;
  }

  .data-table th {
    background: #f0f0f0 !important;
    color: #000 !important;
    border-bottom: 2px solid #333 !important;
    font-weight: bold !important;
  }

  .data-table td {
    color: #000 !important;
    border-bottom: 1px solid #ddd !important;
  }

  .badge {
    border: none !important;
    background: transparent !important;
    color: #000 !important;
    padding: 0 !important;
    font-weight: bold !important;
  }

  .branch-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  .metric-card {
    border: 1px solid #ccc !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  .metric-value {
    color: #000 !important;
  }

  .charts-grid-row {
    page-break-inside: avoid;
  }
}

/* Hidden Print Header (only visible on print) */
.print-header {
  display: none;
}
