/* ==========================================================================
   DESIGN SYSTEM - KEUPES PREMIUM LIGHT THEME (FINCHECK STYLE)
   ========================================================================== */

/* Variables & Custom Properties */
:root {
  /* Font Families */
  --font-heading: 'Outfit', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Color Palette - Premium Light Mode (FINCHECK Style) */
  --bg-app: #f4f6fa;
  --bg-sidebar: #ffffff;
  --bg-panel: #ffffff;
  --bg-card: #ffffff;
  --border-light: #f1f4f9;
  --border-medium: #e2e8f0;
  
  --primary: #0f766e;        /* Deep Teal Green (Money Green) */
  --primary-light: #14b8a6;   /* Light Teal Green */
  --primary-glow: rgba(15, 118, 110, 0.12);
  --accent: #eab308;         /* Gold Currency Accent (Gold Coins) */
  
  --text-main: #1e293b;       /* Dark slate for high contrast */
  --text-muted: #64748b;      /* Muted gray for subtitles */
  --text-light: #94a3b8;      /* Very light gray for placeholder */
  
  /* Status Colors */
  --success: #10b981;
  --success-bg: #e6f4ea;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #3b82f6;
  --info-bg: #dbeafe;

  /* Premium Soft Shadows & Glows */
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.02), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  --shadow-panel: 0 20px 40px -10px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.01);
  --shadow-sidebar: 4px 0 24px rgba(0, 0, 0, 0.02);
  
  /* Colored Card Gradients & Custom Glows */
  --grad-spp: linear-gradient(135deg, #059669 0%, #34d399 100%);
  --glow-spp: 0 12px 24px -6px rgba(5, 150, 105, 0.35);
  
  --grad-income: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  --glow-income: 0 12px 24px -6px rgba(15, 118, 110, 0.35);
  
  --grad-expense: linear-gradient(135deg, #9f1239 0%, #fb7185 100%);
  --glow-expense: 0 12px 24px -6px rgba(159, 18, 57, 0.35);
  
  --grad-balance: linear-gradient(135deg, #065f46 0%, #eab308 100%);
  --glow-balance: 0 12px 24px -6px rgba(6, 95, 70, 0.35);

  /* Border Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.43s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* App Container Layout (Desktop-first approach handled via media queries) */
.app-container {
  display: grid;
  grid-template-areas: 
    "header"
    "main"
    "nav";
  grid-template-rows: 70px 1fr 65px;
  min-height: 100vh;
}

/* Top Header */
.app-header {
  grid-area: header;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  z-index: 99;
}

/* brand area in header (mobile only) */
.brand-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.2));
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Header Left - Welcome greeting (Desktop only, hidden in mobile by default) */
.header-welcome {
  display: none;
}
.header-welcome h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.header-welcome p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Header Right Widgets */
.header-widgets {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Date Display Widget */
.widget-date {
  display: none; /* Desktop only */
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}
.widget-date svg {
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
}

/* Search Box Widget */
.widget-search {
  display: none; /* Desktop only */
  position: relative;
  width: 200px;
}
.widget-search input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 36px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition-fast);
}
.widget-search input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.widget-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
}

/* Notification Widget */
.widget-notification {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #f8fafc;
  border-radius: 50%;
  border: 1px solid var(--border-light);
}
.widget-notification svg {
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
}
.notification-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 6px;
  height: 6px;
  background-color: var(--danger);
  border-radius: 50%;
  box-shadow: 0 0 0 2px #ffffff;
}

/* User Profile Widget */
.widget-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.user-name {
  display: none; /* Desktop only */
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}
.widget-profile svg {
  display: none;
  width: 14px;
  height: 14px;
  fill: var(--text-muted);
}

/* Sync Status Indicator (Pill / Cloud in header) */
.sync-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: #f8fafc;
  transition: all var(--transition-fast);
}
.sync-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: currentColor;
  transition: transform 0.3s ease;
}
.sync-indicator.sync-state-success {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.06);
  color: #059669;
}
.sync-indicator.sync-state-pending {
  border-color: rgba(234, 179, 8, 0.2);
  background: rgba(234, 179, 8, 0.06);
  color: #d97706;
}
.sync-indicator.sync-state-offline {
  border-color: rgba(100, 116, 139, 0.2);
  background: rgba(100, 116, 139, 0.06);
  color: #64748b;
}
.sync-indicator.sync-state-syncing {
  border-color: rgba(14, 165, 233, 0.2);
  background: rgba(14, 165, 233, 0.06);
  color: #0284c7;
}

/* Sync Spinning Animation */
.sync-spinning {
  animation: spin 1.2s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse-dot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* Main Content Wrapper */
.app-main {
  grid-area: main;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden; /* Lock horizontal overflow on mobile viewports */
  padding-bottom: 40px;
}

/* Navigation - Mobile-first Bottom Nav */
.app-nav {
  grid-area: nav;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.02);
}

.sidebar-logo-area,
.sidebar-footer {
  display: none;
}

.nav-links-container {
  width: 100%;
}

