/* ATBC 2026 Awards — UI styles
   Color palette inspired by the ATBC Oaxaca 2025 reference screenshots:
   magenta header, mustard banner, royal-blue primary buttons, soft gray bg. */
:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --ink: #1d2939;
  --ink-soft: #475569;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2453d6;
  --primary-strong: #1e3a8a;
  --magenta: #b8336a;
  --mustard: #d99a32;
  --green-good: #166534;
  --red-bad: #b91c1c;
  --accent-soft: #eef3fb;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 6px 20px rgba(15,23,42,.05);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

/* ---------- Topbar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; padding: 12px 20px;
  flex-wrap: wrap; gap: 12px;
}
.topbar__brand {
  font-weight: 700; color: var(--ink); text-decoration: none;
  letter-spacing: -.01em;
}
.topbar__links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar__links a { color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.topbar__links a:hover { color: var(--primary); }
.topbar__user { font-size: 13px; color: var(--muted); }
.topbar__logout {
  background: var(--accent-soft); color: var(--primary) !important;
  padding: 6px 12px; border-radius: 8px; font-weight: 500;
}

/* ---------- Page layout ---------- */
.page { max-width: 1200px; margin: 24px auto; padding: 0 20px 60px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 0 auto;
  max-width: 640px;
}
.card--wide { max-width: 1100px; }
.card__body { padding: 24px 28px 28px; }
.card__heading { font-size: 22px; margin: 8px 0 4px; }
.card__subheading { font-size: 18px; margin: 24px 0 12px; color: var(--ink); }
.card__lede { color: var(--ink-soft); margin: 0 0 16px; font-size: 14px; }

/* ---------- Banner header ---------- */
.card__banner {
  line-height: 0;
  width: 100%;
  display: block;
  overflow: hidden;
}
.card__banner-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* ---------- Pill (contribution ID badge) ---------- */
.pill {
  display: block;
  background: #eef3fb;
  color: var(--primary);
  border: 1px solid #d8e3f7;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  margin: 16px 0 14px;
}

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.form__label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 14px; color: var(--ink-soft); font-weight: 500;
}
.form__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.form__input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36,83,214,.15);
}
.form__input--lg { padding: 14px 16px; font-size: 16px; }
.form--inline {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px; align-items: end; padding: 12px 0;
}
.form-collapsible { margin-bottom: 18px; }
.form-collapsible summary { cursor: pointer; font-weight: 600; padding: 8px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 18px; border-radius: 8px; font-weight: 600;
  font-size: 15px; line-height: 1;
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
  transition: background .12s, transform .04s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-strong); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: #f8fafc; }
