/* ============================================================
   TA-Intake Portal — Design System
   Modern dashboard theme with dark/light mode
   ============================================================ */

/* ===== CSS Variables — Light Theme (default) ===== */
:root {
  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-light: #f0fdfa;
  --primary-text: #0d9488;

  --success: #10b981;
  --success-light: #ecfdf5;
  --success-text: #059669;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-text: #d97706;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-text: #dc2626;
  --info: #3b82f6;
  --info-light: #eff6ff;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --header-height: 64px;
  --transition: 0.2s ease;
}

/* ===== Dark Theme ===== */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --surface: #1e293b;
  --surface-hover: #334155;
  --border: #334155;
  --border-light: #1e293b;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --primary: #2dd4bf;
  --primary-hover: #14b8a6;
  --primary-light: #042f2e;
  --primary-text: #5eead4;

  --success: #34d399;
  --success-light: #064e3b;
  --success-text: #6ee7b7;
  --warning: #fbbf24;
  --warning-light: #78350f;
  --warning-text: #fcd34d;
  --danger: #f87171;
  --danger-light: #7f1d1d;
  --danger-text: #fca5a5;
  --info: #60a5fa;
  --info-light: #1e3a5f;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Client Portal Layout ===== */
.client-layout {
  max-width: 1200px;
  margin: 0 auto;
}

.client-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: var(--header-height);
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.85);
}

[data-theme="dark"] .client-nav {
  background: rgba(30,41,59,0.9);
}

.client-nav .logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-nav .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.client-nav .nav-links {
  display: flex;
  gap: 4px;
  margin-left: 40px;
  list-style: none;
}

.client-nav .nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.client-nav .nav-links a:hover,
.client-nav .nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
}

.client-nav .nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition);
  color: var(--text-secondary);
}

.theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== Team Dashboard Layout ===== */
.team-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header .logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.sidebar-header .logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.sidebar-nav .nav-section {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 12px 8px;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.sidebar-nav .nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.sidebar-nav .nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.sidebar-nav .nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar-nav .nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.main-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 40;
}

.main-header .page-title {
  font-size: 18px;
  font-weight: 700;
}

.main-header .header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-body {
  padding: 24px;
}

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
}

/* ===== Stat Cards ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.blue { background: var(--info-light); color: var(--info); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.purple { background: var(--primary-light); color: var(--primary); }

.stat-info { flex: 1; }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text-primary); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: var(--danger-text); }

.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.badge-primary { background: var(--primary-light); color: var(--primary-text); }
.badge-success { background: var(--success-light); color: var(--success-text); }
.badge-warning { background: var(--warning-light); color: var(--warning-text); }
.badge-danger { background: var(--danger-light); color: var(--danger-text); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-muted { background: var(--bg); color: var(--text-muted); }

/* ===== Form Elements ===== */
.input, .select, .textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-primary);
  transition: all var(--transition);
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,148,136,0.1);
}

.search-input {
  position: relative;
}

.search-input .input {
  padding-left: 36px;
}

.search-input .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== Tables ===== */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.table tr:last-child td { border-bottom: none; }

.table tr:hover td { background: var(--surface-hover); }

