/* ─────────────────────────────────────────────────────────────────────────
   NGS Tasks Tracker — Design System
   Direction: "Obsidian Signal" — dark engineering aesthetic,
   warm amber accents, Syne headlines, DM Sans body, geometric noise.
   Following: anthropics/frontend-design + vercel web-interface-guidelines
───────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  /* Base palette */
  --bg:          #07070d;
  --bg-2:        #0d0d16;
  --surface:     #111120;
  --surface-2:   #181830;
  --border:      rgba(255 255 255 / 0.07);
  --border-h:    rgba(255 255 255 / 0.14);

  /* Accent — amber signal */
  --amber:       #f59e0b;
  --amber-h:     #fbbf24;
  --amber-dim:   rgba(245 158 11 / 0.15);
  --amber-glow:  rgba(245 158 11 / 0.25);

  /* Secondary — electric teal */
  --teal:        #14b8a6;
  --teal-dim:    rgba(20 184 166 / 0.12);

  /* Status */
  --green:       #22c55e;
  --green-dim:   rgba(34 197 94 / 0.12);
  --red:         #ef4444;
  --red-dim:     rgba(239 68 68 / 0.12);
  --yellow:      #eab308;
  --yellow-dim:  rgba(234 179 8 / 0.12);

  /* Typography */
  --text:        #f1f0ee;
  --text-2:      #a8a5a0;
  --text-3:      #6b6860;

  /* Geometry */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   18px;
  --radius-xl:   24px;

  /* Motion */
  --ease:        cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:     cubic-bezier(0.4, 0, 1, 1);
  --t-fast:      120ms;
  --t:           200ms;
  --t-slow:      350ms;

  --sidebar-w:   256px;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; color-scheme: dark; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--amber); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--amber-h); }
a:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: var(--radius-xs); }

code, pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
}

/* ── Utilities ──────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.page   { min-height: 100dvh; }

.glass {
  background: rgba(17 17 32 / 0.7);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border);
}

.glass-sm {
  background: rgba(255 255 255 / 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255 255 255 / 0.1); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255 255 255 / 0.18); }

/* ── Focus visible ──────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

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

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background var(--t), color var(--t), box-shadow var(--t), transform var(--t-fast);
  white-space: nowrap;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--amber);
  color: #07070d;
  font-weight: 600;
  box-shadow: 0 0 0 0 var(--amber-glow);
}
.btn-primary:hover:not(:disabled) {
  background: var(--amber-h);
  box-shadow: 0 0 24px var(--amber-glow);
}

.btn-ghost {
  background: rgba(255 255 255 / 0.05);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255 255 255 / 0.09);
  color: var(--text);
  border-color: var(--border-h);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239 68 68 / 0.25);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239 68 68 / 0.2);
}

.btn-full { width: 100%; justify-content: center; padding: 0.7rem; font-size: 0.95rem; }
.btn-sm   { padding: 0.3rem 0.65rem; font-size: 0.8rem; gap: 0.3em; }

/* ── Inputs ─────────────────────────────────────────────────────────────── */
.input {
  width: 100%;
  background: rgba(255 255 255 / 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 0.6rem 0.875rem;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  outline: none;
}
.input:hover { border-color: var(--border-h); }
.input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(245 158 11 / 0.12);
  background: rgba(255 255 255 / 0.06);
}
.input::placeholder { color: var(--text-3); }
.textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.select { cursor: pointer; }
.select option { background: #1a1a2a; color: var(--text); }

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 var(--amber-glow); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── LOGIN PAGE ─────────────────────────────────────────────────────────── */
#page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  animation: fade-in 0.4s var(--ease);
}

/* Geometric mesh background */
.login-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.login-bg::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  top: -200px; left: -200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245 158 11 / 0.06) 0%, transparent 70%);
}
.login-bg::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  bottom: -150px; right: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20 184 166 / 0.05) 0%, transparent 70%);
}

/* Decorative grid lines */
.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255 255 255 / 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255 255 255 / 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  box-shadow: 0 40px 100px rgba(0 0 0 / 0.6), 0 0 0 1px rgba(255 255 255 / 0.05);
  margin: 1rem;
  animation: scale-in 0.45s var(--ease);
}

