/* =========================================================
   MADAR 2027 — styles
   ========================================================= */
:root {
  --bg: #070d18;
  --bg-2: #0b1220;
  --card: #0f1a2e;
  --card-2: #132039;
  --card-3: #182846;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e8eef9;
  --muted: #8fa0bd;
  --violet: #7c5cff;
  --violet-2: #9b86ff;
  --teal: #2dd4bf;
  --amber: #f59e0b;
  --pink: #f472b6;
  --blue: #38bdf8;
  --red: #fb7185;
  --green: #34d399;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font-ar: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-en: "Inter", "Segoe UI", system-ui, sans-serif;
  --sidebar-w: 264px;
}

[data-theme="light"] {
  --bg: #f3f6fc;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #f1f5fb;
  --card-3: #e8eef9;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --muted: #5b6b85;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[lang="en"] body { font-family: var(--font-en); }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(700px 420px at -5% 105%, rgba(45, 212, 191, 0.1), transparent 60%);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(124, 92, 255, 0.12), transparent 60%),
    radial-gradient(700px 420px at -5% 105%, rgba(45, 212, 191, 0.08), transparent 60%);
}

h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.3; font-weight: 700; letter-spacing: -0.5px; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.flip { }
[dir="rtl"] .flip { transform: scaleX(-1); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--card-3); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.grow { flex: 1 1 180px; }

/* ============ Layout ============ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.main-wrap { min-width: 0; display: flex; flex-direction: column; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px;
  background: linear-gradient(180deg, rgba(15, 26, 46, 0.92), rgba(11, 18, 32, 0.96));
  border-inline-end: 1px solid var(--line);
  backdrop-filter: blur(16px);
  z-index: 40;
}
[data-theme="light"] .sidebar { background: linear-gradient(180deg, #fff, #f7f9ff); }

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 8px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--violet), #4f3bd6);
  color: #fff;
  box-shadow: 0 10px 24px rgba(124, 92, 255, 0.35);
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-en); font-size: 17px; letter-spacing: 2.5px; }
.brand-text span { font-family: var(--font-en); font-size: 10px; letter-spacing: 4px; color: var(--violet-2); }
.brand.small { padding: 0 0 14px; }

.nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 500;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.nav-link svg { width: 19px; height: 19px; opacity: 0.9; }
.nav-link:hover { background: var(--card-2); color: var(--text); }
.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.95), rgba(79, 59, 214, 0.95));
  box-shadow: 0 10px 22px rgba(124, 92, 255, 0.28);
}
[data-theme="light"] .nav-link.active { color: #fff; }

.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }

.profile {
  display: flex; align-items: center; gap: 10px;
  padding: 11px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
}
.avatar {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--teal), #0f9b8e);
  color: #04201d; font-weight: 700;
}
.profile-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.profile-text strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-text span { font-size: 11.5px; color: var(--muted); }

/* Trial card */
.trial-card {
  padding: 14px;
  border-radius: 15px;
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.18), rgba(45, 212, 191, 0.08));
  border: 1px solid rgba(124, 92, 255, 0.28);
}
.trial-top { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--violet-2); font-weight: 600; }
.trial-top .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.15); }
.trial-days { font-size: 26px; font-weight: 700; margin: 6px 0 8px; line-height: 1; }
.trial-days small { font-size: 12px; color: var(--muted); font-weight: 500; }
.trial-card .bar { height: 6px; margin-bottom: 10px; }
.trial-card button { width: 100%; justify-content: center; }
.trial-card.pro { background: linear-gradient(160deg, rgba(45, 212, 191, 0.2), rgba(52, 211, 153, 0.08)); border-color: rgba(45, 212, 191, 0.4); }
.trial-card.pro .trial-top { color: var(--teal); }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px;
  background: rgba(7, 13, 24, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
[data-theme="light"] .topbar { background: rgba(243, 246, 252, 0.82); }
.topbar-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 150px; }
.topbar-title h2 { font-size: 17px; }
.topbar-title span { font-size: 12px; }
.topbar-search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.topbar-search svg { width: 17px; height: 17px; color: var(--muted); }
.topbar-search input { flex: 1; background: none; border: 0; outline: 0; font-size: 13.5px; }
.topbar-search input::placeholder { color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 7px; margin-inline-start: auto; }
.menu-btn { display: none; }