/* ===== Progress Bar ===== */
.progress {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-bar.green { background: var(--success); }
.progress-bar.yellow { background: var(--warning); }
.progress-bar.red { background: var(--danger); }

/* ===== Hero Section (Client Home) ===== */
.hero {
  background: linear-gradient(135deg, var(--primary), #0891b2);
  color: white;
  padding: 80px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.hero h1 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.hero .subtitle {
  font-size: 18px;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 32px;
  position: relative;
  z-index: 1;
}

.hero .hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.hero .btn-hero {
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
}

.hero .btn-hero-primary {
  background: white;
  color: var(--primary);
}

.hero .btn-hero-primary:hover {
  background: rgba(255,255,255,0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.hero .btn-hero-secondary {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
}

.hero .btn-hero-secondary:hover {
  background: rgba(255,255,255,0.25);
}

/* ===== Service Cards ===== */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 48px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-card .service-icon {
  width: 56px;
  height: 56px;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px;
}

.service-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.service-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Process Timeline ===== */
.process-section {
  padding: 64px 24px;
  max-width: 900px;
  margin: 0 auto;
}

.process-section h2 {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 48px;
}

.process-timeline {
  position: relative;
  padding-left: 40px;
}

.process-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.process-step {
  position: relative;
  margin-bottom: 48px;
  cursor: pointer;
}

.process-step:last-child { margin-bottom: 0; }

.process-step .step-dot {
  position: absolute;
  left: -33px;
  top: 4px;
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  z-index: 1;
  transition: all 0.3s;
}

.process-step:hover .step-dot {
  transform: scale(1.2);
  box-shadow: 0 0 0 6px var(--primary-light);
}

.process-step .step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.3s;
}

.process-step:hover .step-card {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.process-step h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary);
}

.process-step p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.process-step .step-details {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.process-step.expanded .step-details {
  display: block;
}

.step-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.step-detail-item .detail-icon {
  color: var(--success);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ===== Case Cards (Team Dashboard) ===== */
.case-grid {
  display: grid;
  gap: 12px;
}

.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
  cursor: pointer;
}

.case-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.case-card .case-info { flex: 1; }

.case-card .case-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.case-card .case-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
}

.case-card .case-progress {
  width: 120px;
}

.case-card .case-deadline {
  text-align: right;
  min-width: 80px;
}

.case-card .deadline-days {
  font-size: 20px;
  font-weight: 700;
}

.case-card .deadline-label {
  font-size: 11px;
  color: var(--text-muted);
}

.deadline-safe { color: var(--success); }
.deadline-warn { color: var(--warning); }
.deadline-danger { color: var(--danger); }

/* ===== Filter Tabs ===== */
.filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius);
  width: fit-content;
}

.filter-tab {
  padding: 6px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.filter-tab:hover { color: var(--text-primary); }

.filter-tab.active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ===== Legal Reference Cards ===== */
.law-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 12px;
  transition: all var(--transition);
}

.law-card:hover { box-shadow: var(--shadow); }

.law-card .law-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.law-card .law-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.law-card .law-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.law-card .law-articles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.law-card .article-tag {
  background: var(--bg);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== Deadline Calendar ===== */
.deadline-list {
  display: grid;
  gap: 8px;
}

.deadline-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.deadline-item:hover { box-shadow: var(--shadow-sm); }

.deadline-item .dl-date {
  min-width: 70px;
  text-align: center;
}

.deadline-item .dl-date .dl-day {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.deadline-item .dl-date .dl-month {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.deadline-item .dl-indicator {
  width: 4px;
  height: 36px;
  border-radius: 2px;
}

.dl-indicator.safe { background: var(--success); }
.dl-indicator.warn { background: var(--warning); }
.dl-indicator.danger { background: var(--danger); }

.deadline-item .dl-info { flex: 1; }

.deadline-item .dl-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.deadline-item .dl-legal {
  font-size: 12px;
  color: var(--text-muted);
}

.deadline-item .dl-remaining {
  text-align: right;
  min-width: 80px;
  font-size: 13px;
  font-weight: 600;
}

/* ===== Upload Zone ===== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone .upload-icon {
  font-size: 40px;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.upload-zone .upload-text {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.upload-zone .upload-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== View Container ===== */
.view { display: none; }
.view.active { display: block; }

/* ===== Section Title ===== */
.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state .empty-text {
  font-size: 15px;
  margin-bottom: 16px;
}

/* ===== Mobile Menu Toggle ===== */
.mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 45;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero { padding: 48px 20px; }
  .hero h1 { font-size: 28px; }
  .hero .subtitle { font-size: 15px; }
  .hero .hero-cta { flex-direction: column; align-items: center; }

  .service-grid { grid-template-columns: 1fr; padding: 32px 16px; }

  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  .main-content { margin-left: 0; }
  .mobile-toggle { display: flex; }

  .stat-grid { grid-template-columns: 1fr 1fr; }

  .case-card { flex-wrap: wrap; }
  .case-card .case-progress { width: 100%; }
  .case-card .case-deadline { width: auto; }

  .client-nav .nav-links { display: none; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .filter-tabs { flex-wrap: wrap; }
}

/* ===== Print ===== */
@media print {
  .sidebar, .client-nav, .main-header, .theme-toggle, .mobile-toggle { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .card { break-inside: avoid; }
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.view.active {
  animation: fadeIn 0.25s ease;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Tooltip ===== */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.tooltip:hover::after { opacity: 1; }

/* ===== Modal ===== */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.active { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: var(--bg); color: var(--text-primary); }

/* ===== Questionnaire Embed ===== */
.intake-frame-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.intake-frame-wrapper iframe {
  width: 100%;
  min-height: 80vh;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* ===== Compensation Calculator ===== */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.calc-result {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
}

.calc-result .calc-total {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

@media (max-width: 768px) {
  .calc-grid { grid-template-columns: 1fr; }
}