/* Amber corner accent */
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle at top left, rgba(245 158 11 / 0.12), transparent 70%);
  border-radius: var(--radius-xl) 0 0 0;
  pointer-events: none;
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-dim);
  border: 1px solid rgba(245 158 11 / 0.2);
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  width: fit-content;
}

.login-logo {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.logo-mark {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
}
.logo-mark span { color: var(--amber); }

.login-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.login-sub {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-top: -0.3rem;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-3);
  font-size: 0.75rem;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-steps {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.login-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  background: rgba(255 255 255 / 0.025);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.4;
  transition: border-color var(--t);
}
.login-step:hover { border-color: var(--border-h); }
.step-num {
  min-width: 22px; height: 22px;
  background: var(--amber);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: #07070d;
  flex-shrink: 0;
}
.step-text code {
  background: rgba(245 158 11 / 0.1);
  color: var(--amber);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
}
.bot-link {
  color: var(--amber);
  font-weight: 500;
  font-size: 0.85rem;
  margin-left: 0.15rem;
}

.input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.login-error {
  color: var(--red);
  font-size: 0.8rem;
  text-align: center;
  background: var(--red-dim);
  border: 1px solid rgba(239 68 68 / 0.2);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

/* ── DASHBOARD LAYOUT ───────────────────────────────────────────────────── */
#page-dashboard {
  display: flex;
  min-height: 100dvh;
  animation: fade-in 0.3s var(--ease);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.875rem;
  border-right: 1px solid var(--border);
  border-radius: 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  background: rgba(11 11 20 / 0.95);
  backdrop-filter: blur(16px);
}

.sidebar-logo {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  margin-bottom: 1.25rem;
}
.sidebar-logo .logo-mark { font-size: 1.2rem; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.875rem;
  background: rgba(255 255 255 / 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  transition: border-color var(--t);
}
.sidebar-user:hover { border-color: var(--border-h); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber) 0%, #f97316 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #07070d;
  overflow: hidden; flex-shrink: 0;
  font-family: 'Syne', sans-serif;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-size: 0.85rem; font-weight: 600; line-height: 1.2; }
.user-tag  { font-size: 0.72rem; color: var(--text-3); margin-top: 0.1rem; }

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 0.625rem;
  margin: 1.75rem 0 0.5rem;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }

/* Lucide icon sizing resets */
.nav-icon,
[data-lucide] {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.icon-sm { width: 14px; height: 14px; }
.icon-xs { width: 12px; height: 12px; }
.btn [data-lucide],
.btn .nav-icon { width: 15px; height: 15px; stroke-width: 2; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-3);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
  transition: background var(--t), color var(--t), border-color var(--t);
  width: 100%;
}
.nav-item:hover { background: rgba(255 255 255 / 0.05); color: var(--text-2); }
.nav-item.active {
  background: var(--amber-dim);
  color: var(--amber);
  border-color: rgba(245 158 11 / 0.18);
}
.nav-item.active .nav-icon { filter: none; }
.nav-icon { font-size: 0.95rem; flex-shrink: 0; }

.sidebar-footer { margin-top: auto; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.logout-btn { color: var(--text-3); margin-top: 0.25rem; }
.logout-btn:hover { background: var(--red-dim); color: var(--red); }

/* ── Main Content ───────────────────────────────────────────────────────── */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.25rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(7 7 13 / 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 0.875rem; }
.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--t);
  line-height: 1;
}
.sidebar-toggle:hover { background: rgba(255 255 255 / 0.06); color: var(--text); }

/* ── Stats Bar ──────────────────────────────────────────────────────────── */
.tasks-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 1.25rem 1.75rem 0.5rem;
}

.stat-card {
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t);
}
.stat-card:hover { border-color: var(--border-h); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--amber), transparent);
  opacity: 0;
  transition: opacity var(--t);
}
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 18px; height: 18px;
  margin-bottom: 0.5rem;
  color: var(--text-3);
  display: block;
  flex-shrink: 0;
}
.stat-num {
  font-family: 'DM Sans', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-label { font-size: 0.7rem; color: var(--text-3); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500; }
.stat-num.danger  { color: var(--red); }
.stat-num.success { color: var(--green); }

/* ── Tasks List ─────────────────────────────────────────────────────────── */
.tasks-list {
  padding: 0.875rem 1.75rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  align-content: start;
  overflow-y: auto;
  flex: 1;
}

.tasks-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 4rem 2rem;
  color: var(--text-3);
  text-align: center;
  animation: fade-up 0.4s var(--ease);
  grid-column: 1 / -1;
}
.empty-icon {
  font-size: 2.5rem;
  filter: grayscale(0.4);
  opacity: 0.6;
}
.empty-text { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; color: var(--text-2); }
.empty-sub  { font-size: 0.8rem; }

