
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(15, 23, 42, .06);
}
* { font-family: 'Inter', system-ui, sans-serif; }
body { background: var(--bg); color: var(--text); }

/* ---------- Landing ---------- */
.landing-hero { background: linear-gradient(180deg, #eef3ff 0%, var(--bg) 100%); min-height: 100vh; }
.navbar-subtrack .brand-logo, .brand-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; flex: 0 0 auto; padding: 0;
}
.brand-logo svg { width: 56%; height: 56%; display: block; }
.brand-name { font-weight: 800; font-size: 1.4rem; color: var(--text); text-decoration: none; }
.hero-title { font-weight: 800; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; }
.hero-title .accent { color: var(--primary); }
.hero-sub { color: var(--muted); font-size: 1.05rem; max-width: 480px; }
.feature-pill {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 999px;
  padding: .5rem 1rem; font-size: .85rem; font-weight: 600; color: #334155;
  display: inline-flex; align-items: center; gap: .5rem;
}
.feature-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.hero-quote { font-style: italic; color: var(--muted); }
.hero-art { font-size: 6rem; }
.sub-icons span {
  display: inline-flex; width: 44px; height: 44px; border-radius: 12px;
  align-items: center; justify-content: center; font-size: 1.3rem;
  background: #fff; box-shadow: var(--shadow); margin-right: -8px;
  border: 2px solid var(--bg);
}

/* ---------- Auth ---------- */
.auth-card { max-width: 420px; margin: 0 auto; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; padding: 2rem 0; }
.form-control, .form-select { border-radius: 10px; padding: .65rem .9rem; }
.btn-primary-sub {
  background: var(--primary); border: none; border-radius: 10px;
  padding: .7rem 1rem; font-weight: 600; width: 100%;
}
.btn-primary-sub:hover { background: var(--primary-dark); }
.link-muted { color: var(--muted); font-size: .9rem; }

/* ---------- App pages ---------- */
.app-header { padding: 1rem 0; }
.page-title { font-weight: 800; font-size: 1.5rem; }
.page-sub { color: var(--muted); font-size: .9rem; }
.avatar-circle {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; font-weight: 700; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer;
}
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow); height: 100%; border: 1px solid #eef2f7;
}
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 800; margin: .15rem 0 0; }
.stat-card.tint-blue { background: #eff6ff; }
.stat-card.tint-green { background: #ecfdf5; }
.stat-card.tint-violet { background: #f5f3ff; }
.stat-card.tint-rose { background: #fff1f2; }
.stat-card.tint-blue .stat-value { color: #1d4ed8; }
.stat-card.tint-green .stat-value { color: #047857; }
.stat-card.tint-violet .stat-value { color: #6d28d9; }
.stat-card.tint-rose .stat-value { color: #be123c; }

.card-panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #eef2f7; }
.chart-box { position: relative; height: 260px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; }

.renewal-item { display: flex; align-items: center; gap: .75rem; padding: .8rem 0; border-bottom: 1px solid #f1f5f9; }
.renewal-item:last-child { border-bottom: none; }
.logo-badge {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1rem;
}
.renewal-name { font-weight: 700; font-size: .95rem; margin: 0; }
.renewal-meta { font-size: .8rem; color: var(--muted); margin: 0; }
.renewal-price { font-weight: 700; margin-left: auto; }

.filter-pills .btn {
  border-radius: 999px; padding: .35rem 1.1rem; font-weight: 600; font-size: .85rem;
  border: 1px solid #e2e8f0; background: #fff; color: #475569;
}
.filter-pills .btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.sub-row {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem 1.1rem; margin-bottom: .8rem; border: 1px solid #eef2f7;
  display: flex; align-items: center; gap: .9rem;
}
.sub-price { font-weight: 700; }
.sub-renews { font-size: .78rem; color: var(--muted); }
.badge-status { font-size: .7rem; padding: .25em .6em; border-radius: 999px; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }

.kebab-btn { border: none; background: transparent; color: var(--muted); border-radius: 8px; padding: .25rem .5rem; }
.kebab-btn:hover { background: #f1f5f9; }
.dropdown-menu { border-radius: 12px; box-shadow: 0 8px 24px rgba(15,23,42,.12); border: 1px solid #eef2f7; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030;
  background: #fff; border-top: 1px solid #e9edf3;
  display: flex; justify-content: space-around; align-items: center;
  padding: .5rem 0 max(.5rem, env(safe-area-inset-bottom));
}
.bottom-nav a, .bottom-nav .nav-slot {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: #94a3b8; font-size: .68rem; font-weight: 600; text-decoration: none;
  min-width: 60px;
}
.bottom-nav a.active { color: var(--primary); }
.bottom-nav .nav-icon { font-size: 1.15rem; }
.nav-add {
  width: 56px; height: 56px; min-width: 56px; padding: 0;
  border-radius: 50%; background: var(--primary);
  color: #fff !important; display: inline-flex; align-items: center; justify-content: center;
  margin-top: -28px; box-shadow: 0 6px 16px rgba(37, 99, 235, .4);
  border: 4px solid var(--bg); box-sizing: border-box;
  line-height: 0; font-size: 0; flex: 0 0 auto; aspect-ratio: 1 / 1;
}
.nav-add svg { width: 24px; height: 24px; display: block; flex: 0 0 auto; }
.app-content { padding-bottom: 96px; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .88rem; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* ---------- Toasts ---------- */
.toast-container-sub { position: fixed; top: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast-sub {
  background: #0f172a; color: #fff; border-radius: 10px; padding: .7rem 1rem;
  font-size: .88rem; font-weight: 500; box-shadow: 0 8px 24px rgba(15,23,42,.25);
  animation: toastIn .25s ease; max-width: 340px;
}
.toast-sub.success { background: #059669; }
.toast-sub.error { background: #dc2626; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state .big { font-size: 3rem; }

.analytics-tabs .btn {
  border-radius: 8px; padding: .35rem 1rem; font-size: .82rem; font-weight: 600;
  border: none; background: transparent; color: #64748b;
}
.analytics-tabs .btn.active { background: var(--primary); color: #fff; }
.cat-bar-row { margin-bottom: .9rem; }
.cat-bar-head { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.cat-bar-track { height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 999px; }
.spinner-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,.7); z-index: 1500;
  display: flex; align-items: center; justify-content: center;
}
@media (max-width: 576px) {
  .stat-value { font-size: 1.35rem; }
  .page-title { font-size: 1.3rem; }
}
