/* U-Attend lecturer portal.
   Served by PocketBase from pb_public/, so the API is same-origin and there
   are no CORS concerns. */

:root {
  --navy:#0E1628; --navy-2:#152036; --line:#DCE3ED;
  --text:#1B2433; --muted:#65748C;
  --accent:#1F6FEB; --accent-dark:#1858C4;
  --ok:#137A45; --ok-bg:#E6F5ED;
  --warn:#8A6100; --warn-bg:#FDF3DF;
  --err:#B3261E; --err-bg:#FDECEA;
  --radius:10px;
}
* { box-sizing:border-box; }
body {
  margin:0; background:#F5F7FA; color:var(--text);
  font:15px/1.55 "Segoe UI",system-ui,-apple-system,sans-serif;
}
.hidden { display:none !important; }
h1,h2,h3 { margin:0 0 4px; }
h2 { font-size:20px; }
.sub { color:var(--muted); font-size:13px; margin:0; }
.hint { color:var(--muted); font-size:12px; margin:10px 0 0; }
.empty { color:var(--muted); text-align:center; padding:40px 20px;
         background:#fff; border:1px dashed var(--line); border-radius:var(--radius); }
.spacer { flex:1; }

/* login */
.login-wrap { min-height:100vh; display:grid; place-items:center;
              background:linear-gradient(160deg,var(--navy),#1B2C4A); padding:20px; }
.login-card { background:#fff; padding:34px 32px; border-radius:14px;
              width:100%; max-width:380px; box-shadow:0 18px 50px rgba(0,0,0,.28); }
.login-card h1 { font-size:26px; letter-spacing:-.4px; }
.login-card .sub { margin-bottom:22px; }

/* chrome */
header { background:var(--navy); color:#fff; padding:14px 26px;
         display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; }
.brand { font-size:17px; font-weight:600; }
.brand span { font-weight:400; opacity:.65; font-size:13px; margin-left:8px; }
.who { display:flex; align-items:center; gap:14px; font-size:13px; opacity:.9; }
.crumbs { padding:12px 26px 0; font-size:13px; color:var(--muted); }
.crumbs a { color:var(--accent); text-decoration:none; cursor:pointer; }
.crumbs a:hover { text-decoration:underline; }
main { padding:16px 26px 40px; max-width:1080px; }
.row-between { display:flex; align-items:flex-start; justify-content:space-between;
               gap:16px; margin-bottom:16px; flex-wrap:wrap; }
.btn-row { display:flex; gap:8px; flex-wrap:wrap; }
.btn-row.center { justify-content:center; }

/* controls */
label { display:block; font-size:12px; font-weight:600; color:var(--muted);
        margin:14px 0 5px; text-transform:uppercase; letter-spacing:.4px; }
input {
  width:100%; padding:10px 12px; border:1px solid var(--line);
  border-radius:8px; font-size:14px; background:#fff; color:var(--text);
}
input:focus { outline:2px solid rgba(31,111,235,.35); border-color:var(--accent); }
button {
  border:1px solid var(--line); background:#fff; color:var(--text);
  padding:9px 15px; border-radius:8px; font-size:13px; font-weight:600;
  cursor:pointer;
}
button:hover:not(:disabled) { border-color:#B9C4D4; }
button:disabled { opacity:.55; cursor:not-allowed; }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
button.primary:hover:not(:disabled) { background:var(--accent-dark); border-color:var(--accent-dark); }
button.ghost { background:transparent; }
header button.ghost { color:#fff; border-color:rgba(255,255,255,.35); }
header button.ghost:hover { border-color:#fff; }
button.danger { color:var(--err); border-color:#F0C4C0; }
button.danger:hover:not(:disabled) { background:var(--err-bg); }
button.block { width:100%; margin-top:20px; padding:11px; }

/* cards */
.cards { display:grid; gap:12px; }
.card {
  background:#fff; border:1px solid var(--line); border-radius:var(--radius);
  padding:16px 18px; display:flex; align-items:center;
  justify-content:space-between; gap:16px; flex-wrap:wrap;
}
.card-main { min-width:220px; }
.card-title { font-weight:600; font-size:16px; }
.card-meta { color:var(--muted); font-size:13px; margin-top:3px; }
.code {
  display:inline-block; background:#EEF2F8; border-radius:5px;
  padding:1px 7px; font:12px/1.6 Consolas,monospace; color:#33415C;
}

/* status pills */
.pill { display:inline-block; padding:2px 9px; border-radius:999px;
        font-size:11px; font-weight:700; letter-spacing:.3px; text-transform:uppercase; }
.pill.live { background:var(--ok-bg); color:var(--ok); }
.pill.scheduled { background:var(--warn-bg); color:var(--warn); }
.pill.ended { background:#EDF0F5; color:var(--muted); }
.pill.off { background:#EDF0F5; color:var(--muted); }

/* messages */
.error { background:var(--err-bg); color:var(--err); border-radius:7px;
         padding:9px 12px; font-size:13px; margin-top:14px; }
.banner { margin:14px 26px 0; padding:11px 15px; border-radius:8px; font-size:13px; }
.banner.ok { background:var(--ok-bg); color:var(--ok); }
.banner.err { background:var(--err-bg); color:var(--err); }

/* table */
.grid { width:100%; border-collapse:collapse; background:#fff;
        border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
.grid th, .grid td { text-align:left; padding:11px 14px; border-bottom:1px solid var(--line); font-size:14px; }
.grid th { background:#F7F9FC; font-size:12px; text-transform:uppercase;
           letter-spacing:.4px; color:var(--muted); }
.grid tr:last-child td { border-bottom:none; }

/* dialogs */
dialog { border:none; border-radius:14px; padding:26px 28px; max-width:420px;
         width:calc(100% - 32px); box-shadow:0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background:rgba(14,22,40,.55); }
.dialog-actions { display:flex; gap:8px; align-items:center; margin-top:22px; }

/* QR projection */
.qr-overlay { position:fixed; inset:0; background:rgba(14,22,40,.94);
              display:grid; place-items:center; padding:20px; z-index:50; }
.qr-card { background:#fff; border-radius:16px; padding:28px 32px;
           text-align:center; max-width:min(92vw,560px); }
.qr-box { display:grid; place-items:center; margin:18px auto; }
/* White quiet zone matters: scanners need the margin around the symbol. */
.qr-box svg, .qr-box img { width:min(60vh,360px); height:auto; background:#fff; padding:12px; }
.qr-status { font-size:13px; font-weight:600; margin:6px 0 16px; }
.qr-status.live { color:var(--ok); }
.qr-status.scheduled { color:var(--warn); }
.qr-status.ended { color:var(--err); }
