/* === Into23 Verify+ × Lark Demo === */
:root {
  --primary: #0066FF;
  --primary-dark: #0047B3;
  --primary-light: #E6F0FF;
  --accent: #00C4A7;
  --accent-dark: #00A68A;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --border: #E3E8EF;
  --text: #1A202C;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #DC2626;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --sidebar-w: 260px;
  --quality-w: 280px;
}

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

/* Login */
.login-layout { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: var(--bg); }
.login-card { text-align: center; background: var(--surface); border-radius: var(--radius-lg); padding: 48px 40px; box-shadow: var(--shadow-lg); max-width: 400px; width: 90%; }
.login-logo { height: 48px; margin-bottom: 16px; }
.login-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-input { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; outline: none; transition: border 0.15s; }
.login-input:focus { border-color: var(--primary); }
.login-error { color: var(--danger); font-size: 13px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* === Topbar === */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo-img { height: 28px; width: auto; }
.logo-mark {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
  letter-spacing: -0.5px;
}
.logo-text { font-size: 15px; color: var(--text-secondary); }
.logo-text strong { color: var(--text); }

.breadcrumb { display: flex; gap: 8px; font-size: 13px; color: var(--text-muted); }
.breadcrumb-item:not(:last-child)::after { content: '/'; margin-left: 8px; color: var(--border); }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.lark-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary);
  padding: 6px 12px;
  background: var(--bg);
  border-radius: 20px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s;
}
.status-dot.connected { background: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,0.15); }
.status-dot.demo { background: var(--warning); box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }

.engine-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
}

/* === Views === */
.view { display: none; min-height: calc(100vh - 56px); }
.view.active { display: block; }

/* === Dashboard === */
.dashboard-layout { display: flex; min-height: calc(100vh - 56px); }
.dashboard-main { flex: 1; padding: 32px; overflow-y: auto; max-width: 1200px; margin: 0 auto; width: 100%; }

