:root {
  --page-bg: #f8f4ea;
  --panel: #ffffff;
  --panel-2: #faf5e8;
  --line: #e8ddc4;
  --text: #1f1a10;
  --muted: #7a6f54;
  --accent: #0f0f10;
  --success: #2e7d32;
  --danger: #c62828;
  --radius: 10px;

  --gold: #b5893c;
  --gold-light: #d4ac5f;
  --gold-dark: #8a6526;
  --gold-gradient: linear-gradient(135deg, #d4ac5f 0%, #b5893c 55%, #96742f 100%);

  --sidebar-bg: #0a0a0a;
  --sidebar-panel: #1a1509;
  --sidebar-line: #3a3220;
  --sidebar-text: #f4f4f5;
  --sidebar-muted: #a8987a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

h1, h2, h3, .display {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.01em;
  color: var(--text);
  font-weight: 600;
  margin: 0 0 0.4em;
}

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

/* --- Logged-out centered layout (login, verify) --- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 40px 24px 80px; }
.wrap-narrow { max-width: 460px; margin: 0 auto; padding: 60px 24px; }

/* --- Sidebar layout (logged in) --- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.sidebar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 0 4px;
}
.sidebar .logo-mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--gold-gradient);
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, serif; font-weight: 700; color: #1a1509;
  flex-shrink: 0;
}
.sidebar .logo-mark-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar .logo-text {
  font-family: Georgia, serif;
  letter-spacing: 0.05em;
  color: var(--sidebar-text);
  font-size: 0.85rem;
  line-height: 1.3;
}
.sidebar .logo-text span {
  display: block;
  font-size: 0.6rem;
  color: var(--sidebar-muted);
  letter-spacing: 0.1em;
}

.sidebar-juror {
  background: var(--sidebar-panel);
  border: 1px solid var(--sidebar-line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 22px;
}
.sidebar-juror .name { font-size: 0.85rem; font-weight: 600; color: var(--sidebar-text); }
.sidebar-juror .role { font-size: 0.72rem; color: var(--sidebar-muted); margin-top: 2px; }

.sidebar nav {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  opacity: 0.72;
  text-decoration: none;
  font-size: 0.87rem;
  margin-bottom: 2px;
}
.sidebar nav a:hover { opacity: 1; background: rgba(255,255,255,0.07); text-decoration: none; }
.sidebar nav a.active {
  opacity: 1;
  background: linear-gradient(135deg, rgba(212,172,95,0.22), rgba(181,137,60,0.1));
  color: #e8c97a;
  font-weight: 600;
  border: 1px solid rgba(181,137,60,0.4);
}
.sidebar nav a .icon { width: 16px; text-align: center; font-size: 0.85rem; }

.sidebar-footer {
  border-top: 1px solid var(--sidebar-line);
  padding-top: 14px;
  margin-top: 14px;
  font-size: 0.8rem;
}
.sidebar-footer a { color: #ff8a80; opacity: 0.9; }
.sidebar-footer a:hover { opacity: 1; }
.sidebar-logout-btn {
  background: none;
  border: none;
  color: #ff8a80;
  opacity: 0.9;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.sidebar-logout-btn:hover { opacity: 1; }

.main { flex: 1; min-width: 0; background: var(--page-bg); }
.main-content { padding: 32px; max-width: 1080px; }

/* --- Shared components (light content area) --- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.card-tight { padding: 18px 22px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* --- Dashboard stat cards: always 4 across on desktop, not content-driven
   wrapping like .grid — that's what was pushing "Pending Review" onto its
   own row once the cards got wide enough that only 3 fit per auto-fill row. --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 28px 0;
}
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

.stats-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin: 28px 0;
}
@media (max-width: 1100px) {
  .stats-grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .stats-grid-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .stats-grid-5 { grid-template-columns: 1fr; }
}
.stats-grid-5 .stat-card {
  background: linear-gradient(135deg, #d4ac5f 0%, #b5893c 55%, #96742f 100%);
  border: none;
  box-shadow: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stats-grid-5 .stat-card .num,
.stats-grid-5 .stat-card .label {
  color: #1a1509;
}
a.stats-grid-5-link {
  text-decoration: none;
  color: inherit;
  display: flex;
}
.stats-grid-5-link .stat-card {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
a.stats-grid-5-link:hover .stat-card {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(150, 116, 47, 0.35);
  text-decoration: none;
}

/* --- Percentage completion pill (Analytics juror workload) --- */
.pct-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}
.pct-pill-low {
  background: rgba(198, 40, 40, 0.1);
  color: var(--danger);
  border: 1px solid rgba(198, 40, 40, 0.3);
}
.pct-pill-ok {
  background: rgba(181, 137, 60, 0.14);
  color: #8a6526;
  border: 1px solid rgba(181, 137, 60, 0.4);
}

/* --- Small initial-circle avatar for juror rows in tables --- */
.row-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #1a1509;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-right: 8px;
  vertical-align: middle;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.stat-card .num { font-size: 2.1rem; color: var(--gold-dark); font-family: Georgia, serif; }
.stat-card .label { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }

.stat-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.stat-card-link:hover {
  border-color: #b5893c;
  transform: translateY(-2px);
  text-decoration: none;
}
.stat-card-link:focus,
.stat-card-link:focus-visible {
  outline: none;
  border-color: #b5893c;
  box-shadow: 0 0 0 3px rgba(181, 137, 60, 0.45);
}

.cat-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: border-color 0.15s, transform 0.15s;
}
.cat-card:hover { border-color: #b5893c; transform: translateY(-2px); text-decoration: none; }
.cat-card:focus,
.cat-card:focus-visible {
  outline: none;
  border-color: #b5893c;
  box-shadow: 0 0 0 3px rgba(181, 137, 60, 0.45);
}
.cat-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.cat-tag {
  display: inline-block;
  flex-shrink: 0;
  min-width: max-content;
  white-space: nowrap;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}
.cat-tag-sector {
  color: #b5893c;
  border-color: rgba(181, 137, 60, 0.35);
  background: rgba(181, 137, 60, 0.06);
}
.cat-count { color: var(--text); font-weight: 600; font-size: 0.85rem; margin-top: auto; padding-top: 10px; }
.cat-count-pending { color: #b5893c; }
.cat-count-done { color: var(--success); }

table.entries {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  background: var(--panel);
}
table.entries th {
  text-align: left;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.entries td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text);
}
table.entries tr:hover td { background: var(--panel-2); }

/* --- Action button group (e.g. "Scorecard" + "Edit Result" side by side) --- */
.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.table-actions .btn { white-space: nowrap; }

/* --- Result / status pills (Winner, Gold, Not decided, etc.) --- */
.result-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.result-pill-decided {
  background: rgba(181, 137, 60, 0.14);
  color: #8a6526;
  border: 1px solid rgba(181, 137, 60, 0.4);
}
.result-pill-pending {
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 500;
}

/* --- Category section header (Rankings / Winners pages) --- */
.rank-section-title {
  margin-top: 32px;
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #b5893c;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.rank-section-title .count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge-pending { color: var(--muted); }
.badge-done { color: var(--success); border-color: var(--success); }

.btn {
  display: inline-block;
  background: var(--gold-gradient);
  color: #1a1509;
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.92rem;
  box-shadow: 0 1px 3px rgba(150, 116, 47, 0.3);
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--text);
  color: var(--text);
}
.btn-ghost:hover { background: var(--panel-2); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-block { display: block; width: 100%; text-align: center; }

.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-size: 0.95rem;
}
.input:focus { outline: none; border-color: var(--accent); }
.otp-input { letter-spacing: 0.4em; text-align: center; font-size: 1.4rem; }

label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.85rem; }
.field { margin-bottom: 18px; }