.nav-links {
  display: flex;
  justify-content: space-around;
  width: 100%;
  max-width: 500px;
  list-style: none;
  align-items: center;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  transition: var(--transition-fast);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.nav-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: var(--transition-fast);
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link.active {
  color: var(--primary);
}

/* Tab Panels Visibility */
.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.tab-panel.active {
  display: block;
}

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

/* Panel Headers */
.panel-header {
  margin-bottom: 20px;
}
.panel-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}
.panel-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.panel-header-with-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.panel-header-with-actions .header-titles h2 {
  font-size: 1.35rem;
  color: var(--text-main);
}
.panel-header-with-actions .header-titles p {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.panel-header-with-actions .header-buttons {
  display: flex;
  gap: 8px;
}

/* Custom Buttons styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  gap: 6px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.15);
}
.btn-primary:hover:not(:disabled) {
  background: #0d5e56;
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: #1e293b;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.25);
}
.btn-accent:hover:not(:disabled) {
  background: #d97706;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border-medium);
  color: var(--text-main);
}
.btn-outline:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  color: white;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Premium Light Panel / Card (FINCHECK Panel) */
.glass-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-panel);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.glass-panel:hover {
  border-color: #e2e8f0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.05);
}

/* Metric Cards (Gradient Glowing Cards) */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  color: #ffffff;
  transition: transform var(--transition-spring), box-shadow var(--transition-spring), background-color var(--transition-normal);
  position: relative;
  overflow: hidden;
}

/* Grid gradient colors & glows */
.metric-card:nth-child(1) { background: var(--grad-spp); box-shadow: var(--glow-spp); }
.metric-card:nth-child(2) { background: var(--grad-income); box-shadow: var(--glow-income); }
.metric-card:nth-child(3) { background: var(--grad-expense); box-shadow: var(--glow-expense); }
.metric-card:nth-child(4) { background: var(--grad-balance); box-shadow: var(--glow-balance); }

.metric-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 35px -8px rgba(0, 0, 0, 0.08);
}
.metric-card:nth-child(1):hover { box-shadow: 0 16px 28px -4px rgba(14, 165, 233, 0.45); }
.metric-card:nth-child(2):hover { box-shadow: 0 16px 28px -4px rgba(79, 70, 229, 0.45); }
.metric-card:nth-child(3):hover { box-shadow: 0 16px 28px -4px rgba(236, 72, 153, 0.45); }
.metric-card:nth-child(4):hover { box-shadow: 0 16px 28px -4px rgba(124, 58, 237, 0.45); }

/* Background overlay shapes inside gradient cards */
.metric-card::before {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

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

.metric-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-card-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.metric-card-icon svg {
  width: 20px;
  height: 20px;
  fill: #ffffff;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 12px;
}

/* Small pill under value inside gradient cards */
.metric-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  width: fit-content;
  color: #ffffff;
}

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

.chart-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
}
.chart-card:hover {
  box-shadow: var(--shadow-panel);
}

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

.chart-header-row h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.chart-header-row select {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  outline: none;
  cursor: pointer;
}

.chart-container {
  min-height: 220px;
  position: relative;
  width: 100%;
  flex: 1;
}

/* SVG Line Chart Style */
.chart-line-stroke {
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 6px rgba(59, 130, 246, 0.2));
}

.chart-line-area {
  fill: url(#areaGradient);
}

.chart-line-node {
  fill: var(--primary);
  stroke: #ffffff;
  stroke-width: 3;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.chart-line-node-pulse {
  fill: var(--primary);
  opacity: 0.15;
}

.chart-projection-line {
  stroke: #cbd5e1;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.chart-node-label-bg {
  fill: var(--text-main);
  rx: 6px;
}

.chart-node-label-text {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  fill: #ffffff;
}

/* Donut Chart Layout Styling (with side legends) */
.donut-chart-flex {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
  flex: 1;
}

.donut-graphic {
  width: 160px;
  height: 160px;
  position: relative;
  flex-shrink: 0;
}

.donut-legends-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.donut-legend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
}

.donut-legend-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.donut-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.donut-legend-label {
  color: var(--text-muted);
  font-weight: 500;
}

.donut-legend-value {
  font-weight: 700;
  color: var(--text-main);
}

/* Middle Grid dashboard */
.dashboard-middle-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* Prevent CSS Grid items from expanding beyond parent viewport limits when containing wide content */
.dashboard-middle-grid > *,
.quick-actions-grid > *,
.charts-grid > *,
.metrics-grid > *,
.import-sync-grid > * {
  min-width: 0;
}

/* Transaction History Table styling */
.recent-payments-card {
  padding: 22px;
}

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

.card-header-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 10px;
}
.card-header-with-action h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.table-title-row h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.table-filters {
  display: flex;
  gap: 12px;
}

.table-filter-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
}
.table-filter-btn:hover {
  color: var(--text-main);
}
.table-filter-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 118, 110, 0.2) transparent;
}
.table-wrapper::-webkit-scrollbar {
  height: 5px;
}
.table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(15, 118, 110, 0.25);
  border-radius: var(--radius-full);
}
.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

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

.data-table th {
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 0.85rem;
  white-space: nowrap;
}

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

