/* css/main.css — German A1 Hub Base & Responsive Layout */
:root {
  --primary: #1e3a8a;          /* Deep classic blue */
  --primary-light: #3b82f6;    /* Bright active blue */
  --primary-subtle: #eff6ff;   /* Soft ice blue */
  --bg: #f8fafc;               /* Slate-50 clean background */
  --card-bg: #ffffff;
  --text-main: #0f172a;        /* Slate-900 high contrast */
  --text-muted: #64748b;       /* Slate-500 secondary */
  --border: #e2e8f0;           /* Slate-200 clean borders */
  
  /* German Gender Standard Color Scheme */
  --gender-der: #2563eb;       /* Masculine: Blue */
  --gender-der-bg: #dbeafe;
  --gender-die: #e11d48;       /* Feminine: Rose/Red */
  --gender-die-bg: #ffe4e6;
  --gender-das: #059669;       /* Neuter: Emerald Green */
  --gender-das-bg: #d1fae5;
  --gender-plural: #7c3aed;    /* Plural: Violet */
  --gender-plural-bg: #ede9fe;
  
  /* Feedback Colors */
  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --surface-hover: #f1f5f9;
  --surface-alt: #f8fafc;
  --surface-raised: #fafafa;
  --callout-tip-bg: #f0fdf4;
  --callout-tip-border: #bbf7d0;
  --callout-tip-text: #166534;
  --callout-danger-bg: #fef2f2;
  --callout-danger-border: #fecaca;
  --callout-danger-text: #991b1b;
  --callout-info-bg: #eff6ff;
  --callout-info-border: #bfdbfe;
  --callout-info-text: #1e40af;
  --streak-text: #92400e;
  --streak-border: #fde68a;
  --badge-active-border: #bfdbfe;
  --dashboard-hover: #f8fafc;
  --btn-audio-border: #cbd5e1;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
  --primary: #60a5fa;
  --primary-light: #93bbfd;
  --primary-subtle: #1e293b;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;

  --gender-der: #60a5fa;
  --gender-der-bg: #1e3a5f;
  --gender-die: #fb7185;
  --gender-die-bg: #4c1d2e;
  --gender-das: #34d399;
  --gender-das-bg: #134136;
  --gender-plural: #a78bfa;
  --gender-plural-bg: #2e2260;

  --success: #4ade80;
  --success-bg: #14532d;
  --danger: #f87171;
  --danger-bg: #450a0a;
  --warning: #fbbf24;
  --warning-bg: #451a03;

  --surface-hover: #293548;
  --surface-alt: #1a2536;
  --surface-raised: #1e293b;
  --callout-tip-bg: #0f2a1a;
  --callout-tip-border: #166534;
  --callout-tip-text: #86efac;
  --callout-danger-bg: #2a0f0f;
  --callout-danger-border: #991b1b;
  --callout-danger-text: #fca5a5;
  --callout-info-bg: #172040;
  --callout-info-border: #1e40af;
  --callout-info-text: #93c5fd;
  --streak-text: #fbbf24;
  --streak-border: #92400e;
  --badge-active-border: #1e40af;
  --dashboard-hover: #1a2536;
  --btn-audio-border: #475569;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.5);
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* App Container Layout */
.app-container {
  display: flex;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Top Navigation Bar */
.top-header {
  height: 64px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-flag {
  font-size: 1.8rem;
  line-height: 1;
}

.brand-title {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--warning-bg);
  color: var(--streak-text);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid var(--streak-border);
}

.speed-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-hover);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.speed-toggle select {
  border: none;
  background: transparent;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  outline: none;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-header:hover {
  background: var(--primary-light);
}

.menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-main);
  padding: 4px;
}

/* Sidebar Backdrop Overlay */
.sidebar-backdrop {
  display: none;
}

/* Sidebar Navigation */
.sidebar {
  width: 320px;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  transition: width 0.25s ease, opacity 0.25s ease;
}

.sidebar.collapsed {
  width: 0;
  overflow: hidden;
  border-right: none;
  opacity: 0;
  padding: 0;
}

.sidebar-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.sidebar-collapse-btn:hover {
  background: var(--border);
  color: var(--text-main);
}

.sidebar-expand-btn {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 32px;
  background: var(--card-bg);
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: background 0.15s, color 0.15s;
  writing-mode: vertical-lr;
}

.sidebar-expand-btn:hover {
  background: var(--surface-hover);
  color: var(--primary);
}

