:root {
  color-scheme: light;
  --font-sans: 'Plus Jakarta Sans', 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  
  /* Wero Wallet Inspired Palette (Blue-Green) */
  --primary-deep: #1d1c1c;   
  --primary-dark: #1d1c1c;   
  --primary-base: #00e5ff;   
  --primary-medium: #00b4d8; 
  --primary-light: #a8ff78;  
  --primary-wash: #a8ff78;   
  
  /* Accent Colors */
  --accent-gold: #00e5ff;       
  --accent-gold-light: #a8ff78; 
  --accent-blue: #00b4d8;       
  --accent-blue-light: #00b4d8; 
  --accent-lime: #00e5ff;       
  --accent-lime-light: #00e5ff; 
  
  /* Status Colors */
  --color-success: #a8ff78;
  --color-warning: #fff48d;
  --color-danger: #ff1744;
  --color-danger-light: #ff8a80;
  
  /* Neutrals */
  --text-dark: #1d1c1c;     
  --text-medium: #1d1c1c;   
  --text-muted: #1d1c1c;    
  --border-color: #1d1c1c;  
  --border-light: #1d1c1c;
  --bg-wash: #fff;       
  --bg-paper: #ffffff;
  
  /* Neo-Brutalist UI Tokens */
  --shadow-sm: 0 2px 0 0 #1d1c1c;
  --shadow-md: 0 4px 0 0 #1d1c1c;
  --shadow-lg: 0 6px 0 0 #1d1c1c;
  --shadow-premium: 0 8px 0 0 #1d1c1c;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --border-thick: 2px solid #1d1c1c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

/* Pola Latar Belakang Wero-style Gradient */
body {
  background: linear-gradient(121deg, #00e5ff -20.66%, #a8ff78 65.83%);
  background-attachment: fixed;
  color: var(--text-dark);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}


/* TOPBAR WERO STYLE */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem clamp(1rem, 5vw, 4rem);
  background: var(--bg-paper);
  border-bottom: var(--border-thick);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: inherit;
  text-decoration: none;
}

.brand-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #1d1c1c;
}

.brand small {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

/* Real-time Indicator */
.sync-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-wash);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--primary-light);
  margin-right: auto;
  margin-left: 0.5rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-base);
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(2.8); opacity: 0; }
}

.sync-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1d1c1c;
}

/* Realtime Indicator States */
.sync-status.live-on .pulse-dot {
  background: #22c55e; /* green-500 */
}
.sync-status.live-on .pulse-dot::after {
  animation: pulse-ring 1.8s infinite;
  display: block;
}
.sync-status.live-on .sync-text {
  color: #22c55e;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.sync-status.live-off .pulse-dot {
  background: #94a3b8; /* gray/slate */
}
.sync-status.live-off .pulse-dot::after {
  animation: none;
  display: none;
}
.sync-status.live-off .sync-text {
  color: #94a3b8;
  text-shadow: none;
}

/* Navigation tabs */
.nav {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: rgba(241, 245, 249, 0.8);
}

.nav a {
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  color: var(--text-medium);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.nav a:hover {
  color: var(--text-dark);
}

.nav a.active {
  background: var(--bg-paper);
  color: #1d1c1c;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

/* MAIN CONTENT */
main {
  width: min(1200px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2rem 0 5rem;
}

.hidden {
  display: none !important;
}

.page {
  animation: fade-in 0.35s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}
.spin-anim {
  animation: spin 1s linear infinite;
}

/* HERO SECTION */
.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
  min-height: 18rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--radius-lg);
  border: var(--border-thick);
  background: var(--primary-base);
  color: #1d1c1c;
  box-shadow: var(--shadow-premium);
  position: relative;
  overflow: hidden;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #1d1c1c;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  background: var(--primary-light);
  padding: 0.3rem 0.6rem;
  border: var(--border-thick);
  border-radius: var(--radius-full);
}

.hero-band h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 1.5rem;
  color: #1d1c1c;
  text-transform: uppercase;
}

.hero-band h1 .badge-dummy-data {
  color: #000 !important;
}

.hero-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-img-3d {
  width: 100%;
  max-width: 200px;
  filter: drop-shadow(4px 4px 0px #1d1c1c);
  transform: rotate(-10deg);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hero-img-3d:hover {
  transform: rotate(0deg) scale(1.1);
}

.month-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-paper);
  padding: 0.35rem;
  border-radius: var(--radius-full);
  border: var(--border-thick);
  width: fit-content;
  box-shadow: var(--shadow-sm);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: transparent;
  border: var(--border-thick);
  color: #1d1c1c;
  transition: var(--transition-smooth);
}

.icon-button:hover {
  background: var(--primary-medium);
  transform: translateY(-2px);
  box-shadow: 2px 2px 0 0 #1d1c1c;
}

.select-wrapper {
  position: relative;
}