.content-header-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.content-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.content-header .subtitle { color: var(--text-secondary); margin-bottom: 0; }

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* Project table */
.project-table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.project-table-header {
  display: grid;
  grid-template-columns: 2fr 1.5fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.project-table-body { }
.project-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
  transition: background 0.15s;
}
.project-row:hover { background: var(--primary-light); }
.project-row:last-child { border-bottom: none; }
.proj-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.proj-type-icon { font-size: 16px; flex-shrink: 0; }
.proj-langs { display: flex; gap: 4px; flex-wrap: wrap; }
.proj-lang-flag { font-size: 16px; }
.proj-cost { font-weight: 600; color: var(--text); }
.proj-lqa { font-weight: 600; color: var(--success); }
.proj-status { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; }
.proj-status.completed { background: #D1FAE5; color: #065F46; }
.proj-status.in_progress { background: #FEF3C7; color: #92400E; }
.proj-date { color: var(--text-muted); font-size: 12px; }

/* === File Picker === */
.filepicker-layout { max-width: 720px; margin: 0 auto; padding: 32px 24px; }
.filepicker-card { background: var(--surface); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.filepicker-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.filepicker-card .subtitle { color: var(--text-secondary); margin-bottom: 20px; }

.filepicker-folder-info {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.filepicker-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.filepicker-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.filepicker-item:hover { border-color: var(--primary); background: var(--primary-light); }
.filepicker-item.selected { border-color: var(--primary); background: var(--primary-light); }
.filepicker-checkbox {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.filepicker-item.selected .filepicker-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.filepicker-checkbox::after { content: '✓'; font-size: 12px; opacity: 0; }
.filepicker-item.selected .filepicker-checkbox::after { opacity: 1; }
.filepicker-file-icon { font-size: 20px; flex-shrink: 0; }
.filepicker-file-info { flex: 1; }
.filepicker-file-name { font-weight: 600; font-size: 14px; }
.filepicker-file-meta { font-size: 12px; color: var(--text-muted); }

.filepicker-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.filepicker-selected { font-size: 13px; color: var(--text-secondary); }

/* === Translate Config === */
.config-layout { max-width: 720px; margin: 0 auto; padding: 32px 24px; }
.config-card { background: var(--surface); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }

.back-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 13px;
  margin-bottom: 20px; padding: 4px 0;
  transition: color 0.15s;
}
.back-btn:hover { color: var(--primary); }

.config-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }

.doc-preview {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 28px;
  border: 1px solid var(--border);
}
.doc-preview-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.doc-preview-meta { font-size: 12px; color: var(--text-muted); }

.config-section { margin-bottom: 28px; }
.config-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.config-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

.lang-grid {
  display: block;
}
.lang-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
}
.lang-chip:hover:not(.disabled) { border-color: var(--primary); background: var(--primary-light); }
.lang-chip.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* Language groups */
.lang-groups-row { display: flex; gap: 12px; margin-bottom: 16px; }
.lang-section-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.lang-group-chip {
  flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 10px 14px; border: 2px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: all 0.15s;
}
.lang-group-chip:hover { border-color: var(--primary); }
.lang-group-chip.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.lang-group-name { font-weight: 600; font-size: 14px; }
.lang-group-members { font-size: 11px; opacity: 0.7; margin-top: 2px; }
.lang-individual { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }

/* Destination selector */
.dest-selector { display: flex; gap: 12px; }
.dest-option {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border: 2px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: all 0.15s; font-size: 14px;
}
.dest-option:hover { border-color: var(--primary); }
.dest-option.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }
.dest-icon { font-size: 18px; }
.lang-chip.disabled { opacity: 0.4; cursor: not-allowed; }
.lang-chip.disabled .lang-name::after { content: ' (soon)'; font-size: 10px; }
.lang-flag { font-size: 20px; }

.engine-selector { display: flex; flex-direction: column; gap: 8px; }
.engine-option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.engine-option.selected { border-color: var(--primary); background: var(--primary-light); }
.engine-icon { font-size: 24px; }
.engine-name { font-weight: 600; font-size: 14px; }
.engine-desc { font-size: 12px; color: var(--text-secondary); }

.tier-selector { display: flex; gap: 12px; }
.tier-option {
  flex: 1;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.tier-option:hover:not(.disabled) { border-color: var(--primary); }
.tier-option.selected { border-color: var(--primary); background: var(--primary-light); }
.tier-option.disabled { opacity: 0.4; cursor: not-allowed; }
.tier-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.tier-price { font-size: 13px; color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.tier-features { font-size: 11px; color: var(--text-secondary); }
.badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  background: var(--accent);
  color: white;
  border-radius: 4px;
  font-weight: 700;
  vertical-align: middle;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: var(--text-muted); cursor: not-allowed; }
.btn-primary.btn-large { width: 100%; padding: 14px; font-size: 15px; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* === Progress === */
.progress-layout { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 56px); }
.progress-card {
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 48px 64px;
  box-shadow: var(--shadow-lg);
  max-width: 480px;
}
.progress-spinner {
  width: 56px; height: 56px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-card h2 { font-size: 20px; margin-bottom: 8px; }
.progress-doc-name { color: var(--text-secondary); font-size: 14px; margin-bottom: 28px; }
.progress-steps { text-align: left; margin-bottom: 28px; }
.progress-step {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-muted);
}
.progress-step.active { color: var(--text); }
.progress-step.done { color: var(--success); }
.step-icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  border-radius: 50%;
  background: var(--bg);
}
.progress-step.done .step-icon { background: var(--success); color: white; }
.progress-step.active .step-icon { background: var(--primary); color: white; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

.progress-bar-container {
  width: 100%; height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 0.5s ease;
}
.progress-engine { font-size: 12px; color: var(--text-muted); }

/* === CAT Review === */
.cat-layout { display: flex; flex-direction: column; height: calc(100vh - 56px); }

.cat-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cat-toolbar-left { display: flex; align-items: center; gap: 16px; }
.cat-doc-info { display: flex; flex-direction: column; }
.cat-doc-info span:first-child { font-weight: 600; font-size: 14px; }
.cat-lang-pair { font-size: 12px; color: var(--text-muted); }

.cat-toolbar-center { display: flex; align-items: center; gap: 12px; }
.cat-progress-bar {
  width: 200px; height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.cat-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.3s;
}
.cat-progress-text { font-size: 12px; color: var(--text-muted); }

.cat-toolbar-right { display: flex; align-items: center; gap: 16px; }
.lqa-display {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 12px;
  background: var(--bg);
  border-radius: var(--radius);
}
.lqa-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.lqa-value { font-size: 18px; font-weight: 700; }

.cat-main { display: flex; flex: 1; overflow: hidden; }

.segment-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.segment-header {
  display: grid;
  grid-template-columns: 1fr 1fr 100px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.seg-flag { margin-right: 6px; }
.segment-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.segment-row {
  display: grid;
  grid-template-columns: 1fr 1fr 100px;
  border-bottom: 1px solid var(--border);
  min-height: 60px;
  transition: background 0.15s;
}
.segment-row:hover { background: var(--primary-light); }
.segment-row.approved { background: rgba(22, 163, 74, 0.04); }
.segment-row.edited { background: rgba(0, 102, 255, 0.04); }
.segment-row.flagged { background: rgba(220, 38, 38, 0.04); }

.seg-cell {
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
}
.seg-cell.source { color: var(--text); }
.seg-cell.target {
  color: var(--text);
  position: relative;
}
.seg-cell.target textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  background: transparent;
  color: var(--text);
  transition: all 0.15s;
}
.seg-cell.target textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.seg-cell.status {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.seg-status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.seg-status-badge.mt { background: #FEF3C7; color: #92400E; }
.seg-status-badge.approved { background: #D1FAE5; color: #065F46; }
.seg-status-badge.edited { background: #DBEAFE; color: #1E40AF; }
.seg-status-badge.flagged { background: #FEE2E2; color: #991B1B; }

.seg-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.seg-btn {
  width: 24px; height: 24px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  transition: all 0.15s;
}
.seg-btn:hover { border-color: var(--primary); }
.seg-btn.approve:hover { background: var(--success); color: white; border-color: var(--success); }
.seg-btn.flag:hover { background: var(--danger); color: white; border-color: var(--danger); }

.seg-issues {
  font-size: 10px;
  color: var(--warning);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Quality Sidebar */
.quality-sidebar {
  width: var(--quality-w);
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  flex-shrink: 0;
}

/* Language tabs */
.lang-tabs { display: flex; gap: 4px; }
.lang-tab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
  color: var(--text-secondary);
}
.lang-tab:hover { border-color: var(--primary); }
.lang-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 600;
}

/* Terminology */
.term-search { margin-bottom: 10px; }
.term-search input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  outline: none;
}
.term-search input:focus { border-color: var(--primary); }
.term-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.term-item {
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.term-item:hover { border-color: var(--primary); }
.term-source { font-weight: 600; color: var(--text); }
.term-target { color: var(--primary); font-weight: 500; margin-left: 6px; }
.term-cat {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 3px;
  margin-left: 6px;
  text-transform: uppercase;
}
.term-dnt {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  background: #FEF3C7;
  color: #92400E;
  border-radius: 3px;
  margin-left: 4px;
  text-transform: uppercase;
}
.btn-small {
  width: 100%;
  padding: 8px;
  font-size: 12px;
  margin-top: 4px;
}
.qs-section { margin-bottom: 24px; }
.qs-section h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}
.metric-label { color: var(--text-secondary); }
.metric-value { font-weight: 600; }
.metric-approved { color: var(--success); }
.metric-edited { color: var(--primary); }
.metric-flagged { color: var(--danger); }

.error-cat-list { display: flex; flex-direction: column; gap: 4px; }
.error-cat-row {
  display: flex; justify-content: space-between;
  padding: 6px 8px;
  background: var(--bg);
  border-radius: 4px;
  font-size: 12px;
}
.error-cat-count {
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

/* === Quality Report === */
.report-layout { max-width: 800px; margin: 0 auto; padding: 32px 24px; }
.report-card { background: var(--surface); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.report-header { margin-bottom: 28px; }
.report-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.report-meta { font-size: 13px; color: var(--text-muted); }

.report-body { margin-bottom: 28px; }
.report-section { margin-bottom: 24px; }
.report-section h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.report-stat {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.report-stat-value { font-size: 28px; font-weight: 700; }
.report-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.report-stat.score .report-stat-value { color: var(--success); }
.report-stat.pass .report-stat-value { color: var(--primary); }

.report-cat-chart { display: flex; flex-direction: column; gap: 8px; }
.report-cat-bar {
  display: flex; align-items: center; gap: 12px;
}
.report-cat-name { width: 120px; font-size: 13px; }
.report-cat-bar-track {
  flex: 1; height: 24px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.report-cat-bar-fill {
  height: 100%;
  background: var(--warning);
  border-radius: 4px;
  transition: width 0.5s;
}
.report-cat-value { width: 32px; text-align: right; font-weight: 600; font-size: 13px; }

.report-cert { display: flex; gap: 16px; }
.report-cert-item {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 13px;
}
.report-cert-item .cert-icon { font-size: 20px; }

.report-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* Publish detail box */
.publish-detail-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.publish-row { padding: 4px 0; font-size: 13px; }
.publish-row strong { display: inline-block; min-width: 110px; color: var(--text-muted); }
.publish-row a { color: var(--primary); }

/* Language overview cards */
.lang-overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-top: 16px; }
.lang-overview-card { background: var(--bg); border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; transition: all 0.15s; }
.lang-overview-card.pending:hover { border-color: var(--primary); background: var(--primary-light); }
.lang-overview-card.done { border-color: var(--success, #22c55e); }
.lang-overview-flag { font-size: 32px; margin-bottom: 8px; }
.lang-overview-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.lang-overview-status { font-size: 12px; color: var(--text-secondary); }

/* Structure preview */
.structure-preview {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.structure-col {
  flex: 1;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px;
}
.structure-col-header {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.structure-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.struct-item {
  font-size: 12px;
  padding: 6px 8px;
  background: var(--surface);
  border-radius: 4px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.struct-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  flex-shrink: 0;
  text-transform: uppercase;
}
.struct-badge.heading { background: #DBEAFE; color: #1E40AF; }
.struct-badge.body { background: #F3F4F6; color: #374151; }
.struct-badge.bullet { background: #FEF3C7; color: #92400E; }
.structure-arrow {
  display: flex;
  align-items: center;
  font-size: 24px;
  color: var(--primary);
}

/* Format badges */
.format-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.format-badge {
  font-size: 11px;
  padding: 4px 10px;
  background: #D1FAE5;
  color: #065F46;
  border-radius: 12px;
  font-weight: 500;
}

/* === Publish === */
.publish-layout { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 56px); }
.publish-card {
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 48px 64px;
  box-shadow: var(--shadow-lg);
  max-width: 480px;
}
.publish-success {
  width: 64px; height: 64px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  margin: 0 auto 24px;
}
.publish-card h2 { font-size: 22px; margin-bottom: 16px; }
.publish-detail { text-align: left; background: var(--bg); border-radius: var(--radius); padding: 16px; margin-bottom: 24px; font-size: 13px; line-height: 1.8; }
.publish-detail strong { display: inline-block; min-width: 100px; color: var(--text-muted); }
.publish-actions { display: flex; gap: 12px; justify-content: center; }

/* === Ad Hoc Demo === */
.dashboard-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dashboard-primary-btn {
  width: auto;
}

.ad-hoc-card {
  max-width: 1180px;
  width: 100%;
}

.ad-hoc-intro {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius);
}

.ad-hoc-intro h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.ad-hoc-intro p {
  color: var(--text-secondary);
  max-width: 560px;
}

.ad-hoc-controls {
  min-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-hoc-lang-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ad-hoc-lang-badge,
.ad-hoc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e8f0ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
}

.ad-hoc-stats {
  margin-bottom: 0;
}

.ad-hoc-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ad-hoc-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.ad-hoc-table th,
.ad-hoc-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.ad-hoc-table th {
  background: var(--bg);
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.ad-hoc-input {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
  resize: vertical;
}

.ad-hoc-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.ad-hoc-output {
  background: #fbfdff;
}

.ad-hoc-source-id {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 700;
}

.ad-hoc-muted,
.ad-hoc-publish-note {
  font-size: 12px;
  color: var(--text-secondary);
}

.ad-hoc-links {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .dashboard-actions,
  .ad-hoc-intro {
    flex-direction: column;
    align-items: stretch;
  }

  .ad-hoc-controls {
    min-width: 0;
  }
}

/* === Loading === */
.loading {
  display: flex; justify-content: center; align-items: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
}