/* ── Task Card ──────────────────────────────────────────────────────────── */
.task-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1rem 0.85rem;
  border-radius: var(--radius);
  background: rgba(255 255 255 / 0.026);
  border: 1px solid var(--border);
  transition: border-color var(--t), background var(--t), box-shadow var(--t-fast);
  position: relative;
  overflow: hidden;
  animation: fade-up 0.3s var(--ease) both;
  cursor: default;
}
.task-card:hover {
  border-color: var(--border-h);
  background: rgba(255 255 255 / 0.04);
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(0 0 0 / 0.25);
}

/* Priority stripe — top bar */
.task-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  transition: opacity var(--t);
}
.task-card.priority-high::before   { background: linear-gradient(90deg, var(--red), transparent); }
.task-card.priority-medium::before { background: linear-gradient(90deg, var(--yellow), transparent); }
.task-card.priority-low::before    { background: linear-gradient(90deg, var(--teal), transparent); }

.task-card.status-done { opacity: 0.45; }
.task-card.status-done .task-title { text-decoration: line-through; color: var(--text-3); }

/* Staggered entrance */
.task-card:nth-child(1)  { animation-delay: 0.03s; }
.task-card:nth-child(2)  { animation-delay: 0.06s; }
.task-card:nth-child(3)  { animation-delay: 0.09s; }
.task-card:nth-child(4)  { animation-delay: 0.12s; }
.task-card:nth-child(5)  { animation-delay: 0.15s; }
.task-card:nth-child(n+6) { animation-delay: 0.18s; }

/* Card top row: checkbox + action buttons */
.task-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Checkbox */
.task-check {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-h);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  color: transparent;
  background: none;
}
.task-check:hover {
  border-color: var(--green);
  background: var(--green-dim);
  color: var(--green);
}
.task-card.status-done .task-check {
  background: var(--green);
  border-color: var(--green);
  color: #07070d;
  box-shadow: 0 0 8px rgba(34 197 94 / 0.3);
}

.task-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-desc {
  font-size: 0.775rem;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}
.task-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: auto;
}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.13rem 0.45rem;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
}
.badge-high    { background: var(--red-dim);    color: #fca5a5; border: 1px solid rgba(239 68 68 / 0.2); }
.badge-medium  { background: var(--yellow-dim); color: #fde68a; border: 1px solid rgba(234 179 8 / 0.2); }
.badge-low     { background: var(--teal-dim);   color: #5eead4; border: 1px solid rgba(20 184 166 / 0.2); }
.badge-pending { background: rgba(245 158 11 / 0.1); color: var(--amber); border: 1px solid rgba(245 158 11 / 0.2); }
.badge-done    { background: var(--green-dim);  color: #86efac; border: 1px solid rgba(34 197 94 / 0.2); }
.badge-api     { background: rgba(20 184 166 / 0.1); color: var(--teal); border: 1px solid rgba(20 184 166 / 0.2); }
.badge-bot     { background: rgba(245 158 11 / 0.1); color: var(--amber); border: 1px solid rgba(245 158 11 / 0.2); }

.deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-3);
}
.deadline-badge.ok      { color: #5eead4; }
.deadline-badge.soon    { color: var(--yellow); }
.deadline-badge.overdue { color: var(--red); }

/* ── Task card clickable ────────────────────────────────────────────────── */
.task-card { cursor: pointer; }
.task-card:active { transform: translateY(0) scale(0.99); }

/* ── Task Actions ───────────────────────────────────────────────────────── */
.task-actions {
  display: flex;
  gap: 0.2rem;
  align-items: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--t);
}
.task-card:hover .task-actions { opacity: 1; }

.task-action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
  flex-shrink: 0;
  padding: 0;
}
.task-action-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.task-action-btn:hover:not(:disabled) { background: rgba(255 255 255 / 0.07); color: var(--text-2); border-color: var(--border-h); }
.task-action-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.task-action-btn.send-btn:hover:not(:disabled) { color: var(--amber); border-color: rgba(245 158 11 / 0.4); background: var(--amber-dim); }
.task-action-btn.delete-btn:hover:not(:disabled) { color: var(--red); border-color: rgba(239 68 68 / 0.4); background: var(--red-dim); }
.task-action-btn.sent { color: var(--green); border-color: rgba(34 197 94 / 0.3); }
.task-action-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Toggle Switch ──────────────────────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255 255 255 / 0.1);
  border: 1px solid var(--border-h);
  border-radius: 24px;
  transition: background var(--t), border-color var(--t);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-3);
  border-radius: 50%;
  transition: transform var(--t), background var(--t);
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(245 158 11 / 0.25);
  border-color: rgba(245 158 11 / 0.5);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translate(20px, -50%);
  background: var(--amber);
}

