/* ============================================================
   Declutt - Design System & Stylesheet
   ============================================================ */

:root {
  --primary:     #2563EB;
  --primary-dark:#1d4ed8;
  --primary-light:#dbeafe;
  --accent:      #10B981;
  --accent-dark: #059669;
  --accent-light:#d1fae5;
  --dark:        #111827;
  --gray-900:    #111827;
  --gray-800:    #1f2937;
  --gray-700:    #374151;
  --gray-600:    #4b5563;
  --gray-500:    #6b7280;
  --gray-400:    #9ca3af;
  --gray-300:    #d1d5db;
  --gray-200:    #e5e7eb;
  --gray-100:    #f3f4f6;
  --gray-50:     #f9fafb;
  --light:       #F9FAFB;
  --warning:     #F59E0B;
  --danger:      #EF4444;
  --danger-light:#fee2e2;
  --success:     #10B981;
  --info:        #3B82F6;
  --white:       #ffffff;
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.12);
  --transition:  0.2s ease;
  --font:        'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* View aliases */
  --color-primary: #2563EB;
  --color-accent:  #10B981;
  --color-danger:  #EF4444;
  --color-warning: #F59E0B;
  --color-success: #10B981;
  --color-dark:    #111827;
  --color-muted:   #6B7280;
  --color-border:  #E5E7EB;
  --color-bg:      #F9FAFB;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-700);
  background: var(--light);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1,h2,h3,h4,h5,h6 { color: var(--gray-900); font-weight: 700; line-height: 1.25; }
