/* Tuurt.OS portal — the Control Room's look, trimmed to three views.
   Same tokens as panel/public/style.css so the two do not drift while they
   coexist; the portal adds only what it needs (login card, repo lines). */
:root {
  --pink: #E85D75;
  --pink-dark: #D8455F;
  --tan: #C9B99A;
  --wine: #781916;
  --ink: #26262B;
  --muted: #6E6E76;
  --line: #E7E7EC;
  --soft: #F7F5F3;
  --soft2: #FBEEF0;
  --ok: #0E7A56;
  --ok-bg: #E3F4EC;
  --warn: #9A6412;
  --warn-bg: #FBF1DC;
  --danger: #B3261E;
  --danger-bg: #FBE9E7;
  --tan-bg: #F1ECE1;
  --radius: 14px;
  --sans: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--soft); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: var(--pink-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h3 { font-size: 17px; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 18px 0 8px; }
h4:first-child { margin-top: 0; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.err { color: var(--danger); }
.client { color: var(--muted); font-weight: 500; }
.meta { color: var(--muted); font-size: 13px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 28px; background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.mark {
  flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--pink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
}
.brand-title { font-weight: 650; font-size: 17px; letter-spacing: -0.01em; }
.session { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.session .who { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* Layout */
.view { max-width: 1020px; margin: 0 auto; padding: 24px 28px 48px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 12px 0 28px; }
.section { margin-bottom: 22px; }
.section:last-child { margin-bottom: 0; }
.back { display: inline-block; margin-bottom: 14px; font-weight: 500; }
.lead { font-size: 16px; max-width: 760px; margin-bottom: 20px; }
.notice { margin-bottom: 16px; padding: 10px 14px; border-radius: 10px; font-size: 14px; border: 1px solid; }
.notice.warn { background: var(--warn-bg); color: var(--warn); border-color: #ecd9ad; }

/* Cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.proj-name { font-weight: 650; color: var(--ink); font-size: 16px; }
.proj-card { display: block; color: var(--ink); }
.proj-card:hover { text-decoration: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--soft2); }
.empty-card { color: var(--muted); }
.error-card { border-left: 4px solid var(--danger); background: #fff8f7; }
.next-title { font-size: 18px; margin-bottom: 6px; }
.next-detail { color: var(--ink); opacity: 0.85; margin-bottom: 10px; overflow-wrap: anywhere; }
.login-card { max-width: 480px; margin: 8vh auto 0; }
.login-card h1 { margin-bottom: 8px; }
.repo-card { margin-bottom: 14px; }
.repo-card h3 { font-family: var(--mono); font-size: 15px; overflow-wrap: anywhere; margin-bottom: 14px; }

/* Project header */
.proj-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

/* Badges */
.chips { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.st { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st-confirmed { background: var(--ok-bg); color: var(--ok); }
.st-pending { background: var(--warn-bg); color: var(--warn); }
.st-rejected { background: var(--danger-bg); color: var(--danger); }
.st-question { background: var(--tan-bg); color: #6B5A34; }
.st-muted { background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.fr-id { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--pink-dark); background: var(--soft2); padding: 1px 7px; border-radius: 6px; white-space: nowrap; }

/* Buttons */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 600 14px/1 var(--sans); color: var(--ink); background: #fff; border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 14px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--soft); text-decoration: none; border-color: #d6d6dd; }
.btn-primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn-primary:hover { background: var(--pink-dark); border-color: var(--pink-dark); }
.btn-small { padding: 7px 11px; font-size: 13px; }
.btn-link { border: none; background: none; color: var(--pink-dark); padding: 6px 0; }
.btn-link:hover { background: none; text-decoration: underline; }

/* Lists */
.plain { list-style: none; margin: 0; padding: 0; }
.tasks > li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; }
.task-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink); }
.task-head:hover { text-decoration: none; }
.task-head:hover .fr-id { background: var(--pink); color: #fff; }
.repos { margin-top: 10px; border-top: 1px dashed var(--line); }
.repo-line {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
}
.repo-line:last-child { border-bottom: none; }
.repo-name { font-family: var(--mono); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* A proof, read: each piece with its name */
.proof-block { margin-top: 12px; }
.said-h { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.proof-list { margin: 0; padding-left: 20px; font-size: 14px; }
.proof-list li { margin: 3px 0; overflow-wrap: anywhere; }
.findings li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.findings li:last-child { border-bottom: none; }
.finding.blocking { padding-left: 10px; border-left: 3px solid var(--danger); }
.finding-note { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.more > summary { cursor: pointer; color: var(--pink-dark); font-size: 13px; margin-top: 10px; }

/* History */
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: none; }
td.ts { white-space: nowrap; color: var(--muted); font-size: 13px; }
.num-cell { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Something is working */
.run-wait { display: flex; align-items: center; gap: 10px; background: var(--tan-bg); color: #6B5A34; border-radius: 10px; padding: 11px 14px; font-weight: 500; }
.spin { flex: none; width: 15px; height: 15px; border-radius: 50%; border: 2px solid #d9cdb3; border-top-color: #6B5A34; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* On a phone it is still a page you can read, not a table you must pan */
@media (max-width: 720px) {
  .topbar { padding: 10px 14px; }
  .view { padding: 16px 14px 40px; }
  h1 { font-size: 22px; }
  .cards { grid-template-columns: 1fr; }
  .repo-line { align-items: flex-start; flex-direction: column; gap: 6px; }
  .login-card { margin-top: 4vh; }
}
