/* ================================================================
   LinguaLab - Feuille de styles unifiée
   ================================================================
   Couvre : login.html, app.html, admin.html
   Design : clean, professionnel, responsive (mobile-first)
   ================================================================ */

:root {
  /* Palette */
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --surface-2: #F4F4F2;
  --surface-3: #EBE9E5;
  --border: #E7E5E0;
  --border-strong: #D4D2CC;
  --text: #0F172A;
  --text-muted: #475569;
  --text-faint: #94A3B8;

  /* Accents par langue */
  --en: #2563EB;
  --en-bg: #EFF6FF;
  --en-border: #BFDBFE;
  --en-deep: #1E40AF;

  --de: #B45309;
  --de-bg: #FEF3C7;
  --de-border: #FCD34D;
  --de-deep: #92400E;

  /* États */
  --success: #15803D;
  --success-bg: #DCFCE7;
  --error: #B91C1C;
  --error-bg: #FEE2E2;
  --warning: #B45309;
  --warning-bg: #FEF3C7;

  /* Mesures */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
  --shadow: 0 4px 14px rgba(15,23,42,0.06);
  --shadow-lg: 0 10px 30px rgba(15,23,42,0.12);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button { font-family: inherit; cursor: pointer; border: none; background: none; }

input, textarea, select {
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
}

/* ================================================================
   LOGIN PAGE
================================================================ */
body.login-page {
  background: linear-gradient(135deg, #FAFAF9 0%, #F0EDE6 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-brand {
  text-align: center;
}

.login-brand h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.login-brand .tag {
  font-size: 12px;
  color: var(--text-faint);
  font-variant: small-caps;
  letter-spacing: 0.12em;
}

.login-card {
  background: var(--surface);
  padding: 32px 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.login-card h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.login-card .lede {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.login-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.login-meta {
  text-align: center;
}

/* ================================================================
   APP PAGE - HEADER
================================================================ */
body.app-page,
body.admin-page {
  background: var(--bg);
  min-height: 100vh;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.brand .tag {
  font-size: 11px;
  color: var(--text-faint);
  font-variant: small-caps;
  letter-spacing: 0.1em;
}

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

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-muted);
}

.streak-badge .flame { font-size: 14px; }
.streak-badge strong { color: var(--text); font-weight: 600; }

.lang-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}

.lang-toggle button {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  transition: all 0.15s ease;
}

.lang-toggle button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.user-menu {
  position: relative;
}

.user-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--text);
  color: var(--surface);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.user-menu-btn:hover { transform: scale(1.05); }

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 8px;
  z-index: 200;
}

.user-info {
  padding: 10px 12px;
}

.user-info strong { display: block; font-weight: 600; }
.user-info small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.user-role {
  display: inline-block;
  margin-top: 6px;
  font-size: 10px;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.user-menu-dropdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.menu-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}

/* ================================================================
   APP PAGE - NAVIGATION (tabs)
================================================================ */
.app-tabs {
  display: flex;
  gap: 2px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.app-tabs::-webkit-scrollbar { display: none; }

.app-tabs button {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.app-tabs button:hover { color: var(--text); }

.app-tabs button.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 600;
}

/* ================================================================
   APP PAGE - MAIN
================================================================ */
.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
}

.section {
  display: none;
  animation: fadeIn 0.2s ease;
}

.section.active { display: block; }

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