h1 { font-size: clamp(28px, 5vw, 48px); letter-spacing: -1px; }
h2 { font-size: clamp(22px, 4vw, 36px); letter-spacing: -0.5px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
p { margin-bottom: 1em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 13px; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 20px;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-size: 22px; font-weight: 800; color: var(--gray-900);
  letter-spacing: -0.5px; text-decoration: none;
}
.nav-logo span { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; color: var(--gray-600);
  transition: var(--transition); text-decoration: none;
}
.nav-links a:hover { color: var(--primary); background: var(--primary-light); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-mobile { display: none; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-mobile.open { display: block; padding: 16px; border-top: 1px solid var(--gray-200); }
  .nav-mobile a { display: block; padding: 12px 8px; color: var(--gray-700); font-weight: 500; border-bottom: 1px solid var(--gray-100); }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; font-family: var(--font);
  cursor: pointer; border: 2px solid transparent;
  transition: all var(--transition); text-decoration: none;
  white-space: nowrap; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-accent { background: var(--accent); color: white; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-ghost { background: var(--gray-100); color: var(--gray-700); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-lg { padding: 15px 32px; font-size: 17px; border-radius: var(--radius-lg); }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm);
  padding: 24px; transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.card-subtitle { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 11px 16px;
  border: 2px solid var(--gray-200); border-radius: var(--radius);
  font-size: 15px; font-family: var(--font); color: var(--gray-900);
  background: white; transition: border-color var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-control::placeholder { color: var(--gray-400); }
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: 13px; color: var(--danger); margin-top: 4px; }

/* ============================================================
   ALERTS / FLASH
   ============================================================ */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: var(--accent-light); color: #065f46; border: 1px solid #6ee7b7; }
.alert-error, .alert-danger { background: var(--danger-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.alert-info { background: var(--primary-light); color: #1e40af; border: 1px solid #93c5fd; }
.flash-msg { padding: 14px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); }
.flash-success { background: #065f46; color: white; }
.flash-error { background: #991b1b; color: white; }
.flash-info { background: var(--primary); color: white; }
.flash-warning { background: #92400e; color: white; }

/* ============================================================
   BADGES
   ============================================================ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--accent-light); color: var(--accent-dark); }
.badge-warning { background: #fffbeb; color: #92400e; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress { height: 8px; background: var(--gray-200); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; transition: width 0.6s ease; background: var(--primary); }
.progress-bar.success { background: var(--accent); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

/* ============================================================
   SCORE CIRCLES
   ============================================================ */
.score-circle {
  width: 100px; height: 100px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; position: relative;
  background: conic-gradient(var(--circle-color, var(--primary)) calc(var(--score, 50) * 3.6deg), var(--gray-200) 0);
}
.score-circle::before {
  content: ''; position: absolute;
  width: 80px; height: 80px; border-radius: 50%;
  background: white;
}
.score-circle-inner { position: relative; z-index: 1; text-align: center; }
.score-circle-number { font-size: 22px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.score-circle-label { font-size: 10px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; }

/* ============================================================
   DASHBOARD GRID
   ============================================================ */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.dash-stat { background: white; border-radius: var(--radius-lg); padding: 24px; border: 1px solid var(--gray-200); }
.dash-stat-value { font-size: 32px; font-weight: 800; color: var(--gray-900); line-height: 1; margin-bottom: 4px; }
.dash-stat-label { font-size: 13px; color: var(--gray-500); font-weight: 500; }
.dash-stat-icon { width: 44px; height: 44px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 16px; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); }
table { width: 100%; border-collapse: collapse; background: white; }
thead tr { background: var(--gray-50); }
th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--gray-200); }
td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 50%, #fefce8 100%);
  padding: 100px 20px 80px;
  text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(37,99,235,.06) 0%, transparent 60%),
              radial-gradient(circle at 70% 70%, rgba(16,185,129,.06) 0%, transparent 60%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: white; border: 1px solid var(--gray-200);
  border-radius: 99px; padding: 6px 16px;
  font-size: 13px; font-weight: 600; color: var(--primary);
  margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.hero h1 { max-width: 760px; margin: 0 auto 20px; }
.hero p { max-width: 560px; margin: 0 auto 36px; font-size: 18px; color: var(--gray-600); }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-social-proof { margin-top: 48px; color: var(--gray-500); font-size: 13px; }
.hero-avatars { display: inline-flex; margin-right: 8px; }
.hero-avatars span {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid white; display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; background: var(--primary-light); margin-left: -8px;
  font-weight: 700; color: var(--primary);
}
.hero-avatars span:first-child { margin-left: 0; }

/* ============================================================
   FEATURE GRID
   ============================================================ */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.feature-card { background: white; border-radius: var(--radius-lg); padding: 28px; border: 1px solid var(--gray-200); }
.feature-icon { width: 52px; height: 52px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 16px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--gray-500); margin: 0; line-height: 1.6; }

/* ============================================================
   PRICING
   ============================================================ */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.pricing-card { background: white; border-radius: var(--radius-xl); padding: 32px; border: 2px solid var(--gray-200); transition: var(--transition); }
.pricing-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pricing-card.featured { border-color: var(--primary); background: linear-gradient(135deg, #eff6ff, white); }
.pricing-card .plan-name { font-size: 14px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.pricing-card .plan-price { font-size: 40px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.pricing-card .plan-period { font-size: 14px; color: var(--gray-500); }
.pricing-card .plan-desc { color: var(--gray-500); font-size: 14px; margin: 16px 0; }
.plan-features { list-style: none; margin-bottom: 28px; }
.plan-features li { padding: 7px 0; font-size: 14px; color: var(--gray-700); border-bottom: 1px solid var(--gray-100); display: flex; gap: 8px; }
.plan-features li::before { content: '✓'; color: var(--accent); font-weight: 700; flex-shrink: 0; }

/* ============================================================
   APP LAYOUT (authenticated)
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--gray-900); color: white;
  position: fixed; top: 0; left: 0; height: 100vh;
  overflow-y: auto; z-index: 50;
  display: flex; flex-direction: column;
  transition: transform var(--transition);
}
.sidebar-logo { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo a { font-size: 20px; font-weight: 800; color: white; text-decoration: none; letter-spacing: -0.5px; }
.sidebar-logo span { color: #60a5fa; }
.sidebar-nav { padding: 16px 12px; flex: 1; }
.sidebar-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.3); text-transform: uppercase; letter-spacing: 1px; padding: 12px 10px 6px; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius);
  color: rgba(255,255,255,.65); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: var(--transition); margin-bottom: 2px;
}
.sidebar-link:hover { background: rgba(255,255,255,.08); color: white; }
.sidebar-link.active { background: var(--primary); color: white; }
.sidebar-link .icon { font-size: 18px; width: 22px; text-align: center; }
.sidebar-bottom { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.sidebar-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: white; flex-shrink: 0; }
.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-plan { font-size: 11px; color: rgba(255,255,255,.4); text-transform: uppercase; }

.app-main { margin-left: 260px; flex: 1; min-height: 100vh; }
.app-topbar {
  background: white; border-bottom: 1px solid var(--gray-200);
  padding: 0 28px; height: 64px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
}
.app-topbar-title { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.app-topbar-actions { display: flex; align-items: center; gap: 12px; }
.app-content { padding: 28px; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 26px; }
.page-header p { color: var(--gray-500); margin: 4px 0 0; }

.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; font-size: 22px; color: var(--gray-700); padding: 8px; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 49; }
  .sidebar-overlay.open { display: block; }
}


/* ============================================================
   APP SIDEBAR — class aliases used by app.php layout
   ============================================================ */
.app-sidebar {
  width: 260px; flex-shrink: 0;
  background: #0F172A; color: white;
  position: fixed; top: 0; left: 0; height: 100vh;
  overflow-y: auto; z-index: 50;
  display: flex; flex-direction: column;
  transition: transform 0.2s ease;
}
.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-logo { text-decoration: none; }
.logo-text { font-size: 20px; font-weight: 800; color: white; letter-spacing: -0.5px; }
.sidebar-close { background: none; border: none; color: rgba(255,255,255,.4); font-size: 18px; cursor: pointer; padding: 4px; }
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: white; }
.user-plan { font-size: 11px; color: rgba(255,255,255,.4); text-transform: capitalize; }
.nav-group { padding: 8px 10px; }
.nav-group + .nav-group { border-top: 1px solid rgba(255,255,255,.05); }
.nav-label {
  display: block; font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,.3); text-transform: uppercase;
  letter-spacing: 1px; padding: 8px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  color: rgba(255,255,255,.65); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: 0.15s ease; margin-bottom: 1px;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: white; }
.nav-item.active { background: var(--color-primary); color: white; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item--logout { color: rgba(255,255,255,.4); margin-top: 4px; }
.nav-item--logout:hover { color: #FCA5A5; background: rgba(239,68,68,.15); }
.sidebar-upgrade {
  margin: 8px 12px 16px; padding: 14px;
  background: rgba(37,99,235,.2); border: 1px solid rgba(37,99,235,.3);
  border-radius: 10px; font-size: 12px; color: rgba(255,255,255,.7); line-height: 1.5;
}
.sidebar-upgrade p { margin-bottom: 10px; }
.topbar-alert {
  font-size: 13px; color: #D97706; font-weight: 600; text-decoration: none;
  background: #FEF3C7; padding: 5px 10px; border-radius: 6px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.page-title { font-size: 22px; font-weight: 800; color: var(--color-dark); margin: 0; }
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; cursor: pointer; position: relative; flex-shrink: 0;
}
.app-content { padding: 28px; }
.flash-container { padding: 0 28px; margin-top: 8px; }
@media (max-width: 900px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0 !important; }
  .sidebar-toggle { display: flex !important; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 49; }
  .sidebar-overlay.open { display: block; }
}
/* ============================================================
   ADMIN SPECIFIC
   ============================================================ */
.admin-sidebar { background: #0f172a; }
.admin-sidebar .sidebar-link.active { background: #6366f1; }
.admin-header { background: linear-gradient(135deg, #0f172a, #1e293b); color: white; padding: 28px; border-radius: var(--radius-xl); margin-bottom: 24px; }
.admin-header h1 { color: white; font-size: 24px; }
.admin-header p { color: rgba(255,255,255,.6); margin: 4px 0 0; }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state { text-align: center; padding: 64px 20px; }
.empty-icon { font-size: 56px; margin-bottom: 16px; display: block; }
.empty-title { font-size: 20px; font-weight: 700; color: var(--gray-800); margin-bottom: 8px; }
.empty-text { color: var(--gray-500); max-width: 360px; margin: 0 auto 24px; font-size: 15px; }

/* ============================================================
   TASKS
   ============================================================ */
.task-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--gray-200); background: white; margin-bottom: 10px; transition: var(--transition); }
.task-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.task-item.completed { opacity: 0.6; background: var(--gray-50); }
.task-checkbox { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--gray-300); cursor: pointer; flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.task-checkbox.checked { background: var(--accent); border-color: var(--accent); color: white; font-size: 12px; }
.task-content { flex: 1; }
.task-title { font-size: 15px; font-weight: 600; color: var(--gray-800); margin-bottom: 3px; }
.task-meta { font-size: 12px; color: var(--gray-500); display: flex; gap: 12px; }
.task-actions { display: flex; gap: 6px; }

/* ============================================================
   BRAIN DUMP
   ============================================================ */
.brain-dump-items { display: grid; gap: 10px; }
.brain-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--gray-200); background: white; }
.brain-item-priority { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.brain-item-text { flex: 1; font-size: 14px; }
.priority-urgent .brain-item-priority { background: var(--danger); }
.priority-important .brain-item-priority { background: var(--warning); }
.priority-later .brain-item-priority { background: var(--primary); }
.priority-maybe .brain-item-priority { background: var(--gray-400); }
.priority-let_go .brain-item-priority { background: var(--accent); }

/* ============================================================
   AREA COLOURS
   ============================================================ */
.area-mental     { --area-color: #8B5CF6; }
.area-digital    { --area-color: #2563EB; }
.area-financial  { --area-color: #10B981; }
.area-home       { --area-color: #F59E0B; }
.area-work       { --area-color: #6B7280; }
.area-health     { --area-color: #EF4444; }
.area-relationship { --area-color: #EC4899; }
.area-badge { background: color-mix(in srgb, var(--area-color) 12%, white); color: var(--area-color); padding: 2px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--gray-900); color: rgba(255,255,255,.6); padding: 64px 20px 32px; }
.footer-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand-name { font-size: 22px; font-weight: 800; color: white; margin-bottom: 12px; letter-spacing: -0.5px; }
.footer-brand-name span { color: #60a5fa; }
.footer-tagline { font-size: 14px; line-height: 1.6; margin-bottom: 0; }
.footer-col h4 { color: white; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.footer-col a { display: block; color: rgba(255,255,255,.5); font-size: 14px; padding: 4px 0; text-decoration: none; transition: var(--transition); }
.footer-col a:hover { color: white; }
.footer-bottom { max-width: 1100px; margin: 0 auto; padding-top: 32px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ============================================================
   CLUTTER SCORE RADAR (CSS-based)
   ============================================================ */
.radar-container { position: relative; width: 240px; height: 240px; margin: 0 auto; }
.area-bars { display: grid; gap: 12px; }
.area-bar-item { display: flex; align-items: center; gap: 12px; }
.area-bar-label { font-size: 13px; font-weight: 600; color: var(--gray-700); width: 120px; flex-shrink: 0; }
.area-bar-track { flex: 1; height: 10px; background: var(--gray-200); border-radius: 99px; overflow: hidden; }
.area-bar-fill { height: 100%; border-radius: 99px; }
.area-bar-score { font-size: 13px; font-weight: 700; color: var(--gray-700); width: 36px; text-align: right; }

/* ============================================================
   ASSESSMENT
   ============================================================ */
.assessment-progress { background: white; border-radius: var(--radius-lg); padding: 20px 24px; border: 1px solid var(--gray-200); margin-bottom: 24px; }
.question-card { background: white; border-radius: var(--radius-xl); padding: 32px; border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); }
.question-text { font-size: 18px; font-weight: 600; color: var(--gray-900); margin-bottom: 24px; }
.answer-options { display: grid; gap: 10px; }
.answer-option { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); border: 2px solid var(--gray-200); cursor: pointer; transition: var(--transition); }
.answer-option:hover { border-color: var(--primary); background: var(--primary-light); }
.answer-option.selected { border-color: var(--primary); background: var(--primary-light); }
.answer-option input { accent-color: var(--primary); }
.answer-label { font-size: 15px; font-weight: 500; }

/* ============================================================
   STREAK
   ============================================================ */
.streak-badge { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, #f59e0b, #d97706); color: white; padding: 6px 14px; border-radius: 99px; font-size: 14px; font-weight: 700; }

/* ============================================================
   EMERGENCY CALM MODE
   ============================================================ */
.calm-mode {
  position: fixed; inset: 0; background: linear-gradient(135deg, #0f172a, #1e293b);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px;
}
.calm-content { text-align: center; max-width: 480px; }
.calm-title { font-size: 40px; font-weight: 800; color: white; margin-bottom: 16px; }
.calm-message { font-size: 20px; color: rgba(255,255,255,.8); line-height: 1.7; margin-bottom: 40px; }
.calm-action { background: white; color: #0f172a; font-size: 18px; font-weight: 700; padding: 18px 40px; border-radius: var(--radius-xl); display: inline-block; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-500); }
.text-small  { font-size: 13px; }
.text-success{ color: var(--accent); }
.text-danger { color: var(--danger); }
.text-primary{ color: var(--primary); }
.text-warning{ color: var(--warning); }
.fw-bold  { font-weight: 700; }
.fw-semi  { font-weight: 600; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .app-content { padding: 16px; } }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 24px 0; }

/* Onboarding highlight */
.onboarding-tip { background: linear-gradient(135deg, var(--primary-light), var(--accent-light)); border-radius: var(--radius-lg); padding: 20px; border: 1px solid #bfdbfe; margin-bottom: 24px; }
.onboarding-tip h3 { font-size: 16px; color: var(--gray-900); margin-bottom: 6px; }
.onboarding-tip p { font-size: 14px; color: var(--gray-600); margin: 0; }

/* Cookie banner */
#cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: var(--gray-900); color: rgba(255,255,255,.85); padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; z-index: 999; flex-wrap: wrap; font-size: 13px; }
#cookie-banner a { color: #60a5fa; }
#cookie-banner button { background: white; color: var(--gray-900); border: none; padding: 8px 20px; border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: calc(100% + 8px); right: 0; background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); box-shadow: var(--shadow-lg); min-width: 180px; overflow: hidden; display: none; z-index: 100; }
.dropdown-menu.open { display: block; }
.dropdown-item { display: block; padding: 10px 16px; font-size: 14px; color: var(--gray-700); text-decoration: none; transition: var(--transition); }
.dropdown-item:hover { background: var(--gray-50); color: var(--primary); }
.dropdown-divider { height: 1px; background: var(--gray-200); margin: 4px 0; }

/* Loading spinner */
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(37,99,235,.2); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tooltip */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--gray-900); color: white; padding: 5px 10px; border-radius: 6px; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: var(--transition); z-index: 1000; }
[data-tooltip]:hover::after { opacity: 1; }

/* ============================================================
   DASHBOARD — stat cards, welcome, area bars, task cards
   ============================================================ */
.verify-banner { background: #FEF3C7; border: 1px solid #FDE68A; border-radius: var(--radius); padding: 12px 20px; margin-bottom: 20px; font-size: 14px; color: #92400E; display: flex; align-items: center; gap: 10px; }
.dashboard-welcome { margin-bottom: 28px; }
.dashboard-welcome h1 { font-size: 26px; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.dashboard-welcome p { color: var(--gray-500); font-size: 15px; }

/* Stat row */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px 22px; transition: box-shadow .15s; position: relative; }
.stat-card:hover { box-shadow: var(--shadow); }
.stat-card--score { grid-column: span 1; }
.stat-score-circle { width: 64px; height: 64px; position: relative; margin-bottom: 12px; }
.stat-score-circle svg { width: 100%; height: 100%; }
.stat-score-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 900; color: var(--gray-900); }
.stat-score-info { }
.stat-score-cat { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.stat-improvement { font-size: 12px; font-weight: 600; }
.stat-improvement.positive { color: var(--success); }
.stat-improvement.negative { color: var(--danger); }
.btn-link { background: none; border: none; padding: 0; color: var(--primary); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; text-decoration: none; display: inline-block; margin-top: 8px; }
.stat-score-empty .stat-score-placeholder { width: 64px; height: 64px; border-radius: 50%; background: var(--gray-100); display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px; }
.stat-icon { font-size: 28px; margin-bottom: 12px; }
.stat-value { font-size: 28px; font-weight: 900; color: var(--gray-900); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); margin-bottom: 2px; }
.stat-sub { font-size: 12px; color: var(--gray-400); }

/* Dashboard two-col layout */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
.dashboard-card { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px 22px; }
.dashboard-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dashboard-card-title { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.dashboard-card-link { font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; }
.dashboard-card-link:hover { text-decoration: underline; }

/* Task cards */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); background: white; }
.task-check { width: 22px; height: 22px; border: 2px solid var(--gray-300); border-radius: 50%; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: .15s; }
.task-check:hover { border-color: var(--success); background: #F0FDF4; }
.task-text { flex: 1; font-size: 14px; font-weight: 500; color: var(--gray-800); }
.task-area { font-size: 11px; font-weight: 600; color: var(--gray-400); }
.task-empty { text-align: center; padding: 20px; color: var(--gray-400); font-size: 14px; }
.task-add { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; margin-top: 10px; }

/* AI coach card */
.ai-report-preview { font-size: 14px; color: var(--gray-600); line-height: 1.6; }
.ai-empty { text-align: center; padding: 16px; color: var(--gray-400); font-size: 14px; }

/* Area bars */
.area-bars-section { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 20px; }
.area-bars-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.area-bars-title { font-size: 15px; font-weight: 700; color: var(--gray-900); }

/* Recent brain dumps */
.brain-dump-list { display: flex; flex-direction: column; gap: 8px; }
.brain-dump-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: 13px; color: var(--gray-600); text-decoration: none; }
.brain-dump-item:hover { background: var(--gray-50); }

/* Renewal items */
.renewal-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.renewal-item:last-child { border-bottom: none; }

/* Responsive */
@media (max-width: 900px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   DASHBOARD STAT CARDS
   ============================================================ */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px 22px; }
.stat-card--score { }
.stat-score-circle { width: 64px; height: 64px; position: relative; margin-bottom: 10px; }
.stat-score-circle svg { width: 100%; height: 100%; }
.stat-score-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 900; color: var(--gray-900); }
.stat-score-info { }
.stat-score-cat { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.stat-score-empty .stat-score-placeholder { width: 64px; height: 64px; border-radius: 50%; background: var(--gray-100); display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 10px; }
.stat-improvement { font-size: 12px; font-weight: 600; }
.stat-improvement.positive { color: var(--accent); }
.stat-improvement.negative { color: var(--danger); }
.stat-icon { font-size: 28px; margin-bottom: 10px; display: block; }
.stat-value { font-size: 28px; font-weight: 900; color: var(--gray-900); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); margin-bottom: 2px; }
.stat-sub { font-size: 12px; color: var(--gray-400); }
.btn-link { background: none; border: none; padding: 0; color: var(--primary); font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font); text-decoration: none; display: inline-block; margin-top: 6px; }
.verify-banner { background: #FEF3C7; border: 1px solid #FDE68A; border-radius: var(--radius); padding: 12px 20px; margin-bottom: 20px; font-size: 14px; color: #92400E; }
.dashboard-welcome { margin-bottom: 24px; }
.dashboard-welcome h1 { font-size: 24px; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.dashboard-welcome p { color: var(--gray-500); font-size: 14px; margin: 0; }

/* Dashboard two-col grid */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.dashboard-card { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 20px 22px; }
.dashboard-card .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dashboard-card .card-title { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.card-link { font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; }
.card-link:hover { text-decoration: underline; }

/* Task list in dashboard */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item--dashboard { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); background: white; }
.task-check { width: 20px; height: 20px; border: 2px solid var(--gray-300); border-radius: 50%; cursor: pointer; flex-shrink: 0; margin-top: 1px; background: none; display: flex; align-items: center; justify-content: center; }
.task-check:hover { border-color: var(--accent); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 500; color: var(--gray-800); margin-bottom: 2px; }
.task-priority { font-size: 11px; font-weight: 600; color: var(--gray-400); }
.priority-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
.priority-dot--urgent    { background: var(--danger); }
.priority-dot--important { background: var(--warning); }
.priority-dot--medium    { background: var(--primary); }
.priority-dot--low       { background: var(--accent); }
.priority-dot--later     { background: var(--gray-400); }

/* Area bars */
.area-bar { margin-bottom: 12px; }
.area-bar:last-child { margin-bottom: 0; }
.area-score-row { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.area-icon-sm { font-size: 16px; flex-shrink: 0; }
.area-name { font-size: 13px; font-weight: 600; color: var(--gray-700); flex: 1; }
.area-score-num { font-size: 13px; font-weight: 700; color: var(--gray-700); width: 28px; text-align: right; }
.area-bar-wrap { height: 6px; background: var(--gray-200); border-radius: 99px; overflow: hidden; }

/* Area tags */
.area-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-transform: capitalize; }
.area-tag--mental       { background: #EDE9FE; color: #5B21B6; }
.area-tag--digital      { background: #DBEAFE; color: #1D4ED8; }
.area-tag--financial    { background: #D1FAE5; color: #065F46; }
.area-tag--home         { background: #FEF3C7; color: #92400E; }
.area-tag--work         { background: #F3F4F6; color: #374151; }
.area-tag--health       { background: #FEE2E2; color: #991B1B; }
.area-tag--relationship { background: #FCE7F3; color: #9D174D; }
.area-tag--general      { background: #F3F4F6; color: #374151; }
.area-tag--urgent       { background: #FEE2E2; color: #991B1B; }
.area-tag--important    { background: #FEF3C7; color: #92400E; }
.area-tag--later        { background: #D1FAE5; color: #065F46; }
.area-tag--maybe        { background: #F3F4F6; color: #6B7280; }

/* AI coach card */
.ai-message { font-size: 14px; color: var(--gray-600); line-height: 1.6; margin-bottom: 6px; }
.ai-date { font-size: 12px; color: var(--gray-400); }
.empty-state-sm { text-align: center; padding: 20px; color: var(--gray-400); font-size: 14px; }

@media (max-width: 900px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
}

/* area-bar: the fill bar inside area-bar-wrap */
.area-bar { height: 6px; border-radius: 99px; }

.btn-ghost-link { background: none; border: none; color: var(--color-muted); font-size: .875rem; font-weight: 600; text-decoration: none; padding: .5rem .875rem; cursor: pointer; font-family: inherit; }
.btn-ghost-link:hover { color: var(--color-dark); }

/* ============================================================
   TOPBAR MOBILE CLEANUP
   ============================================================ */
.topbar-verify-badge {
    font-size: 1rem; text-decoration: none;
    background: #FEF3C7; border-radius: 100px;
    padding: .25rem .5rem; line-height: 1;
}
.calm-btn {
    display: inline-flex; align-items: center; gap: .375rem;
    padding: .4rem .875rem; border: 1.5px solid #D1D5DB;
    border-radius: 100px; font-size: .8rem; font-weight: 600;
    color: #374151; text-decoration: none; white-space: nowrap;
    transition: background .15s;
}
.calm-btn:hover { background: #F0FDF4; border-color: #10B981; color: #065F46; text-decoration: none; }
.calm-icon { font-size: 1rem; }
.calm-text { }

/* Dropdown now attached to avatar */
.topbar-right { position: relative; }
.dropdown-menu#userDropdown {
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
}

@media (max-width: 900px) {
    /* Topbar tighter on mobile */
    .app-topbar { padding: 0 .875rem; height: 56px; }
    .page-title  { font-size: 1rem; font-weight: 700; }

    /* Calm button: icon only on mobile */
    .calm-text { display: none; }
    .calm-btn  { padding: .4rem .5rem; border-radius: 50%; width: 36px; height: 36px; justify-content: center; }
    .calm-icon { font-size: 1.1rem; }

    /* Avatar stays same size */
    .topbar-avatar { width: 34px; height: 34px; font-size: .8rem; }

    /* Verify badge icon only */
    .topbar-alert { display: none; }

    /* App content padding reduced */
    .app-content { padding: 1rem; }
    .flash-container { padding: 0 1rem; }
}

@media (max-width: 480px) {
    .app-topbar { padding: 0 .75rem; }
    .page-title  { font-size: .875rem; }
    .topbar-right { gap: .5rem; }
}
