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

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --secondary: #7c3aed;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #1e293b;
  --darker: #0f172a;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --sidebar-width: 230px;
  --header-height: 64px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.1), 0 4px 8px rgba(0,0,0,.06);
  --transition: all .25s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--dark);
  min-height: 100vh;
  display: flex;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--darker) 0%, var(--dark) 100%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header h1 i {
  color: var(--primary-light);
}

.sidebar-header .sub {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 4px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 8px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 4px 15px rgba(79,70,229,.35);
}

.nav-item i {
  width: 16px;
  text-align: center;
  font-size: 13px;
}

/* ===== NAV GROUP (Collapsible) ===== */
.nav-group { margin-bottom: 2px; }

.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-group-header:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.nav-group-header span { display: flex; align-items: center; gap: 8px; }

.nav-group-header i { width: 16px; text-align: center; font-size: 13px; }

.nav-group-arrow { font-size: 10px !important; width: auto !important; transition: transform .2s ease; }

.nav-group.collapsed .nav-group-arrow { transform: rotate(-90deg); }

.nav-group-items { overflow: hidden; max-height: 600px; transition: max-height .3s ease; padding-left: 4px; }

.nav-group.collapsed > .nav-group-items { max-height: 0; }

.nav-sub-item { font-size: 11px !important; padding: 5px 10px !important; margin-bottom: 1px !important; }

.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11px;
  color: var(--gray-500);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
}

.top-bar {
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
}

.top-bar .date-display {
  font-size: 13px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-content {
  padding: 28px 32px;
}

/* ===== STATS CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  margin-top: 4px;
}

.stat-card .stat-value.positive { color: var(--success); }
.stat-card .stat-value.negative { color: var(--danger); }

/* ===== CARDS ===== */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 24px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 2px 10px rgba(79,70,229,.25);
}

.btn-primary:hover { box-shadow: 0 4px 16px rgba(79,70,229,.35); transform: translateY(-1px); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: .9; transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; transform: translateY(-1px); }

.btn-warning { background: var(--warning); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ===== TABLES ===== */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table thead {
  background: var(--gray-50);
}

table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
  border: 1px solid var(--gray-400);
}

table td {
  padding: 12px 16px;
  border: 1px solid var(--gray-400);
  color: var(--gray-700);
}

table tbody tr:hover {
  background: var(--gray-50);
}

table tbody tr:last-child td {
  border-bottom: 1px solid var(--gray-200);
}

.amount { font-family: 'JetBrains Mono', 'Fira Code', monospace; text-align: right; font-weight: 500; }
.amount.debit { color: var(--danger); }
.amount.credit { color: var(--success); }

.currency-group-header td {
  background: var(--primary) !important;
  font-size: 14px;
  padding: 8px 12px !important;
  text-align: center;
  font-weight: 700;
  color: #fff !important;
  letter-spacing: 0.5px;
}
.currency-subtotal td {
  background: var(--gray-50) !important;
  border-top: 1px solid var(--gray-300);
  border-bottom: 1px solid var(--gray-300);
  font-size: 12px;
}

#dbb-table th,
#dbb-table td,
#dsb-table th,
#dsb-table td {
  padding: 6px 10px;
  font-size: 12px;
}
#dbb-table th,
#dsb-table th {
  padding: 8px 10px;
  font-size: 11px;
}

.text-muted { color: var(--gray-500); }
.text-right { text-align: right; }
.text-center { text-align: center; }

