/* Owner Back Office: one stylesheet, no framework. Calm, readable, phone first (Task 18a ruling 11). */
:root {
  --bg: #f6f7f9; --card: #ffffff; --ink: #1d2430; --muted: #687385; --line: #dfe3ea;
  --green: #1f8a4c; --yellow: #b7791f; --red: #c0392b; --accent: #2457a6;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.6rem; }
h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.muted { color: var(--muted); }
.mono, pre, code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.85rem; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--bg); padding: 0.6rem; border-radius: 6px; }
.big { font-size: 1.25rem; font-weight: 600; }

/* frame */
.top { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between;
       padding: 0.6rem 1rem; background: var(--ink); color: #fff; }
.top a { color: #cfe0ff; }
.brand { font-weight: 700; }
.brand .muted { color: #aab4c4; font-weight: 400; margin-left: 0.3rem; }
.logout button { background: transparent; color: #fff; border: 1px solid #5b6577; border-radius: 6px; padding: 0.2rem 0.6rem; }
.nav { display: flex; gap: 0.25rem; overflow-x: auto; padding: 0.4rem 0.6rem; background: #fff; border-bottom: 1px solid var(--line); }
.nav a, .nav span { white-space: nowrap; padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.nav a { color: var(--ink); }
.nav a.on { background: var(--ink); color: #fff; }
.nav .soon { color: #b3bac6; }
main { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.foot { max-width: 1200px; margin: 0 auto; padding: 1rem; font-size: 0.85rem; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
.card.tone-red { border-color: var(--red); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1rem; }
.grid > * { min-width: 0; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid.seats { grid-template-columns: repeat(3, 1fr); } }
details.other { margin-top: 0.8rem; border-top: 1px dashed var(--line); padding-top: 0.5rem; }
details.other summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
details.other[open] summary { margin-bottom: 0.5rem; }

/* the lights: large, one per row on a phone */
.lights { display: grid; grid-template-columns: 1fr; gap: 0.6rem; }
@media (min-width: 760px) { .lights { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); } }
.light { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.7rem; border-radius: 8px; background: var(--bg); }
.light .dot { flex: 0 0 1.6rem; height: 1.6rem; border-radius: 50%; margin-top: 0.2rem; }
.light.green .dot { background: var(--green); } .light.yellow .dot { background: var(--yellow); } .light.red .dot { background: var(--red); }
.light .lname { font-size: 1.1rem; font-weight: 700; }
.light .lword { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; }
.light.green .lword { color: var(--green); } .light.yellow .lword { color: var(--yellow); } .light.red .lword { color: var(--red); }
.light p { margin: 0.2rem 0 0; }

.badge { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; color: #fff; background: var(--muted); }
.badge.green { background: var(--green); } .badge.yellow { background: var(--yellow); } .badge.red { background: var(--red); }
.tag { font-size: 0.7rem; font-weight: 700; color: var(--yellow); border: 1px solid var(--yellow); border-radius: 4px; padding: 0 0.3rem; }
.status { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--bg); }
.s-active { color: var(--green); } .s-no_opinion, .s-reviewing, .s-last_view { color: var(--yellow); }
.s-waiting, .s-joins_phase_1_later, .s-joins_phase_2, .s-joins_phase_3 { color: var(--muted); }
.badge.muted { background: var(--muted); }
.view { font-size: 1.1rem; }
.strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.strip li { background: var(--bg); border-radius: 6px; padding: 0.3rem 0.6rem; }
.strip .seat { color: var(--muted); font-size: 0.85rem; }
.notice { background: #eef3fb; border-left: 4px solid var(--accent); padding: 0.5rem 0.7rem; border-radius: 4px; }
.flash { background: #e8f5ee; border-left: 4px solid var(--green); padding: 0.6rem 0.8rem; border-radius: 4px; }
.error { background: #fbeaea; border-left: 4px solid var(--red); padding: 0.6rem 0.8rem; border-radius: 4px; }
.items { list-style: none; padding: 0; margin: 0; }
.items li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.when { color: var(--muted); font-size: 0.85rem; margin-right: 0.4rem; }
/* Task 18b fix round 1 (R4): a long label wraps instead of pushing the page past a 360 px phone */
dl.kv { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 0.3rem 1rem; margin: 0.5rem 0; }
dl.kv dt { color: var(--muted); overflow-wrap: anywhere; } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
/* Round 2 (I1): on a phone the label and its value stack, so a long label can never squeeze the value column to nothing */
@media (max-width: 480px) { dl.kv { grid-template-columns: minmax(0, 1fr); gap: 0 1rem; } dl.kv dd { margin-bottom: 0.5rem; } }

/* Task 18b: staff, shadow, review, trades, performance, risk */
.phase { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.05rem 0.45rem; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.role { color: var(--muted); font-style: italic; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; align-items: center; margin: 0 0 1rem; }
.tabs strong { background: var(--ink); color: #fff; border-radius: 6px; padding: 0.15rem 0.6rem; }
.nominal { font-size: 0.85rem; font-weight: 600; color: var(--yellow); }
.ideas li { overflow-wrap: anywhere; }
h4 { font-size: 0.9rem; margin: 0.8rem 0 0.3rem; }
h4.mono { overflow-wrap: anywhere; }      /* a long metric name (REVIEW's measurement tables, Task 21) wraps on a phone */

/* tables scroll sideways on a phone instead of breaking the page */
table.data { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: 0.9rem; }
table.data th, table.data td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; }

/* forms: a card's controls sit on the card itself, above its bodies, in both views */
.card .controls { border: 1px solid var(--line); border-radius: 8px; padding: 0.2rem 0.7rem; margin: 0 0 0.8rem; background: #fbfcfd; }
.top .switch { display: flex; gap: 0.4rem; align-items: center; margin: 0; }
button.link { background: transparent; color: #cfe0ff; padding: 0; text-decoration: underline; font-weight: 400; }
form.control { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; margin: 0.7rem 0; }
form.inline { display: flex; gap: 0.4rem; align-items: center; margin: 0; }
label { display: inline-flex; gap: 0.3rem; align-items: center; }
input, select, button { font: inherit; }
/* Task 18b round 3: a form field never runs past a phone's width (SETTINGS: the feed list, the FLATTEN phrase) */
input, select, button, textarea { max-width: 100%; }
@media (max-width: 480px) {
  form.control label { display: flex; flex-wrap: wrap; width: 100%; }
  form.control label > select, form.control label > input:not([type="checkbox"]) { flex: 1 1 10rem; min-width: 0; max-width: 100%; }
}
input, select { padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 6px; }
button { padding: 0.45rem 0.9rem; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
button.danger { background: var(--red); }
button:disabled { background: #c4cad4; cursor: not-allowed; }
.confirm { font-size: 0.9rem; color: var(--muted); }

.login { max-width: 360px; margin: 3rem auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.login form { display: grid; gap: 0.8rem; }
.login label { display: grid; gap: 0.3rem; }