.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.messages li {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: #ffffff;
}
.messages .success { border-color: var(--success); color: var(--success); }
.messages .error { border-color: var(--danger); color: var(--danger); }

.detail-row { display: grid; grid-template-columns: 220px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-row .k { color: var(--muted); font-size: 0.85rem; }
.detail-row .v { color: var(--text); }

.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.score-grid .field label {
  display: flex;
  align-items: flex-start;
  min-height: 42px;
  margin-bottom: 8px;
}
.score-input { font-size: 1.3rem; text-align: center; }
.score-max { color: var(--muted); font-size: 0.78rem; text-align: center; margin-top: 4px; }

.nda-box {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 22px;
  background: var(--panel-2);
  font-size: 0.9rem;
  color: #3a3a3a;
  margin-bottom: 20px;
}
.nda-box p { margin: 0 0 12px; }

.checkbox-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.checkbox-row input { width: 18px; height: 18px; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.mt { margin-top: 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.total-score { font-size: 1.6rem; color: var(--text); font-family: Georgia, serif; }

/* legacy top-bar classes, unused now, kept harmless in case referenced anywhere */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { font-family: Georgia, serif; font-size: 1.15rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.brand span { color: var(--muted); font-size: 0.75rem; display: block; letter-spacing: 0.15em; }
.nav-links { display: flex; gap: 22px; align-items: center; font-size: 0.92rem; }
.nav-links a { color: var(--text); opacity: 0.85; }
.nav-links a:hover { opacity: 1; }
.pill { border: 1px solid var(--line); color: var(--text); padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; }

/* --- Category filter tabs --- */
.tab-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 4px;
}
.tab-row-sub {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 8px;
}
.tab {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.tab:hover { color: var(--text); text-decoration: none; border-color: var(--text); }
.tab.active {
  background: var(--gold-gradient);
  color: #1a1509;
  border-color: var(--gold);
}
.tab-sub {
  padding: 6px 13px;
  font-size: 0.78rem;
  font-weight: 500;
  background: transparent;
}
.tab-sub.active {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--text);
}

/* --- Supporting document tiles (images, PDFs, videos) --- */
.doc-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.doc-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel-2);
  width: 150px;
  text-align: center;
}
.doc-tile:hover { border-color: #b5893c; text-decoration: none; }
.doc-tile:focus,
.doc-tile:focus-visible {
  outline: none;
  border-color: #b5893c;
  box-shadow: 0 0 0 3px rgba(181, 137, 60, 0.45);
}
.doc-tile-image img {
  width: 130px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #eeeeee;
}
.doc-tile-file {
  justify-content: center;
  min-height: 100px;
}
.doc-tile-icon { font-size: 2rem; margin-bottom: 6px; }
.doc-tile-label {
  font-size: 0.78rem;
  color: var(--text);
  margin-top: 8px;
  line-height: 1.3;
  word-break: break-word;
}

/* --- Score sliders --- */
.slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.score-slider {
  --accent: #b5893c;
  --fill-pct: 0%;
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--fill-pct), var(--line) var(--fill-pct), var(--line) 100%);
  outline: none;
  accent-color: #b5893c;
  cursor: pointer;
}