/* Table circular icon styling */
.table-icon-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-row-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}
.table-row-avatar svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.table-row-title {
  font-weight: 700;
  color: var(--text-main);
}

.table-row-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}
.badge-success { background: var(--success-bg); color: #047857; }
.badge-warning { background: var(--warning-bg); color: #b45309; }
.badge-danger { background: var(--danger-bg); color: #b91c1c; }
.badge-info { background: var(--info-bg); color: #1d4ed8; }

.badge-sync {
  font-size: 0.65rem;
  padding: 2px 6px;
  margin-left: 6px;
}
.badge-sync.pending {
  background: rgba(245, 158, 11, 0.08);
  color: var(--warning);
  border: 1px dashed var(--warning);
}
.badge-sync.synced {
  background: rgba(16, 185, 129, 0.08);
  color: var(--success);
  border: 1px solid var(--success);
}

/* Segmented Goals Progress Bar card */
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.goal-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.goal-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.goal-icon {
  width: 28px;
  height: 28px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.goal-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.goal-title {
  font-weight: 700;
  color: var(--text-main);
}

.goal-amounts {
  font-weight: 500;
  color: var(--text-muted);
}
.goal-amounts span {
  font-weight: 700;
  color: var(--text-main);
}

.goal-percentage {
  font-weight: 700;
  color: var(--primary);
}

/* Segmented blocks progress bar */
.goal-progress-segments {
  display: flex;
  gap: 3px;
  width: 100%;
  height: 8px;
}

.progress-segment-block {
  flex: 1;
  background-color: #e2e8f0; /* inactive */
  border-radius: 2px;
  transition: background-color var(--transition-normal);
}

.progress-segment-block.active {
  background-color: var(--primary); /* active */
}

/* Filter sections */
.filters-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

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

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
}

.search-box input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 40px;
  font-family: var(--font-body);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: var(--transition-fast);
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.filter-options {
  display: flex;
  gap: 10px;
  width: 100%;
}

.filter-options select {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font-body);
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
}
.filter-options select:focus {
  border-color: var(--primary);
}

/* Quick Actions Cards */
.quick-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  width: 100%;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
}

.action-btn:hover {
  background: #ffffff;
  border-color: var(--primary);
  transform: translateX(2px);
  box-shadow: var(--shadow-card);
}

.action-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.action-icon.new-santri { background: #dbeafe; color: #1e40af; }
.action-icon.record-payment { background: #fef3c7; color: #92400e; }
.action-icon.new-transaction { background: #d1fae5; color: #065f46; }

.action-details h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1px;
}
.action-details p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Ledger summary (Transactions tab) */
.cashflow-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.cash-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

.cash-card h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.cash-card p {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
}

.cash-card.income-bg { border-left: 4px solid var(--success); color: #065f46; }
.cash-card.expense-bg { border-left: 4px solid var(--danger); color: #991b1b; }
.cash-card.total-bg { border-left: 4px solid var(--primary); color: #1e3a8a; }

/* Config Cards (Import/Sync Console) */
.import-sync-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.config-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.description-text {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 16px;
}

.csv-templates {
  margin-bottom: 16px;
}

.csv-templates h4 {
  font-size: 0.8rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.template-item {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
}

.template-item h5 {
  font-size: 0.75rem;
  margin-bottom: 2px;
}

.template-item code {
  display: block;
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--primary);
  overflow-x: auto;
  margin-bottom: 4px;
}

.template-item .note {
  font-size: 0.65rem;
  color: var(--text-light);
  display: block;
  margin-bottom: 2px;
}

.download-link {
  font-size: 0.7rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.download-link:hover {
  text-decoration: underline;
}

/* Drag-Drop Zone */
.upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  transition: var(--transition-fast);
  margin-bottom: 14px;
  position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--primary);
  background: #f0f7ff;
}

.upload-icon {
  width: 36px;
  height: 36px;
  fill: var(--text-muted);
  margin-bottom: 8px;
  transition: transform var(--transition-fast);
}

.upload-dropzone:hover .upload-icon {
  transform: translateY(-2px);
  fill: var(--primary);
}

.upload-dropzone p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upload-dropzone p span {
  color: var(--primary);
  font-weight: 600;
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.selected-file-name {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

/* Database Info Status Panel */
.database-status-box {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.8rem;
}
.status-row:last-child {
  border-bottom: none;
}
.status-row span {
  color: var(--text-muted);
}

.sync-actions-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.backup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sync-btn-icon {
  transition: transform 0.5s ease;
}

.syncing .sync-btn-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Sync Console Output */
.sync-console-container h4 {
  font-size: 0.8rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.console-box {
  background: #1e293b;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: monospace;
  font-size: 0.7rem;
  color: #38bdf8;
  height: 120px;
  overflow-y: auto;
  line-height: 1.4;
}

.console-line {
  margin-bottom: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 1px;
}
.console-line.system { color: #94a3b8; }
.console-line.offline { color: #f59e0b; }
.console-line.success { color: #34d399; }
.console-line.error { color: #ef4444; }


/* ==========================================================================
   MODAL & DIALOG OVERLAY STYLES
   ========================================================================== */

dialog {
  border: none;
  background: transparent;
  color: var(--text-main);
  margin: auto;
  padding: 0;
  max-width: 460px;
  width: 90%;
  outline: none;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: var(--radius-lg);
  scrollbar-width: thin;
}
dialog::-webkit-scrollbar {
  width: 5px;
}
dialog::-webkit-scrollbar-track {
  background: transparent;
}
dialog::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-full);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--transition-normal) ease;
}

dialog[open] {
  animation: modalSlideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

dialog[open]::backdrop {
  opacity: 1;
}

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

.modal-content {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 22px;
  overflow: hidden;
}

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-fast);
}
.modal-close-btn:hover {
  color: var(--text-main);
}

/* Forms styling */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input, 
.form-group select, 
.form-group textarea {
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-family: var(--font-body);
  color: var(--text-main);
  font-size: 0.85rem;
  transition: var(--transition-fast);
  outline: none;
}

.form-group input:focus, 
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-input-wrapper input {
  padding-right: 40px !important;
}

.toggle-password-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: color var(--transition-fast);
  z-index: 10;
}

.toggle-password-btn:hover {
  color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

/* Image Upload Styling */
.image-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  position: relative;
  background: #f8fafc;
  cursor: pointer;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.image-dropzone:hover {
  border-color: var(--primary);
  background: #f0f7ff;
}

.dropzone-prompt {
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.dropzone-prompt svg {
  fill: var(--text-muted);
}
.dropzone-prompt p {
  font-size: 0.75rem;
}

.image-preview-box {
  width: 100%;
  max-height: 160px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: center;
}

.image-preview-box img {
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
}

.remove-preview-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

/* Detail modal layout */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  background: #f8fafc;
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}
.detail-row span {
  color: var(--text-muted);
}
.detail-row strong {
  color: var(--text-main);
}

.transfer-proof-detail h4 {
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.proof-image-frame {
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px;
  min-height: 160px;
}

.proof-image-frame img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.no-proof-placeholder {
  text-align: center;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.no-proof-placeholder p {
  font-size: 0.75rem;
}


/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE VS DESKTOP)
   ========================================================================== */

/* 1. Mobile & Tablet Specific Layout (Width < 1024px) */
@media (max-width: 1023px) {
  /* Mobile Bottom Navigation Optimization */
  .nav-link[data-tab="master"],
  .nav-link[data-tab="keamanan"],
  .nav-link[data-tab="utilitas"] {
    display: none !important;
  }
  .mobile-only-nav-item {
    display: list-item !important;
  }

  .app-header {
    display: none !important; /* Hide desktop top bar */
  }

  /* Full screen grid configuration for phone */
  .app-container {
    grid-template-areas: 
      "mobheader"
      "main"
      "nav";
    grid-template-rows: auto 1fr calc(56px + env(safe-area-inset-bottom, 0px));
    height: 100vh;
  }

  /* HP Gradient Header (FINCHECK Mobile mockup) */
  .mobile-header {
    grid-area: mobheader;
    display: block !important;
    background: linear-gradient(135deg, #064e3b 0%, #0f766e 100%);
    padding: calc(24px + env(safe-area-inset-top, 0px)) 20px 48px;
    color: #ffffff;
    position: relative;
    z-index: 1;
  }

  /* Bottom nav PWA safe area bottom override */
  .app-nav {
    height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
  }

  .mobile-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
  }
  .mobile-brand img {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.1));
  }

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

  .mobile-notification {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    position: relative;
  }
  .mobile-notification svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
  }

  /* Mobile Sync Status Indicator Overrides */
  #mobile-sync-status {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    cursor: pointer;
    border: none !important;
    padding: 0 !important;
    transition: all var(--transition-fast);
  }
  #mobile-sync-status.sync-state-success {
    background: rgba(52, 211, 153, 0.25) !important;
    color: #34d399 !important;
  }
  #mobile-sync-status.sync-state-pending {
    background: rgba(251, 191, 36, 0.25) !important;
    color: #fbbf24 !important;
  }
  #mobile-sync-status.sync-state-offline {
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.6) !important;
  }
  #mobile-sync-status.sync-state-syncing {
    background: rgba(56, 189, 248, 0.25) !important;
    color: #38bdf8 !important;
  }

  .mobile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    object-fit: cover;
  }

  .mobile-balance-area {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
  }
  .balance-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    display: block;
    margin-bottom: 2px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .balance-amount {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff; /* Pure white for maximum contrast and readability on dark green background */
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  }

  /* Quick action buttons row */
  .mobile-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
  }

  .mobile-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    outline: none;
  }
  .mobile-action-btn span {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
  }

  .action-btn-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: transform var(--transition-spring), background-color var(--transition-fast), box-shadow var(--transition-spring);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  }
  .action-btn-circle:hover {
    transform: translateY(-2px) scale(1.05);
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  }
  .action-btn-circle:active {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(0) scale(0.95);
  }
  .action-btn-circle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
  }

  /* HP Rounded Content Sheet overlay */
  .app-main {
    background: #ffffff !important; /* Forces clean white layout sheet */
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    margin-top: -24px;
    position: relative;
    z-index: 10;
    padding: 24px 16px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.04);
  }

  /* Hide desktop-only items on mobile completely to keep spacing proportional */
  .desktop-only {
    display: none !important;
  }

  /* Keep mobile middle FAB list item behaving like standard navigation items */
  .nav-fab-item {
    display: list-item !important;
  }

  /* Responsive metrics cards list on mobile HP */
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .metric-card {
    min-height: 110px;
    padding: 16px;
  }
  .metric-value {
    font-size: 1.4rem;
    margin-bottom: 4px;
  }

  /* Responsive SVG charts scale */
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .chart-container {
    min-height: 150px;
  }
  .donut-chart-flex {
    flex-direction: column;
    align-items: center;
  }
  .donut-legends-list {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin-top: 10px;
  }
  .donut-legend-row {
    border-bottom: 1px solid var(--border-light);
    padding: 6px 0;
  }

  /* Responsive table spacing */
  .data-table th, .data-table td {
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  /* Decrease card paddings for more horizontal content area on mobile */
  .glass-panel, .recent-payments-card, .chart-card {
    padding: 16px !important;
  }
}

