/* ═══════════════════════════════════════════════════════════
   GREEN BANANA – Balance Sheet Web UI
   Material Design · Deep Blue Primary · Responsive
═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --primary:        #1565C0;
  --primary-dark:   #0D47A1;
  --primary-light:  #1976D2;
  --primary-xlight: #E3F2FD;
  --accent:         #FF6F00;
  --green:          #2E7D32;
  --green-light:    #E8F5E9;
  --red:            #C62828;
  --red-light:      #FFEBEE;
  --orange:         #E65100;
  --text-primary:   #212121;
  --text-secondary: #616161;
  --text-hint:      #9E9E9E;
  --divider:        #E0E0E0;
  --bg:             #F5F5F5;
  --surface:        #FFFFFF;
  --toolbar-h:      56px;
  --bottom-nav-h:   60px;
  --sidebar-w:      280px;
  --radius:         8px;
  --radius-lg:      16px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow-md:      0 4px 6px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.08);
  --shadow-lg:      0 10px 25px rgba(0,0,0,.15);
  --transition:     0.2s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Page System ── */
.page { display: none; }
.page.active { display: block; }

/* ═══════════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════════ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  padding: 24px 16px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 64px !important;
  color: var(--primary);
  display: block;
  margin-bottom: 8px;
}

.app-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
}

.app-tagline {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.login-form { display: flex; flex-direction: column; gap: 20px; }

/* ═══════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════ */
#page-app {
  display: none;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
#page-app.active { display: flex; }

/* ── Toolbar ── */
.toolbar {
  height: var(--toolbar-h);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 4px;
  box-shadow: var(--shadow-md);
  z-index: 100;
  flex-shrink: 0;
  gap: 4px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.toolbar-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.toolbar-title {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.toolbar-subtitle {
  font-size: 11px;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar-date-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.toolbar-date-range {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar-date-input {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  width: 90px;
  text-align: center;
  font-family: inherit;
  transition: background var(--transition);
}
.toolbar-date-input::placeholder { color: rgba(255,255,255,0.6); }
.toolbar-date-input:hover { background: rgba(255,255,255,0.25); }
.toolbar-date-input.small { width: 80px; font-size: 11px; }

/* ── Icon Button ── */
.icon-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(255,255,255,0.15); }
.icon-btn:active { background: rgba(255,255,255,0.25); }
.icon-btn .material-icons { font-size: 22px; }

/* ── Sidebar ── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.sidebar-overlay.open { opacity: 1; pointer-events: all; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }

.sidebar-header {
  background: var(--primary);
  color: #fff;
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo-icon-sm {
  font-size: 36px !important;
  color: #fff;
}

.sidebar-app-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.sidebar-branch {
  font-size: 12px;
  opacity: 0.8;
}

.sidebar-close {
  margin-left: auto;
}

.sidebar-menu {
  list-style: none;
  padding: 8px 0;
  flex: 1;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 20px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: background var(--transition), color var(--transition);
  border-radius: 0;
}
.sidebar-item:hover { background: var(--primary-xlight); color: var(--primary); }
.sidebar-item.active { background: var(--primary-xlight); color: var(--primary); font-weight: 600; }
.sidebar-item .material-icons { font-size: 20px; color: var(--text-secondary); }
.sidebar-item:hover .material-icons,
.sidebar-item.active .material-icons { color: var(--primary); }
.sidebar-item.danger { color: var(--red); }
.sidebar-item.danger .material-icons { color: var(--red); }
.sidebar-item.danger:hover { background: var(--red-light); }

.sidebar-divider {
  height: 1px;
  background: var(--divider);
  margin: 8px 0;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 20px 4px;
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  position: relative;
  padding-bottom: var(--bottom-nav-h);
}

/* ── Screen ── */
.screen { display: none; padding: 0; }
.screen.active { display: block; }

/* ── Bottom Navigation ── */
.bottom-nav {
  height: var(--bottom-nav-h);
  background: var(--primary);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}

.bottom-nav-item {
  flex: 1;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  font-family: inherit;
  transition: color var(--transition), background var(--transition);
  padding: 4px 2px;
}
.bottom-nav-item .material-icons { font-size: 22px; }
.bottom-nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.bottom-nav-item.active { color: #fff; }
.bottom-nav-item.active .material-icons {
  color: #fff;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.5));
}

/* ═══════════════════════════════════════════════
   FORM COMPONENTS
═══════════════════════════════════════════════ */
.entry-form {
  padding: 16px;
  max-width: 640px;
  margin: 0 auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-group.half { flex: 1; min-width: 0; }
.form-group.third { flex: 1; min-width: 0; }

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.2px;
}

.required { color: var(--red); }

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--divider);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}
.form-input:hover:not(:focus) { border-color: #BDBDBD; }
.form-input[readonly] { background: #FAFAFA; cursor: pointer; }
.form-input.error { border-color: var(--red); }
.form-input:disabled { background: #F5F5F5; color: var(--text-hint); cursor: not-allowed; }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrapper .form-input { padding-left: 42px; }
.input-wrapper .form-input:only-child { padding-left: 14px; }
.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-hint);
  font-size: 18px !important;
  pointer-events: none;
}
.input-icon-right {
  position: absolute;
  right: 12px;
  color: var(--text-hint);
  font-size: 18px !important;
  pointer-events: none;
}
.input-wrapper .form-input { padding-right: 40px; }

/* Password toggle */
.toggle-password {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-hint);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 50%;
  transition: color var(--transition);
}
.toggle-password:hover { color: var(--primary); }
.toggle-password .material-icons { font-size: 20px; }

/* Select */
.select-wrapper {
  position: relative;
}
.form-select {
  width: 100%;
  padding: 11px 40px 11px 14px;
  border: 1.5px solid var(--divider);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}
.form-select:hover:not(:focus) { border-color: #BDBDBD; }
.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-hint);
  font-size: 20px !important;
  pointer-events: none;
}

/* Radio Group */
.radio-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  user-select: none;
}
.radio-option input[type="radio"] { display: none; }
.radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--divider);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition);
  flex-shrink: 0;
}
.radio-option input[type="radio"]:checked + .radio-custom {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 4px #fff;
}
.radio-option:hover .radio-custom { border-color: var(--primary); }

