/* ==========================================================================
   EMERALD MATRIX THEME DESIGN SYSTEM
   AI Humanizer & Paraphraser Studio
   ========================================================================== */

:root {
  /* Emerald Matrix Palette */
  --bg-core: #070a0d;
  --bg-surface: #0c1217;
  --bg-elevated: #111a22;
  --bg-glass: rgba(12, 20, 26, 0.78);
  --bg-glass-card: rgba(17, 26, 34, 0.65);
  
  /* Emerald & Cyber Teal Accents */
  --primary: #10b981;
  --primary-glow: rgba(16, 185, 129, 0.35);
  --primary-glow-strong: rgba(16, 185, 129, 0.6);
  --primary-light: #34d399;
  --primary-dark: #059669;
  --accent-teal: #06b6d4;
  --accent-cyan: #22d3ee;
  --accent-gradient: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --accent-gradient-subtle: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
  
  /* Status Colors */
  --status-pass: #10b981;
  --status-fail: #ef4444;
  --status-warn: #f59e0b;
  --status-pass-bg: rgba(16, 185, 129, 0.12);
  --status-fail-bg: rgba(239, 68, 68, 0.12);
  
  /* Text & Borders */
  --text-primary: #f0fdf4;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #34d399;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-emerald: rgba(16, 185, 129, 0.25);
  --border-emerald-active: rgba(16, 185, 129, 0.7);
  
  /* Radius & Shadows */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px var(--primary-glow);
  --shadow-glow-lg: 0 0 40px var(--primary-glow-strong);
  
  /* Typography */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html, body {
  min-height: 100vh;
  background-color: var(--bg-core);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
}

/* Container */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 16px 64px 16px;
}

@media (min-width: 640px) {
  .app-container { padding: 20px 24px 64px 24px; }
}

@media (min-width: 1024px) {
  .app-container { padding: 24px 32px 64px 32px; }
}

/* ─── Navbar ─── */
.navbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  position: sticky;
  top: 8px;
  z-index: 50;
}

@media (min-width: 768px) {
  .navbar {
    padding: 16px 28px;
    margin-bottom: 32px;
    top: 16px;
    flex-wrap: nowrap;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  color: #052e16;
  font-size: 20px;
  font-weight: 800;
}

@media (min-width: 768px) {
  .brand-icon { width: 44px; height: 44px; font-size: 22px; }
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .brand-title { font-size: 1.35rem; }
}

.brand-subtitle {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: none;
}

@media (min-width: 640px) {
  .brand-subtitle { display: block; font-size: 0.72rem; }
}

@media (min-width: 1024px) {
  .brand-subtitle { font-size: 0.75rem; }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

@media (min-width: 768px) {
  .nav-actions { gap: 12px; flex-wrap: nowrap; }
}

/* Hide less-essential nav items on very small screens */
@media (max-width: 479px) {
  .badge-status { display: none; }
  #themeSelect { display: none; }
}

@media (max-width: 639px) {
  /* Stack auth buttons */
  #btnOpenAuth, #btnSignUp { padding: 6px 10px; font-size: 0.78rem; }
  #btnOpenAdmin, a.btn-ghost[href="/docs"] { display: none; }
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary-light);
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); opacity: 0.8; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-ghost:hover {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-light);
  border-color: var(--border-emerald);
}

/* ─── Golden Zone Banner ─── */
.golden-zone-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .golden-zone-bar {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
  }
}

.metric-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 640px) {
  .metric-card { padding: 20px 24px; }
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.metric-target {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary-light);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

@media (min-width: 640px) {
  .metric-value { font-size: 1.85rem; }
}

.metric-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  margin-top: 12px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Control Hub ─── */
.control-hub {
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 1024px) {
  .control-hub {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    margin-bottom: 32px;
    gap: 20px;
  }
}

.control-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.control-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.input-instruction {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
  width: 100%;
}

@media (min-width: 640px) {
  .input-instruction {
    width: auto;
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}

.input-instruction:focus {
  border-color: var(--primary);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #042416;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .btn-primary { font-size: 1rem; padding: 14px 28px; }
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--border-emerald);
  color: var(--primary-light);
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .btn-secondary { font-size: 0.95rem; padding: 14px 22px; }
}

.btn-secondary:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--primary-light);
}