/* 2. Tablet Responsive Layout adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .donut-chart-flex {
    flex-direction: row;
    justify-content: center;
    gap: 60px;
  }
  .donut-legends-list {
    width: 100%;
    max-width: 380px;
  }
  .dashboard-middle-grid {
    grid-template-columns: 1.2fr 1fr;
  }
  .import-sync-grid {
    grid-template-columns: 1fr;
  }
}

/* 3. Desktop Specific Layout overrides (Width >= 1024px) */
@media (min-width: 1024px) {
  .mobile-header, .nav-fab-item {
    display: none !important; /* Wipes mobile artifacts from desktop */
  }

  /* Desktop App Grid */
  .app-container {
    grid-template-areas: 
      "sidebar header"
      "sidebar main";
    grid-template-columns: 240px 1fr;
    grid-template-rows: 70px 1fr;
    height: 100vh;
  }

  /* App Header */
  .app-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
  }

  .header-welcome {
    display: block;
  }
  .widget-date, .widget-search, .user-name {
    display: flex;
  }
  .widget-profile svg {
    display: block;
  }

  .app-main {
    padding: 30px;
  }

  /* Sidebar left fixed */
  .app-nav {
    grid-area: sidebar;
    position: static;
    height: 100%;
    width: 240px;
    background: var(--bg-sidebar);
    border-top: none;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 30px;
    align-items: flex-start;
    padding: 30px 0;
    box-shadow: var(--shadow-sidebar);
  }

  .sidebar-logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    margin-bottom: 10px;
  }
  .sidebar-logo-area img {
    width: 32px;
    height: 32px;
    object-fit: contain;
  }
  .sidebar-logo-area h1 {
    font-size: 1.15rem;
    font-weight: 800;
  }

  .nav-links-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
  }

  .nav-links {
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: none;
    align-items: stretch;
  }

  .nav-link {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 0;
    width: 100%;
    text-align: left;
    color: var(--text-muted);
    border-left: 3px solid transparent;
  }

  .nav-link:hover {
    background: #f8fafc;
    color: var(--text-main);
  }

  .nav-link.active {
    background: var(--primary-glow);
    color: var(--primary);
    border-left: 3px solid var(--primary);
  }

  .sidebar-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
  }

  /* Desktop Metrics (4 Columns) */
  .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Desktop Chart Card */
  .chart-container {
    min-height: 260px;
  }
  .donut-chart-flex {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 80px;
    width: 100%;
  }
  .donut-legends-list {
    width: 100%;
    max-width: 450px;
  }
  .donut-graphic {
    width: 190px;
    height: 190px;
  }

  /* Desktop Bottom (Table + Goals) */
  .dashboard-middle-grid {
    grid-template-columns: 1.5fr 1fr;
  }
  .import-sync-grid {
    grid-template-columns: 1.2fr 1fr;
  }
  .filters-bar {
    flex-direction: row;
    align-items: center;
  }
  .search-box {
    flex: 2;
  }
  .filter-options {
    flex: 1;
  }
}