.sidebar-expand-btn.visible {
  display: flex;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-close-btn {
  display: none;
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.nav-dashboard-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--badge-active-border);
}

.nav-dashboard-link:hover {
  background: var(--surface-hover);
}

.curriculum-list {
  padding: 10px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.week-group {
  margin-bottom: 8px;
}

.week-heading {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 6px 8px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.day-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border: 1px solid transparent;
  margin-bottom: 4px;
  text-decoration: none;
  color: var(--text-main);
}

.day-nav-item:hover {
  background: var(--surface-hover);
}

.day-nav-item.active {
  background: var(--primary-subtle);
  border-color: var(--badge-active-border);
  color: var(--primary);
  font-weight: 700;
}

.day-nav-item.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.day-nav-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 200px;
}

.day-nav-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.day-nav-item.active .day-nav-num {
  color: var(--primary);
}

.day-nav-name {
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-done {
  background: var(--success-bg);
  color: var(--success);
}

.badge-pending {
  background: var(--surface-hover);
  color: var(--text-muted);
}

.badge-planned {
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.65rem;
}

/* Main Workspace */
.main-workspace {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

.main-workspace > section {
  max-width: 1080px;
  margin: 0 auto;
}

/* Day Header Banner */
.day-header-banner {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.day-meta-tag {
  display: inline-block;
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.day-title-main {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.day-title-german {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

/* Workspace Tabs */
.workspace-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary);
  background: var(--surface-alt);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

.tab-badge {
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 10px;
}

.tab-btn.active .tab-badge {
  background: var(--primary);
  color: #ffffff;
}

/* Content Panel Views */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Callout Alert Boxes */
.callout {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 16px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.92rem;
}

.callout-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.callout-tip {
  background: var(--callout-tip-bg);
  border: 1px solid var(--callout-tip-border);
  color: var(--callout-tip-text);
}

.callout-pitfall {
  background: var(--callout-danger-bg);
  border: 1px solid var(--callout-danger-border);
  color: var(--callout-danger-text);
}

.callout-exam {
  background: var(--callout-info-bg);
  border: 1px solid var(--callout-info-border);
  color: var(--callout-info-text);
}

/* Mobile & Tablet Responsive Media Queries */
@media (max-width: 900px) {
  .menu-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
  }
  .menu-toggle-btn:hover {
    background: var(--surface-hover);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-in-out;
  }
  .sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    max-height: 100vh;
    background: var(--card-bg);
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    opacity: 1;
    border-right: 1px solid var(--border);
  }
  .sidebar.collapsed {
    width: 85%;
    opacity: 1;
    overflow-y: auto;
    border-right: 1px solid var(--border);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 2;
  }

  .sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    font-size: 1.1rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
  }
  .sidebar-close-btn:hover {
    background: var(--border);
    color: var(--text-main);
  }
  .sidebar-collapse-btn {
    display: none;
  }
  .sidebar-expand-btn {
    display: none !important;
  }

  .main-workspace {
    padding: 18px 16px;
    max-width: 100%;
  }

  .day-header-banner {
    padding: 18px 16px;
    margin-bottom: 18px;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .top-header {
    height: 58px;
    padding: 0 12px;
  }
  .brand-title {
    font-size: 1.05rem;
  }
  .brand-flag {
    font-size: 1.5rem;
  }
  .header-controls {
    gap: 8px;
  }
  .streak-badge {
    padding: 4px 8px;
    font-size: 0.8rem;
  }
  .speed-toggle {
    padding: 4px 8px;
    font-size: 0.78rem;
  }
  .btn-header {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  .profile-dropdown {
    position: fixed;
    top: 60px;
    right: 12px;
    width: 280px;
  }

  .workspace-tabs {
    gap: 4px;
    margin-bottom: 18px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .workspace-tabs::-webkit-scrollbar {
    display: none;
  }
  .tab-btn {
    padding: 10px 12px;
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  .day-title-main {
    font-size: 1.35rem;
    line-height: 1.25;
  }
  .day-title-german {
    font-size: 0.95rem;
  }
}

@media (max-width: 520px) {
  .brand-sub,
  .brand-title {
    display: none;
  }
  .btn-revision-text {
    display: none;
  }
  .btn-revision-quick {
    padding: 6px 10px;
  }
  .speed-label {
    display: none;
  }
  .speed-toggle {
    padding: 4px 6px;
    min-width: 0;
  }
  .speed-toggle select {
    font-size: 0.75rem;
    min-width: 50px;
  }
  .streak-badge span:last-child {
    font-size: 0.78rem;
  }
  .streak-day-label {
    display: none;
  }
  .header-controls {
    gap: 6px;
  }
  .profile-dropdown {
    position: fixed;
    top: 60px;
    right: 8px;
    left: 8px;
    width: auto;
  }
  .day-title-main {
    font-size: 1.2rem;
  }
}

/* ===== Landing Page ===== */

#landing-view {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.landing-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #fff;
  text-align: center;
  padding: 60px 40px;
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
  box-shadow: var(--shadow-lg);
}

.landing-hero-flag {
  font-size: 3rem;
  margin-bottom: 12px;
}

.landing-hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}

.landing-hero-subtitle {
  font-size: 1.15rem;
  font-weight: 500;
  opacity: 0.92;
  margin: 0 0 16px;
}

.landing-hero-desc {
  font-size: 0.95rem;
  opacity: 0.82;
  max-width: 600px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.landing-cta {
  display: inline-block;
  background: var(--card-bg);
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 36px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  box-shadow: var(--shadow-md);
}

.landing-cta:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.landing-section {
  margin-bottom: 40px;
}

.landing-section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin: 0 0 24px;
}

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.landing-feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}

.landing-feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.landing-feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.landing-feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 8px;
}

.landing-feature-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.landing-steps {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.landing-step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.landing-step-num {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 6px;
}

.landing-step p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.landing-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.landing-stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.landing-stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.landing-stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.landing-bottom-cta {
  text-align: center;
  padding: 40px 20px;
  background: var(--primary-subtle);
  border-radius: var(--radius-lg);
}

.landing-bottom-cta .landing-cta {
  background: var(--primary);
  color: #fff;
}

.landing-bottom-cta .landing-cta:hover {
  background: var(--primary-light);
}

.landing-bottom-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.landing-footer {
  text-align: center;
  padding: 24px 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

.landing-footer p {
  margin: 0;
}

@media (max-width: 600px) {
  .landing-hero {
    padding: 40px 20px;
  }
  .landing-hero-title {
    font-size: 1.8rem;
  }
  .landing-hero-subtitle {
    font-size: 1rem;
  }
  .landing-features-grid {
    grid-template-columns: 1fr;
  }
  .landing-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Theme Toggle Button */
.btn-theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  color: var(--text-main);
}

.btn-theme-toggle:hover {
  background: var(--surface-hover);
}

/* Profile Button */
.profile-wrapper {
  position: relative;
}
.btn-profile {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  transition: background 0.15s;
  color: var(--text-main);
}
.btn-profile:hover {
  background: var(--surface-hover);
}
.profile-avatar {
  font-size: 1.1rem;
  line-height: 1;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Profile Dropdown */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
}
.profile-dropdown.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.profile-dd-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.profile-dd-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.9rem;
}
.profile-dd-email {
  color: var(--text-muted);
  font-size: 0.8rem;
  word-break: break-all;
}
.profile-dropdown-body {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.profile-dd-role {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: capitalize;
}
.btn-logout {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-logout:hover {
  background: var(--surface-hover);
}

/* Login Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 201;
  width: min(420px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.modal.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 0;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-main);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
}
.modal-close:hover {
  color: var(--text-main);
}
.modal-body {
  padding: 20px 24px 24px;
}
.btn-login-google {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-main);
  transition: background 0.15s;
}
.btn-login-google:hover {
  background: var(--surface-hover);
}
.login-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.login-divider span {
  padding: 0 12px;
}
.phone-login-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.input-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
}
.input-phone,
.input-otp {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: var(--card-bg);
  color: var(--text-main);
  box-sizing: border-box;
}
.input-phone:focus,
.input-otp:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.btn-send-otp,
.btn-verify-otp {
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-send-otp:hover,
.btn-verify-otp:hover {
  opacity: 0.9;
}
.btn-send-otp:disabled,
.btn-verify-otp:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.otp-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-note {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}
.login-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--callout-danger-bg);
  border: 1px solid var(--callout-danger-border);
  color: var(--callout-danger-text);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

/* Dark mode landing CTA override */
[data-theme="dark"] .landing-cta {
  background: var(--card-bg);
  color: var(--primary);
}

[data-theme="dark"] .landing-cta:hover {
  background: var(--surface-hover);
}

