/* Admin area styles */

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

body {
  display: flex;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  background: #f0f2f7;
  color: #1a1f2e;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: #1a1f2e;
  color: #c8cfe0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid #2d3348;
}
.logo-icon { font-size: 22px; margin-right: 6px; }
.logo-text { font-size: 15px; font-weight: 700; color: #fff; }
.logo-sub {
  display: block;
  font-size: 11px;
  color: #6b7390;
  margin-top: 2px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav { padding: 16px 12px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #8b94b0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: #252b3d; color: #fff; }
.nav-item.active { background: #2d3654; color: #fff; }
.nav-icon { font-style: normal; width: 18px; text-align: center; }
.nav-section-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: #5a6380; padding: 4px 8px 2px; font-weight: 600; }

.sidebar-footer { padding: 12px; border-top: 1px solid #2d3348; }
.sidebar-user { padding: 6px 12px 10px; }
.sidebar-username { display: block; font-size: 13px; font-weight: 600; color: #c8cfe0; }
.sidebar-role { display: block; font-size: 11px; color: #5a6380; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.nav-logout {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: #8b94b0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
}

/* ── Main ── */
.main {
  margin-left: 220px;
  flex: 1;
  min-height: 100vh;
}
.main-inner { padding: 32px; max-width: 100%; }

/* ── Jobs bar ── */
.jobs-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 32px;
  background: #1a1f2e;
  border-bottom: 1px solid #2d3348;
}
.jobs-label { font-size: 11px; font-weight: 700; color: #6b7390; text-transform: uppercase; letter-spacing: 0.5px; }
.job-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: #2d3654; border-radius: 20px; padding: 4px 12px;
  text-decoration: none; color: #c8cfe0; font-size: 12px;
  transition: background 0.15s;
}
.job-pill:hover { background: #3a4570; }
.job-spinner {
  width: 8px; height: 8px; border-radius: 50%;
  border: 2px solid #3498db; border-top-color: transparent;
  animation: spin 0.8s linear infinite; flex-shrink: 0;
}
.job-name { font-weight: 600; color: #fff; }
.job-step { color: #8b94b0; font-size: 11px; }

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-header h1 { font-size: 22px; font-weight: 700; color: #1a1f2e; display: flex; align-items: center; gap: 10px; }
.paper-count { font-size: 13px; font-weight: 500; color: #8b94b0; background: #f0f2f7; padding: 2px 10px; border-radius: 20px; }
.page-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Filter input */
.filter-input {
  padding: 7px 13px; border: 1px solid #d0d5e0; border-radius: 8px;
  font-size: 13px; width: 220px;
}
.filter-input:focus { outline: none; border-color: #3498db; }

/* View toggle */
.view-toggle { display: flex; border: 1px solid #d0d5e0; border-radius: 8px; overflow: hidden; }
.view-btn {
  padding: 6px 10px; border: none; background: #fff; color: #8b94b0;
  cursor: pointer; display: flex; align-items: center; transition: background 0.15s, color 0.15s;
}
.view-btn:hover { background: #f0f2f7; color: #1a1f2e; }
.view-btn.active { background: #f0f2f7; color: #1a1f2e; }
.breadcrumb {
  display: inline-block;
  font-size: 12px;
  color: #6b7390;
  text-decoration: none;
  margin-bottom: 6px;
}
.breadcrumb:hover { color: #3498db; }

.paper-meta-row { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.paper-danger-actions { display: flex; align-items: center; margin-left: auto; padding-right: 16px; }

/* ── Cards ── */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: #1a1f2e; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-board { background: #e8f0fe; color: #1a73e8; }
.badge-qual  { background: #e6f4ea; color: #188038; }
.badge-code  { background: #f3e8fd; color: #7b1fa2; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #3498db; color: #fff; }
.btn-sm       { padding: 4px 10px; font-size: 12px; background: #f0f2f7; color: #1a1f2e; }
.btn-sm:hover { background: #e0e4ef; }
.btn-ok       { background: #e6f4ea; color: #188038; }
.btn-ok:hover { background: #cfebd4; }
.btn-warn     { background: #fde8e8; color: #c0392b; }
.btn-warn:hover { background: #fad0d0; }
.btn-fetch    { background: #e8f4fd; color: #1a6fa8; border: 1px solid #b3d7f0; }
.btn-fetch:hover { background: #cce5f6; }
.btn-bulk-approve    { background: #fef3e2; color: #b45309; border: 1px solid #fcd38d; font-weight: 600; }
.btn-bulk-approve:hover { background: #fde8c0; }

/* ── Group blocks ── */
.group-block { margin-bottom: 28px; }
.group-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 2px solid #e8eaf0;
}
.group-subject { font-size: 15px; font-weight: 700; color: #1a1f2e; }
.group-count {
  font-size: 11px; font-weight: 700; color: #8b94b0;
  background: #f0f2f7; padding: 1px 8px; border-radius: 20px;
}

/* Option badge */
.badge-option { background: #f3e8fd; color: #7b1fa2; }
.option-label { color: #7b1fa2; font-weight: 600; font-size: 11px; }

/* List table scroll */
.list-table-wrap { overflow-x: auto; }
.no-results { padding: 40px; text-align: center; color: #8b94b0; font-size: 14px; }
.next-cell { font-size: 12px; white-space: nowrap; }

/* ── Dashboard paper grid ── */
.paper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.paper-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  text-decoration: none;
  color: inherit;
  display: flex;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
}
.paper-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); transform: translateY(-1px); }
.paper-card.running { border: 2px solid #3498db; }

.paper-card-accent { width: 5px; flex-shrink: 0; }
.paper-card-body { flex: 1; padding: 16px; }

.paper-meta { display: flex; gap: 6px; margin-bottom: 8px; }
.paper-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.paper-code { font-size: 12px; color: #6b7390; margin-bottom: 12px; }

.progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.progress-bar { flex: 1; height: 6px; background: #e8eaf0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: #3498db; border-radius: 3px; transition: width 0.3s; }
.progress-pct { font-size: 12px; color: #6b7390; width: 30px; text-align: right; }

.paper-card-footer { display: flex; align-items: center; justify-content: space-between; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 6px;
}
.status-dot.pending { background: #f39c12; }
.status-dot.running { background: #3498db; animation: pulse 1s infinite; }
.status-dot.done    { background: #27ae60; }
.next-label { font-size: 12px; color: #6b7390; }
.doc-counts { display: flex; gap: 8px; font-size: 11px; color: #8b94b0; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── Pipeline stages ── */
.paper-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) { .paper-layout { grid-template-columns: 1fr; } }

.stage-list { display: flex; flex-direction: column; gap: 4px; }

.stage-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8f9fc;
}
.stage-row.stage-complete    { background: #e6f4ea; }
.stage-row.stage-approved    { background: #e6f4ea; }
.stage-row.stage-failed      { background: #fde8e8; }
.stage-row.stage-running     { background: #e8f0fe; }
.stage-row.stage-in_progress { background: #fef9e7; }

.stage-indicator {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.stage-complete  .stage-indicator,
.stage-approved  .stage-indicator { background: #27ae60; color: #fff; }
.stage-failed    .stage-indicator { background: #e74c3c; color: #fff; }
.stage-running   .stage-indicator { background: #3498db; color: #fff; animation: pulse 1s infinite; }
.stage-pending   .stage-indicator { background: #dde0ea; color: #888; }

.stage-info { flex: 1; }
.stage-label { font-size: 13px; font-weight: 600; display: block; }
.stage-ts    { font-size: 11px; color: #8b94b0; }
.stage-actions { flex-shrink: 0; }

/* ── Progress circle ── */
.progress-circle-wrap { position: relative; width: 70px; height: 70px; }
.progress-circle { width: 70px; height: 70px; transform: rotate(-90deg); }
.circle-bg   { fill: none; stroke: #e8eaf0; stroke-width: 3; }
.circle-fill { fill: none; stroke: #3498db; stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 0.5s; }
.circle-pct  {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 13px; font-weight: 700; color: #1a1f2e;
}

/* ── Documents ── */
.doc-checklist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.doc-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 6px 10px; border-radius: 6px;
}
.doc-item.ok      { background: #e6f4ea; color: #188038; }
.doc-item.missing { background: #fde8e8; color: #c0392b; }
.doc-item.warn    { background: #fef9e7; color: #b7770d; }
.missing-hint { margin-left: auto; font-size: 11px; opacity: 0.7; }

.naming-guide { margin-top: 8px; }
.naming-guide summary { font-size: 12px; color: #6b7390; cursor: pointer; }

/* ── Log ── */
.log-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.log-header h2 { margin-bottom: 0; }
.running-badge {
  font-size: 12px; color: #3498db; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.log-output {
  background: #1a1f2e; color: #c8cfe0;
  font-family: 'Courier New', monospace; font-size: 12px; line-height: 1.5;
  padding: 16px; border-radius: 8px;
  max-height: 400px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-all;
}

/* ── Search page ── */
.search-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .search-layout { grid-template-columns: 1fr; } }

.hint { font-size: 13px; color: #6b7390; margin-bottom: 16px; }
.search-fields { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 8px; }
@media (max-width: 700px) { .search-fields { grid-template-columns: 1fr; } }
.search-field-group { display: flex; flex-direction: column; gap: 5px; }
.search-field-group label { font-size: 12px; font-weight: 600; color: #6b7390; }
.search-field-group input { padding: 9px 13px; border: 1px solid #d0d5e0; border-radius: 8px; font-size: 13px; }
.search-field-group input:focus { outline: none; border-color: #3498db; }
.search-field-code { }
.search-go-btn { align-self: end; white-space: nowrap; }
.optional { font-weight: 400; color: #8b94b0; }

.search-status { margin-bottom: 8px; min-height: 20px; font-size: 13px; }
.search-status .error { color: #e74c3c; }
.search-status .warn  { color: #f39c12; }
.search-status .ok    { color: #27ae60; }

.results-heading { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: #6b7390; }

.result-card {
  border: 1px solid #e0e4ef;
  border-radius: 8px; padding: 14px; margin-bottom: 10px;
}
.result-main { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.result-meta { font-size: 12px; color: #6b7390; margin-bottom: 10px; }

.confirm-table { width: 100%; font-size: 13px; border-collapse: collapse; margin-bottom: 16px; }
.confirm-table td { padding: 6px 8px; border-bottom: 1px solid #f0f2f7; }
.confirm-table td:first-child { color: #6b7390; width: 110px; }

.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 12px; color: #6b7390; margin-bottom: 6px; }
.form-row input { width: 100%; padding: 8px 12px; border: 1px solid #d0d5e0; border-radius: 8px; font-size: 13px; }

/* ── Document instructions ── */
.doc-table-wrap { overflow-x: auto; margin-bottom: 16px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc-table th { background: #f0f2f7; padding: 8px 12px; text-align: left; font-weight: 600; }
.doc-table td { padding: 8px 12px; border-bottom: 1px solid #f0f2f7; }
.doc-table.small { font-size: 12px; }
.doc-table code { background: #f0f2f7; padding: 1px 5px; border-radius: 3px; font-size: 11px; }

.notice {
  padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px;
}
.notice-warn { background: #fef9e7; color: #b7770d; border-left: 3px solid #f39c12; }
.notice-info { background: #e8f0fe; color: #1a73e8; border-left: 3px solid #3498db; }

.action-row { display: flex; gap: 12px; justify-content: flex-end; }

/* ── Library table (list view) ── */
.library-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.library-table th {
  text-align: left; padding: 11px 14px;
  font-size: 11px; font-weight: 700; color: #6b7390;
  text-transform: uppercase; letter-spacing: 0.4px;
  background: #f8f9fc; border-bottom: 1px solid #eef0f6;
}
.library-table td {
  padding: 11px 14px; border-bottom: 1px solid #f0f2f7;
  font-size: 13px; vertical-align: middle;
}
.library-table tr:last-child td { border-bottom: none; }
.library-table tr:hover td { background: #fafbfd; }
.library-table tr.row-running td { background: #f0f6ff; }

.table-paper-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: #1a1f2e; font-weight: 600;
}
.table-paper-link:hover { color: #3498db; }
.table-accent { width: 4px; height: 32px; border-radius: 2px; flex-shrink: 0; }

.mono { font-family: 'Courier New', monospace; font-size: 12px; color: #6b7390; }

.doc-cell { white-space: nowrap; }
.doc-pip {
  display: inline-block; padding: 2px 5px; border-radius: 4px;
  font-size: 10px; font-weight: 700; margin-right: 3px;
}
.pip-ok   { background: #e6f4ea; color: #188038; }
.pip-miss { background: #fde8e8; color: #c0392b; }
.pip-warn { background: #fef9e7; color: #b7770d; }

.progress-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

/* ── Pipeline card header ── */
.pipeline-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.pipeline-card-header h2 { margin-bottom: 0; }

/* ── Doc card header ── */
.doc-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.doc-card-header h2 { margin-bottom: 0; }

/* ── Doc item detail ── */
.doc-item { align-items: flex-start; }
.doc-tick { flex-shrink: 0; width: 18px; }
.doc-item-detail { display: flex; flex-direction: column; gap: 1px; }
.doc-name { font-family: 'Courier New', monospace; font-size: 12px; }
.doc-type { font-size: 11px; opacity: 0.7; }

/* ── Naming guide (always visible) ── */
.naming-guide-full { margin-top: 20px; padding-top: 16px; border-top: 1px solid #f0f2f7; }
.naming-guide-full h3 { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: #1a1f2e; }
.guide-path { font-size: 12px; color: #6b7390; margin-bottom: 10px; }
.guide-note { font-size: 11px; color: #8b94b0; margin-top: 8px; }

/* ── Existing papers notice (search) ── */
.notice-ok { background: #e6f4ea; color: #188038; border-left: 3px solid #27ae60; }

.result-card-exists { background: #fafbfd; }
.result-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f2f7;
}
.result-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #6b7390; }
.notice-inline { font-size: 12px; color: #1a73e8; margin-bottom: 6px; }

/* ── Misc ── */
.empty-state { text-align: center; padding: 60px 20px; color: #6b7390; }
.empty-state p { margin-bottom: 20px; }

.spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid #d0d5e0; border-top-color: #3498db;
  border-radius: 50%; animation: spin 0.6s linear infinite;
  margin-right: 6px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

code { background: #f0f2f7; padding: 1px 5px; border-radius: 3px; font-size: 12px; }

/* ── Review page ── */
.review-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.review-status-badge {
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.status-approved    { background: #e6f4ea; color: #188038; }
.status-pending     { background: #f0f2f7; color: #6b7390; }
.status-in_progress { background: #fef9e7; color: #b7770d; }

.review-stats {
  font-size: 13px; color: #6b7390; margin-bottom: 16px;
  padding: 8px 16px; background: #f0f2f7; border-radius: 8px;
}

.save-notice {
  padding: 10px 16px; border-radius: 8px; font-size: 13px;
  font-weight: 600; margin-bottom: 16px;
}
.save-notice-ok    { background: #e6f4ea; color: #188038; }
.save-notice-error { background: #fde8e8; color: #c0392b; }

.review-card {
  background: #fff; border-radius: 10px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07); overflow: hidden;
}
.review-card.card-warn { border-left: 4px solid #f39c12; }

.review-card-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; background: #f8f9fc; border-bottom: 1px solid #eef0f6;
}
.review-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }

.item-id {
  font-size: 11px; font-weight: 700; color: #fff;
  background: #6b7390; padding: 2px 8px; border-radius: 4px; flex-shrink: 0;
}

.field-title { flex: 1; font-size: 14px; font-weight: 600; border: 1px solid transparent;
  background: transparent; border-radius: 6px; padding: 4px 8px; }
.field-title:focus { border-color: #3498db; background: #fff; outline: none; }
.field-name  { flex: 1; border: 1px solid #e0e4ef; border-radius: 6px; padding: 4px 8px; font-size: 13px; }
.field-name:focus { border-color: #3498db; outline: none; }

.field-row { display: flex; flex-direction: column; gap: 4px; }
.field-row label { font-size: 11px; font-weight: 600; color: #6b7390; text-transform: uppercase; letter-spacing: 0.4px; }
.field-row input, .field-row select, .field-row textarea {
  border: 1px solid #e0e4ef; border-radius: 6px; padding: 6px 10px;
  font-size: 13px; font-family: inherit; resize: vertical;
}
.field-row input:focus, .field-row select:focus, .field-row textarea:focus {
  border-color: #3498db; outline: none;
}

.field-row-inline { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; }
.char-count { font-weight: 400; color: #8b94b0; }

.flag-badge {
  font-size: 11px; font-weight: 700; color: #b7770d;
  background: #fef9e7; padding: 2px 8px; border-radius: 4px;
}

.add-btn { margin-top: 8px; }
.add-lp-btn { margin: 8px 0 16px 16px; font-size: 12px; }

/* Knowledge blocks */
.knowledge-block { margin-bottom: 24px; }
.knowledge-block-header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: #f0f2f7; border-radius: 8px;
  margin-bottom: 8px; font-size: 14px;
}
.lp-count { margin-left: auto; font-size: 12px; color: #6b7390; }
.lp-thin  { color: #e67e22; font-weight: 700; }

.lp-card { margin-left: 16px; margin-bottom: 8px; }

.cat-select {
  padding: 3px 8px; border: 1px solid #e0e4ef; border-radius: 6px;
  font-size: 12px; font-weight: 600; background: #f8f9fc; flex-shrink: 0;
}

/* Technique */
.technique-item {
  padding: 14px 0; border-bottom: 1px solid #f0f2f7;
  display: flex; flex-direction: column; gap: 10px;
}
.technique-item:last-child { border-bottom: none; }
.technique-header { display: flex; align-items: center; gap: 10px; }
.field-word { font-weight: 700; font-size: 15px; width: 160px; border: 1px solid #e0e4ef; border-radius: 6px; padding: 4px 8px; }

.list-item-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.list-item-row textarea { flex: 1; border: 1px solid #e0e4ef; border-radius: 6px; padding: 6px 10px; font-size: 13px; font-family: inherit; resize: vertical; }

/* Badge variants for priority/weighting */
.badge-high   { background: #fde8e8; color: #c0392b; }
.badge-medium { background: #fef9e7; color: #b7770d; }
.badge-low    { background: #e6f4ea; color: #188038; }

/* ── Quality badges ─────────────────────────────────────────────────────── */
.badge-quality { font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 4px; }
.grade-a { background: #e6f4ea; color: #1a7431; }
.grade-b { background: #e8f0fe; color: #1a56b0; }
.grade-c { background: #fef9e7; color: #b7770d; }
.grade-d { background: #fde8e8; color: #c0392b; }

/* Doc adequacy badges */
.badge-doc-strong  { background: #e6f4ea; color: #1a7431; font-size: 12px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.badge-doc-good    { background: #e8f0fe; color: #1a56b0; font-size: 12px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.badge-doc-limited { background: #fef9e7; color: #b7770d; font-size: 12px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.badge-doc-minimal { background: #fde8e8; color: #c0392b; font-size: 12px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }

/* Dashboard card footer badges */
.card-badges-right { display: flex; align-items: center; gap: 4px; margin-left: auto; }

/* List view quality column */
.quality-cell { white-space: nowrap; }
.quality-score { font-size: 12px; color: #666; margin-left: 4px; }
.muted { color: #aaa; font-size: 13px; }

/* Doc adequacy pip in list view */
.pip-adequacy-strong  { background: #e6f4ea; color: #1a7431; border-color: #1a7431; }
.pip-adequacy-good    { background: #e8f0fe; color: #1a56b0; border-color: #1a56b0; }
.pip-adequacy-limited { background: #fef9e7; color: #b7770d; border-color: #b7770d; }
.pip-adequacy-minimal { background: #fde8e8; color: #c0392b; border-color: #c0392b; }

/* ── Paper page: quality + adequacy panels ──────────────────────────────── */
.quality-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.quality-card-header h2 { margin: 0; }

/* Doc adequacy stats row */
.doc-adequacy-stats { display: flex; gap: 24px; margin-bottom: 12px; }
.adequacy-stat { text-align: center; }
.adequacy-num  { display: block; font-size: 28px; font-weight: 700; line-height: 1; color: #1a1a2e; }
.adequacy-label { display: block; font-size: 11px; color: #666; margin-top: 2px; line-height: 1.3; }

.adequacy-issues { margin: 8px 0; padding: 0; list-style: none; }
.adequacy-issues li { font-size: 13px; padding: 4px 0; }
.issue-warn { color: #c0392b; }
.issue-warn::before { content: '!! '; font-weight: 700; }

.adequacy-advice { margin: 6px 0 0; padding: 0 0 0 16px; }
.adequacy-advice li { font-size: 12px; color: #555; padding: 2px 0; }

/* Quality summary stats */
.quality-summary-row { display: flex; gap: 24px; margin-bottom: 14px; }
.qs-stat { text-align: center; }
.qs-num   { display: block; font-size: 24px; font-weight: 700; color: #1a1a2e; }
.qs-label { display: block; font-size: 11px; color: #666; margin-top: 2px; line-height: 1.3; }

.quality-alert { font-size: 12px; padding: 6px 10px; border-radius: 6px; margin-bottom: 8px;
  background: #fde8e8; color: #c0392b; }
.quality-alert.warn { background: #fef9e7; color: #b7770d; }

/* Per-topic breakdown table */
.topic-breakdown { margin-top: 12px; }
.topic-breakdown summary { font-size: 13px; color: #555; cursor: pointer; padding: 4px 0; }
.topic-breakdown summary:hover { color: #1a1a2e; }

.topic-score-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.topic-score-table th { text-align: left; padding: 4px 8px; border-bottom: 2px solid #e0e4ef; color: #666; font-weight: 600; }
.topic-score-table td { padding: 4px 8px; border-bottom: 1px solid #f0f2f7; }
.topic-row-good td:first-child { border-left: 3px solid #34a853; }
.topic-row-warn td:first-child { border-left: 3px solid #fbbc04; }
.topic-row-poor td:first-child { border-left: 3px solid #ea4335; }
.topic-title-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-cell { font-weight: 600; }
.theorist-cell { color: #555; font-style: italic; }

/* ── Review queue ── */
.review-queue-table { width: 100%; border-collapse: collapse; }
.review-queue-table th { text-align: left; padding: 10px 16px; background: #f8f9fc; border-bottom: 2px solid #e0e4ef; font-size: 12px; color: #6b7390; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.review-queue-table td { padding: 12px 16px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
.review-queue-table tr:last-child td { border-bottom: none; }
.review-queue-table tr { transition: background 0.15s; }
.review-queue-table tr:hover td { background: #fafbfd; }

/* ── Admin form fields (student create / detail) ── */
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; color: #3a4060; margin-bottom: 4px; }
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="date"],
.form-field input[type="time"],
.form-field select { width: 100%; padding: 7px 10px; border: 1px solid #d0d5e0; border-radius: 6px; font-size: 13px; background: #fff; }
.form-field input:focus, .form-field select:focus { outline: none; border-color: #1a6fa8; box-shadow: 0 0 0 2px #dceffe; }
.label-hint { font-weight: 400; color: #8b94b0; font-size: 12px; }
.field-hint { font-size: 11px; color: #8b94b0; margin-top: 3px; display: block; }

/* ── Student paper rows ── */
.student-papers-list { display: flex; flex-direction: column; gap: 10px; }
.student-paper-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #f8f9fc; border-radius: 8px; gap: 12px; }
.spr-body { flex: 1; }
.spr-name { font-weight: 600; font-size: 14px; }
.spr-paper { font-size: 12px; color: #6b7390; margin-top: 1px; }
.spr-exam { font-size: 11px; color: #8b94b0; margin-top: 3px; }
.add-paper-details summary { list-style: none; }
.add-paper-details summary::-webkit-details-marker { display: none; }