/* ==========================================================================
   PENYEMPURNAAN FITUR & UX (BADGE, TOAST, GOAL DELETE)
   ========================================================================== */

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--danger);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Toast Notification */
.keupes-toast {
  position: fixed;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  transition: top 0.43s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.keupes-toast.show {
  top: 20px;
}
.keupes-toast.online {
  border-left-color: var(--success);
}
.keupes-toast.offline {
  border-left-color: var(--danger);
}
.keupes-toast svg {
  width: 18px;
  height: 18px;
}

/* Custom Goal Delete Button */
.btn-delete-goal {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-delete-goal:hover {
  color: var(--danger);
  background-color: var(--danger-bg);
}

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

/* ==========================================================================
   FITUR PRINT & DETAIL KARTU SPP SANTRI STYLING
   ========================================================================== */

/* Screen only hide print template */
#print-receipt-area {
  display: none;
}

@media print {
  /* Hide all container, dialogs, headers */
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-container, dialog, .keupes-toast, header, nav, main {
    display: none !important;
  }
  #print-receipt-area {
    display: block !important;
    width: 100% !important;
    max-width: 650px !important;
    margin: 40px auto !important;
    padding: 25px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
  }
  .receipt-card {
    background: #ffffff !important;
  }
}

/* Struk Kwitansi Styling */
.receipt-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
}
.receipt-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.receipt-title-block h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #000000;
  margin: 0;
}
.receipt-title-block h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  margin: 2px 0;
}
.receipt-title-block p {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0;
}
.receipt-divider {
  border: 0;
  border-top: 2px solid #000000;
  margin: 12px 0;
}
.receipt-main-title {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 800;
  margin: 15px 0;
  letter-spacing: 0.05em;
  text-decoration: underline;
}
.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}
.receipt-table td {
  padding: 10px 12px;
  border-bottom: 1px dashed #cbd5e1;
  font-size: 0.85rem;
  color: #1e293b;
}
.receipt-signature {
  float: right;
  text-align: center;
  margin-top: 30px;
  padding-right: 20px;
  font-size: 0.85rem;
}
.receipt-signature p {
  margin: 4px 0;
}