/* Main */
.main { padding: 24px; max-width: 1360px; width: 100%; margin: 0 auto; flex: 1; }
.view { display: none; }
.view.active { display: block; animation: fadeUp 0.28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}
.card + .card, .view > .card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; margin-top: 18px; }
.dash-grid + .dash-grid { margin-top: 18px; }

/* Hero */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background:
    radial-gradient(600px 260px at 90% 0%, rgba(124, 92, 255, 0.22), transparent 60%),
    linear-gradient(135deg, var(--card), var(--card-2));
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: ""; position: absolute; inset-inline-end: -80px; top: -120px;
  width: 280px; height: 280px; border-radius: 50%;
  border: 1px solid rgba(124, 92, 255, 0.25);
  box-shadow: 0 0 0 34px rgba(124, 92, 255, 0.05), 0 0 0 68px rgba(124, 92, 255, 0.03);
  pointer-events: none;
}
.hero-text { position: relative; z-index: 1; }
.hero-text h1 { margin: 2px 0 6px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 15px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--violet), #5b43e8);
  box-shadow: 0 10px 24px rgba(124, 92, 255, 0.3);
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(124, 92, 255, 0.4); }
.btn-soft { background: var(--card-3); border-color: var(--line); color: var(--text); }
.btn-soft:hover { border-color: var(--line-strong); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: var(--card-2); }
.btn-danger { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.3); color: var(--red); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  display: inline-grid; place-items: center;
  background: var(--card); border: 1px solid var(--line);
  color: var(--muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--card-2); color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.lang-btn { font-family: var(--font-en); font-weight: 700; font-size: 12px; letter-spacing: 0.5px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.stat-card {
  display: flex; align-items: center; gap: 13px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat-icon {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--card-3);
  color: var(--violet-2);
}
.stat-icon.teal { color: var(--teal); background: rgba(45, 212, 191, 0.12); }
.stat-icon.amber { color: var(--amber); background: rgba(245, 158, 11, 0.12); }
.stat-icon.pink { color: var(--pink); background: rgba(244, 114, 182, 0.12); }
.stat-icon.violet { color: var(--violet-2); background: rgba(124, 92, 255, 0.12); }
.stat-body { min-width: 0; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.15; font-family: var(--font-en); }
.stat-label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Resume */
.resume {
  display: flex; align-items: center; gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(244, 114, 182, 0.07));
  border: 1px solid rgba(245, 158, 11, 0.22);
}
.resume-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(245, 158, 11, 0.16); color: var(--amber); }
.resume-body { flex: 1; min-width: 0; }
.resume-body strong { display: block; font-size: 14px; }
.resume-body p { font-size: 12.5px; color: var(--muted); }

/* Reward */
.reward {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.16), rgba(45, 212, 191, 0.08));
  border: 1px solid rgba(124, 92, 255, 0.24);
}
.reward-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: rgba(124, 92, 255, 0.18); color: var(--violet-2); }
.reward-body { flex: 1; min-width: 200px; }
.reward-body strong { font-size: 14px; }
.reward-body p { font-size: 12.5px; color: var(--muted); }
.reward-code {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  font-family: var(--font-en);
  font-size: 12.5px;
  letter-spacing: 1px;
}
[data-theme="light"] .reward-code { background: rgba(15, 23, 42, 0.06); border-color: rgba(15, 23, 42, 0.18); }