.month-control select {
  appearance: none;
  background: transparent;
  border: none;
  color: #1d1c1c;
  padding: 0.4rem 1.6rem 0.4rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.month-control select:hover {
  background: rgba(0, 0, 0, 0.05);
}

.month-control select option {
  color: #000 !important;
  background-color: #fff !important;
}

.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #1d1c1c;
  font-size: 0.7rem;
  pointer-events: none;
}

/* Balance Card in Hero */
.hero-balance-card {
  background: var(--bg-paper);
  border: var(--border-thick);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-premium);
  min-width: 0;
  color: #1d1c1c;
}

.balance-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.balance-meta span {
  font-size: 0.82rem;
  font-weight: 800;
  color: #1d1c1c;
}

.tag-managed {
  background: var(--accent-lime);
  color: #1d1c1c;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  border: var(--border-thick);
  text-transform: uppercase;
}

.hero-balance-card strong {
  display: block;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
  color: #1d1c1c;
}

.balance-sub-info {
  border-top: var(--border-thick);
  padding-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.balance-sub-info span {
  font-size: 0.75rem;
  color: #1d1c1c;
  font-weight: 800;
}

.balance-sub-info small {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1d1c1c;
}

/* ACTION BAR (DEADLINE & PRINT) */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.deadline-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--accent-gold-light);
  border: 1px solid rgba(217, 119, 6, 0.2);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  color: #1d1c1c;
  flex: 1;
}

.deadline-icon {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.deadline-banner strong {
  display: block;
  font-weight: 800;
  font-size: 0.95rem;
}

.deadline-banner span {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.9;
}

.report-actions {
  display: flex;
  gap: 0.75rem;
}

/* PANELS AND CARDS */
.panel {
  background: var(--bg-paper);
  border: var(--border-thick);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-premium);
  padding: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
  color: #1d1c1c;
}

.panel:hover {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0 0 #1d1c1c;
}

/* DASHBOARD GRID */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
  margin-top: 1.25rem;
  align-items: stretch;
}

.dashboard-left-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.panel-header {
  margin-bottom: 0.85rem; /* More compact header spacing */
}

.panel-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1d1c1c;
  letter-spacing: -0.02em;
}

.panel-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* IPL Split Card */
.ipl-split-panel {
  display: flex;
  flex-direction: column;
}

.split-visualization {
  margin: auto 0;
  padding: 0.25rem 0;
}

.split-info-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.5rem;
}

.split-info-item {
  display: flex;
  flex-direction: column;
}

.split-info-item.text-rw {
  align-items: flex-start;
}

.split-info-item.text-rt {
  align-items: flex-end;
}

.split-info-item strong {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-medium);
}

.split-info-item span {
  font-size: 1.15rem;
  font-weight: 850;
}

.text-rw span {
  color: #1d1c1c;
}

.text-rt span {
  color: #1d1c1c;
}

.split-progress-container {
  display: flex;
  height: 0.95rem;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--border-color);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

.split-segment {
  height: 100%;
  transition: width 0.4s ease;
}

.rw-segment {
  background: var(--primary-base);
}

.rt-segment {
  background: var(--primary-medium);
}

.split-info-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-weight: 650;
}

.split-footer-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.split-footer-info svg {
  flex-shrink: 0;
  color: #1d1c1c;
}

/* Metrics Stack */
.metrics-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.metric-card {
  display: flex;
  align-items: flex-start; /* Align to top because details are taller now */
  gap: 0.75rem;
  flex: 1;
}

.metric-card span {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-card strong {
  display: block;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  font-weight: 850;
  color: #1d1c1c;
  line-height: 1.2;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.green-icon {
  background: var(--primary-wash);
  color: #1d1c1c;
}

.blue-icon {
  background: var(--primary-light);
  color: #1d1c1c;
}

/* Sub-list of categories inside metric details */
.metric-details-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.metric-sub-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(2, 132, 199, 0.15);
}

.sub-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
}

.sub-list-item span {
  color: var(--text-muted);
  font-weight: 550;
}

.sub-list-item small {
  font-weight: 750;
  color: #1d1c1c;
}

/* Chart Panel (Perfect height alignment) */
.chart-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Normal stack to prevent empty spaces */
  min-width: 0;
}

.chart-header-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.chart-header-container .panel-header {
  margin-bottom: 0;
}

.range-selector {
  display: flex;
  background: var(--bg-paper);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: var(--border-thick);
}

.btn-range {
  background: transparent;
  border: none;
  color: #1d1c1c;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-range:hover {
  background: var(--primary-light);
}

.btn-range.active {
  background: var(--primary-base);
  color: #1d1c1c;
  box-shadow: 2px 2px 0 0 #1d1c1c;
  border: 1px solid #1d1c1c;
}

.chart-container {
  flex: 1;
  min-height: 180px;
  position: relative;
  margin-bottom: 0.65rem;
}



/* News Ticker */
.news-ticker-container {
  display: flex;
  align-items: center;
  background: var(--primary-deep);
  color: #fff;
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  margin-top: auto; /* Push ticker to bottom of container cleanly */
  box-shadow: var(--shadow-sm);
}

