/* ========================================
   TILGO - Modern Design System
   Updated: 2026-04-01
   ======================================== */

:root {
  --primary: #1e3a8a;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --accent: #059669;
  --accent-bright: #10b981;
  --success: #059669;
  --warning: #f59e0b;
  --danger: #dc2626;
  --ink: #0f172a;
  --ink-light: #1e293b;
  --text: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 10px 25px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
h1, h2, h3, h4 { font-family: 'Sora', sans-serif; color: var(--ink); line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
a { color: inherit; text-decoration: none; transition: var(--transition); }

.container { width: min(1200px, 92vw); margin: 0 auto; }
.text-gradient { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border-radius: var(--radius); font-weight: 600; font-size: 0.95rem; cursor: pointer; border: 2px solid transparent; transition: var(--transition); }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3); }
.btn-primary:hover { box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4); }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

.site-header { position: sticky; top: 0; z-index: 1000; background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 1rem 0; }
.nav-row { display: flex; justify-content: space-between; align-items: center; gap: 2rem; }
.logo { display: flex; align-items: center; gap: 0.75rem; font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.75rem; color: var(--primary); }
.logo-icon { font-size: 1.5rem; }
.nav-links { display: flex; gap: 2rem; }
.nav-links a { color: var(--text); font-weight: 500; }
.nav-links a:hover { color: var(--primary); }
.nav-actions { display: flex; gap: 1rem; align-items: center; }