/* Calendar */
.cal-nav { display: flex; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: 10.5px; color: var(--muted); font-weight: 600; padding: 4px 0 6px; }
.cal-day {
  position: relative;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-en);
  font-size: 12.5px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: background 0.15s, border-color 0.15s;
}
.cal-day:hover { background: var(--card-2); }
.cal-day.other { opacity: 0.3; }
.cal-day.today { border-color: rgba(124, 92, 255, 0.6); background: rgba(124, 92, 255, 0.12); color: var(--violet-2); font-weight: 700; }
.cal-day.selected { background: var(--violet); color: #fff; border-color: var(--violet); }
.cal-day .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--teal); }
.cal-day.selected .dot { background: #fff; }
.cal-day .dot.amber { background: var(--amber); }

/* Focus list */
.focus-list { display: flex; flex-direction: column; gap: 8px; }
.focus-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: var(--card-2); }
.focus-item .check { width: 22px; height: 22px; }
.focus-item span { font-size: 13px; }
.focus-item.done span { text-decoration: line-through; color: var(--muted); }
.focus-timer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.timer-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.timer-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.timer-label svg { width: 16px; height: 16px; }
.timer-row strong { font-family: var(--font-en); font-size: 24px; letter-spacing: 1px; }
.timer-actions { display: flex; gap: 8px; }
.timer-actions .btn { flex: 1; }

/* Tasks */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.segmented { display: inline-flex; gap: 3px; padding: 3px; background: var(--card-2); border: 1px solid var(--line); border-radius: 11px; }
.seg-btn { padding: 7px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.seg-btn.active { background: var(--card-3); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }
[data-theme="light"] .seg-btn.active { background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1); }

.task-list { display: flex; flex-direction: column; gap: 8px; }
.task {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 13px;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid transparent;
  transition: border-color 0.15s, opacity 0.15s;
}
.task:hover { border-color: var(--line-strong); }
.task.done { opacity: 0.62; }
.task.done .task-title { text-decoration: line-through; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; gap: 7px; margin-top: 3px; flex-wrap: wrap; }
.task-meta span { font-size: 11px; color: var(--muted); }
.check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  display: grid; place-items: center;
  color: #fff;
  transition: background 0.15s, border-color 0.15s;
  flex: none;
}
.check svg { width: 14px; height: 14px; }
.check.checked { background: var(--teal); border-color: var(--teal); color: #04201d; }
.check:hover { border-color: var(--teal); }

.chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; }
.chip.high { background: rgba(251, 113, 133, 0.14); color: var(--red); }
.chip.medium { background: rgba(245, 158, 11, 0.14); color: var(--amber); }
.chip.low { background: rgba(45, 212, 191, 0.12); color: var(--teal); }
.chip.career { background: rgba(124, 92, 255, 0.14); color: var(--violet-2); }
.chip.health { background: rgba(45, 212, 191, 0.12); color: var(--teal); }
.chip.finance { background: rgba(245, 158, 11, 0.14); color: var(--amber); }
.chip.learning { background: rgba(56, 189, 248, 0.14); color: var(--blue); }
.chip.personal { background: rgba(244, 114, 182, 0.14); color: var(--pink); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 600; }
.badge.accent { background: rgba(124, 92, 255, 0.16); border-color: rgba(124, 92, 255, 0.3); color: var(--violet-2); }