.section h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.section .lede {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 15px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* ================================================================
   CARDS
================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

/* ================================================================
   NEXT ACTION (dashboard hero card)
================================================================ */
.next-action {
  background: linear-gradient(135deg, #0F172A 0%, #1e293b 100%);
  color: white;
  padding: 28px;
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.next-action .label {
  font-size: 11px;
  font-variant: small-caps;
  letter-spacing: 0.12em;
  opacity: 0.6;
  margin-bottom: 8px;
}

.next-action h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.next-action p {
  opacity: 0.85;
  margin-bottom: 16px;
  font-size: 14px;
}

.next-action .btn {
  background: white;
  color: var(--text);
}

.next-action .btn:hover { background: var(--surface-2); }

/* ================================================================
   STATS GRID
================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.stat-label,
.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-faint);
  font-variant: small-caps;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  font-weight: 600;
}

.stat-value,
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-sub,
.stat-card .stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ================================================================
   BUTTONS
================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--text);
  color: white;
}
.btn-primary:hover { background: #1e293b; }

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

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

.btn-danger {
  background: var(--error);
  color: white;
}
.btn-danger:hover { background: #991B1B; }

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ================================================================
   FORMS
================================================================ */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface);
  transition: border-color 0.15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(15,23,42,0.05);
}

.field small {
  display: block;
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-full { grid-column: 1 / -1; }

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
  flex-wrap: wrap;
}

.password-row {
  display: flex;
  gap: 8px;
}

.password-row input { flex: 1; }

/* ================================================================
   MESSAGES (alerts)
================================================================ */
.message {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

.message.error { background: var(--error-bg); color: var(--error); }
.message.success { background: var(--success-bg); color: var(--success); }
.message.warning { background: var(--warning-bg); color: var(--warning); }

/* ================================================================
   QUOTA BAR
================================================================ */
.quota-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.quota-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--en), var(--text));
  transition: width 0.3s ease;
}

.quota-mini {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: 4px;
}

/* ================================================================
   INSTRUCTIONS (ordered list)
================================================================ */
.instructions {
  margin-left: 24px;
  color: var(--text);
}

.instructions li {
  margin-bottom: 8px;
}

/* ================================================================
   LESSON LIST
================================================================ */
.lesson-list {
  display: grid;
  gap: 12px;
}

.lesson-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 16px;
}

.lesson-item:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.lesson-num {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-muted);
}

.lesson-num.en { background: var(--en-bg); color: var(--en-deep); }
.lesson-num.de { background: var(--de-bg); color: var(--de-deep); }
.lesson-num.done { background: var(--success-bg); color: var(--success); }

.lesson-meta { flex: 1; min-width: 0; }
.lesson-meta h4 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.lesson-meta .info { font-size: 12px; color: var(--text-muted); }

.lesson-status {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.lesson-status.done { background: var(--success-bg); color: var(--success); }
.lesson-status.todo { background: var(--surface-2); color: var(--text-muted); }

/* ================================================================
   LESSON DETAIL
================================================================ */
.lesson-detail h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.lesson-detail p { margin-bottom: 12px; }

/* Vocab table */
.vocab-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}

