/* ============================================================
   RemoveBG.vn — Stylesheet
   Light theme · gradient teal→blue · responsive
   ============================================================ */

/* ---------- Reset & tokens ---------- */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --brand: #10b981;
  --brand-2: #0ea5e9;
  --brand-dark: #059669;
  --grad: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --success-soft: #d1fae5;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --shadow-sm: 0 2px 8px rgba(2, 6, 23, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: #eef2f7;
  padding: 0.15em 0.4em;
  border-radius: 6px;
}

.container { width: min(1080px, 100% - 40px); margin-inline: auto; }
.hidden { display: none !important; }

/* Nền caro thể hiện độ trong suốt */
.checker {
  background-image:
    linear-gradient(45deg, #e5eaf0 25%, transparent 25%),
    linear-gradient(-45deg, #e5eaf0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5eaf0 75%),
    linear-gradient(-45deg, transparent 75%, #e5eaf0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.6em 1.25em;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, opacity 0.12s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(14, 165, 233, 0.45); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: #f8fafc; }

.btn-danger {
  background: var(--danger-soft);
  color: #b91c1c;
}
.btn-danger:hover { background: #fecaca; }

.btn-light { background: #fff; color: var(--text); }
.btn-outline-light { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.55); }
.btn-outline-light:hover { background: rgba(255,255,255,0.12); }

.btn-lg { padding: 0.85em 2em; font-size: 1.05rem; }
.btn-sm { padding: 0.4em 0.9em; font-size: 0.875rem; border-radius: 9px; }
.btn-block { width: 100%; }

.link-btn { color: var(--brand-2); font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 50%;
  width: 34px; height: 34px;
  cursor: pointer;
  color: var(--muted);
  flex: none;
}
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55em;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text) !important;
  text-decoration: none !important;
}
.brand-logo { width: 32px; height: 32px; border-radius: 8px; }
.brand-tld { color: var(--brand); }

.nav { display: flex; gap: 0.25em; }
.nav a {
  padding: 0.45em 0.9em;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
}
.nav a:hover { color: var(--text); background: #eef2f7; }
.nav a.active { color: var(--brand-dark); background: var(--success-soft); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 64px 0 28px;
}
.hero-chip {
  display: inline-block;
  background: var(--success-soft);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.4em 1.1em;
  border-radius: 999px;
  margin-bottom: 1.1em;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.1rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Upload tool ---------- */
.tool { padding-bottom: 12px; }
.upload-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px;
}

.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand);
  background: #f0fdf9;
}
.dz-icon { width: 46px; height: 46px; color: var(--brand); margin-bottom: 8px; }
.dz-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 4px; }
.dz-sub { color: var(--muted); margin: 0 0 6px; }
.dz-hint { color: #94a3b8; font-size: 0.85rem; margin: 0; }

/* File đã chọn */
.file-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
.file-thumb {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: 10px;
  flex: none;
  background: #e2e8f0;
}
.file-meta { min-width: 0; flex: 1; }
.file-name { margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-sub { margin: 0; color: var(--muted); font-size: 0.85rem; }

/* Tùy chọn */
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
  margin-top: 20px;
}
.option-group { display: flex; flex-direction: column; gap: 8px; }
.option-label { font-size: 0.85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.swatches { display: flex; gap: 10px; }
.swatch {
  width: 40px; height: 40px;
  padding: 3px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  display: inline-flex;
  transition: border-color 0.12s, transform 0.12s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.selected { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(14,165,233,0.2); }
.swatch-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.swatch-inner svg { width: 16px; height: 16px; }
.swatch-custom { position: relative; }
.swatch-custom input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%; height: 100%;
}

.select {
  font: inherit;
  padding: 0.55em 2.2em 0.55em 0.9em;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.8em center;
  appearance: none;
  cursor: pointer;
  color: var(--text);
}
.select-sm { padding: 0.35em 1.9em 0.35em 0.7em; font-size: 0.875rem; }

.actions { margin-top: 24px; text-align: center; }

/* Checkbox hàng option */
.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 0.5em 0;
  font-size: 0.95rem;
  user-select: none;
}
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--brand-2); cursor: pointer; flex: none; }
.checkbox-row em { color: var(--muted); font-style: normal; font-size: 0.82rem; }