/* Field Error */
.field-error {
  font-size: 12px;
  color: var(--red);
  min-height: 16px;
  display: block;
}

/* Form Section Title */
.form-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 0 8px;
  border-bottom: 2px solid var(--primary-xlight);
  margin-bottom: 12px;
}
.form-section-title.sub {
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom-color: var(--divider);
  padding-top: 8px;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 12px;
  padding: 16px 0 8px;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.btn .material-icons { font-size: 18px; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: var(--shadow-sm); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-xlight); }

.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-danger:hover { background: #B71C1C; box-shadow: var(--shadow-md); }

.btn-full { width: 100%; justify-content: center; }

.detail-view-modal { max-height: 85vh; overflow-y: auto; }
.detail-view-body { text-align: left; max-height: 48vh; overflow-y: auto; margin: 0 0 20px; border-top: 1px solid var(--divider); }
.detail-view-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--divider); font-size: 13px; }
.detail-view-row span { color: var(--text-secondary); }
.detail-view-row strong { color: var(--text-primary); text-align: right; word-break: break-word; }

/* Branch selection */
.branch-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--background);
}
.branch-card {
  width: min(100%, 480px);
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.branch-header { text-align: center; margin-bottom: 24px; }
.branch-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.branch-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.branch-item:hover { background: var(--primary-xlight); border-color: var(--primary); }
.branch-item-icon { color: var(--primary); }
.branch-item-text { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.branch-item-text strong { font-size: 15px; }
.branch-item-text small { color: var(--text-secondary); }
.branch-empty { min-height: 140px; }
.full-width { width: 100%; justify-content: center; margin-bottom: 12px; }

.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ═══════════════════════════════════════════════
   LIST COMPONENTS
═══════════════════════════════════════════════ */
.list-header-row {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 2px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.col-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.col-label.right { text-align: right; }
.col-label.center { text-align: center; }

.col-flex-1 { flex: 1; }
.col-flex-2 { flex: 2; }
.col-flex-3 { flex: 3; }
.col-flex-4 { flex: 4; }
.col-flex-5 { flex: 5; }

.list-body { padding-bottom: 8px; }

.grid-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  z-index: 11;
}
.grid-search-bar > .material-icons {
  color: var(--text-hint);
  font-size: 20px;
}
.grid-search-bar input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 9px 10px;
  font: 13px inherit;
  color: var(--text-primary);
  outline: none;
}
.grid-search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}
.grid-search-bar .icon-btn-sm {
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* List Row */
.list-row {
  display: flex;
  align-items: center;
  padding: 12px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background var(--transition);
  animation: fadeIn 0.2s ease;
}
.list-row:hover { background: var(--primary-xlight); }
.list-row:active { background: #BBDEFB; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.list-cell {
  font-size: 13px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 4px;
}
.list-cell.right { text-align: right; padding-right: 0; }
.list-cell.center { text-align: center; }
.list-cell.bold { font-weight: 600; }

/* Status Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-paid   { background: var(--green-light); color: var(--green); }
.badge-pending { background: var(--red-light); color: var(--red); }
.badge-active  { background: var(--green-light); color: var(--green); }
.badge-inactive { background: #F5F5F5; color: var(--text-secondary); }

/* List Footer */
.list-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  background: var(--surface);
  border-top: 2px solid var(--primary);
  position: sticky;
  bottom: 0;
  flex-wrap: wrap;
}