/* ── Settings row ───────────────────────────────────────────────────────── */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}
.setting-info { flex: 1; }
.setting-label { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.setting-desc  { font-size: 0.78rem; color: var(--text-3); line-height: 1.4; }

/* ── Modal footer info ──────────────────────────────────────────────────── */
.modal-footer-info {
  font-size: 0.78rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.modal-footer-info svg { flex-shrink: 0; opacity: 0.7; }
.modal-footer-info.active { color: var(--amber); }

/* ── Task Detail ────────────────────────────────────────────────────────── */
#page-task-detail { animation: fade-in 0.3s var(--ease); }
.task-detail-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.back-btn { align-self: flex-start; }
.task-detail-card {
  border-radius: var(--radius-xl);
  padding: 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: scale-in 0.35s var(--ease);
}
.detail-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.detail-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.detail-desc { color: var(--text-2); line-height: 1.65; font-size: 0.9rem; }

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
.detail-meta-item {
  padding: 0.75rem;
  background: rgba(255 255 255 / 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--t);
}
.detail-meta-item:hover { border-color: var(--border-h); }
.detail-meta-label {
  font-size: 0.65rem;
  color: var(--text-3);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.detail-meta-label svg { width: 10px; height: 10px; flex-shrink: 0; opacity: 0.7; }
.detail-meta-value { font-size: 0.875rem; font-weight: 500; }
.detail-meta-value.muted { color: var(--text-3); font-style: italic; font-weight: 400; }
.detail-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.detail-owner { display: flex; align-items: center; gap: 0.5rem; }
.detail-owner-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), #f97316);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; color: #07070d;
  font-family: 'Syne', sans-serif;
}

/* ── Archived task card ─────────────────────────────────────────────────── */
.task-card.archived {
  opacity: 0.6;
}
.task-card.archived .task-title {
  text-decoration: line-through;
  color: var(--text-3);
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0 0 0 / 0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 1rem;
  backdrop-filter: blur(6px);
  animation: fade-in 0.15s var(--ease);
}
.modal {
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  max-height: 90dvh;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0 0 0 / 0.7), 0 0 0 1px rgba(255 255 255 / 0.07);
  animation: scale-in 0.22s var(--ease);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem 0;
}
.modal-header h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.modal-close {
  background: rgba(255 255 255 / 0.06);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  transition: var(--t);
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  flex-shrink: 0;
}
.modal-close svg, .modal-close [data-lucide] { width: 14px; height: 14px; }
.modal-close:hover { background: rgba(255 255 255 / 0.1); color: var(--text); }
.modal-close:focus-visible { outline: 2px solid var(--amber); }

.modal-body {
  padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
  overflow-y: auto;
}
.modal-footer {
  padding: 0.875rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  background: rgba(255 255 255 / 0.02);
}
.modal-actions { display: flex; gap: 0.5rem; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.input-with-mic { position: relative; }
.input-with-mic .input { padding-right: 2.5rem; }
.mic-btn {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: var(--radius-xs);
  transition: opacity var(--t), background var(--t), color var(--t);
  color: var(--text-3);
  opacity: 0.6;
}
.mic-btn svg { width: 14px; height: 14px; }
.mic-btn-top { top: 0.7rem; transform: none; }
.mic-btn:hover { opacity: 1; background: rgba(255 255 255 / 0.08); color: var(--text-2); }
.mic-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.mic-btn.recording { opacity: 1; color: var(--red); animation: blink 1s ease-in-out infinite; }

.voice-status {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: var(--red); font-weight: 500;
}
.voice-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  animation: blink 1s ease-in-out infinite;
}