.score-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #b5893c;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px #b5893c, 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer;
  margin-top: -1px;
}

.score-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #b5893c;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px #b5893c, 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer;
}

.score-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}

.score-slider::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: #b5893c;
}

.slider-value {
  min-width: 46px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: Georgia, serif;
  color: #b5893c;
  background: rgba(181, 137, 60, 0.1);
  border-radius: 8px;
  padding: 4px 6px;
}

/* Editable number box paired with each slider */
input.slider-number {
  border: 1px solid rgba(181, 137, 60, 0.35);
  cursor: text;
  -moz-appearance: textfield;
}
input.slider-number:focus {
  outline: none;
  border-color: #b5893c;
  background: rgba(181, 137, 60, 0.16);
}
input.slider-number::-webkit-outer-spin-button,
input.slider-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* --- Score rows (one criterion per row, label left / slider right) --- */
.score-rows {
  display: flex;
  flex-direction: column;
}
.score-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.score-row:last-child {
  border-bottom: none;
}
.score-row-label {
  width: 300px;
  flex-shrink: 0;
}
.score-row-label label {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.score-row .score-max {
  margin-top: 0;
  text-align: left;
}
.score-row .slider-row {
  flex: 1;
}

@media (max-width: 720px) {
  .score-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .score-row-label {
    width: auto;
  }
}

/* --- Juror avatar in sidebar --- */
.sidebar-juror-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--sidebar-line);
}
.sidebar-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-gradient);
  color: #1a1509;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
}

