/* ============================================================
   Income & Expense — Custom Styles v2
   Mobile-first, app-like font sizes
   ============================================================ */

:root {
  --sidebar-width: 220px;
  --sidebar-bg: #1565C0;
  --topbar-h: 56px;
  --blue: #1565C0;
  --green: #2E7D32;
  --red: #B71C1C;
  --font-base: 14px;       /* mobile app baseline */
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Body ── */
body {
  background: #f0f4f8;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: var(--font-base);
  line-height: 1.5;
  color: #1a1d2e;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  overflow-y: auto;
  z-index: 1040;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  font-size: 15px; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.sidebar-brand i { font-size: 20px; }
.sidebar-section {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,.45);
  text-transform: uppercase; letter-spacing: .9px;
  padding: 14px 20px 5px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  font-size: 13.5px; color: rgba(255,255,255,.82);
  text-decoration: none; transition: background .15s;
}
.sidebar-link i { font-size: 15px; }
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255,255,255,.17); color: #fff;
}

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

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 1030;
  background: #fff; border-bottom: 1px solid #dee2e6;
  padding: 0 20px;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-title { font-size: 15px; font-weight: 600; color: #1a1d2e; }

/* ── Page body ── */
.page-body { padding: 20px; flex: 1; }

/* ── Cards ── */
.stat-card {
  border-radius: 12px; border: 1px solid #e0e4ee;
  background: #fff; padding: 14px 16px;
}
.stat-card .label { font-size: 12px; color: #6c757d; margin-bottom: 3px; }
.stat-card .value { font-size: 20px; font-weight: 700; }

.ie-card {
  background: #fff; border: 1px solid #e0e4ee; border-radius: 12px;
}

/* ── Txn icon circle ── */
.txn-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

/* ── Type toggle ── */
.type-toggle { display: flex; gap: 8px; }
.type-toggle a {
  padding: 7px 20px; border-radius: 8px; font-size: 13px; font-weight: 600;
  text-decoration: none; opacity: .55; transition: opacity .15s;
}
.type-toggle a.active { opacity: 1; }
.type-toggle a.income  { background:#E8F5E9; color:#1B5E20; border:1.5px solid #66BB6A; }
.type-toggle a.expense { background:#FFEBEE; color:#B71C1C; border:1.5px solid #EF9A9A; }

/* ── Tables ── */
.table th { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #6c757d; }
.table td { font-size: 13.5px; vertical-align: middle; }

/* ── ADD/EDIT FORM — modal & page consistent font ── */
.form-label        { font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-control,
.form-select       { font-size: 14px; }
.form-control-lg,
.input-group-lg .form-control { font-size: 16px; }
.btn               { font-size: 14px; }
.btn-lg            { font-size: 15px; }
.btn-sm            { font-size: 12.5px; }

/* ── Modal overrides ── */
.modal-content     { border-radius: 16px; border: none; }
.modal-header      { border-radius: 16px 16px 0 0; padding: 14px 20px; }
.modal-body        { padding: 20px; }
.modal-footer      { padding: 14px 20px; border-top: 1px solid #e4e8f0; }

/* ── Default badge on account ── */
.badge-default {
  font-size: 10px; padding: 2px 7px;
  background: #1565C0; color: #fff;
  border-radius: 20px; font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-body { padding: 14px; }
  :root { --font-base: 13.5px; }
}
@media (max-width: 576px) {
  :root { --font-base: 13px; }
  .stat-card .value { font-size: 17px; }
  .topbar { padding: 0 14px; }
  .modal-dialog { margin: 8px; }
}