.ticker-label {
  background: var(--primary-base);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.68rem;
  text-transform: uppercase;
  margin-right: 0.75rem;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.ticker-wrap {
  width: 100%;
  overflow: hidden;
  display: flex;
}

.ticker-content {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-scroll 35s linear infinite;
  padding-left: 10%;
  font-weight: 500;
}

.ticker-content:hover {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0% { transform: translate3d(50%, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* DETAILED REPORT TABLE SECTION */
.report-stack {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.report-table {
  background: var(--bg-paper);
  border: var(--border-thick);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-premium);
  overflow: hidden;
  min-width: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}
.report-table:hover {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0 0 #1d1c1c;
}

.report-table header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: var(--primary-base);
  border-bottom: var(--border-thick);
  color: #1d1c1c;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.header-icon {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  font-size: 0.88rem;
}

th {
  color: var(--text-medium);
  background: var(--bg-wash);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

td {
  color: var(--text-dark);
}

td:last-child, th:last-child {
  text-align: right;
  font-weight: 700;
}

tfoot td {
  background: var(--primary-wash);
  color: #1d1c1c;
  font-weight: 800;
  border-top: 2px solid var(--primary-light);
  border-bottom: none;
  font-size: 0.92rem;
}

.row-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.mini-icon {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
}

.current-icon { background: var(--primary-light); color: #1d1c1c; }
.two-icon { background: rgba(56, 189, 248, 0.15); color: #1d1c1c; }
.six-icon { background: var(--accent-gold-light); color: #1d1c1c; }
.year-icon { background: #fae8ff; color: #a21caf; }
.unpaid-icon { background: rgba(100, 116, 139, 0.1); color: var(--text-medium); }

.table-privacy-note {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px dashed var(--border-color);
  background: var(--bg-wash);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.table-privacy-note svg {
  color: #1d1c1c;
}

/* FINAL RT BALANCE STRIP */
.summary-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.summary-card {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-premium);
  border: 1px solid rgba(255, 255, 255, 0.5);
  min-width: 0;
}

.primary-card {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-base));
  color: #fff;
}

.primary-card span {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.primary-card strong {
  display: block;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  font-weight: 850;
  margin-top: 0.25rem;
}

.secondary-card {
  background: #fff;
}

.secondary-card span {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.secondary-card strong {
  display: block;
  font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  font-weight: 800;
  color: #1d1c1c;
  margin-top: 0.25rem;
}

/* MONTHLY HISTORY LEDGER */
.ledger-section {
  margin-top: 2.5rem;
}

.ledger-section h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1d1c1c;
  letter-spacing: -0.02em;
}

.ledger-section p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ledger-blocks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

.ledger-block {
  padding: 1.25rem;
}

.ledger-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.ledger-block-header h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1d1c1c;
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.ledger-dummy-badge {
  background: rgba(217, 119, 6, 0.08);
  color: #1d1c1c;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(217, 119, 6, 0.15);
}

.badge-dummy-data {
  background: var(--accent-gold-light);
  color: #1d1c1c;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(217, 119, 6, 0.2);
  margin-left: 0.5rem;
}

.ledger-line, .ledger-line-total {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 0.4rem 0;
}

.ledger-line {
  border-bottom: 1px dashed var(--border-color);
  color: var(--text-medium);
}

.ledger-line strong {
  color: var(--text-dark);
}

.resident-name-input:focus,
.resident-house-input:focus {
  border-color: #1d1c1c;
  background: var(--bg-paper);
}

.resident-name-input {
  font-weight: 700;
  color: #1d1c1c;
}

.resident-comment-input {
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--text-base);
  font-style: italic;
  width: 100%;
  resize: none;
  min-height: 32px;
  line-height: 1.2;
  overflow: hidden;
  transition: min-height 0.2s ease-out;
  padding: 0.4rem 0.5rem;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
}

.resident-comment-input:focus {
  min-height: 60px; /* ~3 lines */
  overflow-y: auto;
  position: relative;
  z-index: 10;
  box-shadow: var(--shadow-md);
  border-color: #1d1c1c;
  background: var(--bg-paper);
}

.ledger-line-total {
  font-weight: 800;
  color: #1d1c1c;
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

/* BUTTONS */
button, .btn-primary, .btn-secondary, .btn-danger {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--primary-base);
  color: #1d1c1c;
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-medium);
  border-color: #1d1c1c;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 0 #1d1c1c;
}

.btn-primary:active {
  transform: translate(0, 0);
  box-shadow: 0 0 0 0 #1d1c1c;
}

.btn-secondary {
  background: #fff;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-wash);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--color-danger-light);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.18);
}

.btn-danger:hover {
  background: var(--color-danger);
  color: #fff;
}

/* ADMIN PANEL PAGE */
.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #0c4a6e 0%, #0f172a 100%);
  color: #fff;
  padding: 1.5rem clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}

.admin-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-logo-container-admin {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  border: 2px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-img-admin {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.admin-tools label,
.resident-list-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.admin-tools select,
.admin-tools input,
.resident-list-controls select,
.resident-list-controls input,
.resident-row select,
.resident-row input,
.expense-row input {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  background: var(--bg-paper);
  transition: var(--transition-smooth);
}

.admin-tools select:focus,
.admin-tools input:focus,
.resident-list-controls select:focus,
.resident-list-controls input:focus,
.resident-row select:focus,
.resident-row input:focus {
  outline: none;
  border-color: #1d1c1c;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.admin-metrics .panel {
  padding: 1.25rem;
}

.admin-metrics span {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-metrics strong {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: #1d1c1c;
  margin-top: 0.25rem;
}

.admin-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.full-width-panel {
  grid-column: 1 / -1;
  width: 100%;
}

.admin-panel {
  padding: 1.5rem;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
}

.panel-title h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1d1c1c;
}

.button-row {
  display: flex;
  gap: 0.5rem;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Simulator inside Admin Page */
.simulator-panel-admin {
  background: var(--bg-paper);
}

.simulator-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

#simStatusText {
  font-size: 0.85rem;
  font-weight: 750;
  color: var(--text-muted);
}

.sim-help-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Toggle Switch */
.switch-control {
  position: relative;
  display: inline-block;
  width: 2.8rem;
  height: 1.55rem;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.15rem;
  width: 1.15rem;
  left: 0.2rem;
  bottom: 0.2rem;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .slider {
  background-color: #1d1c1c;
}

input:checked + .slider:before {
  transform: translateX(1.25rem);
}

/* Resident List - 8 Columns layout for Confirm details */
.resident-list-controls {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(12rem, 0.45fr) auto;
  gap: 0.85rem;
  align-items: end;
  margin-bottom: 0.85rem;
  padding: 0.85rem;
  background: var(--bg-wash);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.resident-result-count {
  align-self: center;
  justify-self: end;
  font-size: 0.78rem;
  font-weight: 800;
  color: #1d1c1c;
  background: var(--primary-light);
  border-radius: var(--radius-full);
  padding: 0.45rem 0.75rem;
  white-space: nowrap;
}

.resident-list-header {
  display: grid;
  grid-template-columns: 2.2rem 2.8rem minmax(180px, 1.2fr) 90px 300px minmax(200px, 1fr);
  gap: 0.6rem;
  padding: 0.5rem 0.85rem;
  background: var(--bg-wash);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.resident-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 38rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.resident-row {
  display: grid;
  grid-template-columns: 2.2rem 2.8rem minmax(180px, 1.2fr) 90px 300px minmax(200px, 1fr);
  gap: 0.6rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: var(--bg-paper);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.resident-row:hover {
  background: var(--primary-wash);
  border-color: #1d1c1c;
}

.resident-number {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--bg-wash);
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 4px;
}

.resident-name-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  border: 1px dashed var(--border-color);
  background: transparent;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
}

.resident-name-input:focus {
  background: #fff;
  border-color: #1d1c1c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.resident-house-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-medium);
  border: 1px dashed var(--border-color);
  background: transparent;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  text-align: center;
}

.resident-house-input:focus {
  background: #fff;
  border-color: #1d1c1c;
  outline: none;
}

.resident-months-grid {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
}

.month-box {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  height: 17px;
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-smooth);
  min-width: 12px;
}

.month-box.special-box {
  flex: 0 0 34px;
  font-size: 0.52rem;
  padding: 0 1px;
  white-space: nowrap;
}

.month-box.paid {
  background-color: #22c55e;
  color: #ffffff;
}

.month-box.unpaid {
  background-color: #ef4444;
  color: #ffffff;
}

.month-box.future {
  background-color: #cbd5e1;
  color: #64748b;
}

.month-box.selected {
  outline: 2px solid var(--text-dark);
  outline-offset: 1px;
  z-index: 5;
}

.month-box:hover {
  transform: scale(1.15);
  filter: brightness(0.9);
}

.comment-cell {
  display: flex;
  align-items: center;
  width: 100%;
}

.resident-comment-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  background: var(--bg-wash);
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.resident-comment-input:focus {
  background: #fff;
  border-color: #1d1c1c;
  outline: none;
}

.reminder-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.reminder-wrap {
  display: flex;
  gap: 4px;
  align-items: center;
  width: 100%;
}

.reminder-input {
  flex: 1;
  font-family: inherit;
  font-size: 0.75rem !important;
  font-weight: 550 !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border-color) !important;
  padding: 0.25rem 0.45rem !important;
  border-radius: 4px !important;
  background: var(--bg-wash) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.btn-copy-reminder {
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  background: var(--primary-wash);
  border: 1px solid var(--primary-light);
  color: #1d1c1c;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-copy-reminder:hover {
  background: var(--primary-base);
  color: #fff;
  border-color: #1d1c1c;
}

.resident-months-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-align: center;
  background: var(--bg-wash);
  color: var(--text-medium);
}

.resident-months-badge.current { background: var(--primary-light); color: #1d1c1c; }
.resident-months-badge.two { background: rgba(56, 189, 248, 0.15); color: #1d1c1c; }
.resident-months-badge.six { background: var(--accent-gold-light); color: #1d1c1c; }
.resident-months-badge.year { background: #fae8ff; color: #a21caf; }
.resident-months-badge.social { background: var(--accent-gold-light); color: #1d1c1c; }
.resident-months-badge.unpaid { background: rgba(100, 116, 139, 0.1); color: var(--text-medium); }

.resident-donation-input-17, .resident-donation-input-thr {
  width: 100%;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1d1c1c;
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  text-align: right;
}

.resident-donation-input-17::placeholder, .resident-donation-input-thr::placeholder {
  color: #cbd5e1;
  font-weight: 500;
}

.resident-donation-input-17:focus {
  border-color: #1d1c1c;
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.resident-donation-input-thr:focus {
  border-color: #1d1c1c;
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

/* Confirmation Box Form styling */
.confirmation-details-box {
  grid-column: 1 / -1;
  background: var(--bg-wash);
  border-top: 1px dashed var(--border-color);
  padding: 0.85rem 1rem;
  margin-top: 0.5rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.confirm-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr 0.9fr 0.8fr 1.25fr;
  gap: 0.75rem;
  align-items: end;
}

.file-upload-inline {
  display: flex;
  gap: 0.35rem;
  width: 100%;
}

.btn-file-trigger, .btn-view-file {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-wash);
  color: var(--text-dark);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.btn-file-trigger:hover, .btn-view-file:hover {
  background: var(--primary-light);
  border-color: #1d1c1c;
  color: #1d1c1c;
}

.btn-view-file {
  background: var(--primary-wash);
  border-color: #1d1c1c;
  color: #1d1c1c;
  flex: 0 0 auto;
}

.confirm-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.confirm-grid input {
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
  width: 100%;
}

.confirm-checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
  cursor: pointer;
  height: 2.3rem;
}

.confirm-checkbox-label input {
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
}

.confirm-checkbox-label span {
  font-size: 0.75rem;
  font-weight: 800;
  color: #1d1c1c;
}

/* Status colors borders */
.resident-row.pending-confirmation {
  border-left: 4px solid var(--color-warning);
  background: #fffdf5;
}

.resident-row.confirmed-paid {
  border-left: 4px solid var(--color-success);
  background: #f0fdf4;
}

.resident-row.unpaid-row {
  border-left: 4px solid #94a3b8;
}

.resident-row.social-row {
  border-left: 4px solid var(--accent-gold);
  background: #fffbeb;
}

/* Expense Editor */
.expense-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.expense-row {
  display: grid;
  grid-template-columns: 1fr 7.5rem 2.2rem;
  gap: 0.4rem;
  align-items: center;
}

.expense-row button {
  padding: 0.5rem;
  height: 2.3rem;
  width: 2.3rem;
  background: var(--color-danger-light);
  color: var(--color-danger);
  border: 1px solid rgba(239,68,68,0.1);
  font-size: 1.2rem;
  line-height: 1;
}

.expense-row button:hover {
  background: var(--color-danger);
  color: #fff;
}

/* MODAL OVERLAY */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: grid;
  place-items: center;
  animation: modal-fade 0.25s ease-out;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: min(800px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color);
  animation: modal-slide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-slide {
  from { transform: translateY(30px) scale(0.96); }
  to { transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1d1c1c;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

.close-modal:hover {
  color: var(--text-dark);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--bg-wash);
}

.print-config {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.print-config label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: 1;
  min-width: 8rem;
}

.print-config select {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-wash);
}

/* Document Sheet Preview */
.print-preview-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preview-header-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.document-scroller {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.document-sheet {
  background: #ffffff;
  width: 680px;
  margin: 0 auto;
  padding: 2.5rem;
  color: #1e293b;
  font-family: var(--font-sans);
  line-height: 1.4;
  box-sizing: border-box;
}

.document-sheet.canvas-exporting {
  width: 794px;
  padding: 3.5rem;
}

.doc-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.doc-logo-img {
  height: 3.5rem;
  width: auto;
  object-fit: contain;
}

.doc-title-section h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.doc-title-section p {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.1rem;
}

.doc-divider {
  height: 3px;
  background: #0f172a;
  margin: 1.25rem 0;
  position: relative;
}

.doc-divider::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 1px;
  background: #0f172a;
}

.doc-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  background: #f8fafc;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  margin-bottom: 1.5rem;
}

.doc-meta strong {
  color: #475569;
}

.doc-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.25rem 0 0.5rem;
  border-left: 3px solid #0f172a;
  padding-left: 0.5rem;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
}

.doc-table th, .doc-table td {
  padding: 0.6rem 0.85rem;
  border: 1px solid #cbd5e1;
  text-align: left;
}

.doc-table th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
  text-transform: none;
}

.doc-table td:last-child, .doc-table th:last-child {
  text-align: right;
}

.doc-table tfoot td {
  font-weight: 800;
  background: #f8fafc;
  color: #0f172a;
  border-top: 2px solid #0f172a;
}

.doc-table .highlight-row td {
  background: #f0fdf4;
  font-weight: 700;
  color: #166534;
}

.doc-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.doc-summary-table td {
  padding: 0.5rem 0.85rem;
  border-bottom: 1px dashed #cbd5e1;
}

.doc-summary-table td:last-child {
  text-align: right;
  font-weight: 700;
}

.doc-summary-table .total-row {
  font-size: 0.9rem;
  font-weight: 800;
  background: #f8fafc;
  border-top: 2px solid #0f172a;
  border-bottom: 2px solid #0f172a;
}

.doc-summary-table .total-row td {
  padding: 0.65rem 0.85rem;
}

.doc-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding: 0 1rem;
}

.sig-block {
  text-align: center;
  width: 12rem;
  font-size: 0.82rem;
}

.sig-role {
  font-weight: 700;
}

.sig-space {
  height: 4rem;
}

.sig-name {
  font-weight: 700;
  text-decoration: underline;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: #fff;
}

/* TOAST STYLES */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  width: 22rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 24px rgba(12, 74, 110, 0.08);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transform: translateX(25rem);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #1d1c1c;
}

.toast-indicator {
  width: 6px;
  height: 6px;
  background: var(--primary-base);
  border-radius: 50%;
}

.toast-header strong {
  font-weight: 800;
  flex: 1;
}

.toast-header small {
  color: var(--text-muted);
}

.toast-body {
  font-size: 0.82rem;
  color: var(--text-medium);
  line-height: 1.4;
}

.toast-body strong {
  color: var(--text-dark);
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 900px) {
  .hero-band {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 1.5rem;
  }
  .report-stack, .summary-strip, .admin-top-row {
    grid-template-columns: 1fr;
  }
  .admin-tools {
    grid-template-columns: repeat(3, 1fr);
  }
  .resident-list-controls {
    grid-template-columns: 1fr 1fr;
  }
  .resident-result-count {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .admin-metrics {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  main {
    width: min(100% - 1.25rem, 1200px);
  }
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 1rem;
  }
  .sync-status {
    margin: 0;
    justify-content: center;
  }
  .nav {
    width: 100%;
  }
  .nav a {
    flex: 1;
    text-align: center;
  }
  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .chart-panel {
    grid-column: span 1;
  }
  .ledger-blocks {
    grid-template-columns: 1fr;
  }
  .admin-hero {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .admin-panel {
    padding: 1rem;
  }
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-tools,
  .db-buttons-grid {
    grid-template-columns: 1fr;
  }
  .resident-list-controls {
    grid-template-columns: 1fr;
  }
  .resident-result-count {
    justify-self: stretch;
    text-align: center;
  }
  .admin-metrics {
    grid-template-columns: 1fr;
  }
  .resident-list-header {
    display: none;
  }
  .resident-row {
    grid-template-columns: 2.2rem 2.2rem minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.85rem;
    align-items: start;
  }
  .resident-row select, .resident-row input {
    grid-column: span 3;
    width: 100%;
  }
  .resident-name-input {
    grid-column: span 1 !important;
  }
  .resident-house-input,
  .resident-months-grid,
  .comment-cell,
  .reminder-cell,
  .confirmation-details-box {
    grid-column: 1 / -1;
  }
  .resident-months-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
  }
  .month-box,
  .month-box.special-box {
    min-width: 0;
    width: 100%;
    height: 2rem;
    flex: initial;
    font-size: 0.7rem;
  }
  .reminder-wrap,
  .file-upload-inline {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-copy-reminder,
  .btn-file-trigger,
  .btn-view-file {
    width: 100%;
  }
  .confirm-grid {
    grid-template-columns: 1fr;
  }
  .confirm-checkbox-label {
    justify-content: flex-start;
  }
  .expense-row {
    grid-template-columns: 1fr;
  }
  .expense-row button {
    width: 100%;
  }
  .document-sheet {
    width: 620px;
  }
  .resident-months-badge {
    grid-column: span 1 !important;
  }
}

/* CHART TOOLTIP & INTERACTIVE HOVER */
.trash-item-row.undoing .btn-undo {
  pointer-events: none;
  opacity: 0.5;
}

/* SLOW-MOTION DISAPPEAR EFFECT (RED) */
.fade-out-red {
  animation: fadeOutRedAnim 1.5s ease-out forwards;
  pointer-events: none; /* prevent clicks during animation */
}

@keyframes fadeOutRedAnim {
  0% {
    opacity: 1;
    background-color: var(--card-bg);
  }
  20% {
    opacity: 1;
    background-color: rgba(239, 68, 68, 0.15); /* soft red transparent */
  }
  60% {
    opacity: 1;
    background-color: rgba(239, 68, 68, 0.35); /* stronger red transparent */
  }
  100% {
    opacity: 0;
    background-color: rgba(239, 68, 68, 0);
  }
}

/* SLOW-MOTION APPEAR/ACTIVATE EFFECT (GREEN) */
.flash-green {
  animation: flashGreenAnim 1.5s ease-out forwards;
  pointer-events: none;
}

@keyframes flashGreenAnim {
  0% {
    background-color: var(--card-bg);
  }
  20% {
    background-color: rgba(34, 197, 94, 0.15); /* soft green transparent */
  }
  60% {
    background-color: rgba(34, 197, 94, 0.35); /* stronger green transparent */
  }
  100% {
    background-color: var(--card-bg);
  }
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: #fff;
  font-size: 0.78rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  z-index: 99;
  transition: opacity 0.1s ease, transform 0.05s ease;
  white-space: nowrap;
}

.chart-tooltip .tooltip-date {
  font-weight: 700;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 0.25rem;
  font-size: 0.82rem;
  color: #38bdf8;
}

.chart-tooltip .tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0.15rem 0;
}

.chart-tooltip .tooltip-label {
  color: rgba(255, 255, 255, 0.7);
}

.chart-tooltip .tooltip-value {
  font-weight: 600;
}

.chart-tooltip .val-balance {
  color: #38bdf8;
}

.chart-tooltip .val-kk {
  color: #34d399;
}

.chart-hover-line {
  stroke: rgba(148, 163, 184, 0.4);
  stroke-dasharray: 4,4;
  stroke-width: 1.5;
  pointer-events: none;
}

.chart-hover-dot-left {
  fill: var(--primary-base);
  stroke: #fff;
  stroke-width: 2;
  r: 5.5;
  pointer-events: none;
}

.chart-hover-dot-right {
  fill: #10b981;
  stroke: #fff;
  stroke-width: 2;
  r: 5.5;
  pointer-events: none;
}

/* MONEY ADVISOR PANEL */
.advisor-panel {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.02), rgba(2, 132, 199, 0.04));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.advisor-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary-base);
}

.advisor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.advisor-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.advisor-title-text h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1d1c1c;
  margin: 0;
}

.advisor-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-top: 0.15rem;
}

.advisor-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.advisor-stat-box {
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  border: var(--border-thick);
  transition: transform 0.2s, box-shadow 0.2s;
}

.advisor-stat-box:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 0 #1d1c1c;
}

.advisor-stat-box.primary {
  background: var(--primary-light);
}

.advisor-stat-box.secondary {
  background: var(--accent-lime-light);
}

.advisor-stat-box span {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.advisor-stat-box.primary span {
  color: #1d1c1c;
}

.advisor-stat-box.secondary span {
  color: #047857;
}

.advisor-stat-box strong {
  font-size: 1rem;
  font-weight: 800;
  margin-top: 0.15rem;
}

.advisor-stat-box.primary strong {
  color: #1d1c1c;
}

.advisor-stat-box.secondary strong {
  color: #047857;
}

.advisor-body {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-dark);
  margin: 0;
}

.advisor-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  text-align: right;
  font-weight: 700;
  margin-top: 0.75rem;
}

.db-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
}

