/* RJExamResults — Goal Panel
   Palette and radii follow the existing portal so the module does not read as a bolt-on. */

:root {
  --bg: #020617;
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(148, 163, 184, 0.12);
  --text: #f8fafc;
  --muted: #94a3b8;
  --brand: #38bdf8;
  --brand-glow: rgba(56, 189, 248, 0.3);
  --warn: #fbbf24;
  --hot: #fb7185;
  --good: #34d399;
  --sand: #f59e0b;
  --radius: 20px;
  --container: 1080px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(56, 189, 248, 0.10), transparent 30%),
    radial-gradient(circle at 88% 22%, rgba(168, 85, 247, 0.08), transparent 28%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 18px 18px 80px; }

/* ---------------------------------------------------------------- header */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; margin-bottom: 20px;
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 999px; backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 12px var(--brand); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--card-border); object-fit: cover; }

.btn {
  border: 1px solid var(--card-border); background: rgba(148,163,184,0.08);
  color: var(--text); border-radius: 999px; padding: 9px 16px; cursor: pointer;
  font-weight: 600; font-size: 0.92rem; transition: background .18s, transform .18s, border-color .18s;
}
.btn:hover { background: rgba(148,163,184,0.16); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.primary { background: linear-gradient(135deg, #0ea5e9, #38bdf8); border-color: transparent; color: #04121f; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--hot); border-color: rgba(251,113,133,0.3); }
.btn.small { padding: 6px 12px; font-size: 0.82rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ----------------------------------------------------------------- cards */

.card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 20px; backdrop-filter: blur(14px);
}
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }

h1, h2, h3 { letter-spacing: -0.5px; margin: 0; }
h1 { font-size: 1.9rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
.muted { color: var(--muted); }
.tiny { font-size: 0.78rem; }
.stamp { font-size: 0.72rem; color: var(--muted); }

/* ------------------------------------------------------------ today strip */

.today {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.clock { font-variant-numeric: tabular-nums; font-size: 1.05rem; font-weight: 600; }
.clock span { color: var(--muted); font-weight: 500; }

.age-line { font-variant-numeric: tabular-nums; }
.age-line b { color: var(--brand); }

.birthday {
  margin-top: 12px; padding: 14px 18px; border-radius: 16px;
  background: linear-gradient(120deg, rgba(251,191,36,0.16), rgba(251,113,133,0.14));
  border: 1px solid rgba(251,191,36,0.35);
}

.quote {
  margin-top: 16px; padding: 18px 22px; border-left: 3px solid var(--warn);
  background: rgba(15,23,42,0.6); border-radius: 0 16px 16px 0; font-size: 1.02rem;
}
.quote.shock { border-left-color: var(--hot); }
.quote footer { margin-top: 6px; color: var(--muted); font-size: 0.82rem; }

/* --------------------------------------------------------------- hero exam */

.hero { display: grid; grid-template-columns: 190px 1fr; gap: 24px; align-items: center; }
.hero .glass { width: 190px; height: 240px; }

.bignum { font-size: 4.4rem; font-weight: 800; line-height: 0.95; font-variant-numeric: tabular-nums; }
.bignum small { display: block; font-size: 0.9rem; font-weight: 600; color: var(--muted); letter-spacing: 0.2px; }

.stat-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 14px; }
.stat b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.8rem; }

/* --------------------------------------------------------------- day grid */

.daygrid { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 16px; }
.daygrid i {
  width: 8px; height: 8px; border-radius: 2px; background: rgba(148,163,184,0.22); display: block;
}
.daygrid i.weekend { background: rgba(56,189,248,0.55); }
.daygrid i.gone { background: rgba(148,163,184,0.08); }
.legend { display: flex; gap: 16px; margin-top: 10px; font-size: 0.76rem; color: var(--muted); }
.legend em { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* ------------------------------------------------------------- exam board */

.board { display: grid; gap: 16px; margin-top: 20px; }

.exam-card { position: relative; overflow: hidden; }
.exam-card header { display: flex; gap: 14px; align-items: center; }
.exam-logo {
  width: 52px; height: 52px; border-radius: 14px; object-fit: cover; flex: none;
  background: rgba(148,163,184,0.12); display: grid; place-items: center;
  font-weight: 800; font-size: 1.1rem; border: 1px solid var(--card-border);
}
.exam-card h3 { font-size: 1.12rem; }
.exam-meta { color: var(--muted); font-size: 0.82rem; }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  background: rgba(56,189,248,0.12); color: var(--brand); border: 1px solid rgba(56,189,248,0.25);
}
.tag.own { background: rgba(168,85,247,0.12); color: #c4b5fd; border-color: rgba(168,85,247,0.3); }
.tag.live { background: rgba(52,211,153,0.14); color: var(--good); border-color: rgba(52,211,153,0.3); }
.tag.warn { background: rgba(251,191,36,0.14); color: var(--warn); border-color: rgba(251,191,36,0.3); }

/* stage rail */
.rail { display: flex; align-items: stretch; gap: 0; margin-top: 18px; overflow-x: auto; padding-bottom: 6px; }
.stage {
  min-width: 190px; flex: 1; padding: 14px 16px; border: 1px solid var(--card-border);
  border-radius: 16px; background: rgba(2,6,23,0.5);
}
.stage.past { opacity: 0.55; }
.stage h4 { margin: 0 0 6px; font-size: 0.92rem; }
.stage .days { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.stage .days.soon { color: var(--hot); }
.stage ul { list-style: none; margin: 10px 0 0; padding: 0; font-size: 0.8rem; color: var(--muted); }
.stage ul li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.stage ul li b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }

.gap {
  min-width: 130px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 0 12px; color: var(--muted); font-size: 0.75rem; text-align: center; position: relative;
}
.gap::before {
  content: ''; position: absolute; left: 6px; right: 6px; top: 26px; height: 2px;
  background: repeating-linear-gradient(90deg, rgba(148,163,184,0.4) 0 6px, transparent 6px 12px);
}
.gap b { display: block; color: var(--brand); font-size: 1rem; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- drawer */

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(2,6,23,0.72); backdrop-filter: blur(3px);
  display: none; z-index: 40;
}
.drawer-backdrop.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: #0b1324; border-left: 1px solid var(--card-border); z-index: 50;
  transform: translateX(100%); transition: transform .25s cubic-bezier(0.16,1,0.3,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer > header { padding: 18px 20px; border-bottom: 1px solid var(--card-border); display: flex; justify-content: space-between; align-items: center; }
.drawer > .body { padding: 18px 20px 40px; overflow-y: auto; flex: 1; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button {
  border: 1px solid var(--card-border); background: transparent; border-radius: 999px;
  padding: 6px 14px; cursor: pointer; font-size: 0.85rem; color: var(--muted);
}
.tabs button.active { background: rgba(56,189,248,0.14); color: var(--brand); border-color: rgba(56,189,248,0.3); }
.panel { display: none; }
.panel.active { display: block; }

.file-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--card-border);
}
.file-row:last-child { border-bottom: none; }
.file-row .name { flex: 1; min-width: 0; }
.file-row .name b { display: block; font-weight: 600; font-size: 0.92rem; }

table.seats { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.seats th, table.seats td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--card-border); }
table.seats th:first-child, table.seats td:first-child { text-align: left; }
table.seats thead th { color: var(--muted); font-weight: 600; font-size: 0.76rem; }
table.seats tr.total td { font-weight: 700; color: var(--brand); }

/* ---------------------------------------------------------------- forms */

label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=date], input[type=time], input[type=number], input[type=tel], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--card-border); background: rgba(2,6,23,0.65);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-glow); border-color: var(--brand); }
textarea { min-height: 90px; resize: vertical; }