/* ─── File Drop Zone ─── */
.file-upload-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.82rem;
  border: 1px dashed var(--border-emerald);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  white-space: nowrap;
}

.file-upload-badge:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary-light);
}

/* ─── Studio Main Workspace ─── */
.studio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .studio-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 28px;
  }
}

.editor-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 380px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
  min-width: 0;
}

@media (min-width: 640px) {
  .editor-card { height: 440px; }
}

@media (min-width: 1024px) {
  .editor-card { height: 540px; }
}

.editor-card:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.editor-card.is-dragover {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-glow), var(--shadow-glow);
}

.editor-card.is-dragover .textarea-wrap::after {
  content: "Drop document to upload";
  position: absolute;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--primary-light);
  border-radius: var(--radius-md);
  background: rgba(7, 10, 13, 0.82);
  color: var(--primary-light);
  font: 500 0.9rem var(--font-mono);
  pointer-events: none;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  gap: 8px;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .editor-header { padding: 16px 20px; }
}

.editor-title {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

@media (min-width: 640px) {
  .editor-title { font-size: 0.95rem; }
}

.editor-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.textarea-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

textarea.editor-input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.95rem;
  line-height: 1.7;
  padding: 16px;
  resize: none;
  outline: none;
}

@media (min-width: 640px) {
  textarea.editor-input { font-size: 1rem; padding: 20px; }
}

textarea.editor-input::placeholder {
  color: var(--text-muted);
}

.editor-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  flex-shrink: 0;
  gap: 8px;
  flex-wrap: wrap;
}

.document-status {
  max-width: 100%;
  overflow: hidden;
  color: var(--text-muted);
  font: 0.68rem var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .editor-footer { padding: 12px 20px; }
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--primary-light);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-text-action:hover {
  background: rgba(16, 185, 129, 0.12);
}

/* ─── Output Display ─── */
.output-content {
  padding: 16px;
  font-size: 0.95rem;
  line-height: 1.7;
  overflow-y: auto;
  height: 100%;
  word-break: break-word;
}

@media (min-width: 640px) {
  .output-content { padding: 20px; font-size: 1rem; }
}

/* ─── Review Card ─── */
.review-card { grid-column: 1 / -1; }
.review-tabs { display: flex; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
.review-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-muted); padding: 8px 12px; cursor: pointer; }
.review-tab.active { color: var(--primary-light); border-bottom-color: var(--primary); }
.review-filters { display: flex; align-items: center; gap: 10px; padding: 10px 16px 0; color: var(--text-muted); font: 0.78rem var(--font-mono); flex-wrap: wrap; }
.review-filters label { display: inline-flex; align-items: center; gap: 6px; }
.review-filter { background: rgba(255,255,255,0.05); border: 1px solid var(--border-subtle); color: var(--text-primary); border-radius: 6px; padding: 5px 8px; font: inherit; }
.review-filter-action, .decision-button { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-muted); border-radius: 6px; padding: 5px 8px; cursor: pointer; font: inherit; }
.review-filter-action:hover, .decision-button:hover, .decision-button.selected { border-color: var(--primary); color: var(--primary-light); }
.filter-count { margin-left: auto; color: var(--primary-light); }
.changes-display, .summary-display { max-height: 460px; overflow: auto; padding: 14px 16px; }
.change-row { display: grid; grid-template-columns: 56px 24px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--border-subtle); line-height: 1.5; }

@media (max-width: 479px) {
  .change-row { grid-template-columns: 40px 20px minmax(0, 1fr) auto; gap: 6px; }
}