/* INTERACTIVE REPORT TEMPLATE STYLING */
.interactive-sheet {
  background: #fdfdfd;
  padding: 2rem 2.5rem !important;
  color: #1e293b;
  font-family: 'Plus Jakarta Sans', var(--font-sans);
}

.interactive-report-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.interactive-header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.interactive-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #137333;
  margin: 0;
  letter-spacing: 0.02em;
  font-family: 'Plus Jakarta Sans', var(--font-sans);
}

.interactive-period-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.25rem;
}

.period-line {
  height: 2px;
  background: #137333;
  width: 4rem;
}

.interactive-period {
  font-size: 1.1rem;
  font-weight: 700;
  color: #137333;
}

/* Card Panel (Pie Chart Box) */
.interactive-card-panel {
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.25rem;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.interactive-flex-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 1.5rem;
}

.interactive-pie-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.interactive-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-grow: 1;
  max-width: 14rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.legend-color-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-color-dot.rw-dot {
  background-color: #137333;
}

.legend-color-dot.rt-dot {
  background-color: #b5ec58;
}

.legend-details {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.legend-details strong {
  font-size: 0.85rem;
  color: #1e293b;
}

.legend-details span {
  font-size: 0.85rem;
  color: #475569;
}

.legend-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 0.25rem 0;
}