.bank-link { color: var(--primary); font-size: 12px; text-decoration: none; cursor: pointer; }
.bank-link:hover { text-decoration: underline; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* ===== SEARCH ===== */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box input {
  padding: 8px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  width: 220px;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-primary { background: rgba(79,70,229,.1); color: var(--primary); }
.badge-success { background: rgba(16,185,129,.1); color: var(--success); }
.badge-danger { background: rgba(239,68,68,.1); color: var(--danger); }
.badge-cash { background: rgba(16,185,129,.1); color: var(--success); }
.badge-cheque { background: rgba(245,158,11,.1); color: #92400e; }
.badge-bank { background: rgba(59,130,246,.1); color: #1e40af; }
.badge-card { background: rgba(168,85,247,.1); color: #6b21a8; }
.badge-okbl { background: rgba(165,252,154,.3); color: #15803d; }

/* ===== DOUBLE-ENTRY DISPLAY ===== */
.tx-debit td { border-bottom: none !important; }
.tx-debit + .tx-credit td { padding-top: 4px !important; border-top: none !important; }
.tx-credit td { padding-top: 2px !important; background: var(--gray-50); }
.tx-credit .tx-acno { font-size: 12px; color: var(--gray-400); }
.tx-debit .tx-acno { font-size: 11px; color: var(--gray-400); }
.tx-num { text-align: center; color: var(--gray-400); font-size: 11px; vertical-align: middle; }
.tx-actions { white-space: nowrap; text-align: center; vertical-align: middle; }

.totals-row.balanced td { border-top: 2px solid var(--success) !important; }
.totals-row.unbalanced td { border-top: 2px solid var(--danger) !important; }

/* ===== ADD ROW (INLINE EDIT) ===== */
.add-row { background: var(--gray-50) !important; }
.add-row td { padding: 8px 10px !important; vertical-align: middle; }
.add-row .form-control {
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 6px;
  height: 34px;
  min-width: 0;
}

/* ===== AUTOCOMPLETE DROPDOWN ===== */
.autocomplete-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  max-height: 280px;
  overflow-y: auto;
  margin-top: 2px;
}
.ac-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  max-height: 280px;
  overflow-y: auto;
  margin-top: 2px;
}
.ac-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--gray-100);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--gray-50); }
.ac-name { font-weight: 600; font-size: 13px; color: var(--dark); }
.ac-no { font-size: 12px; color: var(--gray-400); font-family: monospace; }

/* ===== TOTALS ROW ===== */
.totals-row { background: var(--gray-50) !important; font-weight: 700; }
.totals-row td { border-top: 2px solid var(--gray-300) !important; color: var(--dark) !important; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

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

.modal {
  background: #fff;
  border-radius: 16px;
  width: 520px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,.25);
  animation: modalIn .25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 { font-size: 17px; font-weight: 600; }

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--gray-100);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--gray-500);
  transition: var(--transition);
}

.modal-close:hover { background: var(--gray-200); }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}