/* SPP Monthly Grid Styling */
.spp-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 15px;
}
.spp-month-card {
  padding: 12px 8px;
  border-radius: var(--radius-md);
  text-align: center;
  background-color: var(--border-light);
  border: 1px solid var(--border-medium);
  transition: transform var(--transition-fast);
}
.spp-month-card:hover {
  transform: translateY(-2px);
}
.spp-month-card.paid {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.spp-month-card.unpaid {
  background-color: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
.spp-month-name {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.spp-month-status {
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}
.spp-month-card.paid .spp-month-status {
  background-color: #d1fae5;
  color: #065f46;
}
.spp-month-card.unpaid .spp-month-status {
  background-color: #fee2e2;
  color: #991b1b;
}
.spp-month-amount {
  font-size: 0.75rem;
  margin-top: 4px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==========================================================================
   FITUR LOGIN, NOTIFIKASI SIDEBAR, DAN RBAC BADGES STYLING
   ========================================================================== */

/* Login Screen Styling */
.login-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #022c22 0%, #064e3b 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100000;
  padding: 20px;
  overflow: hidden;
}

/* Background Glowing Blurs */
.login-wrapper::before {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--accent) 0%, rgba(234, 179, 8, 0) 70%);
  top: -50px;
  left: -50px;
  opacity: 0.3;
  filter: blur(50px);
  z-index: 0;
  pointer-events: none;
}
.login-wrapper::after {
  content: '';
  position: absolute;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--primary-light) 0%, rgba(20, 184, 166, 0) 70%);
  bottom: -100px;
  right: -100px;
  opacity: 0.25;
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}

.login-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 35px 30px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(4, 47, 31, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  animation: loginFadeIn 0.5s var(--transition-spring);
  z-index: 1;
  position: relative;
}
@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-header {
  text-align: center;
  margin-bottom: 25px;
}
.login-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  margin-bottom: 12px;
  padding: 6px;
  background: #ffffff;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.15);
  transition: transform var(--transition-normal);
}
.login-logo:hover {
  transform: scale(1.08) rotate(5deg);
}
.login-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
.login-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.login-footer {
  margin-top: 25px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 15px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.login-cred-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}
.login-cred-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(15, 118, 110, 0.15);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.login-cred-card:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.08);
}
.login-cred-card code {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Credentials Role Badges */
.role-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-admin {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.badge-bendahara {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.badge-kepsek {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* Notification Slide-Over Panel */
.notification-sidebar {
  position: fixed;
  top: 0;
  right: -420px;
  width: 100%;
  max-width: 380px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: right 0.43s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-left: 1px solid var(--border-light);
}
.notification-sidebar.show {
  right: 0;
}
.notification-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
}
.notification-sidebar-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.close-sidebar-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.close-sidebar-btn:hover {
  color: var(--danger);
}
.notification-list {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.notification-item-empty {
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  padding: 40px 20px;
}
.notification-item {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01);
  transition: transform 0.2s ease;
  border-left: 3.5px solid var(--primary);
  text-align: left;
}
.notification-item:hover {
  transform: translateX(-3px);
}
.notification-item.success { border-left-color: var(--success); }
.notification-item.warning { border-left-color: var(--warning); }
.notification-item.error { border-left-color: var(--danger); }

.notification-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notification-item-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}
.notification-item-time {
  font-size: 0.7rem;
  color: var(--text-light);
}
.notification-item-msg {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Role Badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.role-badge.utama {
  background-color: var(--info-bg);
  color: var(--info);
  border: 1px solid #93c5fd;
}
.role-badge.pembantu {
  background-color: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #fde047;
}

/* RBAC pembatasan */
.rbac-hide {
  display: none !important;
}

/* User Profile Widget Info & Role Chip */
.widget-profile-info {
  display: none;
}
.user-role-chip {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

@media (min-width: 1024px) {
  .widget-profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
  }
  .user-name {
    display: block;
  }
}

/* ==========================================================================
   USER PROFILE MODAL STYLING
   ========================================================================== */

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.profile-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  object-fit: cover;
}

.profile-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-card-info h4 {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.profile-username-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Permissions Area */
.profile-permissions-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.profile-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-main);
  letter-spacing: 0.03em;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}

.profile-section-title svg {
  color: var(--primary);
}

.profile-access-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.profile-access-list::-webkit-scrollbar {
  width: 4px;
}
.profile-access-list::-webkit-scrollbar-track {
  background: transparent;
}
.profile-access-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.access-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
}