.legend-total-kk {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #1e293b;
}

.legend-kk-icon {
  color: #137333;
}

/* Section Panel & Table Styling */
.interactive-section-panel {
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.interactive-panel-header {
  background-color: #137333;
  color: #ffffff;
  font-weight: 800;
  text-align: center;
  padding: 0.6rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.interactive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.interactive-table th {
  background: #f8fafc;
  color: #137333;
  font-weight: 700;
  padding: 0.5rem 0.85rem;
  border-bottom: 1.5px solid #e2e8f0;
  text-align: left;
}

.interactive-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #334155;
}

.interactive-table tr:last-child td {
  border-bottom: none;
}

.interactive-table .total-row td {
  font-weight: 800;
  color: #137333;
  background: #f0fdf4;
  font-size: 0.9rem;
  border-top: 1.5px solid #cbd5e1;
  padding: 0.75rem 0.85rem;
}

.interactive-table.no-th td {
  padding: 0.65rem 1rem;
}

.table-icon-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.table-icon-wrap svg, .table-icon-wrap span {
  flex-shrink: 0;
}

/* Sisa Kas Box */
.interactive-sisa-kas-box {
  background: #137333;
  color: #ffffff;
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.sisa-kas-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
}

.sisa-kas-divider {
  width: 1.5px;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.25);
}