.empty-state i { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; }

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* ===== HAMBURGER MENU ===== */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--gray-600);
  cursor: pointer;
  padding: 4px;
}
.hamburger:hover { color: var(--dark); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: 4px 0 24px rgba(0,0,0,.2);
  }
  .sidebar.open { transform: translateX(0); }

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

  .top-bar {
    padding: 0 12px;
    height: 56px;
  }
  .top-bar h2 { font-size: 15px; }
  .top-bar .date-display { font-size: 11px; gap: 4px; }
  .top-bar .date-display i { font-size: 12px; }

  .page-content { padding: 12px; }

  .card-header { padding: 14px 16px; }
  .card-header h3 { font-size: 14px; }
  .card-body { padding: 16px; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }
  .stat-card { padding: 14px 16px; }
  .stat-card .stat-icon { width: 36px; height: 36px; font-size: 16px; }
  .stat-card .stat-label { font-size: 11px; }
  .stat-card .stat-value { font-size: 18px; }

  .form-row { grid-template-columns: 1fr; gap: 10px; }
  .form-control { font-size: 16px; } /* prevent iOS zoom */

  /* Override inline fixed widths on mobile */
  .card-body input[type="date"],
  .card-body input[type="text"],
  .card-body .form-control {
    width: 100% !important;
    min-width: 0 !important;
  }
  .card-body select.form-control { width: 100% !important; }

  /* Filter bars stack vertically */
  .card-body > div[style*="flex-wrap:wrap"] {
    flex-direction: column;
    align-items: stretch !important;
  }
  .card-body > div[style*="flex-wrap:wrap"] > .form-group {
    width: 100%;
    margin-bottom: 8px !important;
  }
  /* Card header button groups wrap better */
  .card-header > div[style*="flex-wrap:wrap"] { gap: 6px !important; }

  /* Table improvements */
  .table-container {
    margin: 0 -8px;
    padding: 0 8px;
  }
  table { font-size: 12px; }
  table th, table td { padding: 8px 10px; }
  table th { font-size: 10px; }
  .action-btns button { padding: 6px 10px; font-size: 13px; }

  /* Add row mobile - stack inputs vertically */
  #db-add-row td, #tmn-add-row td { display: block; width: 100% !important; padding: 4px 8px !important; border-bottom: 1px solid var(--gray-200) !important; }
  #db-add-row td:first-child, #tmn-add-row td:first-child { display: none; }
  #db-add-row .form-control, #tmn-add-row .form-control { width: 100% !important; }
  #db-add-row td:nth-child(2) input, #tmn-add-row td:nth-child(2) input { width: 100% !important; }
  #db-add-row td:nth-child(5) input, #db-add-row td:nth-child(6) input,
  #tmn-add-row td:nth-child(5) input, #tmn-add-row td:nth-child(6) input,
  #tmn-add-row td:nth-child(7) input, #tmn-add-row td:nth-child(8) input { width: 100% !important; }
  #db-add-row td:nth-child(8), #tmn-add-row td:last-child { text-align: center !important; }
  #tmn-add-row td:last-child { text-align: center !important; }

  /* Double entry mobile */
  .tx-credit td { padding-top: 6px !important; padding-bottom: 6px !important; }
  .tx-credit td:nth-child(1),
  .tx-credit td:nth-child(7),
  .tx-credit td:nth-child(8) { display: none; }
  .tx-debit td:nth-child(6) { display: none; }

  /* Modal full-screen on mobile */
  .modal {
    width: 100%;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .modal-body { flex: 1; overflow-y: auto; }
  .modal-overlay.open { align-items: flex-end; }
  .modal-overlay { align-items: flex-end; }
  @keyframes modalIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Navigation */
  .sidebar-nav { padding: 12px 8px; }
  .nav-item, .nav-group-header { padding: 10px 12px; font-size: 13px; }
  .nav-sub-item { padding: 8px 12px !important; font-size: 12px !important; }
  .nav-group-items { padding-left: 4px; }

  /* Dashboard sub-grids */
  .stats-grid[style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
  }
  .stats-grid[style*="grid-template-columns:repeat(3,1fr)"] > div {
    padding: 10px !important;
  }
  .stats-grid[style*="grid-template-columns:repeat(3,1fr)"] > div:not(:last-child) {
    border-bottom: 1px solid var(--gray-200);
    border-right: none !important;
  }

  /* Dashboard 2-col balance sheet on mobile */
  .card-body > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Sidebar footer */
  .sidebar-footer { padding: 12px 16px; }

  /* Toast smaller on mobile */
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  .toast {
    min-width: auto;
    font-size: 13px;
    padding: 12px 16px;
  }

  /* Ledger account details section */
  .card-body > div[style*="display:grid;grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Balance sheet layout */
  .card-body > div[style*="display:grid"][style*="1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Search box */
  .search-box input { width: 140px; }

  /* Ledger info grid */
  .card-body > div[style*="display:flex"][style*="gap:24px"],
  .card-body > div[style*="display:flex"][style*="gap:32px"] {
    flex-direction: column;
    gap: 8px !important;
  }

  /* Print hidden for toggle */
  .btn-logout { font-size: 11px !important; padding: 5px 10px !important; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card .stat-value { font-size: 20px; }
  .top-bar h2 { font-size: 13px; }
  .page-content { padding: 8px; }
  .card-header { padding: 12px 12px; }
  .card-body { padding: 12px; }
  table th, table td { padding: 6px 8px; }
  .sidebar { width: 260px; }
}

/* ===== LOADING ===== */

/* Report table compact */
#dbr-table th, #dbr-table td,
#db-table th, #db-table td,
#tmn-db-table th, #tmn-db-table td,
#fc-db-table th, #fc-db-table td {
  padding: 4px 6px !important;
  font-size: 12px;
}
#dbr-table th,
#db-table th,
#tmn-db-table th,
#fc-db-table th {
  font-size: 10px;
  padding: 4px 6px !important;
}
#dbr-table .tx-acno,
#db-table .tx-acno,
#tmn-db-table .tx-acno,
#fc-db-table .tx-acno {
  font-size: 10px;
}
#dbr-table .tx-actions button,
#db-table .tx-actions button,
#tmn-db-table .tx-actions button,
#fc-db-table .tx-actions button {
  padding: 2px 6px;
  font-size: 11px;
}
.btn-edit {
  background: rgba(79,70,229,.1);
  color: var(--primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
  transition: var(--transition);
}
.btn-edit:hover { background: rgba(79,70,229,.2); }
.btn-delete {
  background: rgba(239,68,68,.1);
  color: var(--danger);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
  transition: var(--transition);
}
.btn-delete:hover { background: rgba(239,68,68,.2); }
.loading {
  text-align: center;
  padding: 32px;
  color: var(--gray-400);
}

.loading i { font-size: 24px; animation: spin 1s linear infinite; }

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

/* ===== NO TRANSACTIONS ===== */
.empty-row td { text-align: center; color: var(--gray-400); padding: 32px; }

/* ===== ACTION BUTTONS IN TABLE ===== */
.action-btns { display: flex; gap: 4px; }
.action-btns button {
  padding: 4px 8px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
}
.action-btns .btn-edit { background: rgba(79,70,229,.1); color: var(--primary); }
.action-btns .btn-edit:hover { background: rgba(79,70,229,.2); }
.action-btns .btn-delete { background: rgba(239,68,68,.1); color: var(--danger); }
.action-btns .btn-delete:hover { background: rgba(239,68,68,.2); }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  animation: slideInRight .3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.exit { animation: slideOutRight .3s ease forwards; }

@keyframes slideOutRight {
  to { opacity: 0; transform: translateX(100px); }
}

/* ===== PRINT STYLES ===== */
@media print {
  body * { visibility: hidden; }
  #bs-report, #bs-report * { visibility: visible; }
  #bs-report { position: absolute; left: 0; top: 0; width: 100%; }
  #tmn-report, #tmn-report * { visibility: visible; }
  #tmn-report { position: absolute; left: 0; top: 0; width: 100%; }
  #tmn-db-report, #tmn-db-report * { visibility: visible; }
  #tmn-db-report { position: absolute; left: 0; top: 0; width: 100%; }
  #db-report, #db-report * { visibility: visible; }
  #db-report { position: absolute; left: 0; top: 0; width: 100%; }
  #lbs-report, #lbs-report * { visibility: visible; }
  #lbs-report { position: absolute; left: 0; top: 0; width: 100%; }
  #tmn-ledger-report, #tmn-ledger-report * { visibility: visible; }
  #tmn-ledger-report { position: absolute; left: 0; top: 0; width: 100%; }
  .sidebar, .top-bar, .card-header .btn:not(.btn-print-keep), .card-header div:last-child,
  #bs-card .card-header div:last-child, #tmn-card .card-header div:last-child,
  #tmn-db-card .card-header div:last-child, #db-card .card-header div:last-child { display: none !important; }
  #bs-card .card-header h3, #tmn-card .card-header h3,
  #tmn-db-card .card-header h3, #db-card .card-header h3 { visibility: hidden; }
}