.footer-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.footer-label {
  font-weight: 600;
  color: var(--text-secondary);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-secondary);
}
.empty-icon {
  font-size: 64px !important;
  color: var(--divider);
  margin-bottom: 16px;
}
.empty-state p { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.empty-sub { font-size: 13px; color: var(--text-hint); }

/* ═══════════════════════════════════════════════
   SUMMARY CARD
═══════════════════════════════════════════════ */
.summary-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--divider);
  padding: 16px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 14px;
}
.summary-row:last-child { border-bottom: none; }
.summary-row.total-row {
  font-weight: 700;
  font-size: 15px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 2px solid var(--divider);
  border-bottom: none;
}

.summary-value { font-weight: 600; }
.summary-value.green { color: var(--green); }
.summary-value.red { color: var(--red); }

/* ═══════════════════════════════════════════════
   REPORTS
═══════════════════════════════════════════════ */
.report-container { padding: 16px; }

.report-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.report-card-title {
  background: var(--primary);
  color: #fff;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  overflow-x: auto;
  display: block;
}

.report-table thead tr {
  background: var(--primary-xlight);
}

.report-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: var(--primary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider);
  color: var(--text-primary);
  white-space: nowrap;
}

.report-table tbody tr:hover { background: var(--primary-xlight); }
.report-table tbody tr:last-child td { border-bottom: none; }

.empty-row {
  text-align: center;
  color: var(--text-hint);
  padding: 32px !important;
  font-style: italic;
}

/* ═══════════════════════════════════════════════
   ACCOUNTS SCREEN
═══════════════════════════════════════════════ */
.accounts-container {
  padding: 24px 16px;
  max-width: 480px;
  margin: 0 auto;
}

.account-card {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.account-icon {
  font-size: 64px !important;
  opacity: 0.9;
}

.account-name {
  font-size: 20px;
  font-weight: 700;
}

.account-role {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 2px;
}

.account-branch {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 2px;
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ═══════════════════════════════════════════════
   DATE PICKER MODAL
═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.date-picker-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 320px;
  overflow: hidden;
  animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.date-picker-header {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px;
}

.picker-month-label {
  font-size: 15px;
  font-weight: 600;
}

.date-picker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 8px 8px 4px;
  background: var(--primary-xlight);
}
.date-picker-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  padding: 4px 0;
}