.checkbox-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; cursor: pointer; color: var(--text-2);
  transition: color var(--t);
}
.checkbox-label:hover { color: var(--text); }
.checkbox-label input {
  width: 14px; height: 14px;
  accent-color: var(--amber);
  cursor: pointer;
}

/* ── API Key Modal ──────────────────────────────────────────────────────── */
.api-key-display {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255 255 255 / 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.api-key-display code {
  flex: 1;
  font-size: 0.78rem;
  word-break: break-all;
  color: var(--amber);
  line-height: 1.4;
}
.api-key-info { margin-top: 0.5rem; }
.api-key-info p { font-size: 0.78rem; color: var(--text-3); margin-bottom: 0.5rem; font-weight: 600; }
.api-key-info pre {
  font-size: 0.7rem;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  background: rgba(17 17 28 / 0.97);
  border: 1px solid var(--border-h);
  color: var(--text);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 200;
  max-width: 300px;
  box-shadow: 0 8px 40px rgba(0 0 0 / 0.5);
  animation: fade-up 0.2s var(--ease);
  display: flex; align-items: center; gap: 0.5rem;
}
.toast.toast-success { border-color: rgba(34 197 94 / 0.3); color: #86efac; }
.toast.toast-error   { border-color: rgba(239 68 68 / 0.3); color: #fca5a5; }

/* ── Loading ────────────────────────────────────────────────────────────── */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem; color: var(--text-3); gap: 0.5rem;
}
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-h);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .tasks-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    position: fixed;
    left: -264px;
    width: 256px;
    z-index: 50;
    transition: left 0.25s var(--ease);
    box-shadow: none;
    height: 100dvh;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 4px 0 40px rgba(0 0 0 / 0.6);
  }
  .sidebar-toggle { display: flex; }
  .main-content   { width: 100%; }
  .tasks-list     { padding: 0.75rem 1rem 2rem; grid-template-columns: 1fr; }
  .tasks-stats    { padding: 0.75rem 1rem 0; }
  .main-header    { padding: 0.8rem 1rem; }
  .form-row       { grid-template-columns: 1fr; }
  .task-actions   { opacity: 1; }
  .tasks-empty    { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .tasks-stats { grid-template-columns: repeat(2, 1fr); }
  .modal       { border-radius: var(--radius-lg); max-height: 95dvh; }
  .login-card  { padding: 1.75rem 1.25rem; }
  .detail-meta-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   WIZARD — Create Task (multi-step)
═══════════════════════════════════════════════════════════════════════════ */

/* ── Overlay ────────────────────────────────────────────────────────────── */
.wiz-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(7 7 13 / 0.88);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}


.wiz-x {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255 255 255 / 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t);
}
.wiz-x:hover { background: rgba(255 255 255 / 0.1); color: var(--text-2); }

/* ── Step dots ──────────────────────────────────────────────────────────── */
.wiz-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 2.5rem;
}
.wiz-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255 255 255 / 0.15);
  transition: background var(--t), width var(--t);
}
.wiz-dot.active {
  background: var(--amber);
  width: 20px;
  border-radius: 3px;
}

