/* ============================================
   CASHFLOW DESIGN SYSTEM v1.0 (adapted from gym_app, navy+amber)
   Palette: Navy #0f3d6e + Amber #f59e0b
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #0f172a;
  background: #f1f5f9;
  line-height: 1.55;
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.3; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.layout { display: flex; min-height: 100vh; }

/* ============================================
   SIDEBAR (navy, fixed left)
   ============================================ */
.sidebar { width: 240px; background: linear-gradient(180deg, #0f3d6e 0%, #0a2d52 100%); color: #dbeafe; padding: 0; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 50; transition: transform .3s; box-shadow: 2px 0 12px rgba(15, 61, 110, 0.08); }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
.sidebar-head { padding: 22px 18px; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 10px; }
.sidebar-head .logo-mark { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #0f3d6e; width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 18px; flex-shrink: 0; box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4); }
.sidebar-head .gym-name { color: #fff; font-weight: 800; font-size: 14px; line-height: 1.2; }
.sidebar-head .gym-sub { color: #93c5fd; font-size: 10px; font-weight: 600; margin-top: 2px; text-transform: uppercase; letter-spacing: .5px; }
.sidebar-section { padding: 18px 14px 6px; color: #93c5fd; font-size: 9px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 800; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; color: #dbeafe; font-size: 14px; font-weight: 500; border-radius: 8px; margin: 2px 10px; transition: .2s; }
.sidebar-link:hover { background: rgba(255,255,255,.1); color: #fff; transform: translateX(2px); }
.sidebar-link.active { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #0f3d6e; font-weight: 800; box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3); }
.sidebar-link .ico { width: 20px; text-align: center; font-size: 16px; flex-shrink: 0; }
.sidebar-foot { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.1); position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(15, 45, 82, 0) 0%, #0a2d52 30%); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(255,255,255,.05); border-radius: 8px; }
.sidebar-user .avatar { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #0f3d6e; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.sidebar-user .info { font-size: 12px; min-width: 0; flex: 1; }
.sidebar-user .name { color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .role { color: #fbbf24; font-size: 9px; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; }
.sidebar-logout { display: block; text-align: center; padding: 9px; margin-top: 10px; background: rgba(255,255,255,.1); color: #fff; border-radius: 6px; font-size: 12px; font-weight: 700; border: none; width: 100%; transition: .2s; }
.sidebar-logout:hover { background: #dc2626; }

/* ============================================
   MAIN + TOPBAR
   ============================================ */
.main { flex: 1; margin-left: 240px; min-height: 100vh; }
.topbar { background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid #e2e8f0; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; }
.topbar-title { font-size: 18px; font-weight: 800; color: #0f3d6e; letter-spacing: -0.01em; }
.topbar-date { color: #64748b; font-size: 13px; font-weight: 500; }
.topbar-hamburger { display: none; background: #0f3d6e; color: #fff; border: none; padding: 8px 12px; border-radius: 6px; font-size: 18px; cursor: pointer; }

.content { padding: 24px 28px; max-width: 1400px; }

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.2); }
  .main { margin-left: 0; }
  .topbar-hamburger { display: inline-flex; align-items: center; }
  .topbar-date { display: none; }
  .content { padding: 16px; }
}

/* ============================================
   FLASH MESSAGES
   ============================================ */
.flash { padding: 14px 18px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.flash-success { background: linear-gradient(135deg, #d1fae5, #a7f3d0); border: 1px solid #6ee7b7; color: #065f46; }
.flash-warning { background: linear-gradient(135deg, #fef3c7, #fde68a); border: 1px solid #fcd34d; color: #92400e; }
.flash-error { background: linear-gradient(135deg, #fee2e2, #fecaca); border: 1px solid #fca5a5; color: #991b1b; }

/* ============================================
   HERO (page header)
   ============================================ */
.dash-hero { position: relative; border-radius: 16px; padding: 28px 32px; color: #fff; background: linear-gradient(135deg, #0f3d6e 0%, #0a2d52 100%); box-shadow: 0 4px 20px rgba(15, 61, 110, 0.18); overflow: hidden; margin-bottom: 20px; }
.dash-hero-bg { position: absolute; top: -40%; right: -10%; width: 480px; height: 480px; background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, transparent 70%); pointer-events: none; }
.dash-hero-bg-2 { position: absolute; bottom: -30%; left: -5%; width: 320px; height: 320px; background: radial-gradient(circle, rgba(96, 165, 250, 0.12) 0%, transparent 70%); pointer-events: none; }
.dash-eyebrow { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.85); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; backdrop-filter: blur(4px); }
.dash-eyebrow .dot { width: 6px; height: 6px; background: #f59e0b; border-radius: 50%; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.dash-title { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.dash-sub { font-size: 14px; color: rgba(255, 255, 255, 0.7); margin-top: 6px; }
.btn-amber { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #0f3d6e; font-weight: 800; font-size: 13px; padding: 10px 18px; border-radius: 10px; text-decoration: none; transition: all 0.15s; box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4); border: 0; cursor: pointer; }
.btn-amber:hover { background: linear-gradient(135deg, #fbbf24, #fcd34d); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5); }
.btn-amber:link, .btn-amber:visited { color: #0f3d6e; }
.btn-ghost-light { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.08); color: #fff; font-weight: 700; font-size: 13px; padding: 10px 18px; border-radius: 10px; text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.15); transition: all 0.15s; backdrop-filter: blur(4px); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.25); }
.btn-ghost-light:link, .btn-ghost-light:visited { color: #fff; }

/* ============================================
   KPI CARDS
   ============================================ */
.kpi-card { position: relative; background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06); border: 1px solid rgba(0, 0, 0, 0.05); transition: all 0.2s; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08); }
.kpi-amber { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); border-color: rgba(245, 158, 11, 0.25); }
.kpi-amber .kpi-value { color: #b45309; }
.kpi-amber .kpi-label { color: #92400e; }
.kpi-icon { width: 42px; height: 42px; border-radius: 10px; background: #f3f4f6; color: #6b7280; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon-blue    { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e40af; }
.kpi-icon-emerald { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #065f46; }
.kpi-icon-purple  { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #5b21b6; }
.kpi-icon-amber   { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
.kpi-icon-rose    { background: linear-gradient(135deg, #ffe4e6, #fecdd3); color: #9f1239; }
.kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; }
.kpi-value { font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; color: #0f172a; line-height: 1.1; margin-top: 6px; font-feature-settings: "tnum"; letter-spacing: -0.02em; }
.kpi-foot { font-size: 11px; color: #6b7280; margin-top: 6px; }
.kpi-foot-amber { color: #b45309; font-weight: 600; }

/* ============================================
   DASH CARD (generic content card)
   ============================================ */
.dash-card { background: #fff; border-radius: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06); border: 1px solid rgba(0, 0, 0, 0.05); overflow: hidden; }
.dash-card-head { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #f3f4f6; }
.dash-card-title { font-weight: 800; font-size: 15px; color: #0f172a; letter-spacing: -0.01em; }
.dash-card-sub { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.dash-card-body { padding: 18px 22px; }
.dash-section-title { font-size: 11px; font-weight: 800; color: #6b7280; text-transform: uppercase; letter-spacing: 0.08em; }

/* ============================================
   BUTTONS
   ============================================ */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 9px; font-size: 13px; font-weight: 700; text-decoration: none; transition: all 0.15s; border: 0; cursor: pointer; line-height: 1.2; }
.btn:link, .btn:visited { color: inherit; }
.btn-primary { background: linear-gradient(135deg, #0f3d6e, #1e5a99); color: #fff; box-shadow: 0 2px 6px rgba(15, 61, 110, 0.3); }
.btn-primary:hover { background: linear-gradient(135deg, #1e5a99, #2563eb); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 61, 110, 0.4); }
.btn-secondary { background: #fff; color: #0f3d6e; border: 1.5px solid #e2e8f0; }
.btn-secondary:hover { background: #f8fafc; border-color: #0f3d6e; }
.btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3); }
.btn-danger:hover { background: linear-gradient(135deg, #ef4444, #f87171); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: #0f3d6e; }
.btn-ghost:hover { background: #f1f5f9; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 22px; font-size: 14px; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.form-label .required { color: #dc2626; }
.form-label .optional { color: #94a3b8; font-size: 11px; font-weight: 500; }
.form-control, .form-input, .form-select { width: 100%; padding: 10px 14px; border: 1.5px solid #e2e8f0; border-radius: 9px; font-size: 14px; background: #fff; transition: all 0.15s; color: #0f172a; }
.form-control:focus, .form-input:focus, .form-select:focus { outline: none; border-color: #0f3d6e; box-shadow: 0 0 0 3px rgba(15, 61, 110, 0.1); }
.form-control::placeholder { color: #94a3b8; }
.form-help { font-size: 11px; color: #64748b; margin-top: 4px; }
.form-error { color: #dc2626; font-size: 12px; margin-top: 4px; font-weight: 500; }
.form-textarea { min-height: 100px; resize: vertical; font-family: inherit; }
textarea.form-control, textarea.form-input { min-height: 100px; resize: vertical; }

/* ============================================
   ALERTS / INFO BOXES
   ============================================ */
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; display: flex; align-items: flex-start; gap: 12px; }
.alert-info    { background: linear-gradient(135deg, #dbeafe, #bfdbfe); border-left: 4px solid #3b82f6; color: #1e3a8a; }
.alert-warning { background: linear-gradient(135deg, #fef3c7, #fde68a); border-left: 4px solid #f59e0b; color: #78350f; }
.alert-success { background: linear-gradient(135deg, #d1fae5, #a7f3d0); border-left: 4px solid #10b981; color: #064e3b; }
.alert-danger  { background: linear-gradient(135deg, #fee2e2, #fecaca); border-left: 4px solid #ef4444; color: #7f1d1d; }
.alert-icon { font-size: 18px; flex-shrink: 0; line-height: 1; }
.alert-title { font-weight: 800; margin-bottom: 2px; }
.alert-text { line-height: 1.5; }

/* ============================================
   BADGES
   ============================================ */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.badge-amber   { background: #fef3c7; color: #92400e; }
.badge-emerald { background: #d1fae5; color: #065f46; }
.badge-blue    { background: #dbeafe; color: #1e40af; }
.badge-purple  { background: #ede9fe; color: #5b21b6; }
.badge-rose    { background: #ffe4e6; color: #9f1239; }
.badge-red     { background: #fee2e2; color: #991b1b; }
.badge-mute    { background: #f3f4f6; color: #6b7280; }

/* ============================================
   AVATAR
   ============================================ */
.avatar { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; border-radius: 50%; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; border-radius: 50%; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; border-radius: 50%; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; border-radius: 50%; }
.avatar-navy  { background: linear-gradient(135deg, #0f3d6e, #1e5a99); color: #fff; }
.avatar-amber { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.avatar-emerald { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state { padding: 40px 20px; text-align: center; color: #94a3b8; }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-text { font-size: 14px; color: #9ca3af; }

/* ============================================
   STAT PILL (inline metric)
   ============================================ */
.stat-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.stat-pill-emerald { background: #d1fae5; color: #065f46; }
.stat-pill-red     { background: #fee2e2; color: #991b1b; }
.stat-pill-amber   { background: #fef3c7; color: #92400e; }
.stat-pill-blue    { background: #dbeafe; color: #1e40af; }
.stat-pill-mute    { background: #f3f4f6; color: #4b5563; }

/* ============================================
   SECTION TITLE (between sections)
   ============================================ */
.section-title { display: flex; align-items: center; gap: 8px; margin: 24px 0 12px; }
.section-title-text { font-size: 13px; font-weight: 800; color: #475569; text-transform: uppercase; letter-spacing: 0.06em; }
.section-title::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }

/* ============================================
   TABLE
   ============================================ */
.data-table { width: 100%; }
.data-table thead th { background: #f8fafc; color: #64748b; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 12px 14px; text-align: left; border-bottom: 1px solid #e2e8f0; }
.data-table tbody td { padding: 14px; border-bottom: 1px solid #f1f5f9; font-size: 14px; color: #1e293b; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: 0; }

/* ============================================
   UTILITY: TEXT, FLEX, GRID
   ============================================ */
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 22px; }
.text-3xl { font-size: 28px; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-muted { color: #64748b; }
.text-navy { color: #0f3d6e; }
.text-amber { color: #d97706; }
.text-emerald { color: #059669; }
.text-red { color: #dc2626; }
.text-mono { font-family: 'SF Mono', 'Monaco', 'Consolas', monospace; }
.text-num { font-feature-settings: "tnum"; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .dash-hero { padding: 20px 18px; }
  .content { padding: 14px; }
  .kpi-card { padding: 16px; }
  .kpi-icon { width: 36px; height: 36px; margin-bottom: 10px; }
  .kpi-icon svg { width: 18px; height: 18px; }
  .dash-card-head { padding: 14px 16px; flex-wrap: wrap; }
  .dash-card-body { padding: 14px 16px; }
  .data-table thead th, .data-table tbody td { padding: 10px; font-size: 13px; }
  .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-5 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .col-span-1, .col-span-2, .col-span-3, .col-span-4, .col-span-5, .lg\:col-span-2, .lg\:col-span-3 { grid-column: 1 / -1; }
}
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
}
@media (min-width: 1280px) {
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .xl\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ============================================
   DASH CARD FOOT (pagination footer)
   ============================================ */
.dash-card-foot {
    padding: 14px 16px;
    border-top: 1.5px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 14px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================
   TRX (transaction list) - avatar + row + amount
   ============================================ */
.trx-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #0f3d6e, #1e5a99);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.trx-row { padding: 12px 0; }
.trx-row:hover { background: #f9fafb; }
.trx-amount { font-weight: 700; }

/* ============================================
   DATA TABLE TFOOT (totals row)
   ============================================ */
.data-table tfoot td { background: #f8fafc; border-top: 2px solid #e2e8f0; font-weight: 700; }

/* ============================================
   GRID COL-SPAN HELPERS
   ============================================ */
.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-5 { grid-column: span 5 / span 5; }
/* ============================================================
   CASHFLOW ADDITIONS — chart, toggle, upload, lightbox, login
   ============================================================ */

/* Segmented control (minggu/bulan, masuk/keluar) */
.seg { display: inline-flex; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 10px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg a, .seg button {
  border: 0; background: transparent; color: #64748b; font-size: 13px; font-weight: 700;
  padding: 7px 14px; border-radius: 8px; cursor: pointer; transition: .15s; display: inline-flex; align-items: center; gap: 6px;
}
.seg a:hover, .seg button:hover { color: #0f3d6e; }
.seg .active { background: #fff; color: #0f3d6e; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg.seg-amber .active { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #0f3d6e; }

/* Type toggle (besar, untuk form input cepat) */
.type-toggle { display: flex; gap: 10px; }
.type-toggle label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-radius: 12px; border: 2px solid #e2e8f0; background: #fff;
  font-size: 15px; font-weight: 800; color: #64748b; cursor: pointer; transition: .15s;
  position: relative;
}
.type-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.type-toggle label:hover { border-color: #cbd5e1; }
.type-toggle label.on-in { border-color: #10b981; background: #ecfdf5; color: #065f46; }
.type-toggle label.on-out { border-color: #ef4444; background: #fef2f2; color: #991b1b; }
.type-toggle label.on-transfer { border-color: #0f3d6e; background: #eff6ff; color: #0f3d6e; }

/* Nominal besar */
.amount-wrap { position: relative; }
.amount-wrap .prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 22px; font-weight: 800; color: #94a3b8; pointer-events: none;
}
.amount-input {
  width: 100%; padding: 14px 14px 14px 44px; font-size: 26px; font-weight: 800;
  border: 2px solid #e2e8f0; border-radius: 12px; color: #0f3d6e; letter-spacing: -0.01em;
  font-feature-settings: "tnum"; background: #fff; box-sizing: border-box;
}
.amount-input:focus { outline: none; border-color: #0f3d6e; box-shadow: 0 0 0 4px rgba(15,61,110,.1); }
.amount-input::placeholder { color: #cbd5e1; font-weight: 700; }

/* Bar chart (arus harian) */
.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; position: relative; }
.bar-col .bars { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; }
.bar { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-in { background: linear-gradient(180deg, #34d399, #059669); }
.bar-out { background: linear-gradient(180deg, #fca5a5, #dc2626); }
.bar-none { background: #e5e7eb; }
.bar-col.today .bar { outline: 2px solid rgba(245,158,11,.55); outline-offset: 1px; }
.bar-col:hover::after {
  content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: #0f172a; color: #fff; font-size: 11px; padding: 5px 8px; border-radius: 6px; white-space: nowrap; z-index: 5;
  margin-bottom: 6px;
}
.chart-legend { display: flex; gap: 14px; font-size: 11px; color: #64748b; font-weight: 600; margin-top: 10px; }
.chart-legend .dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }

/* Share bar untuk rekap kategori */
.share-track { background: #f1f5f9; border-radius: 999px; height: 8px; overflow: hidden; min-width: 90px; }
.share-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0f3d6e, #1e5a99); }
.share-fill.out { background: linear-gradient(90deg, #ef4444, #f97316); }

/* Delta pill (vs periode sebelumnya) */
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.delta-up { background: #d1fae5; color: #065f46; }
.delta-down { background: #fee2e2; color: #991b1b; }
.delta-flat { background: #f3f4f6; color: #6b7280; }

/* Upload nota */
.upload-zone {
  border: 2px dashed #cbd5e1; border-radius: 12px; padding: 18px; text-align: center;
  background: #f8fafc; cursor: pointer; transition: .15s; display: block;
}
.upload-zone:hover { border-color: #0f3d6e; background: #f1f5f9; }
.upload-zone input { display: none; }
.upload-zone .uz-title { font-size: 14px; font-weight: 800; color: #0f3d6e; }
.upload-zone .uz-sub { font-size: 12px; color: #64748b; margin-top: 3px; }
.upload-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.upload-preview .up-item {
  width: 76px; height: 76px; border-radius: 10px; overflow: hidden; border: 1px solid #e2e8f0;
  background: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #64748b;
  position: relative;
}
.upload-preview .up-item img { width: 100%; height: 100%; object-fit: cover; }

/* Nota / gallery */
.receipt-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.receipt-thumb {
  width: 110px; height: 110px; border-radius: 12px; overflow: hidden; border: 1px solid #e2e8f0;
  background: #f8fafc; display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: .15s; position: relative;
}
.receipt-thumb:hover { border-color: #0f3d6e; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,61,110,.15); }
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.receipt-thumb .file-ico { font-size: 30px; }
.receipt-thumb .file-tag { position: absolute; bottom: 4px; right: 4px; font-size: 9px; font-weight: 800; background: #0f3d6e; color: #fff; padding: 1px 5px; border-radius: 4px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(2,6,23,.88); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 10px; background: #fff; }
.lightbox .lb-close {
  position: absolute; top: 18px; right: 22px; background: rgba(255,255,255,.12); color: #fff;
  border: 0; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer;
}
.lightbox .lb-meta { position: absolute; bottom: 22px; color: #cbd5e1; font-size: 13px; text-align: center; }

/* Pagination */
.pg { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pg a, .pg span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px;
  padding: 0 10px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff;
  font-size: 13px; font-weight: 700; color: #0f3d6e; text-decoration: none;
}
.pg a:hover { border-color: #0f3d6e; background: #f8fafc; }
.pg .active { background: #0f3d6e; border-color: #0f3d6e; color: #fff; }
.pg .disabled { color: #cbd5e1; pointer-events: none; }

/* Login page */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(245,158,11,.16), transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(59,130,246,.14), transparent 45%),
    linear-gradient(135deg, #0f3d6e 0%, #0a2d52 100%);
}
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 30px 28px; box-shadow: 0 24px 60px rgba(2,6,23,.35); }
.login-logo {
  width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #0f3d6e; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 24px;
  margin-bottom: 14px; box-shadow: 0 6px 16px rgba(245,158,11,.35);
}
.login-title { font-size: 22px; font-weight: 800; color: #0f3d6e; letter-spacing: -0.02em; }
.login-sub { font-size: 13px; color: #64748b; margin-top: 4px; }

/* Kartu akun */
.account-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.account-row:last-child { border-bottom: 0; }
.account-ico {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; background: #eff6ff; color: #0f3d6e; flex-shrink: 0;
}

/* Keterangan samping (label + nilai) */
.meta-list { display: flex; flex-direction: column; gap: 10px; }
.meta-item { display: flex; justify-content: space-between; gap: 14px; font-size: 14px; padding-bottom: 10px; border-bottom: 1px dashed #e2e8f0; }
.meta-item:last-child { border-bottom: 0; padding-bottom: 0; }
.meta-k { color: #64748b; font-weight: 600; }
.meta-v { color: #0f172a; font-weight: 700; text-align: right; }

/* Nominal besar untuk detail */
.big-amount { font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -0.02em; font-feature-settings: "tnum"; }
.big-amount.in { color: #059669; }
.big-amount.out { color: #dc2626; }
.big-amount.transfer { color: #0f3d6e; }

/* Form void (tersembunyi sampai diklik) */
.void-box { display: none; margin-top: 12px; }
.void-box.open { display: block; }

/* Catatan kecil */
.micro { font-size: 11px; color: #94a3b8; }
.pill-note { display: inline-flex; align-items: center; gap: 6px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }

/* Form 2 kolom */
.form-2col { display: flex; flex-wrap: wrap; gap: 16px; }
.form-2col > .col { flex: 1 1 260px; min-width: 0; }

@media (max-width: 640px) {
  .amount-input { font-size: 22px; padding-left: 40px; }
  .type-toggle label { padding: 12px 8px; font-size: 14px; }
  .bar-chart { height: 110px; }
  .receipt-thumb { width: 84px; height: 84px; }
}