.date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 4px 8px 8px;
  gap: 2px;
}

.picker-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border: none;
  background: none;
  font-family: inherit;
  color: var(--text-primary);
}
.picker-day:hover { background: var(--primary-xlight); color: var(--primary); }
.picker-day.selected { background: var(--primary); color: #fff; font-weight: 600; }
.picker-day.today { font-weight: 700; color: var(--primary); }
.picker-day.today.selected { color: #fff; }
.picker-day.empty { cursor: default; }
.picker-day.other-month { color: var(--text-hint); }

.date-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--divider);
}

/* ═══════════════════════════════════════════════
   FILTER MODAL
═══════════════════════════════════════════════ */
.filter-modal {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.filter-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--divider);
}
.filter-header .icon-btn { color: var(--text-primary); }

.filter-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.filter-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.filter-footer {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--divider);
}
.filter-footer .btn { flex: 1; justify-content: center; }

/* ═══════════════════════════════════════════════
   CONFIRM DIALOG
═══════════════════════════════════════════════ */
.confirm-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px 20px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  animation: scaleIn 0.2s ease;
}

.confirm-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-xlight);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.confirm-icon {
  font-size: 28px !important;
  color: var(--primary);
}

.confirm-message {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.confirm-actions .btn { flex: 1; justify-content: center; }

/* ═══════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #323232;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  text-align: center;
  box-shadow: var(--shadow-md);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }

/* ═══════════════════════════════════════════════
   BOTTOM SHEET
═══════════════════════════════════════════════ */
.bottom-sheet {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  padding-bottom: 16px;
  animation: slideUp 0.3s ease;
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--divider);
  border-radius: 2px;
  margin: 12px auto 8px;
}

.bottom-sheet-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px 24px;
  background: none;
  border: none;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition);
  text-align: left;
}
.bottom-sheet-item:hover { background: var(--bg); }
.bottom-sheet-item .material-icons { color: var(--text-secondary); font-size: 22px; }
.bottom-sheet-item.danger { color: var(--red); }
.bottom-sheet-item.danger .material-icons { color: var(--red); }

/* ═══════════════════════════════════════════════
   LOADER
═══════════════════════════════════════════════ */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  z-index: 500;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.loader-overlay.show { display: flex; }

.loader-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--primary-xlight);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════
   BALANCE SHEET SCREEN STYLES
═══════════════════════════════════════════════ */
.bs-container {
  background: var(--surface);
  min-height: 100%;
}

.bs-header {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.bs-title h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.bs-title p {
  font-size: 12px;
  margin: 2px 0 0;
  opacity: 0.9;
}

.bs-date-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.icon-btn-small {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}
.icon-btn-small:hover { background: rgba(255,255,255,0.25); }
.icon-btn-small .material-icons { font-size: 18px; }

.bs-date-input {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
  min-width: 100px;
  text-align: center;
  font-family: inherit;
  transition: background var(--transition);
}
.bs-date-input:hover { background: rgba(255,255,255,0.3); }

/* Tabs */
.bs-tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 2px solid var(--divider);
}

.bs-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
  font-family: inherit;
  letter-spacing: 0.5px;
}
.bs-tab:hover { background: var(--primary-xlight); color: var(--primary); }
.bs-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-xlight);
}

/* Tab Content */
.bs-tab-content {
  display: none;
}
.bs-tab-content.active {
  display: block;
}

/* Balance Sheet Table */
.bs-table {
  background: var(--surface);
}

.bs-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  gap: 12px;
}

.bs-row.separator {
  border-top: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  background: var(--primary-xlight);
  margin-top: 4px;
}

.bs-label {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 400;
}

.bs-label.bold {
  font-weight: 700;
  font-size: 15px;
}

.bs-value {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  color: var(--text-primary);
}

.bs-value.blue {
  color: var(--primary);
}

.bs-value.green {
  color: var(--green);
}

.bs-value.red {
  color: var(--red);
}

