/* ============================================================
   1CRTracker — App Shell Design System
   Same tokens as the marketing site: black bg, #00E676 accent,
   Poppins, rounded-card minimal-premium look.
   ============================================================ */

:root{
  --bg:#000000;
  --primary:#00E676;
  --primary-dim: rgba(0,230,118,0.12);
  --primary-dimmer: rgba(0,230,118,0.06);
  --secondary:#1A1A1A;
  --panel:#141414;
  --text:#FFFFFF;
  --text-dim: rgba(255,255,255,0.62);
  --text-dimmer: rgba(255,255,255,0.38);
  --border:#2A2A2A;
  --danger:#FF5C5C;
  --danger-dim: rgba(255,92,92,0.12);
  --warn:#FFC24B;
  --radius:18px;
  --sidebar-w:260px;
}
*{margin:0;padding:0;box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  background:var(--bg);
  color:var(--text);
  font-family:'Poppins',sans-serif;
  font-size:14.5px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
a{text-decoration:none;color:inherit;}
ul{list-style:none;}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit;}
input,select,textarea{font-family:inherit;color:inherit;}
img,svg{display:block;}
::selection{background:var(--primary); color:#000;}
a:focus-visible, button:focus-visible, input:focus-visible{outline:2px solid var(--primary); outline-offset:2px;}

/* ============ Ambient glow (used on auth screens) ============ */
.glow{
  position:fixed; width:900px; height:900px;
  background: radial-gradient(circle, rgba(0,230,118,0.10) 0%, rgba(0,230,118,0) 70%);
  top:-380px; left:50%; transform:translateX(-50%);
  pointer-events:none; z-index:0;
}

/* ============ Buttons ============ */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 22px; border-radius:12px;
  font-size:14px; font-weight:600;
  transition: transform .2s cubic-bezier(.2,.9,.3,1), box-shadow .2s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
  white-space:nowrap;
}
.btn-primary{ background:var(--primary); color:#000; }
.btn-primary:hover{ transform:translateY(-2px); box-shadow:0 10px 28px rgba(0,230,118,0.3); }
.btn-ghost{ color:var(--text); border:1px solid var(--border); background:rgba(255,255,255,0.02); }
.btn-ghost:hover{ border-color:rgba(255,255,255,0.3); }
.btn-danger-ghost{ color:var(--danger); border:1px solid var(--danger-dim); background:var(--danger-dim); }
.btn-danger-ghost:hover{ background:rgba(255,92,92,0.18); }
.btn-sm{ padding:8px 14px; font-size:13px; border-radius:10px; }
.btn-block{ width:100%; }
.btn-icon{
  width:36px;height:36px;border-radius:10px;
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--border); background:rgba(255,255,255,0.02);
  transition: border-color .2s ease, color .2s ease;
}
.btn-icon:hover{border-color:rgba(255,255,255,0.3);}
.btn[disabled]{opacity:0.5; pointer-events:none;}