.vocab-table th {
  background: var(--surface-2);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.vocab-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

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

.vocab-table .play-btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.vocab-table .play-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.ipa {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: var(--text-muted);
  font-size: 13px;
}

/* Mini-text */
.mini-text {
  background: var(--surface-2);
  border-left: 3px solid var(--text);
  padding: 16px 20px;
  border-radius: 6px;
  margin: 14px 0;
  font-size: 15px;
  line-height: 1.7;
}

.mini-text.en { border-left-color: var(--en); }
.mini-text.de { border-left-color: var(--de); }

.mini-text .translation {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* ================================================================
   QUIZ
================================================================ */
.quiz-container {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.quiz-question {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}

.q-num {
  font-size: 11px;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.q-text {
  font-weight: 500;
  margin-bottom: 12px;
  font-size: 15px;
}

.options {
  display: grid;
  gap: 8px;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
  user-select: none;
}

.option:hover { background: white; border-color: var(--border-strong); }
.option.selected { background: white; border-color: var(--text); font-weight: 500; }
.option.correct { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.option.incorrect { background: var(--error-bg); border-color: var(--error); color: var(--error); }
.option.show-correct { background: var(--success-bg); border-color: var(--success); }

.quiz-result {
  padding: 18px;
  border-radius: var(--radius);
  margin-top: 14px;
  font-weight: 500;
}

.quiz-result.pass { background: var(--success-bg); color: var(--success); }
.quiz-result.fail { background: var(--error-bg); color: var(--error); }

/* ================================================================
   CHAT (Tutor)
================================================================ */
.chat-wrapper {
  display: flex;
  flex-direction: column;
  height: 600px;
  max-height: 70vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tutor-name { font-weight: 600; font-size: 14px; }
.tutor-status { font-size: 12px; color: var(--text-muted); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.msg.tutor {
  background: var(--surface-2);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg.tutor.en { background: var(--en-bg); }
.msg.tutor.de { background: var(--de-bg); }

.msg.user {
  background: var(--text);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.speak-btn {
  background: transparent;
  border: 1px solid rgba(15,23,42,0.15);
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  margin-top: 6px;
  color: var(--text-muted);
}

.speak-btn:hover { background: rgba(15,23,42,0.05); }

.msg.loading {
  background: var(--surface-2);
  align-self: flex-start;
  color: var(--text-muted);
  font-style: italic;
}

.chat-input-area {
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 8px;
}

.chat-input-area textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  resize: none;
  min-height: 42px;
  max-height: 100px;
  background: var(--surface);
}

.chat-input-area textarea:focus {
  outline: none;
  border-color: var(--text);
}

/* ================================================================
   PRONUNCIATION
================================================================ */
.pronun-grid {
  display: grid;
  gap: 12px;
}

.pronun-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.pronun-word {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pronun-word .word {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pronun-word .ipa-large {
  font-family: "SF Mono", Menlo, monospace;
  color: var(--text-muted);
  font-size: 16px;
}

.pronun-word .meaning {
  font-size: 13px;
  color: var(--text-faint);
  font-style: italic;
}

.pronun-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.pronun-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  display: none;
}

.pronun-feedback.show { display: block; }
.pronun-feedback.success { background: var(--success-bg); color: var(--success); }
.pronun-feedback.partial { background: var(--warning-bg); color: var(--warning); }
.pronun-feedback.error { background: var(--error-bg); color: var(--error); }

/* ================================================================
   PROGRESS BARS
================================================================ */
.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--text);
  transition: width 0.3s ease;
}

.progress-fill.progress-en { background: var(--en); }
.progress-fill.progress-de { background: var(--de); }

.skill-progress {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.skill-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.skill-name { min-width: 100px; }
.skill-val {
  color: var(--text-muted);
  min-width: 60px;
  text-align: right;
  font-size: 13px;
}

/* ================================================================
   TEST (Level test)
================================================================ */
.test-locked {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.test-locked .icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.test-locked h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.test-locked p {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}

/* ================================================================
   ADMIN — TABLE
================================================================ */
.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
}

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

.users-table th {
  background: var(--surface-2);
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.users-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.users-table tr:last-child td { border-bottom: none; }
.users-table tr:hover { background: var(--surface-2); }

.users-table .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.role-admin { background: var(--text); color: white; }
.badge.role-parent { background: var(--en-bg); color: var(--en-deep); }
.badge.role-teen { background: var(--de-bg); color: var(--de-deep); }

.badge.status-active { background: var(--success-bg); color: var(--success); }
.badge.status-paused { background: var(--warning-bg); color: var(--warning); }
.badge.status-archived { background: var(--error-bg); color: var(--error); }

.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Admin stats summary */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat-block .stat-label {
  margin-bottom: 6px;
}

.stat-block .stat-value {
  font-size: 24px;
}

/* ================================================================
   MODAL
================================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

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

.modal-content p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ================================================================
   UTILITIES
================================================================ */
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.loading {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-faint);
  font-style: italic;
}

code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 768px) {
  .app-header { padding: 12px 16px; }
  .app-tabs { padding: 0 16px; }
  .app-main { padding: 20px 16px; }
  .brand h1 { font-size: 18px; }
  .brand .tag { display: none; }
  .section h2 { font-size: 22px; }
  .next-action { padding: 20px; }
  .next-action h3 { font-size: 18px; }
  .stat-value { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-summary { grid-template-columns: 1fr; }
  .pronun-word .word { font-size: 18px; }
  .users-table { font-size: 12px; }
  .users-table th, .users-table td { padding: 8px 10px; }
  .streak-badge { padding: 4px 8px; font-size: 12px; }
}

@media (max-width: 480px) {
  .header-right { flex-wrap: wrap; }
  .lang-toggle button { padding: 5px 10px; font-size: 12px; }
}