/* Habits */
.habit-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(290px, 2fr) 38px;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.habit-row:last-child { border-bottom: 0; }
.habit-row.compact { grid-template-columns: 1fr minmax(220px, 1.6fr); }
@media (max-width: 720px) {
  .habit-row.compact { grid-template-columns: 1fr; }
  .habit-row.compact .habit-days { grid-column: 1 / -1; }
}
.habit-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.habit-emoji { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--card-2); font-size: 19px; flex: none; }
.habit-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.habit-streak { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.habit-streak svg { width: 12px; height: 12px; color: var(--amber); }
.habit-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.habit-cell {
  min-height: 46px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.habit-cell span { font-size: 9.5px; opacity: 0.8; }
.habit-cell b { font-family: var(--font-en); font-size: 11.5px; font-weight: 600; }
.habit-cell.on { background: rgba(45, 212, 191, 0.16); border-color: rgba(45, 212, 191, 0.45); color: var(--teal); }
.habit-cell.on b { color: var(--teal); }
.habit-cell.today { outline: 1px solid rgba(124, 92, 255, 0.55); outline-offset: -1px; }
.habit-cell.future { opacity: 0.28; cursor: not-allowed; }
.habit-cell:hover:not(.future) { border-color: var(--line-strong); }

/* Goals */
.goals-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.goal-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.goal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.goal-card h3 { font-size: 15px; margin-bottom: 12px; }
.goal-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.goal-foot .pct { font-family: var(--font-en); font-size: 12px; color: var(--muted); min-width: 34px; }
.goal-foot input[type="range"] { flex: 1; accent-color: var(--violet); height: 4px; }
.goal-deadline { margin-top: 9px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.goal-deadline svg { width: 13px; height: 13px; }

.bar { height: 8px; border-radius: 99px; background: var(--card-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--violet), var(--teal)); transition: width 0.4s ease; }
.bar.amber > span { background: linear-gradient(90deg, var(--amber), var(--pink)); }

/* Goal list in dashboard */
.mini-goal { padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-goal:last-child { border-bottom: 0; }
.mini-goal-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.mini-goal-top strong { font-size: 13px; font-weight: 500; }
.mini-goal-top span { font-family: var(--font-en); font-size: 11.5px; color: var(--muted); }

/* Quote */
.quote-card {
  display: flex; flex-direction: column; justify-content: center; gap: 12px;
  background:
    radial-gradient(400px 200px at 100% 0%, rgba(45, 212, 191, 0.16), transparent 60%),
    linear-gradient(135deg, var(--card), var(--card-2));
  min-height: 180px;
}
.quote-mark { font-size: 42px; line-height: 0.6; color: var(--violet); font-family: Georgia, serif; }
.quote-text { font-size: 18px; font-weight: 600; line-height: 1.5; }
.quote-author { font-size: 12px; color: var(--muted); }

/* Forms */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.input, .select, .textarea {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.input:focus, .select:focus, .textarea:focus { border-color: rgba(124, 92, 255, 0.6); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.select { padding-inline-end: 30px; }
.textarea { width: 100%; resize: vertical; min-height: 70px; line-height: 1.6; }
input[type="date"] { color-scheme: dark; }
[data-theme="light"] input[type="date"] { color-scheme: light; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.field .input, .field .textarea { width: 100%; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.settings-row strong { font-size: 13.5px; }
.settings-row p { font-size: 12px; margin-top: 2px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.price-card { display: flex; flex-direction: column; gap: 10px; position: relative; }
.price-card.featured { border-color: rgba(124, 92, 255, 0.5); box-shadow: 0 18px 50px rgba(124, 92, 255, 0.18); }
.price-card .badge { align-self: flex-start; }
.price { display: flex; align-items: baseline; gap: 7px; margin: 2px 0; }
.price span { font-family: var(--font-en); font-size: 34px; font-weight: 700; }
.price small { font-size: 11.5px; color: var(--muted); }
.feature-list { list-style: none; padding: 0; margin: 4px 0 12px; display: flex; flex-direction: column; gap: 7px; }
.feature-list li { position: relative; padding-inline-start: 20px; font-size: 12.5px; color: var(--muted); }
.feature-list li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--teal); font-weight: 700; }
.price-card .btn { margin-top: auto; width: 100%; }
#trialStatus .card, .trial-status-card { }
.faq details { border-top: 1px solid var(--line); padding: 11px 0; }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.faq details p { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

/* Journal */
.journal-entry { padding: 12px 0; border-bottom: 1px solid var(--line); }
.journal-entry:last-child { border-bottom: 0; }
.journal-entry-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.journal-entry-top strong { font-size: 13px; }
.journal-entry p { font-size: 12.5px; color: var(--muted); }
.journal-entry .jlabel { color: var(--violet-2); font-size: 11px; font-weight: 600; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 18px;
  background: rgba(3, 7, 15, 0.72);
  backdrop-filter: blur(6px);
  animation: fade 0.2s ease;
}
.modal { width: min(520px, 100%); max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow); animation: pop 0.22s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Toast */
.toast {
  position: fixed; z-index: 120;
  inset-inline: 0; bottom: 26px;
  margin: 0 auto;
  width: max-content; max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--card-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: none; }

/* Trial banner */
.trial-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 11px 24px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), rgba(244, 114, 182, 0.1));
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 12.5px;
}
.trial-banner strong { color: var(--amber); }

/* Empty */
.empty { text-align: center; padding: 28px 10px; color: var(--muted); font-size: 13px; }
.empty svg { width: 34px; height: 34px; opacity: 0.5; margin-bottom: 8px; }

/* About / version */
.about { text-align: center; }
.about .brand { justify-content: center; }
.about p { max-width: 520px; margin: 0 auto; }

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed; z-index: 50;
  inset-inline: 0; bottom: 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(11, 18, 32, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
[data-theme="light"] .mobile-nav { background: rgba(255, 255, 255, 0.94); }
.mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: 10px; color: var(--muted); font-size: 9.5px; font-weight: 600; }
.mobile-nav a svg { width: 19px; height: 19px; }
.mobile-nav a.active { color: var(--violet-2); background: rgba(124, 92, 255, 0.12); }

/* Proof review */
.proof-tier {
  display: flex; align-items: center; gap: 9px;
  margin: 12px 0; padding: 11px 13px;
  border-radius: 12px;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.24);
  font-size: 13px; font-weight: 600; color: var(--violet-2);
}
.proof-tier svg { width: 18px; height: 18px; }
.proof-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 20px 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--card-2);
  cursor: pointer; text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.proof-drop:hover, .proof-drop.dragover { border-color: rgba(124, 92, 255, 0.6); background: rgba(124, 92, 255, 0.06); }
.proof-drop svg { width: 26px; height: 26px; color: var(--violet-2); }
.proof-drop strong { font-size: 13.5px; }
.proof-file-name { font-size: 11.5px; color: var(--muted); word-break: break-all; }
.proof-preview { margin-top: 12px; }
.proof-preview img { display: block; max-width: 100%; max-height: 240px; border-radius: 12px; border: 1px solid var(--line); margin: 0 auto; }
.proof-loading { padding: 18px; text-align: center; color: var(--muted); font-size: 12.5px; }
.consent-row { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0 0; font-size: 12px; color: var(--muted); line-height: 1.55; }
.consent-row input { margin-top: 3px; accent-color: var(--violet); flex: none; }
.proof-status { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 12.5px; border: 1px solid transparent; }
.proof-status.ok { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.3); color: var(--green); }
.proof-status.bad { background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.3); color: var(--red); }
.proof-status.wait { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); color: var(--amber); }
.proof-status p { color: var(--text); }
.proof-status .reward-code { color: var(--text); }