.change-actions { display: flex; gap: 5px; }
.decision-accepted { background: rgba(16, 185, 129, 0.08); }
.decision-rejected { background: rgba(239, 68, 68, 0.08); opacity: 0.72; }
.change-location { color: var(--text-muted); font: 0.72rem var(--font-mono); }
.change-marker { color: var(--text-muted); font-weight: 700; }
.change-delete .change-marker, .change-delete del { color: #fca5a5; }
.change-insert .change-marker, .change-insert ins { color: #86efac; }
.change-replace .change-marker { color: #fcd34d; }
.change-text del, .change-text ins { text-decoration-thickness: 2px; margin-right: 8px; }
.summary-display { display: grid; gap: 12px; line-height: 1.6; color: var(--text-secondary); }
.download-actions { gap: 16px; }

/* ─── Special highlights ─── */
.frozen-entity-highlight {
  background: rgba(6, 182, 212, 0.15);
  border-bottom: 2px solid var(--accent-teal);
  color: #a5f3fc;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.badge-golden-zone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid var(--primary);
  color: #6ee7b7;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ─── Telemetry Section ─── */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .telemetry-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (min-width: 1024px) {
  .telemetry-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 18px; }
}

.telemetry-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

@media (min-width: 640px) {
  .telemetry-card { padding: 16px 20px; }
}

.telemetry-val {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-accent);
  margin-top: 4px;
}

@media (min-width: 640px) {
  .telemetry-val { font-size: 1.4rem; }
}

.telemetry-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── Modal Backdrop & Cards ─── */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 7, 10, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 12px;
  overflow-y: auto;
}

@media (min-width: 640px) {
  .modal-backdrop { padding: 20px; }
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  box-shadow: 0 0 50px rgba(16, 185, 129, 0.25);
  overflow: hidden;
  animation: modalFadeIn 0.25s ease-out;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .modal-header { padding: 20px 24px; }
}

.modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex: 1;
}

@media (min-width: 640px) {
  .modal-body { padding: 24px; gap: 18px; }
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.01);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 12px;
}

@media (min-width: 640px) {
  .modal-footer { padding: 16px 24px; }
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-label {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (min-width: 640px) {
  .admin-label { font-size: 0.82rem; }
}

.admin-stats-box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.stat-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.stat-pill span {
  color: var(--primary-light);
  font-weight: 700;
}

/* ─── User Badge ─── */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.08);
  color: var(--text-primary);
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.btn-ghost.small {
  padding: 5px 10px;
  font-size: 0.72rem;
}

/* ─── Auth Card ─── */
.auth-card {
  max-width: 480px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 20px 0;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .auth-tabs { padding: 20px 24px 0; }
}

.auth-tab {
  flex: 1;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.18s;
}

.auth-tab.active {
  border-color: var(--border-emerald);
  color: var(--primary-light);
  background: rgba(16, 185, 129, 0.08);
}

.auth-body {
  padding-top: 12px;
}

.auth-form-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form-block[hidden] {
  display: none;
}

.auth-password-field {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.auth-password-field .input-instruction {
  min-width: 0;
  flex: 1;
}

.auth-password-toggle {
  flex: 0 0 58px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--primary-light);
  cursor: pointer;
  font: 0.76rem var(--font-mono);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  border-color: var(--border-emerald-active);
  outline: none;
}

.auth-status {
  min-height: 22px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--primary-light);
  overflow-wrap: anywhere;
}

.auth-status.error {
  color: var(--status-fail);
}

.auth-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.auth-links [hidden] {
  display: none;
}

.auth-help {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ─── Admin Panel ─── */
.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
}

.admin-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
}

.admin-user-row strong {
  display: block;
  font-size: 0.9rem;
}

.admin-user-row small {
  display: block;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: var(--font-mono);
}

.role-select {
  min-width: 110px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-emerald);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

/* ─── Admin sub-grids – responsive ─── */
.admin-concurrency-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.admin-zone-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .admin-zone-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ─── Review panel states ─── */
.change-row.is-rejected .change-text ins { opacity: 0.35; text-decoration: line-through; }
.change-row.is-rejected .change-text del { color: var(--text-primary); text-decoration: none; }
.change-row.is-rejected .change-marker { color: #fca5a5; }
.change-row.is-accepted .change-marker { color: #86efac; }
.change-text { white-space: pre-wrap; word-break: break-word; }
.change-text ins { background: rgba(134, 239, 172, 0.10); text-decoration: underline; margin-right: 0; }
.change-text del { background: rgba(252, 165, 165, 0.10); margin-right: 0; }
.review-filter-action:disabled { opacity: 0.4; cursor: default; }