.sisa-kas-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sisa-kas-label {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.9;
}

.sisa-kas-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Titipan Box */
.interactive-titipan-box {
  border: 2px solid #b5ec58;
  background: #ffffff;
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.titipan-icon {
  color: #137333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.titipan-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.titipan-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
}

.titipan-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #137333;
}

/* Footer Styling */
.interactive-footer {
  text-align: center;
  font-size: 0.85rem;
  color: #475569;
  font-weight: 600;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.75rem;
}

.heart-icon {
  color: #ef4444;
  margin-right: 0.25rem;
}



\ n [ d a t a - t h e m e = \  
 c l a s s i c \ ]   { \ n     - - p r i m a r y - d e e p :   # 0 a 4 d 3 c ; \ n     - - p r i m a r y - d a r k :   # 1 2 7 a 5 d ; \ n     - - p r i m a r y - b a s e :   # 1 a 9 e 7 a ; \ n     - - p r i m a r y - m e d i u m :   # 2 d c 4 9 d ; \ n     - - p r i m a r y - l i g h t :   # 6 e e 6 c 6 ; \ n     - - p r i m a r y - w a s h :   # e 8 f 9 f 4 ; \ n     - - a c c e n t - g o l d :   # f 5 9 e 0 b ; \ n     - - a c c e n t - g o l d - l i g h t :   # f e f 3 c 7 ; \ n     - - a c c e n t - b l u e :   # 3 b 8 2 f 6 ; \ n     - - a c c e n t - b l u e - l i g h t :   # d b e a f e ; \ n     - - a c c e n t - l i m e :   # 8 4 c c 1 6 ; \ n     - - a c c e n t - l i m e - l i g h t :   # e c f c c b ; \ n     - - c o l o r - s u c c e s s :   # 1 0 b 9 8 1 ; \ n     - - c o l o r - w a r n i n g :   # f 5 9 e 0 b ; \ n     - - c o l o r - d a n g e r :   # e f 4 4 4 4 ; \ n     - - c o l o r - d a n g e r - l i g h t :   # f e e 2 e 2 ; \ n     - - t e x t - d a r k :   # 0 f 1 7 2 a ; \ n     - - t e x t - m e d i u m :   # 4 7 5 5 6 9 ; \ n     - - t e x t - m u t e d :   # 9 4 a 3 b 8 ; \ n     - - b o r d e r - c o l o r :   # e 2 e 8 f 0 ; \ n     - - b o r d e r - l i g h t :   # f 1 f 5 f 9 ; \ n     - - b g - w a s h :   # f 8 f a f c ; \ n     - - b g - p a p e r :   # f f f f f f ; \ n     - - s h a d o w - s m :   0   1 p x   2 p x   0   r g b a ( 0 , 0 , 0 , 0 . 0 5 ) ; \ n     - - s h a d o w - m d :   0   4 p x   6 p x   - 1 p x   r g b a ( 0 , 0 , 0 , 0 . 1 ) ,   0   2 p x   4 p x   - 1 p x   r g b a ( 0 , 0 , 0 , 0 . 0 6 ) ; \ n     - - s h a d o w - l g :   0   1 0 p x   1 5 p x   - 3 p x   r g b a ( 0 , 0 , 0 , 0 . 1 ) ,   0   4 p x   6 p x   - 2 p x   r g b a ( 0 , 0 , 0 , 0 . 0 5 ) ; \ n     - - s h a d o w - p r e m i u m :   0   2 0 p x   2 5 p x   - 5 p x   r g b a ( 0 ,   0 ,   0 ,   0 . 1 ) ,   0   1 0 p x   1 0 p x   - 5 p x   r g b a ( 0 ,   0 ,   0 ,   0 . 0 4 ) ; \ n     - - r a d i u s - s m :   8 p x ; \ n     - - r a d i u s - m d :   1 2 p x ; \ n     - - r a d i u s - l g :   1 6 p x ; \ n     - - r a d i u s - f u l l :   9 9 9 9 p x ; \ n     - - b o r d e r - t h i c k :   1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ; \ n } \ n \ n [ d a t a - t h e m e = \ c l a s s i c \ ]   b o d y   { \ n     b a c k g r o u n d :   v a r ( - - b g - w a s h ) ; \ n } \ n  
 