/* ============ Responsive ============ */
@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .goals-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
  }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: none !important; }
  .menu-btn { display: inline-grid; }
  .main { padding: 18px; padding-bottom: 92px; }
  .topbar { padding: 12px 18px; }
  .mobile-nav { display: flex; justify-content: space-around; }
  .pricing-grid { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  .topbar-search { display: none; }
  .topbar-title { min-width: 0; flex: 1; }
  .topbar-title span { display: none; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 13px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; border-radius: 11px; }
  .stat-value { font-size: 19px; }
  .stat-label { font-size: 11px; }
  h1 { font-size: 24px; }
  .habit-row { grid-template-columns: 1fr 38px; }
  .habit-days { grid-column: 1 / -1; overflow-x: auto; padding-bottom: 4px; }
  .habit-cell { min-width: 40px; }
  .form-row .input, .form-row .select { flex: 1 1 100%; }
  .form-row .btn { width: 100%; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
  .resume { flex-wrap: wrap; }
  .resume .btn { width: 100%; }
  .trial-banner { padding: 10px 16px; }
  .toast { bottom: 84px; }
}
@media (max-width: 480px) {
  .main { padding: 14px; padding-bottom: 92px; }
  .card { padding: 15px; border-radius: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { flex-direction: column; align-items: flex-start; }
  .cal-day { min-height: 38px; font-size: 11.5px; }
  .price span { font-size: 28px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* Keep the mobile menu button hidden on desktop (icon-btn sets display later) */
.topbar .menu-btn { display: none; }
@media (max-width: 980px) {
  .topbar .menu-btn { display: inline-grid; }
}