.access-item.allowed {
  background: #f0fdf4;
  color: #166534;
}

.access-item.denied {
  background: #fef2f2;
  color: #991b1b;
}

.access-item svg {
  flex-shrink: 0;
}

/* Session Info styling */
.profile-session-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.profile-session-info svg {
  color: var(--text-light);
}

/* Helpers Management Panel Styles */
#settings-panel-helpers form {
  background: #f8fafc;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

#settings-panel-helpers table {
  background: #ffffff;
}

#settings-panel-helpers table th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

#settings-panel-helpers table td {
  font-size: 0.82rem;
}

/* ==========================================================================
   IMBS FINANCE ADDITIONS: SPP MATRIX & CR80 ID CARDS
   ========================================================================== */

/* SPP Matrix Table & Status Cells */
.spp-matrix-table td {
  padding: 8px 6px;
  vertical-align: middle;
  text-align: center;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-light);
}
.spp-status-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 55px;
  position: relative;
  transition: all 0.15s ease;
}
.spp-status-cell.lunas {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.spp-status-cell.kurang {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.spp-status-cell.belum {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.spp-status-cell:hover {
  transform: scale(1.05);
}
.proof-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 4px rgba(234, 179, 8, 0.8);
}

/* Sticky Grand Total Bar */
.sticky-grand-total {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--border-light);
  padding: 12px 24px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-family: 'Outfit', sans-serif;
  z-index: 10;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}
.sticky-grand-total strong {
  font-size: 1.15rem;
  color: var(--primary);
  font-weight: 800;
}

/* CR80 ID Card Styling */
.cr80-card {
  width: 86mm;
  height: 54mm;
  background: linear-gradient(135deg, #064e3b 0%, #0f766e 100%);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #ffffff;
  padding: 12px;
  box-sizing: border-box;
  display: flex;
  gap: 12px;
  position: relative;
  overflow: hidden;
  font-family: 'Outfit', 'Inter', sans-serif;
  text-align: left;
  flex-shrink: 0;
}
.cr80-card::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  pointer-events: none;
}
.cr80-photo-container {
  width: 28mm;
  height: 38mm;
  border: 2px solid #ffffff;
  border-radius: 4px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  align-self: center;
}
.cr80-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cr80-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.cr80-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 4px;
  margin-bottom: 4px;
}
.cr80-header h4 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ffffff;
}
.cr80-header p {
  margin: 0;
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.8);
}
.cr80-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.cr80-name {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cr80-info-row {
  display: flex;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.9);
}
.cr80-info-label {
  width: 45px;
  font-weight: 600;
}
.cr80-info-value {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cr80-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 2px;
}
.cr80-role {
  font-size: 0.52rem;
  background: rgba(234, 179, 8, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.35);
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 700;
}
.cr80-logo-text {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fbbf24; /* Gold color */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@media print {
  body.printing-idcards {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  body.printing-idcards .app-container,
  body.printing-idcards dialog,
  body.printing-idcards .keupes-toast,
  body.printing-idcards header,
  body.printing-idcards nav,
  body.printing-idcards main,
  body.printing-idcards #print-receipt-area {
    display: none !important;
  }
  body.printing-idcards #print-id-cards-area {
    display: grid !important;
    grid-template-columns: repeat(2, 86mm);
    gap: 10mm;
    padding: 10mm;
    box-sizing: border-box;
  }
  body.printing-idcards .cr80-card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    page-break-inside: avoid;
  }
}

/* Responsive Grid Utilities for Sub-Features */
.santri-import-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 15px;
}

.security-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
}

.utility-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (min-width: 768px) {
  .utility-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .santri-import-section {
    grid-template-columns: 1.5fr 1fr;
  }
  .security-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

/* Responsive Grid for Master Data Module */
.master-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
}
@media (min-width: 768px) {
  .master-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1200px) {
  .master-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Master Data Cards Custom Typography & Spacing */
.master-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}
.master-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 15px;
}

/* Sub-card Sections within Parameter Card */
.master-sub-card {
  background: rgba(244, 246, 250, 0.45);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.2s ease;
}
.master-sub-card:hover {
  background: rgba(244, 246, 250, 0.7);
  border-color: rgba(15, 118, 110, 0.1);
}
.master-sub-header {
  margin-bottom: 10px;
}
.master-sub-header h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 2px 0;
}
.master-sub-header p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.3;
}