/* ============ Forms ============ */
.field{ display:flex; flex-direction:column; gap:8px; margin-bottom:20px; }
.field label{ font-size:13px; font-weight:500; color:var(--text-dim); }
.field .hint{ font-size:12px; color:var(--text-dimmer); }
.input, .select{
  width:100%; padding:13px 16px;
  background:var(--panel); border:1px solid var(--border); border-radius:12px;
  color:var(--text); font-size:14.5px;
  transition: border-color .2s ease, background .2s ease;
}
.input::placeholder{ color:var(--text-dimmer); }
.input:focus, .select:focus{ border-color:var(--primary); background:#0f0f0f; outline:none; }
.select{ appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 14px center; background-size:16px; padding-right:40px;}
.input-icon-wrap{ position:relative; }
.input-icon-wrap .input{ padding-left:44px; }
.input-icon-wrap svg{ position:absolute; left:15px; top:50%; transform:translateY(-50%); width:18px;height:18px; stroke:var(--text-dimmer); }
.checkbox-row{ display:flex; align-items:center; gap:10px; font-size:13.5px; color:var(--text-dim); }
.checkbox-row input{ width:16px;height:16px; accent-color:var(--primary); }

/* Toggle switch */
.toggle{ position:relative; width:44px; height:25px; border-radius:100px; background:#2A2A2A; border:1px solid var(--border); flex-shrink:0; transition: background .2s ease; }
.toggle::after{ content:''; position:absolute; top:2px; left:2px; width:19px; height:19px; border-radius:50%; background:#888; transition: transform .2s ease, background .2s ease; }
.toggle.on{ background:var(--primary-dim); border-color:var(--primary); }
.toggle.on::after{ transform:translateX(19px); background:var(--primary); }

/* Goal chips (signup) */
.goal-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.goal-chip{
  border:1px solid var(--border); background:var(--panel); border-radius:14px;
  padding:18px 10px; text-align:center; cursor:pointer;
  transition: all .2s ease;
}
.goal-chip:hover{ border-color:rgba(0,230,118,0.4); }
.goal-chip.active{ border-color:var(--primary); background:var(--primary-dim); box-shadow:0 0 0 1px var(--primary) inset; }
.goal-chip .amt{ font-size:16px; font-weight:700; }
.goal-chip .lbl{ font-size:11px; color:var(--text-dimmer); margin-top:2px; }

/* ============ App shell ============ */
.app{ display:flex; min-height:100vh; }

.sidebar{
  width:var(--sidebar-w); flex-shrink:0;
  background:#050505; border-right:1px solid var(--border);
  display:flex; flex-direction:column;
  position:fixed; top:0; left:0; bottom:0; z-index:50;
  transition: transform .3s ease;
}
.sidebar-brand{ display:flex; align-items:center; gap:10px; padding:26px 24px 22px; }
.logo-mark{
  width:32px;height:32px;border-radius:10px; background:#0a0a0a; border:1px solid var(--border);
  display:flex;align-items:center;justify-content:center; position:relative; box-shadow:0 0 18px rgba(0,230,118,0.22);
}
.logo-mark svg{ width:32px;height:32px; position:absolute; inset:0; }
.logo-mark span{ position:relative; font-size:14px; font-weight:800; color:#fff; z-index:1; }
.sidebar-brand .brand-name{ font-weight:700; font-size:16.5px; letter-spacing:-0.02em; }

.sidebar-nav{ flex:1; padding:10px 14px; display:flex; flex-direction:column; gap:3px; overflow-y:auto; }
.nav-item{
  display:flex; align-items:center; gap:12px;
  padding:11px 14px; border-radius:12px;
  font-size:14px; font-weight:500; color:var(--text-dim);
  transition: background .2s ease, color .2s ease;
}
.nav-item svg{ width:19px;height:19px; stroke:currentColor; flex-shrink:0; }
.nav-item:hover{ background:rgba(255,255,255,0.04); color:var(--text); }
.nav-item.active{ background:var(--primary-dim); color:var(--primary); }
.nav-divider{ height:1px; background:var(--border); margin:14px 10px; }
.nav-label{ font-size:11px; font-weight:600; color:var(--text-dimmer); text-transform:uppercase; letter-spacing:0.06em; padding:10px 14px 4px; }

.sidebar-plan{ margin:14px; padding:16px; border:1px solid var(--border); border-radius:16px; background:var(--panel); }
.plan-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.plan-name{ font-size:12.5px; font-weight:700; letter-spacing:0.03em; }
.plan-badge{ font-size:10px; font-weight:700; padding:3px 9px; border-radius:100px; background:var(--primary-dim); color:var(--primary); }
.plan-stat{ margin-bottom:10px; }
.plan-stat-row{ display:flex; justify-content:space-between; font-size:11.5px; color:var(--text-dimmer); margin-bottom:6px; }
.plan-track{ height:6px; border-radius:100px; background:#262626; overflow:hidden; }
.plan-fill{ height:100%; border-radius:100px; background:linear-gradient(90deg,#00b85f,var(--primary)); }

.sidebar-footer{ padding:14px; }

/* Topbar + content */
.main{ flex:1; margin-left:var(--sidebar-w); display:flex; flex-direction:column; min-height:100vh; }
.topbar{
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 32px; border-bottom:1px solid var(--border);
  background:rgba(0,0,0,0.75); backdrop-filter:blur(14px);
}
.topbar-title h1{ font-size:20px; font-weight:700; letter-spacing:-0.02em; }
.topbar-title p{ font-size:12.5px; color:var(--text-dimmer); margin-top:2px; }
.topbar-right{ display:flex; align-items:center; gap:14px; }
.search-box{ display:flex; align-items:center; gap:10px; padding:9px 14px; border:1px solid var(--border); border-radius:10px; background:var(--panel); min-width:220px; }
.search-box svg{ width:16px;height:16px; stroke:var(--text-dimmer); flex-shrink:0; }
.search-box input{ background:transparent; border:none; outline:none; font-size:13.5px; color:var(--text); width:100%; }
.mobile-toggle{ display:none; flex-direction:column; gap:5px; padding:6px; }
.mobile-toggle span{ width:20px;height:2px;background:var(--text);border-radius:2px; }

.user-menu{ display:flex; align-items:center; gap:10px; padding:6px 10px 6px 6px; border-radius:12px; border:1px solid var(--border); background:var(--panel); position:relative; }
.dropdown-menu{ display:none; position:absolute; top:calc(100% + 10px); right:0; min-width:190px; background:#0d0d0d; border:1px solid var(--border); border-radius:14px; padding:8px; box-shadow:0 20px 50px rgba(0,0,0,0.5); z-index:60; }
.dropdown-menu.open{ display:block; }
.dropdown-menu a{ display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:9px; font-size:13.5px; color:var(--text-dim); }
.dropdown-menu a:hover{ background:rgba(255,255,255,0.05); color:var(--text); }
.dropdown-menu a svg{ width:15px;height:15px; stroke:currentColor; }
.dropdown-menu .dd-divider{ height:1px; background:var(--border); margin:6px 4px; }
.avatar{ width:30px;height:30px;border-radius:50%; background:linear-gradient(145deg,var(--primary),#00713a); display:flex;align-items:center;justify-content:center; font-size:12.5px; font-weight:700; color:#000; }
.user-menu .uname{ font-size:13.5px; font-weight:500; }
.user-menu svg{ width:14px;height:14px; stroke:var(--text-dimmer); }

.content{ padding:32px; flex:1; }
.content-narrow{ max-width:640px; }

/* ============ Cards / stats ============ */
.stat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; margin-bottom:24px; }
.card{ background:var(--secondary); border:1px solid var(--border); border-radius:var(--radius); padding:22px; }
.stat-card .stat-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.stat-icon{ width:36px;height:36px;border-radius:10px; background:var(--primary-dim); display:flex;align-items:center;justify-content:center; }
.stat-icon svg{ width:18px;height:18px; stroke:var(--primary); }
.stat-label{ font-size:12.5px; color:var(--text-dimmer); font-weight:500; }
.stat-value{ font-size:25px; font-weight:700; letter-spacing:-0.02em; margin-bottom:4px; }
.stat-delta{ font-size:12px; font-weight:600; color:var(--primary); }
.stat-delta.down{ color:var(--danger); }

.progress-track{ width:100%; height:10px; border-radius:100px; background:#262626; overflow:hidden; }
.progress-fill{ height:100%; border-radius:100px; background:linear-gradient(90deg,#00b85f,var(--primary)); box-shadow:0 0 12px rgba(0,230,118,0.5); }

.panel-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.panel-head h2{ font-size:16.5px; font-weight:600; }
.panel-head .link{ font-size:13px; color:var(--primary); font-weight:600; }

/* ============ Tables ============ */
.table-wrap{ overflow-x:auto; }
table{ width:100%; border-collapse:collapse; min-width:640px; }
th{ text-align:left; font-size:11.5px; font-weight:600; text-transform:uppercase; letter-spacing:0.04em; color:var(--text-dimmer); padding:0 14px 12px; border-bottom:1px solid var(--border); }
td{ padding:14px; font-size:14px; border-bottom:1px solid var(--border); color:var(--text-dim); }
tr:last-child td{ border-bottom:none; }
td.strong{ color:var(--text); font-weight:600; }
.row-actions{ display:flex; gap:8px; justify-content:flex-end; }
.amt-pos{ color:var(--primary); font-weight:600; }
.amt-neg{ color:var(--danger); font-weight:600; }

/* Badges */
.badge{ display:inline-flex; align-items:center; gap:6px; padding:4px 11px; border-radius:100px; font-size:11.5px; font-weight:600; }
.badge-green{ background:var(--primary-dim); color:var(--primary); }
.badge-grey{ background:#262626; color:var(--text-dim); }
.badge-orange{ background:rgba(255,194,75,0.12); color:var(--warn); }
.cat-dot{ width:7px;height:7px;border-radius:50%; display:inline-block; }

/* ============ Tabs ============ */
.tabs{ display:flex; gap:6px; padding:5px; background:var(--panel); border:1px solid var(--border); border-radius:12px; width:fit-content; margin-bottom:22px; }
.tab-btn{ padding:9px 18px; border-radius:9px; font-size:13.5px; font-weight:600; color:var(--text-dim); transition:all .2s ease; }
.tab-btn.active{ background:var(--primary); color:#000; }

/* ============ Modal ============ */
.modal-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,0.7); backdrop-filter:blur(4px);
  display:none; align-items:center; justify-content:center; z-index:200; padding:20px;
}
.modal-overlay.open{ display:flex; }
.modal{ width:100%; max-width:460px; background:#0d0d0d; border:1px solid var(--border); border-radius:22px; padding:28px; box-shadow:0 40px 100px rgba(0,0,0,0.6); }
.modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; }
.modal-head h3{ font-size:18px; font-weight:700; }
.modal-actions{ display:flex; gap:12px; margin-top:6px; }
.modal-actions .btn{ flex:1; }

/* ============ Auth pages ============ */
.auth-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:40px 20px; position:relative; z-index:1; }
.auth-card{ width:100%; max-width:440px; }
.auth-logo{ display:flex; align-items:center; gap:10px; justify-content:center; margin-bottom:34px; }
.auth-logo .brand-name{ font-weight:700; font-size:19px; }
.auth-panel{ background:var(--secondary); border:1px solid var(--border); border-radius:24px; padding:36px 32px; }
.auth-title{ font-size:23px; font-weight:700; letter-spacing:-0.02em; margin-bottom:8px; text-align:center; }
.auth-sub{ font-size:13.5px; color:var(--text-dim); text-align:center; margin-bottom:30px; }
.auth-foot{ text-align:center; font-size:13.5px; color:var(--text-dim); margin-top:22px; }
.auth-foot a{ color:var(--primary); font-weight:600; }
.divider-or{ display:flex; align-items:center; gap:14px; margin:22px 0; color:var(--text-dimmer); font-size:12px; }
.divider-or::before, .divider-or::after{ content:''; flex:1; height:1px; background:var(--border); }

/* ============ Empty state ============ */
.empty-state{ text-align:center; padding:60px 20px; color:var(--text-dimmer); }
.empty-state svg{ width:40px;height:40px; margin:0 auto 16px; stroke:var(--text-dimmer); }
.empty-state p{ font-size:14px; }

/* ============ Chart helpers ============ */
.bar-chart{ display:flex; align-items:flex-end; gap:12px; height:180px; padding-bottom:22px; position:relative; }
.bar-chart .bar{ flex:1; border-radius:6px 6px 0 0; background:#242424; position:relative; transition: height .6s cubic-bezier(.16,1,.3,1); }
.bar-chart .bar.income{ background:linear-gradient(180deg,var(--primary),rgba(0,230,118,0.15)); }
.bar-chart .bar.expense{ background:linear-gradient(180deg,var(--danger),rgba(255,92,92,0.15)); }
.bar-chart .bar-label{ position:absolute; bottom:-22px; left:0; right:0; text-align:center; font-size:10.5px; color:var(--text-dimmer); }
.legend-row{ display:flex; gap:18px; margin-top:8px; }
.legend-item{ display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--text-dim); }
.legend-item .sw{ width:9px;height:9px;border-radius:3px; }

/* ============ Responsive ============ */
@media (max-width: 1080px){
  .stat-grid{ grid-template-columns:repeat(2,1fr); }
  .goal-grid{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 900px){
  .sidebar{ transform:translateX(-100%); }
  .sidebar.open{ transform:translateX(0); box-shadow:0 0 60px rgba(0,0,0,0.6); }
  .main{ margin-left:0; }
  .mobile-toggle{ display:flex; }
  .search-box{ display:none; }
}
@media (max-width: 620px){
  .content{ padding:20px; }
  .stat-grid{ grid-template-columns:1fr; }
  .topbar{ padding:16px 20px; }
  .goal-grid{ grid-template-columns:repeat(2,1fr); }
  .auth-panel{ padding:28px 22px; }
}
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.01ms !important; transition-duration:0.01ms !important; }
}