.hours-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.hours-picker button {
  border-radius: 12px; padding: 8px 14px; border: 1px solid var(--card-border);
  background: transparent; cursor: pointer; font-variant-numeric: tabular-nums;
}
.hours-picker button.on { background: rgba(56,189,248,0.16); border-color: var(--brand); color: var(--brand); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(2,6,23,0.8); display: none; z-index: 60; padding: 20px; overflow-y: auto; }
.modal-backdrop.open { display: block; }
.modal { max-width: 560px; margin: 40px auto; }

.msg { padding: 11px 14px; border-radius: 12px; font-size: 0.88rem; margin: 12px 0; display: none; }
.msg.show { display: block; }
.msg.bad { background: rgba(251,113,133,0.12); border: 1px solid rgba(251,113,133,0.3); color: #fecdd3; }
.msg.good { background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.3); color: #a7f3d0; }
.msg.warn { background: rgba(251,191,36,0.12); border: 1px solid rgba(251,191,36,0.3); color: #fde68a; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.hidden { display: none !important; }

.searchbar { display: flex; gap: 10px; margin-bottom: 14px; }
.searchbar input { flex: 1; }

.catalogue-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--card-border);
}

footer.foot { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 26px 0 10px; }
footer.foot a:hover { color: var(--brand); }

@media (max-width: 760px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .hero .glass { width: 150px; height: 190px; }
  .bignum { font-size: 3.4rem; }
  .topbar { border-radius: 20px; }
  .stat-row { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