.hero { position: relative; padding: 6rem 0 5rem; background: radial-gradient(circle at 15% 20%, rgba(30,58,138,0.08) 0%, transparent 40%), radial-gradient(circle at 85% 30%, rgba(5,150,105,0.08) 0%, transparent 40%), linear-gradient(180deg, #f1f5f9 0%, #ffffff 100%); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 4rem; align-items: center; }
.hero-content { max-width: 650px; }
.hero-badge { display: inline-flex; align-items: center; gap: 0.5rem; background: linear-gradient(135deg, rgba(30,58,138,0.08), rgba(5,150,105,0.08)); border: 1px solid rgba(30,58,138,0.15); color: var(--primary); padding: 0.5rem 1rem; border-radius: var(--radius-full); font-size: 0.85rem; font-weight: 600; margin-bottom: 1.5rem; }
.hero-badge .dot { width: 8px; height: 8px; background: var(--accent-bright); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(1.1); } }
.hero-title { margin-bottom: 1.5rem; line-height: 1.15; }
.hero-description { font-size: 1.125rem; color: var(--text-muted); margin-bottom: 2rem; line-height: 1.7; }
.hero-cta { display: flex; gap: 1rem; margin-bottom: 2.5rem; flex-wrap: wrap; }
.hero-trust { display: flex; gap: 2rem; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.trust-item svg { color: var(--accent); }

.hero-visual { perspective: 1000px; }
.dashboard-preview { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; transform: rotateY(-5deg) rotateX(3deg); transition: var(--transition); }
.dashboard-preview:hover { transform: rotateY(0) rotateX(0); }
.dashboard-header { background: linear-gradient(135deg, var(--bg-soft), #fff); padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.75rem; }
.dashboard-dots { display: flex; gap: 0.5rem; }
.dashboard-dots span { width: 12px; height: 12px; border-radius: 50%; background: #e2e8f0; }
.dashboard-dots span:nth-child(1) { background: #f87171; }
.dashboard-dots span:nth-child(2) { background: #fbbf24; }
.dashboard-dots span:nth-child(3) { background: #34d399; }
.dashboard-title { flex: 1; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.dashboard-content { padding: 1.5rem; }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--bg-soft); padding: 1.25rem; border-radius: var(--radius); text-align: center; }
.stat-card.highlighted { background: linear-gradient(135deg, rgba(5,150,105,0.08), rgba(5,150,105,0.12)); border: 1px solid rgba(5,150,105,0.2); }
.stat-value { font-size: 2.5rem; font-weight: 800; color: var(--primary); font-family: 'Sora', sans-serif; }
.stat-card.highlighted .stat-value { color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.stat-trend { font-size: 0.7rem; color: var(--accent); font-weight: 600; margin-top: 0.5rem; }
.progress-section { margin-bottom: 1.5rem; }
.progress-label { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; }
.progress-bar { height: 12px; background: var(--bg-soft); border-radius: var(--radius-full); overflow: hidden; margin-bottom: 0.5rem; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: var(--radius-full); }
.progress-meta { font-size: 0.8rem; color: var(--text-muted); }
.recent-activity { display: flex; flex-direction: column; gap: 0.75rem; }
.activity-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: var(--bg-soft); border-radius: var(--radius-sm); }
.activity-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; }
.activity-item.success .activity-icon { background: rgba(5,150,105,0.1); color: var(--success); }
.activity-item.pending .activity-icon { background: rgba(245,158,11,0.1); color: var(--warning); }
.activity-text { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.activity-text strong { font-size: 0.9rem; color: var(--ink); }
.activity-text span { font-size: 0.8rem; color: var(--text-muted); }
.activity-time { font-size: 0.75rem; color: var(--text-light); }

.trusted-section { padding: 3rem 0; background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.trusted-label { text-align: center; color: var(--text-light); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1.5rem; }
.trusted-logos { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; align-items: center; }
.logo-placeholder { color: var(--text-light); font-weight: 700; font-size: 1.1rem; opacity: 0.6; }
.logo-placeholder:hover { opacity: 1; color: var(--primary); }

.section { padding: 5rem 0; }
.section-center { text-align: center; max-width: 700px; margin: 0 auto 3rem; }
.section-title { margin-bottom: 1rem; }
.section-intro { font-size: 1.125rem; color: var(--text-muted); line-height: 1.7; }

.section-problem { background: linear-gradient(180deg, #fff 0%, var(--bg-soft) 100%); }
.problem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-bottom: 4rem; }
.problem-card { background: #fff; padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); transition: var(--transition); }
.problem-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.problem-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.problem-card h3 { margin-bottom: 0.75rem; font-size: 1.25rem; }
.problem-card p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }
.stat-highlight { display: flex; justify-content: space-around; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); padding: 3rem; border-radius: var(--radius-lg); color: #fff; }
.stat-item { text-align: center; padding: 0 2rem; }
.stat-number { font-size: 3rem; font-weight: 800; font-family: 'Sora', sans-serif; margin-bottom: 0.5rem; }
.stat-desc { font-size: 0.95rem; opacity: 0.9; }
.stat-divider { width: 1px; background: rgba(255,255,255,0.2); }

.section-how { background: #fff; }
.steps-container { display: flex; justify-content: space-between; align-items: flex-start; max-width: 900px; margin: 0 auto; }
.step { flex: 1; text-align: center; position: relative; }
.step-number { width: 64px; height: 64px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.75rem; font-weight: 800; margin: 0 auto 1.5rem; box-shadow: 0 8px 20px rgba(30,58,138,0.3); }
.step-content h3 { margin-bottom: 0.75rem; font-size: 1.25rem; }
.step-content p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }
.step-connector { width: 100px; height: 2px; background: linear-gradient(90deg, var(--primary), var(--accent)); margin: 2.5rem 1rem; position: relative; }
.step-connector::after { content: '→'; position: absolute; right: -10px; top: 50%; transform: translateY(-50%); color: var(--primary); font-size: 1.25rem; }

.section-pricing { background: var(--bg-soft); }
.pricing-toggle-wrapper { display: flex; justify-content: center; margin-bottom: 3rem; }
.pricing-toggle { display: flex; background: #fff; padding: 0.5rem; border-radius: var(--radius-full); border: 1px solid var(--border); }
.toggle-btn { padding: 0.75rem 1.5rem; border: none; background: transparent; color: var(--text); font-weight: 600; cursor: pointer; border-radius: var(--radius-full); transition: var(--transition); font-size: 0.95rem; }
.toggle-btn.active { background: var(--primary); color: #fff; }
.save-badge { background: var(--accent); color: #fff; padding: 0.2rem 0.5rem; border-radius: var(--radius-full); font-size: 0.75rem; margin-left: 0.5rem; }
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; max-width: 900px; margin: 0 auto; }
.pricing-card { background: #fff; padding: 2.5rem; border-radius: var(--radius-lg); border: 2px solid var(--border); position: relative; transition: var(--transition); }
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pricing-card.featured { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.featured-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 0.35rem 1rem; border-radius: var(--radius-full); font-size: 0.8rem; font-weight: 700; }
.pricing-header { text-align: center; margin-bottom: 2rem; }
.pricing-plan { font-size: 1.5rem; margin-bottom: 0.5rem; }
.pricing-desc { color: var(--text-muted); font-size: 0.95rem; }
.pricing-price { text-align: center; margin-bottom: 2rem; }
.price-amount { font-size: 3.5rem; font-weight: 800; color: var(--primary); font-family: 'Sora', sans-serif; }
.price-period { color: var(--text-muted); font-size: 1rem; }
.pricing-features { list-style: none; margin-bottom: 2rem; }
.pricing-features li { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.95rem; }
.pricing-features li:last-child { border-bottom: none; }
.feature-check::before { content: '✓'; color: var(--accent); font-weight: 700; }
.pricing-legal { text-align: center; color: var(--text-light); font-size: 0.85rem; margin-top: 1rem; }
.pricing-guarantee { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 3rem; padding: 1.5rem; background: rgba(5,150,105,0.05); border: 1px solid rgba(5,150,105,0.2); border-radius: var(--radius); color: var(--ink); }
.pricing-guarantee svg { color: var(--accent); flex-shrink: 0; }

.section-faq { background: #fff; }
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { margin-bottom: 1rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: var(--transition); }
.faq-item:hover { border-color: var(--primary); }
.faq-question { width: 100%; padding: 1.25rem 1.5rem; background: #fff; border: none; text-align: left; font-size: 1.05rem; font-weight: 600; color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: var(--transition); }
.faq-question:hover { background: var(--bg-soft); }
.faq-icon { font-size: 1.5rem; color: var(--primary); transition: var(--transition); }
.faq-item.active .faq-icon { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; padding: 0 1.5rem; background: var(--bg-soft); color: var(--text); line-height: 1.7; transition: all 0.3s ease; }
.faq-item.active .faq-answer { max-height: 200px; padding: 1.25rem 1.5rem; }

.section-cta { background: var(--bg-soft); padding-bottom: 6rem; }
.cta-card { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); padding: 4rem; border-radius: var(--radius-lg); text-align: center; color: #fff; position: relative; overflow: hidden; }
.cta-card h2 { color: #fff; margin-bottom: 1rem; }
.cta-card p { color: rgba(255,255,255,0.9); font-size: 1.125rem; margin-bottom: 2rem; }
.cta-buttons .btn-primary { background: #fff; color: var(--primary); }
.cta-meta { display: flex; justify-content: center; gap: 2rem; margin-top: 2rem; flex-wrap: wrap; font-size: 0.9rem; color: rgba(255,255,255,0.8); }

.site-footer { background: var(--ink); color: #fff; padding: 4rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand p { color: var(--text-light); margin-top: 1rem; }
.footer-links h4 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.footer-links a { display: block; color: var(--text-light); margin-bottom: 0.75rem; }
.footer-links a:hover { color: #fff; }
.footer-links p { color: var(--text-light); font-size: 0.9rem; line-height: 1.6; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1); color: var(--text-light); font-size: 0.9rem; }

@media (max-width: 1024px) {
  .hero-grid, .problem-grid, .pricing-grid, .footer-grid { grid-template-columns: 1fr; }
  .steps-container { flex-direction: column; gap: 2rem; }
  .step-connector { width: 2px; height: 50px; margin: 0 auto; }
  .step-connector::after { content: '↓'; right: 50%; transform: translateX(50%); }
  .stat-highlight { flex-direction: column; gap: 2rem; padding: 2rem; }
  .stat-divider { width: 100%; height: 1px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-cta, .cta-meta { flex-direction: column; }
  .hero-trust { flex-direction: column; gap: 1rem; }
  .cta-card { padding: 2rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

.reveal { opacity: 0; transform: translateY(30px); transition: all 0.6s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* ========================================
   AUTH PAGES (Login, Register, Dashboard)
   ======================================== */

.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(30,58,138,0.06) 0%, rgba(5,150,105,0.04) 100%);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.brand-mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
}

.brand-text {
  font-family: 'Sora', sans-serif;
  font-size: 1.5rem;
}

.auth-card h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.auth-subline {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form label {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.9rem;
}

.form input[type="text"],
.form input[type="email"],
.form input[type="password"] {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.checkbox-row span {
  font-size: 0.9rem;
  color: var(--text);
}

.checkbox-row a {
  color: var(--primary);
  text-decoration: underline;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #047857);
  color: #fff;
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}

.btn-accent:hover {
  box-shadow: 0 8px 25px rgba(5, 150, 105, 0.4);
}

.auth-footer {
  text-align: center;
  margin-top: 2rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}

/* Dashboard Styles */
.dashboard-page {
  min-height: 100vh;
  background: var(--bg-soft);
}

.dashboard-header-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.dashboard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.dashboard-content-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 2rem 0;
}

.dashboard-sidebar {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-section h4 {
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: var(--transition);
}

.sidebar-link:hover,
.sidebar-link.active {
  background: var(--bg-soft);
  color: var(--primary);
}

.sidebar-link.active {
  background: rgba(30, 58, 138, 0.08);
  font-weight: 600;
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dashboard-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
}

.dashboard-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.mini-stat {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}

.mini-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  font-family: 'Sora', sans-serif;
}

.mini-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

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

.broker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}

.broker-name {
  font-weight: 600;
  color: var(--ink);
}

.broker-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.broker-status.success {
  color: var(--success);
}

.broker-status.pending {
  color: var(--warning);
}

.broker-status.failed {
  color: var(--danger);
}

@media (max-width: 768px) {
  .auth-card { padding: 2rem; }
  .form-row { grid-template-columns: 1fr; }
  .dashboard-content-grid { grid-template-columns: 1fr; }
  .dashboard-sidebar { order: -1; }
  .dashboard-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Dashboard Page v2 Styles */
.dashboard-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.dashboard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  color: var(--primary);
}

.dashboard-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.dashboard-user p {
  font-weight: 600;
  color: var(--ink);
}

.dashboard-user small {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.dashboard-main {
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
}

.card.stat {
  text-align: center;
}

.card.stat .label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.card.stat .value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  font-family: 'Sora', sans-serif;
}

.card.stat .note {
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 0.5rem;
}

.progress-card h2 {
  font-size: 1.25rem;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.progress-head strong {
  font-size: 1.5rem;
  color: var(--accent);
}

.progress-track {
  height: 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-card .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.progress-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--bg-soft);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

th {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.9rem;
}

td {
  font-size: 0.95rem;
}

.status {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.status.ok {
  background: rgba(5,150,105,0.1);
  color: var(--success);
}

.status.wait {
  background: rgba(245,158,11,0.1);
  color: var(--warning);
}

.status.alert {
  background: rgba(220,38,38,0.1);
  color: var(--danger);
}

.family-card .family-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.family-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.family-form.hidden {
  display: none;
}

.family-form input {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.family-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.family-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}

.family-list li span:first-child {
  font-weight: 600;
  color: var(--ink);
}

.family-list li span:nth-child(2) {
  color: var(--text-muted);
}

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

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: 1fr; }
  .family-form { grid-template-columns: 1fr; }
  .family-list li { flex-wrap: wrap; gap: 0.5rem; }
}