.bs-value.bold {
  font-size: 15px;
  font-weight: 700;
}

.bs-input {
  text-align: right;
}

.bs-input input {
  width: 100%;
  padding: 6px 10px;
  border: 1.5px solid var(--divider);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  text-align: right;
  background: #FAFAFA;
  transition: border-color var(--transition);
}
.bs-input input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

/* Section */
.bs-section {
  margin-top: 16px;
  background: var(--surface);
}

.bs-section-title {
  background: var(--primary-xlight);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

/* Comments */
.bs-comments {
  padding: 16px;
  background: var(--surface);
  border-top: 1px solid var(--divider);
}

.bs-comment-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.bs-comment-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--divider);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  resize: vertical;
  min-height: 60px;
  transition: border-color var(--transition);
}
.bs-comment-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}

/* Footer */
.bs-footer {
  background: var(--primary);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  bottom: 0;
  border-top: 2px solid var(--primary-dark);
}

.bs-footer-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bs-footer-value {
  font-size: 16px;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════
   UTILITY CLASSES
═══════════════════════════════════════════════ */
.green { color: var(--green); }
.red   { color: var(--red); }
.bold  { font-weight: 600; }

/* ═══════════════════════════════════════════════
   RESPONSIVE – TABLET (≥ 600px)
═══════════════════════════════════════════════ */
@media (min-width: 600px) {
  .toolbar { padding: 0 16px 0 8px; }
  .toolbar-date-input { width: 110px; font-size: 13px; }
  .toolbar-date-input.small { width: 100px; }

  .entry-form { padding: 24px; }

  .bottom-nav-item { font-size: 11px; }
  .bottom-nav-item .material-icons { font-size: 24px; }

  .filter-modal { border-radius: var(--radius-lg); position: static; transform: none; }
  .bottom-sheet { border-radius: var(--radius-lg); position: static; transform: none; }
}

/* ═══════════════════════════════════════════════
   ICON BUTTON SMALL (inline in lists)
═══════════════════════════════════════════════ */
.icon-btn-sm {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: background var(--transition);
}
.icon-btn-sm:hover { background: var(--primary-xlight); }

/* ═══════════════════════════════════════════════
   RESPONSIVE – DESKTOP (≥ 960px)
═══════════════════════════════════════════════ */
@media (min-width: 960px) {
  :root {
    --toolbar-h: 64px;
    --bottom-nav-h: 0px;
  }

  /* Persistent sidebar on desktop */
  .sidebar {
    position: relative;
    transform: none !important;
    height: 100%;
    flex-shrink: 0;
    box-shadow: none;
    border-right: 1px solid var(--divider);
    overflow-y: auto;
  }

  .sidebar-overlay { display: none !important; }
  #btnMenuToggle { display: none !important; }

  #page-app {
    flex-direction: column;
    height: 100vh;
  }

  .app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
  }

  .main-content {
    padding-bottom: 0;
    flex: 1;
    min-width: 0;
  }

  .bottom-nav { display: none; }

  .toolbar-title { font-size: 18px; }
  .toolbar-subtitle { font-size: 12px; }

  .entry-form { padding: 32px; max-width: 720px; }

  .list-header-row { padding: 12px 20px; }
  .list-row { padding: 14px 20px; }
  .list-cell { font-size: 14px; }

  .report-table { display: table; }

  .login-card { padding: 48px 48px; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE – WIDE DESKTOP (≥ 1280px)
═══════════════════════════════════════════════ */
@media (min-width: 1280px) {
  :root { --sidebar-w: 300px; }

  .entry-form { max-width: 800px; }
}

/* ═══════════════════════════════════════════════
   SCROLLBAR STYLING
═══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--divider); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #BDBDBD; }

/* ═══════════════════════════════════════════════
   PRINT
═══════════════════════════════════════════════ */
@media print {
  .toolbar, .bottom-nav, .sidebar, .sidebar-overlay,
  .btn, .form-actions { display: none !important; }
  .main-content { padding: 0; }
  .report-table { display: table; }
}