.btn--danger { background: var(--red-bad); color: #fff; }
.btn--mini { padding: 6px 10px; font-size: 12px; }
.btn--block { width: 100%; }

.actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.actions--two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions--three { display: grid; grid-template-columns: auto 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .actions--three { grid-template-columns: 1fr; } }
.actions--right { justify-content: flex-end; }

/* ---------- Abstract view ---------- */
.abstract__title { font-size: 18px; font-weight: 700; margin: 8px 0 12px; }
.abstract__authors { margin: 0 0 14px; font-size: 14px; }
.abstract__body { font-size: 14px; line-height: 1.6; white-space: pre-wrap; color: #334155; margin: 12px 0; }
.abstract__meta { margin-top: 16px; font-size: 14px; }
.abstract__meta p { margin: 6px 0; }

.awards-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge--oral    { background: #e0e7ff; color: #3730a3; }
.badge--poster  { background: #dcfce7; color: #166534; }
.badge--bacardi { background: #fee2e2; color: #b91c1c; }
.badge--np      { background: #fef3c7; color: #92400e; }
.badge--admin   { background: #ede9fe; color: #5b21b6; }
.badge--judge   { background: #e0f2fe; color: #075985; }

/* ---------- Rating table (evaluation form) ---------- */
.rating-table {
  width: 100%; border-collapse: collapse;
  background: #fff;
  font-size: 14px;
  margin: 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.rating-table th, .rating-table td {
  padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--line);
}
.rating-table thead th { background: #f1f5f9; font-weight: 600; }
.rating-table thead th:first-child { text-align: left; padding-left: 14px; }
.rating-table__crit { text-align: left; padding-left: 14px; font-weight: 500; }
.rating-table__bacardi.is-disabled { color: var(--muted); }
.rating-table__hint { display: block; font-weight: 400; font-size: 11px; }
.rating-table input[type="radio"] { transform: scale(1.1); cursor: pointer; }
.req { color: var(--red-bad); }

/* ---------- Data tables (admin & user lists) ---------- */
.data-table {
  width: 100%; border-collapse: collapse; background: #fff;
  font-size: 13px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  margin: 12px 0;
}
.data-table th, .data-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table th { background: #f8fafc; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.data-table tr:last-child td { border-bottom: none; }
.data-table--rank .rank { font-weight: 700; width: 36px; }
.data-table .title { max-width: 360px; }
.data-table .authors { max-width: 220px; color: var(--ink-soft); font-size: 12px; }
.data-table .score { font-weight: 700; }
.data-table .comments { max-width: 320px; color: #334155; }

/* ---------- KPIs (admin dashboard) ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 8px 0 18px; }
.kpi {
  background: #f8fafc; border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; text-align: center;
}
.kpi__num { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1; }
.kpi__lbl { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Misc ---------- */
.flash {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 12px;
  font-size: 14px; max-width: 1100px; margin-inline: auto;
}
.flash--error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash--success { background: #dcfce7; color: #14532d; border: 1px solid #bbf7d0; }
.flash--info    { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

.login__footer {
  text-align: center; margin-top: 16px; font-size: 13px;
  border-top: 1px solid var(--line); padding-top: 14px;
}
.login__footer a { color: var(--muted); text-decoration: none; }
.login__footer a:hover { color: var(--primary); text-decoration: underline; }

.notice { padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: 13px; }
.notice--info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.notice--warn { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

.conflict-form { margin-top: 18px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; background: #fafafa; }
.conflict-form summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); font-size: 13px; }
.conflict-form .form { margin-top: 12px; }
.muted { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); font-style: italic; padding: 12px 0; }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--primary); text-decoration: none; font-size: 14px; }
.back-link:hover { text-decoration: underline; }
.ranking { margin-top: 28px; }

/* ---------- Agenda (judge home) ---------- */
.progress {
  position: relative; height: 28px; background: #f1f5f9; border-radius: 999px;
  border: 1px solid var(--line); margin: 4px 0 18px; overflow: hidden;
}
.progress__bar {
  position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%);
  background: linear-gradient(90deg, #34d399, #10b981);
  transition: width .3s ease;
}
.progress__label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink);
}

.filters {
  display: flex !important;
  flex-direction: row !important;   /* override .form { flex-direction: column } when both classes applied */
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  background: #f8fafc;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0 0 18px;
}
.filters > label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  font-weight: 600;
  flex: 0 1 auto;
}
.filters select,
.filters input[type="text"],
.filters input[type="search"] {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font-size: 14px; min-width: 160px;
  font-family: inherit;
}

.agenda-day { margin: 26px 0 10px; }
.agenda-day__heading {
  font-size: 16px; font-weight: 700; color: var(--ink);
  background: var(--accent-soft); padding: 10px 14px; border-radius: 8px;
  margin: 0 0 12px; border-left: 4px solid var(--primary);
}

.agenda-session {
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px;
  overflow: hidden; background: #fff;
}
.agenda-session__head {
  display: flex; justify-content: space-between; align-items: center;
  background: #f8fafc; padding: 10px 14px;
  border-bottom: 1px solid var(--line); font-size: 13px;
  flex-wrap: wrap; gap: 6px;
}
.agenda-session__time { font-weight: 700; color: var(--primary); margin-right: 10px; }
.agenda-session__num {
  background: #eef3fb; color: var(--primary);
  padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 12px;
  margin-right: 8px;
}
.agenda-session__title { color: var(--ink-soft); }
.agenda-session__room { color: var(--muted); font-size: 12px; }

.agenda-list { list-style: none; padding: 0; margin: 0; }
.agenda-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  gap: 12px; flex-wrap: wrap;
  transition: background .12s;
}
.agenda-item:last-child { border-bottom: none; }
.agenda-item:hover { background: #f8fafc; }
.agenda-item.is-evaluated { background: #f0fdf4; }
.agenda-item.is-evaluated:hover { background: #dcfce7; }

.agenda-item__main {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1 1 60%; min-width: 240px;
  text-decoration: none; color: var(--ink);
}
.agenda-item__id {
  font-size: 11px; font-weight: 700; color: var(--primary);
  letter-spacing: .04em;
}
.agenda-item__title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.agenda-item__authors { font-size: 12px; color: var(--muted); }
.agenda-item__meta {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}

.badge--gentry { background: #fef9c3; color: #854d0e; }
.status {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.status--done    { background: #dcfce7; color: #166534; }
.status--pending { background: #fef3c7; color: #92400e; }

.empty--big { padding: 30px 20px; text-align: center; background: #f8fafc; border: 1px dashed var(--line); border-radius: 10px; }
.empty--big p { margin: 6px 0; color: var(--ink-soft); font-style: normal; }

.actions-cell { display: flex; gap: 8px; align-items: center; }
.actions-cell form { display: inline; }

.filters--admin { margin-bottom: 16px; }
.filters__actions {
  display: flex; gap: 8px;
  margin-left: auto;        /* push to the right when there's room */
  align-self: flex-end;
}
.is-evaluated-row { background: #f0fdf4; }

.codeblock {
  background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px;
  overflow-x: auto; font-size: 12px; font-family: SFMono-Regular, Menlo, monospace;
}

.judge-pool { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.judge-pool legend { padding: 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.judge-pool__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.judge-pool__item { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.judge-pool__item:hover { background: #f8fafc; }

/* Filter chips for the per-judge "All contributions" table */
.scope-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  flex: 1 1 100%;            /* take a full row so chips don't squish next to search */
  margin-bottom: 4px;
}
.scope-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  color: var(--ink-soft); text-decoration: none; font-size: 13px; font-weight: 500;
  transition: all .12s;
}
.scope-chip:hover { background: #f8fafc; color: var(--ink); }
.scope-chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.scope-chip__n {
  background: rgba(0,0,0,.08); color: inherit;
  padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
}
.scope-chip.is-active .scope-chip__n { background: rgba(255,255,255,.25); }
.scope-chip__n--warn { background: #fee2e2; color: #b91c1c; }

.search-wrap { flex: 1 1 240px; }
.search-wrap input { width: 100%; }

.data-table--compact th, .data-table--compact td { padding: 6px 10px; font-size: 12px; }
.data-table--compact .title { max-width: 380px; }
.data-table--compact .num { text-align: center; font-weight: 600; }

/* Pagination controls (used below paginated tables) */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin: 14px 0 24px; font-size: 13px;
}
.pagination__link {
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: 8px;
  background: #fff; border: 1px solid var(--line);
  color: var(--primary); text-decoration: none; font-weight: 500;
  transition: all .12s;
}
.pagination__link:hover { background: var(--accent-soft); border-color: var(--primary); }
.pagination__link.is-disabled {
  color: #cbd5e1; cursor: not-allowed; pointer-events: none;
  background: #f8fafc;
}
.pagination__info { color: var(--muted); padding: 0 6px; }

.is-flagged { background: #fff7ed; }
.is-flagged:hover { background: #ffedd5; }
.data-table--rank .title small.authors { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 2px; }

.comments-feed { list-style: none; padding: 0; margin: 0; }
.comments-feed__item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; background: #fefefe; }
.comments-feed__head { font-size: 12px; margin-bottom: 6px; }
.comments-feed__head a { font-weight: 700; color: var(--primary); text-decoration: none; margin-right: 8px; }
.comments-feed__title { color: var(--ink-soft); font-weight: 600; }
.comments-feed__body { font-size: 13px; color: #334155; white-space: pre-wrap; }

/* ---------- Mobile tweaks ---------- */
@media (max-width: 640px) {
  .actions--two { grid-template-columns: 1fr; }
  /* Convert the rating table to a stacked layout on phones for thumb-friendly tapping */
  .rating-table { border: none; }
  .rating-table thead { display: none; }
  .rating-table tbody, .rating-table tr, .rating-table td { display: block; width: 100%; }
  .rating-table tr { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
  .rating-table__crit { padding: 0 0 8px !important; font-size: 14px; font-weight: 600; border: none; }
  .rating-table td { border: none; padding: 0; }
  .rating-table__bacardi.is-disabled { display: none; }
  /* Inline radios laid out as a row of bigger touch targets */
  .rating-table tr { display: flex; flex-direction: column; }
  .rating-table tr td:not(.rating-table__crit) {
    display: inline-block; width: auto;
    padding: 6px 4px; flex: 0 0 auto;
  }
  .rating-table tr td:not(.rating-table__crit) input[type="radio"] {
    transform: scale(1.5); margin: 0 8px; cursor: pointer;
  }
  .rating-table tr {
    display: grid;
    grid-template-columns: 1fr;
  }
  .rating-row__radios {
    display: flex; flex-wrap: wrap; gap: 4px;
  }
  .data-table { font-size: 12px; }
  .data-table .title { max-width: 200px; }
  .topbar__inner { flex-direction: column; align-items: flex-start; }
}