/* ── Step container ─────────────────────────────────────────────────────── */
.wiz-step {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: wiz-in 0.28s var(--ease);
}
@keyframes wiz-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wiz-prompt {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.wiz-hint {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: -0.25rem;
}

.wiz-back {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem 0;
  transition: color var(--t);
  align-self: flex-start;
  margin-bottom: -0.5rem;
}
.wiz-back:hover { color: var(--text-2); }

.wiz-skip {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color var(--t);
  margin-top: -0.25rem;
}
.wiz-skip:hover { color: var(--text-2); }

/* ── Input field ────────────────────────────────────────────────────────── */
.wiz-field-wrap {
  position: relative;
  width: 100%;
}

.wiz-glow {
  position: absolute;
  inset: -24px;
  border-radius: 40px;
  background: radial-gradient(ellipse, rgba(245 158 11 / 0.07) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(16px);
  transition: opacity var(--t);
  opacity: 0;
}
.wiz-field-wrap:focus-within .wiz-glow { opacity: 1; }

.wiz-input {
  width: 100%;
  background: rgba(255 255 255 / 0.055);
  border: 1.5px solid rgba(255 255 255 / 0.1);
  border-radius: 18px;
  padding: 1rem 3.5rem 1rem 3.25rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  position: relative;
  z-index: 1;
}
.wiz-input::placeholder { color: rgba(255 255 255 / 0.25); }
.wiz-input:focus {
  border-color: rgba(245 158 11 / 0.45);
  box-shadow: 0 0 0 4px rgba(245 158 11 / 0.07), 0 16px 48px rgba(0 0 0 / 0.3);
  background: rgba(255 255 255 / 0.075);
}

.wiz-textarea {
  resize: none;
  padding-top: 1rem;
  padding-bottom: 1rem;
  line-height: 1.55;
  border-radius: 18px;
}

.wiz-mic {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: none;
  border: none;
  color: rgba(255 255 255 / 0.3);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-xs);
  transition: color var(--t), background var(--t);
  display: flex; align-items: center;
}
.wiz-mic--ta { top: 1rem; transform: none; }
.wiz-mic:hover, .wiz-mic.recording { color: var(--amber); background: var(--amber-dim); }

.wiz-send {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: var(--amber);
  border: none;
  border-radius: 12px;
  color: #07070d;
  cursor: pointer;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), box-shadow var(--t), transform 0.1s;
  flex-shrink: 0;
}
.wiz-send--ta { top: auto; bottom: 0.6rem; transform: none; }
.wiz-send:hover  { background: var(--amber-h); box-shadow: 0 0 16px var(--amber-glow); }
.wiz-send:active { transform: translateY(-50%) scale(0.93); }
.wiz-send--ta:active { transform: scale(0.93); }

/* ── Voice status ───────────────────────────────────────────────────────── */
.wiz-voice-status {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--amber);
  font-weight: 500;
  background: rgba(234 179 8 / 0.1);
  border: 1px solid rgba(234 179 8 / 0.3);
  border-radius: 99px;
  padding: 0.4rem 1rem;
  white-space: nowrap;
}

/* ── Calendar ───────────────────────────────────────────────────────────── */
.wiz-cal {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-lg);
  padding: 1rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wcal-presets {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.wcal-preset {
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: rgba(255 255 255 / 0.04);
  color: var(--text-2);
  font-size: 0.78rem;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.wcal-preset:hover  { background: rgba(255 255 255 / 0.08); color: var(--text); border-color: var(--border-h); }
.wcal-preset.active { background: var(--amber-dim); border-color: rgba(245 158 11 / 0.4); color: var(--amber); }

.wcal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wcal-month-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.wcal-nav-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  transition: color var(--t), background var(--t);
}
.wcal-nav-btn:hover { color: var(--text); background: rgba(255 255 255 / 0.07); }

.wcal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  width: 100%;
}
.wcal-weekdays span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.04em;
  padding-bottom: 0.3rem;
}
.wcal-weekdays .weekend { color: rgba(245 158 11 / 0.5); }

.wcal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  width: 100%;
}
.wcal-day {
  aspect-ratio: 1 / 1;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-2);
  transition: background var(--t), color var(--t);
  position: relative;
}
.wcal-day:hover:not(.past):not(.empty) { background: rgba(255 255 255 / 0.08); color: var(--text); }
.wcal-day.today {
  color: var(--amber);
  font-weight: 600;
}
.wcal-day.today::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--amber);
}
.wcal-day.selected {
  background: var(--amber);
  color: #07070d;
  font-weight: 700;
}
.wcal-day.selected.today::after { background: #07070d; }
.wcal-day.past   { opacity: 0.25; cursor: not-allowed; }
.wcal-day.empty  { cursor: default; }
.wcal-day.weekend:not(.selected) { color: rgba(245 158 11 / 0.6); }

/* ── Time picker ────────────────────────────────────────────────────────── */
.wcal-lbl {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: block;
  margin-bottom: 0.35rem;
}

.wcal-time {
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}
.wcal-time-ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}
.wct-btn {
  background: rgba(255 255 255 / 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-2);
  cursor: pointer;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  transition: background var(--t), color var(--t);
  flex-shrink: 0;
}
.wct-btn:hover { background: rgba(255 255 255 / 0.12); color: var(--text); }
.wct-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  min-width: 2ch;
  text-align: center;
}
.wct-sep {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  color: var(--text-3);
  margin: 0 0.25rem;
}