.welcome-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.welcome-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-gradient);
  color: #1a1509;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.6rem;
  text-transform: uppercase;
}

/* --- Mobile top bar + collapsible sidebar drawer --- */
.mobile-topbar {
  display: none;
  align-items: center;
  gap: 14px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-line);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 1001;
}
.menu-toggle {
  background: transparent;
  border: 1px solid var(--sidebar-line);
  color: #ffffff;
  font-size: 1.2rem;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}
.mobile-logo {
  color: #ffffff;
  font-family: Georgia, serif;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 999;
}
.sidebar-backdrop.open {
  display: block;
}

@media (max-width: 860px) {
  .mobile-topbar { display: flex; }

  .shell { display: block; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    max-width: 82vw;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1000;
    overflow-y: auto;
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .main { width: 100%; }
  .main-content { padding: 20px 16px 48px; max-width: 100%; }

  .grid { grid-template-columns: 1fr; }
  .score-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .score-row-label { width: auto; }
  .detail-row { grid-template-columns: 1fr; }
  .flex-between { flex-direction: column; align-items: flex-start; }

  table.entries { font-size: 0.82rem; }

  .wrap, .wrap-narrow { padding: 28px 16px 60px; }
}

@media (max-width: 480px) {
  .stat-card .num { font-size: 1.6rem; }
  .display { font-size: 1.4rem !important; }
  h1.display { line-height: 1.25; }
}

/* --- Section labels (Video / Pictures / Documents) --- */
.section-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  margin-bottom: 12px;
}

/* --- Video player --- */
.video-player-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
  background: #000000;
}
.video-player-card:last-child { margin-bottom: 0; }
.video-title-bar {
  background: #000000;
  color: #ffffff;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 500;
}
.video-player {
  width: 100%;
  max-height: 520px;
  display: block;
  background: #000000;
}
.video-iframe {
  aspect-ratio: 16 / 9;
  max-height: none;
  height: auto;
  border: none;
}
.video-fallback-link {
  padding: 40px 20px;
  text-align: center;
  color: #ffffff;
}
.video-fallback-link a {
  color: #b5893c;
  font-weight: 600;
}

/* --- Picture gallery grid --- */
.picture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.picture-thumb {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.picture-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}
.picture-thumb:hover img {
  transform: scale(1.05);
}
.picture-thumb:focus,
.picture-thumb:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(181, 137, 60, 0.45);
}

/* --- Deadline countdown banner --- */
.deadline-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(181, 137, 60, 0.12);
  border: 1px solid #b5893c;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  color: var(--text);
  font-size: 0.9rem;
}
.deadline-banner.deadline-urgent {
  background: rgba(198, 40, 40, 0.1);
  border-color: var(--danger);
}
.deadline-icon { font-size: 1.3rem; flex-shrink: 0; }

/* --- Progress bar --- */
.progress-track {
  width: 100%;
  height: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #b5893c, #d4ac5f);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* --- Two-column widget row (chart + recent) --- */
.grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

/* --- Score distribution mini bar chart --- */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 140px;
}
.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.chart-bar-track {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: flex-end;
  background: var(--panel-2);
  border-radius: 6px;
  overflow: hidden;
}
.chart-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #d4ac5f, #b5893c);
  border-radius: 6px 6px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}