/* Inline Form for Master Elements */
.master-form-inline {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.master-form-inline input {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: #ffffff;
  font-family: var(--font-body);
  color: var(--text-main);
  font-size: 0.82rem;
  transition: all 0.2s ease;
}
.master-form-inline input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

/* Premium Tags/Chips for parameters list */
.master-list-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.master-chip {
  display: inline-flex;
  align-items: center;
  background-color: rgba(15, 118, 110, 0.05);
  color: var(--primary);
  border: 1px solid rgba(15, 118, 110, 0.12);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.master-chip:hover {
  background-color: rgba(15, 118, 110, 0.1);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.08);
}
.master-chip-close {
  margin-left: 6px;
  color: var(--text-light);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  transition: color 0.15s ease;
}
.master-chip:hover .master-chip-close {
  color: var(--danger);
}

/* ==========================================================================
   MOBILE UI/UX PERFECTING (PWA NAV, STICKY COLS, FORM RESPONSIVENESS)
   ========================================================================== */

/* 1. Mobile Bottom Nav Active Tab Micro-Indicator & scale animation */
@media (max-width: 1023px) {
  .nav-link {
    position: relative;
    padding-bottom: 8px !important;
  }
  .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--primary);
    animation: scaleIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  }
  .nav-link.active .nav-icon {
    transform: scale(1.1) translateY(-1px);
    color: var(--primary);
  }
}

@keyframes scaleIn {
  from { transform: translateX(-50%) scale(0); opacity: 0; }
  to { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* 2. Sticky Left Column on Mobile Tables for Horizontal Scroll Context */
@media (max-width: 767px) {
  .table-wrapper {
    position: relative;
    -webkit-overflow-scrolling: touch;
  }
  .data-table.sticky-col th:first-child,
  .data-table.sticky-col td:first-child {
    position: sticky;
    left: 0;
    background-color: #ffffff !important;
    z-index: 10;
    box-shadow: 3px 0 8px rgba(0, 0, 0, 0.07);
  }
  .data-table.sticky-col th:first-child {
    z-index: 11;
    background-color: #f8fafc !important; /* matches header row background color */
  }
  
  /* Ensure zebra rows have proper sticky background */
  .data-table.sticky-col tr:nth-child(even) td:first-child {
    background-color: #f8fafc !important;
  }
}

/* 3. Form & Layout Responsiveness */
@media (max-width: 600px) {
  /* Stack grid form columns */
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  
  /* Modal responsive content sizes */
  dialog {
    max-height: 100vh;
    border-radius: var(--radius-lg);
    width: 95%;
  }
  
  .modal-content {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  /* Stack modal dialog action buttons for easy thumb-reach */
  .form-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .form-actions .btn {
    width: 100%;
    margin: 0 !important;
    padding: 12px;
  }
  
  /* Allow inline parameters form inside master sub-cards to stack */
  .master-form-inline {
    flex-direction: column;
    gap: 6px;
  }
  .master-form-inline input {
    width: 100%;
  }
  .master-form-inline button {
    width: 100%;
  }
}

/* 4. Settings tab horizontal scroll & premium close button */
.settings-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 15px;
  padding-bottom: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.settings-tabs::-webkit-scrollbar {
  display: none;
}
.settings-tab-btn {
  flex: 0 0 auto;
}

/* Modal dialog close icon styled as a premium circular button */
.modal-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}
.modal-close-btn:hover {
  background: var(--border-light);
  color: var(--text-main);
  transform: rotate(90deg);
}

/* 5. Custom Utility Classes */
.hidden {
  display: none !important;
}

/* Prevent broken image placeholders */
img:not([src]), img[src=""], img[src="null"], img[src="undefined"] {
  display: none !important;
}

/* 6. Mobile bottom nav adjustments (Icons only, no text) */
@media (max-width: 1023px) {
  .app-nav .nav-link span {
    display: none !important;
  }
  .app-nav .nav-icon {
    width: 24px;
    height: 24px;
  }
  .app-nav .nav-link {
    padding: 10px 14px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
  }
  .app-nav .nav-link.active::after {
    bottom: 2px !important;
  }
}

/* 7. Pintasan Aksi Cepat (Quick Actions Grid Panel) */
.quick-actions-panel {
  margin-top: 24px;
  padding: 22px;
}
.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 600px) {
  .quick-actions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.quick-action-btn {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 16px 20px !important;
  border-radius: var(--radius-md) !important;
  width: 100% !important;
  box-sizing: border-box !important;
  height: auto !important;
  justify-content: flex-start !important;
  text-align: left !important;
  transition: all var(--transition-fast) !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-light) !important;
  color: var(--text-main) !important;
  box-shadow: var(--shadow-card) !important;
}

.quick-action-btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-panel) !important;
  border-color: var(--primary) !important;
}

.quick-action-btn .btn-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(15, 118, 110, 0.08);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.quick-action-btn:nth-child(2) .btn-icon {
  background: rgba(14, 165, 233, 0.08);
}

.quick-action-btn:nth-child(3) .btn-icon {
  background: rgba(234, 179, 8, 0.08);
}

.quick-action-btn .btn-text {
  display: flex;
  flex-direction: column;
}

.quick-action-btn .btn-text strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: block;
}

.quick-action-btn .btn-text span {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