/* ── Priority ───────────────────────────────────────────────────────────── */
.wcal-prio {
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}
.wcal-prio-btns {
  display: flex;
  gap: 0.4rem;
}
.wcal-prio-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255 255 255 / 0.03);
  color: var(--text-2);
  font-size: 0.8rem;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.wcal-prio-btn:hover { background: rgba(255 255 255 / 0.07); color: var(--text); border-color: var(--border-h); }
.wcal-prio-btn.active[data-prio="low"]    { background: var(--teal-dim);   border-color: rgba(20 184 166 / 0.4); color: var(--teal); }
.wcal-prio-btn.active[data-prio="medium"] { background: var(--amber-dim);  border-color: rgba(245 158 11 / 0.4); color: var(--amber); }
.wcal-prio-btn.active[data-prio="high"]   { background: var(--red-dim);    border-color: rgba(239 68 68 / 0.4);  color: var(--red); }

.pdot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.pdot.low    { background: var(--teal); }
.pdot.medium { background: var(--amber); }
.pdot.high   { background: var(--red); }

/* ── Create button ──────────────────────────────────────────────────────── */
.wiz-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 2rem;
  background: var(--amber);
  border: none;
  border-radius: var(--radius-sm);
  color: #07070d;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), box-shadow var(--t), transform 0.1s;
  margin-top: 0.25rem;
  width: 100%;
  max-width: 400px;
  justify-content: center;
}
.wiz-create-btn:hover  { background: var(--amber-h); box-shadow: 0 0 24px var(--amber-glow); }
.wiz-create-btn:active { transform: scale(0.98); }
.wiz-create-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Shake on empty title */
@keyframes wiz-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.wiz-shake { animation: wiz-shake 0.38s ease; border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239,68,68,.25) !important; }

/* Recording state for wizard mic */
#wizard .wiz-mic.recording { color: var(--amber); }

/* Amber dot for wizard voice status */
.wiz-voice-status .voice-dot { background: var(--amber); animation: pulse-ring 1s ease-in-out infinite; }

@media (max-width: 480px) {
  .wiz-prompt { font-size: 1.15rem; }
  .wiz-input  { font-size: 0.95rem; padding: 0.875rem 3.25rem 0.875rem 3rem; }
  .wiz-cal    { padding: 0.75rem; }
  .wcal-day   { font-size: 0.75rem; }
}

/* ── Admin Panel ─────────────────────────────────────────────────────────── */
.admin-stats-row {
  display: flex; gap: 0.75rem; margin-bottom: 1.25rem;
}
.admin-stat {
  flex: 1; background: rgba(255 255 255 / 0.04); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.75rem; text-align: center;
  font-size: 0.72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em;
}
.admin-stat span { display: block; font-size: 1.5rem; font-weight: 700; color: var(--amber); margin-bottom: 0.2rem; }

.admin-users-list { display: flex; flex-direction: column; gap: 0.75rem; }

.admin-user-card {
  background: rgba(255 255 255 / 0.03); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem;
}
.admin-user-header { display: flex; align-items: center; gap: 0.75rem; }
.admin-user-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--amber-dim);
  color: var(--amber); font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden;
}
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name { font-weight: 600; font-size: 0.92rem; }
.admin-user-meta { font-size: 0.75rem; color: var(--text-3); margin-top: 0.15rem; }
.admin-user-meta code { color: var(--text-2); background: rgba(255 255 255 / 0.06); padding: 0.05rem 0.3rem; border-radius: 3px; }

.admin-key-row {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(255 255 255 / 0.03); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; flex-wrap: wrap;
}
.admin-key-label { font-size: 0.7rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0; }
.admin-key-val { font-size: 0.72rem; color: var(--amber); flex: 1; word-break: break-all; }
.admin-copy-btn {
  background: none; border: none; color: var(--text-3); cursor: pointer; padding: 0.2rem;
  border-radius: 4px; transition: color var(--t); flex-shrink: 0;
}
.admin-copy-btn:hover { color: var(--amber); }