.chart-bar-count {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 6px;
  color: var(--text);
}
.chart-bar-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

/* --- Recently viewed list --- */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.recent-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.recent-item:hover {
  background: var(--panel-2);
  text-decoration: none;
}
.recent-item:focus,
.recent-item:focus-visible {
  outline: none;
  background: var(--panel-2);
  box-shadow: 0 0 0 3px rgba(181, 137, 60, 0.45);
}
.recent-item-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.recent-item-cat { margin-top: 2px; }

/* --- Quick search row on the Categories page --- */
.quick-search-row {
  display: flex;
  gap: 10px;
  margin: 18px 0 4px;
  max-width: 560px;
}
.quick-search-row .input { flex: 1; }
.quick-search-row .btn { flex-shrink: 0; }
@media (max-width: 480px) {
  .quick-search-row { flex-direction: column; }
  .quick-search-row .btn { width: 100%; }
}

/* --- Hero banner (My Dashboard) --- */
.hero-banner {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 44px 40px;
  margin-bottom: 24px;
  background:
    radial-gradient(circle at 15% 25%, rgba(228, 201, 122, 0.22) 0%, transparent 35%),
    radial-gradient(circle at 85% 15%, rgba(181, 137, 60, 0.28) 0%, transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(212, 172, 95, 0.18) 0%, transparent 38%),
    radial-gradient(circle at 30% 90%, rgba(181, 137, 60, 0.15) 0%, transparent 30%),
    linear-gradient(135deg, #0a0805 0%, #1c1509 55%, #0a0805 100%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.hero-kicker {
  color: #d4ac5f;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-title {
  font-family: Georgia, 'Times New Roman', serif;
  color: #ffffff;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 14px;
  max-width: 640px;
}
.hero-subtitle {
  color: #cfc3a3;
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 520px;
  margin: 0;
}
.hero-subtitle strong { color: #e4c97a; }
.hero-avatar-wrap {
  position: absolute;
  top: 50%;
  right: 48px;
  transform: translateY(-50%);
}
.hero-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(212, 172, 95, 0.6);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
.hero-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-gradient);
  color: #1a1509;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 3.4rem;
  text-transform: uppercase;
}

@media (max-width: 620px) {
  .hero-banner { padding: 32px 24px; }
  .hero-title { font-size: 1.7rem; }
  .hero-avatar-wrap { position: static; margin-top: 18px; transform: none; text-align: center; }
  .hero-avatar, .hero-avatar-fallback { width: 90px; height: 90px; }
  .hero-avatar-fallback { font-size: 2rem; }
}

/* --- Full logo lockup on the login page --- */
.login-logo {
  max-width: 300px;
  width: 100%;
  height: auto;
  margin-bottom: 10px;
}
.login-kicker {
  color: #b5893c;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* --- Mobile-friendly data tables ---
   Below 700px, table.entries stops being a horizontal-scroll table and
   becomes a stack of labeled cards instead — each row becomes its own
   card, each cell shows its column header as a label before the value.
   Requires each <td> to carry a data-label="..." attribute matching its
   column header; cells with no data-label (e.g. the trailing action-button
   column) just render full-width with no label. */
@media (max-width: 700px) {
  table.entries, table.entries thead, table.entries tbody,
  table.entries th, table.entries td, table.entries tr {
    display: block;
  }
  table.entries thead {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  table.entries tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 14px;
    padding: 4px 14px;
    background: var(--panel);
  }
  table.entries td {
    border: none;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: right;
  }
  table.entries td:last-child { border-bottom: none; }
  table.entries td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    flex-shrink: 0;
  }
  table.entries td:not([data-label]) {
    justify-content: center;
    padding: 12px 0;
  }
  .table-actions {
    justify-content: center;
    width: 100%;
  }
  /* Cells with multi-line nested content (e.g. org name + category
     subtitle) look cramped squeezed into a side-by-side flex row — let
     them stack full-width under their label instead. */
  table.entries td.entries-cell-block {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 4px;
  }
}