/* Progress */
.progress-wrap { margin-top: 20px; }
.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--grad);
  transition: width 0.2s ease;
}
.progress-fill.indeterminate {
  width: 100% !important;
  background: linear-gradient(90deg, #10b981 25%, #0ea5e9 50%, #10b981 75%);
  background-size: 200% 100%;
  animation: slide 1.2s linear infinite;
}
@keyframes slide { from { background-position: 200% 0; } to { background-position: 0 0; } }
.progress-label { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 8px 0 0; }

/* ---------- Kết quả ---------- */
.result-section { max-width: 980px; margin: 28px auto 0; }
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.result-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.result-head { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.result-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tag-success { color: var(--brand-dark); }
.result-img-wrap {
  min-height: 220px;
  max-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.result-img-wrap img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}
.result-meta { text-align: center; color: var(--muted); font-size: 0.9rem; }

/* Kết quả hàng loạt */
.batch-head {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.badge-count {
  display: inline-block;
  background: var(--success-soft);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 0.1em 0.7em;
  font-size: 0.78rem;
}
.batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.batch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.batch-card.err { background: var(--danger-soft); border-color: #fecaca; }
.batch-thumb {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}
.batch-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.batch-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-top: 1px solid var(--border);
}
.batch-name {
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.batch-err { color: #b91c1c; font-size: 0.82rem; padding: 12px; word-break: break-word; }
.batch-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.batch-hint { color: var(--muted); font-size: 0.82rem; font-weight: 500; text-transform: none; letter-spacing: 0; }
.batch-thumb { cursor: pointer; }

/* ---------- Trình chỉnh sửa xóa tay (pen tool) ---------- */
.editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(2, 6, 23, 0.72);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}
.editor-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  background: var(--surface);
  border-radius: 14px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
}
.editor-title { font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.editor-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; }
.editor-actions { display: flex; gap: 8px; }
.tool-btn {
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 10px;
  padding: 0.45em 0.9em;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: background 0.12s, border-color 0.12s;
}
.tool-btn:hover { background: #eef2f7; }
.tool-btn.active { background: var(--success-soft); color: var(--brand-dark); border-color: transparent; }
.editor-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.editor-size input[type="range"] { width: 120px; accent-color: var(--brand-2); cursor: pointer; }
#brush-size-val { min-width: 3.2em; font-family: var(--mono); font-size: 0.8rem; }

.editor-canvas-wrap {
  flex: 1;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: #cbd5e1;
}
#editor-canvas {
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
  cursor: crosshair;
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.35);
  background: transparent;
}
.brush-cursor {
  position: absolute;
  border: 1.5px solid rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9), inset 0 0 0 1.5px rgba(255,255,255,0.6);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 5;
}
.editor-hint {
  margin: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
}

/* ---------- Góp ý chất lượng (trang chủ) ---------- */
.feedback-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.feedback-q { font-weight: 600; font-size: 0.92rem; }
textarea.fb-comment {
  width: 100%;
  font: inherit;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: vertical;
  min-height: 56px;
}
textarea.fb-comment:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.fb-thanks {
  text-align: center;
  color: var(--brand-dark);
  font-weight: 600;
  margin: 14px 0 0;
}

/* ---------- Dashboard: AI model + phản hồi ---------- */
.ai-version { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.model-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.model-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.model-label { flex: 1; min-width: 220px; font-weight: 600; font-size: 0.92rem; }
.model-sub { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 500; font-family: var(--mono); }
.model-status { font-size: 0.88rem; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.model-status.ok { color: var(--brand-dark); font-weight: 700; }
.model-status.err { color: #b91c1c; }

.satisfaction-bar {
  display: inline-block;
  width: 90px;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 8px;
}
.satisfaction-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--grad);
}
.fb-list { list-style: none; margin: 0; padding: 0; }
.fb-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.fb-list li:last-child { border-bottom: none; }
.fb-time { color: var(--muted); font-size: 0.82rem; margin-left: 8px; }
.fb-comment-text { margin: 6px 0 0; color: #334155; font-size: 0.9rem; }

/* ---------- Features ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 48px 0 8px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.feature-icon { font-size: 1.8rem; margin-bottom: 8px; }
.feature-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* ---------- API CTA ---------- */
.api-cta {
  margin: 48px 0 64px;
  background: linear-gradient(135deg, #064e3b 0%, #0c4a6e 100%);
  color: #fff;
  border-radius: 20px;
  padding: 36px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.api-cta h2 { margin: 0 0 6px; font-size: 1.5rem; }
.api-cta p { margin: 0; color: rgba(255,255,255,0.8); }
.api-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.api-cta .code-chip { background: rgba(255,255,255,0.12); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.footer-nav { display: flex; gap: 16px; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--text); }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 36px));
}
.toast {
  background: #0f172a;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  animation: toast-in 0.25s ease;
  border-left: 4px solid var(--brand-2);
}
.toast-success { border-left-color: var(--brand); }
.toast-error { border-left-color: var(--danger); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: 0.25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   DOCS PAGE
   ============================================================ */
.docs { padding: 40px 0 60px; }
.docs-head { margin-bottom: 30px; }
.docs-head h1 { margin: 0 0 8px; }
.docs-head p { color: var(--muted); max-width: 760px; }

.doc-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px 28px;
  margin-bottom: 22px;
}
.doc-section h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 1.3rem; }
.doc-section h3 { margin: 20px 0 10px; font-size: 1.02rem; }
.doc-section p { color: #334155; }

.doc-steps { color: #334155; padding-left: 1.3em; }
.doc-steps li { margin-bottom: 6px; }
.doc-note { color: var(--muted) !important; font-size: 0.9rem; }
.doc-list { color: #334155; padding-left: 1.3em; }
.doc-list li { margin-bottom: 6px; }

.info-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 14px;
}
.info-box ul { margin: 6px 0 0; padding-left: 1.2em; }

.method-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.3em 0.7em;
  border-radius: 8px;
  color: #fff;
  flex: none;
}
.method-post { background: #16a34a; }
.method-get { background: #0ea5e9; }

.plan-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25em 0.8em;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--brand-dark);
}
.plan-pro { background: #ede9fe; color: #6d28d9; }
.plan-ent { background: #fef3c7; color: #b45309; }

/* Code blocks & tabs */
.code-example {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 12px 0;
}
.code-tabs {
  display: flex;
  gap: 2px;
  background: #0f172a;
  padding: 8px 10px 0;
}
.code-tabs button {
  border: none;
  background: transparent;
  color: #94a3b8;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5em 1em;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}
.code-tabs button:hover { color: #e2e8f0; }
.code-tabs button.active { background: #1e293b; color: #fff; }

.code-example pre, pre.code-block {
  margin: 0;
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.6;
}
pre.code-block { border-radius: 12px; }
.code-example pre { display: none; }
.code-example pre.active { display: block; }
/* Code bên trong khối dark không dùng style inline-code toàn cục */
.code-example pre code, pre.code-block code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 10px 0;
}
.doc-table th, .doc-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.doc-table th { background: #f8fafc; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard { padding: 36px 0 60px; }

/* Auth */
.auth-wrap { display: flex; justify-content: center; padding: 40px 0; }
.auth-card { width: min(440px, 100%); padding: 28px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #eef2f7;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tab {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 700;
  padding: 0.55em;
  border-radius: 9px;
  cursor: pointer;
  color: var(--muted);
}
.auth-tab.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.auth-form h2 { margin: 0 0 4px; font-size: 1.3rem; }
.auth-sub { color: var(--muted); font-size: 0.92rem; margin: 0 0 18px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; color: #334155; }
.field input {
  width: 100%;
  font: inherit;
  padding: 0.65em 0.9em;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field input:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
  background: #fff;
}
.form-error {
  background: var(--danger-soft);
  color: #b91c1c;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin: 0 0 14px;
}

/* Dash header & stats */
.dash-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dash-head h1 { margin: 0 0 2px; }
.dash-sub { margin: 0; color: var(--muted); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.stat-card { padding: 20px 22px; }
.stat-label { margin: 0 0 6px; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.stat-value { margin: 0; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-unit { font-size: 1rem; color: var(--muted); font-weight: 600; }
.stat-foot { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; }
.plan-change { display: flex; gap: 8px; margin-top: 12px; }

/* Tables */
.table-card { padding: 22px 24px; margin-bottom: 22px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2 { margin: 0; font-size: 1.15rem; }
.table-scroll { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.data-table tbody tr:hover { background: #f8fafc; }
.cell-actions { text-align: right; }

.key-prefix, .req-id { font-size: 0.85rem; }
.status-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2em 0.75em;
  border-radius: 999px;
}
.status-active { background: var(--success-soft); color: var(--brand-dark); }
.status-revoked { background: var(--danger-soft); color: #b91c1c; }

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 22px 0 10px;
  margin: 0;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(2, 6, 23, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal { width: min(520px, 100%); padding: 26px; }
.modal h2 { margin: 0 0 10px; }
.modal-warn {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
}
.key-reveal {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 16px 0 20px;
}
.key-reveal code {
  flex: 1;
  background: #0f172a;
  color: #a5f3fc;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  word-break: break-all;
  white-space: normal;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .header-inner { flex-direction: column; height: auto; padding: 10px 0; gap: 6px; }
  .hero { padding-top: 36px; }
  .upload-card { padding: 18px; }
  .dropzone { padding: 30px 12px; }
  .result-grid { grid-template-columns: 1fr; }
  .options { flex-direction: column; align-items: stretch; }
  .footer-inner { flex-direction: column; text-align: center; }
  .doc-section { padding: 20px 16px; }
}