.admin-sessions { display: flex; flex-direction: column; gap: 0.4rem; }
.admin-sessions-label {
  font-size: 0.7rem; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.05em; display: flex; align-items: center; gap: 0.3rem; margin-bottom: 0.1rem;
}
.admin-session {
  background: rgba(255 255 255 / 0.02); border: 1px solid rgba(255 255 255 / 0.06);
  border-radius: var(--radius-sm); padding: 0.5rem 0.75rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.admin-session-row {
  font-size: 0.78rem; color: var(--text-2); display: flex; align-items: center; gap: 0.4rem;
}
.admin-session-row code { color: var(--text); background: rgba(255 255 255 / 0.06); padding: 0.05rem 0.3rem; border-radius: 3px; font-size: 0.75rem; }
.admin-session-row svg { color: var(--text-3); flex-shrink: 0; }

.admin-username-link {
  color: var(--amber); text-decoration: none; font-weight: 500;
  transition: opacity var(--t);
}
.admin-username-link:hover { opacity: 0.75; text-decoration: underline; }

/* Admin responsive */
@media (max-width: 600px) {
  #modal-admin .modal { max-width: 100% !important; width: 100% !important; margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; align-self: flex-end; }
  #modal-admin { align-items: flex-end; }
  #modal-admin .modal-body { max-height: 80vh !important; }

  .admin-stats-row { gap: 0.4rem; }
  .admin-stat { padding: 0.5rem 0.4rem; font-size: 0.65rem; }
  .admin-stat span { font-size: 1.2rem; }

  .admin-user-card { padding: 0.75rem; }
  .admin-key-row { flex-wrap: wrap; }
  .admin-key-val { font-size: 0.65rem; width: 100%; }

  .admin-session { padding: 0.4rem 0.6rem; }
  .admin-session-row { font-size: 0.72rem; flex-wrap: wrap; }
  .admin-session-row code { word-break: break-all; }
}

/* ── Sidebar Divider ────────────────────────────────────────────────────── */
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0.625rem;
  opacity: 0.5;
}

/* ── STATISTICS PAGE ────────────────────────────────────────────────────── */
.stats-range-picker {
  display: flex;
  padding: 4px;
  gap: 4px;
}
.range-btn {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--t);
}
.range-btn:hover { color: var(--text-2); background: rgba(255,255,255,0.05); }
.range-btn.active {
  background: var(--amber);
  color: #07070d;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 1.25rem 1.75rem;
}

.stat-big-card {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.stat-big-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  font-weight: 600;
}
.stat-big-num {
  font-family: 'DM Sans', sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-big-num.success { color: var(--green); }
.stat-trend {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-top: 0.5rem;
}

.stats-charts {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.25rem;
  padding: 0 1.75rem 3rem;
}

.chart-container {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.chart-title {
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-2);
}

.chart-placeholder {
  height: 240px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border);
  position: relative;
  margin-top: 10px;
}

/* Custom CSS Bar Chart */
.bar-group {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  position: relative;
}
.bar {
  flex: 1;
  min-width: 4px;
  border-radius: 2px 2px 0 0;
  transition: height 0.6s var(--ease);
  position: relative;
}
.bar.created { background: var(--amber); opacity: 0.4; }
.bar.completed { background: var(--green); }

.bar:hover::after {
  content: attr(data-value);
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  border: 1px solid var(--border-h);
  z-index: 10;
}

.chart-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--text-3);
  white-space: nowrap;
}

.priority-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.prio-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.prio-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}
.prio-bar-bg {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
}
.prio-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s var(--ease);
}
.prio-bar-fill.high { background: var(--red); }
.prio-bar-fill.medium { background: var(--yellow); }
.prio-bar-fill.low { background: var(--teal); }

@media (max-width: 900px) {
  .stats-grid, .stats-charts {
    grid-template-columns: 1fr;
  }
}

/* ── View Filters ───────────────────────────────────────────────────────── */
.view-filters {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1.75rem 1.5rem;
  overflow-x: auto;
  scrollbar-width: none; /* Hide scrollbar for cleaner look */
}
.view-filters::-webkit-scrollbar { display: none; }

.filter-pill {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text-3);
  padding: 0.45rem 1rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.filter-pill:hover { 
  background: rgba(255,255,255,0.06); 
  color: var(--text-2); 
  border-color: var(--border-h);
}
.filter-pill.active {
  background: var(--amber-dim);
  border-color: rgba(245,158,11,0.3);
  color: var(--amber);
}
