/* Couvert — the caterer console.
   The cold steel comes from the equipment: stainless, hotel pans, walk-in cooler.
   The accent colours do not decorate, they encode the day of service — it is the
   day-dot system of professional kitchens, one day one colour. Red is reserved for
   allergens and appears nowhere else. */
:root {
  --steel: #e4e8e9;
  --white: #ffffff;
  --ink: #132022;
  --soft: #66757a;
  --rule: #c8cfd0;
  --rule-strong: #9daaad;
  --alert: #e02b27;
  --ok: #0d7a4a;

  --mon: #00a04a;
  --tue: #c9a21a;
  --wed: #d12b26;
  --thu: #7b4a2d;
  --fri: #2f6fdb;
  --sat: #ef7c11;
  --sun: #2a2f33;

  --gutter: clamp(16px, 3vw, 40px);
  --dot: currentColor;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--steel);
  color: var(--ink);
  font-family: Archivo, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, p, figure { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
a { color: inherit; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* --- Application chrome --- */
.top {
  display: flex; align-items: baseline; gap: 20px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--rule-strong);
  background: var(--white);
  position: sticky; top: 0; z-index: 5;
}
.wordmark { font-weight: 700; letter-spacing: -.02em; font-size: 19px; }
.wordmark span { font-weight: 400; color: var(--soft); }
.top nav { display: flex; gap: 18px; margin-left: auto; font-size: 15px; }
.top nav button {
  border: 0; background: none; padding: 4px 0; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.top nav button[aria-current='page'] { border-bottom-color: var(--ink); font-weight: 600; }

.shell {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  gap: 0; align-items: start;
  max-width: 1500px; margin: 0 auto;
}
.work { padding: var(--gutter); min-width: 0; }
.loading { color: var(--soft); padding: 40px 0; }

/* --- The service board: one row per event, in order of time --- */
.board-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.board-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.board-head p { color: var(--soft); font-size: 15px; }

.rows { border-top: 1px solid var(--rule-strong); }
.row {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr) 82px 92px minmax(0, 250px);
  gap: 16px; align-items: center;
  width: 100%; text-align: left;
  padding: 13px 4px; border: 0; border-bottom: 1px solid var(--rule);
  background: none; cursor: pointer;
}
.row:hover, .row:focus-visible { background: var(--white); }
.row .when { display: flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.row .when em { font-style: normal; color: var(--soft); font-weight: 400; }
.day-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--dot); flex: 0 0 auto;
}
.row .what { min-width: 0; }
.row .what b { font-weight: 600; letter-spacing: -.01em; }
.row .what i { display: block; font-style: normal; color: var(--soft); font-size: 14px; }
.row .count { text-align: right; font-weight: 500; }
.row .count s { text-decoration: none; color: var(--soft); font-weight: 400; font-size: 13px; display: block; }
.row .flag { font-size: 14px; color: var(--soft); }
.row .flag.hot { color: var(--alert); font-weight: 600; }
.row .todo { font-size: 14px; }
.row .todo.mine { font-weight: 500; }
.row .todo.theirs { color: var(--soft); }

/* --- Event page --- */
.event-head { border-bottom: 1px solid var(--rule-strong); padding-bottom: 16px; margin-bottom: 4px; }
.event-head .back {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--soft); font-size: 14px; margin-bottom: 10px;
}
.event-head h1 { font-size: clamp(24px, 3vw, 34px); font-weight: 700; letter-spacing: -.03em; }
.event-head .facts { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 8px; color: var(--soft); font-size: 15px; }
.event-head .facts b { color: var(--ink); font-weight: 500; }

.tabs { display: flex; gap: 2px; flex-wrap: wrap; margin: 18px 0 22px; }
.tabs button {
  border: 1px solid var(--rule); border-bottom-width: 1px; background: none;
  padding: 8px 15px; cursor: pointer; border-radius: 2px;
}
.tabs button[aria-selected='true'] { background: var(--ink); color: var(--white); border-color: var(--ink); font-weight: 500; }
.tabs button .badge { color: var(--alert); font-weight: 700; }
.tabs button[aria-selected='true'] .badge { color: #ff9e9c; }

/* --- Work blocks: white surfaces on a steel background, no shadow and no rounding --- */
.panel { background: var(--white); border: 1px solid var(--rule); padding: 20px; margin-bottom: 18px; }
.panel > h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.panel > h2 .side { float: right; color: var(--soft); font-weight: 400; }
.panel p.hint { color: var(--soft); font-size: 14px; }

.act {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border: 1px solid var(--ink); background: var(--ink); color: var(--white);
  border-radius: 2px; cursor: pointer; font-weight: 500;
}
.act:hover { background: #000; }
.act[disabled] { opacity: .4; cursor: wait; }
.act.ghost { background: none; color: var(--ink); }
.act.ghost:hover { background: var(--steel); }
.act.small { padding: 5px 11px; font-size: 14px; font-weight: 400; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 400; color: var(--soft); font-size: 13px; padding: 0 8px 8px 0; }
td { padding: 9px 8px 9px 0; border-top: 1px solid var(--rule); vertical-align: baseline; }
th:last-child, td:last-child { text-align: right; padding-right: 0; }
tfoot td { border-top: 1px solid var(--rule); color: var(--soft); }
tfoot tr:last-child td { border-top: 2px solid var(--ink); color: var(--ink); font-weight: 600; }

.chip {
  display: inline-block; padding: 1px 8px; margin: 1px 3px 1px 0;
  border: 1px solid var(--rule-strong); border-radius: 2px; font-size: 13px;
}
.chip.risk { border-color: var(--alert); color: var(--alert); }
.state-dot { color: var(--soft); font-size: 14px; }
.state-dot.paid { color: var(--ok); }
.state-dot.open { color: var(--ink); }

/* --- Allergens: the only red place in the application --- */
.conflict { border-left: 3px solid var(--alert); padding: 12px 0 12px 14px; border-top: 1px solid var(--rule); }
.conflict:first-of-type { border-top: 0; }
.conflict b { font-weight: 600; }
.conflict .why { color: var(--alert); }
.conflict .fix { color: var(--soft); font-size: 14px; margin-top: 3px; }
.clear { color: var(--ok); }

/* --- Count: three numbers, and the gap they produce --- */
.counts { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-end; }
.counts div { min-width: 92px; }
.counts .n { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.counts .n.unset { color: var(--rule-strong); }
.counts label { display: block; color: var(--soft); font-size: 13px; margin-top: 4px; }

form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
input[type='text'], input[type='number'], select, textarea {
  border: 1px solid var(--rule-strong); border-radius: 2px; padding: 8px 10px; background: var(--white);
}
input[type='number'] { width: 9ch; }
textarea { width: 100%; min-height: 86px; resize: vertical; }
.field-note { color: var(--soft); font-size: 13px; }

/* --- The day of: the only place where the line is drawn heavier --- */
.rail { position: relative; padding-left: 116px; }
.rail::before {
  content: ''; position: absolute; left: 88px; top: 12px; bottom: 12px;
  width: 1px; background: var(--rule-strong);
}
.step { position: relative; padding: 11px 0; border-top: 1px solid var(--rule); }
.step:first-child { border-top: 0; }
.step .at {
  position: absolute; left: -116px; width: 72px; text-align: right;
  font-size: 19px; font-weight: 600; letter-spacing: -.02em;
}
.step::before {
  content: ''; position: absolute; left: -32px; top: 19px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--rule-strong);
}
.step .label { font-weight: 500; }
.step .crew { color: var(--soft); font-size: 14px; }
.step .tick {
  position: absolute; right: 0; top: 10px;
  border: 1px solid var(--rule-strong); background: var(--white);
  padding: 4px 11px; font-size: 14px; border-radius: 2px; cursor: pointer;
}
.step.done { color: var(--soft); }
.step.done .at { color: var(--soft); font-weight: 400; }
.step.done::before { background: var(--ink); border-color: var(--ink); }
.step.done .label { font-weight: 400; }

/* The "now" marker carries the colour of the day of service. */
.now {
  position: relative; height: 0; border-top: 2px solid var(--dot);
  margin: 14px 0 14px -32px;
}
.now span {
  position: absolute; left: -116px; top: -11px; width: 72px; text-align: right;
  font-size: 13px; font-weight: 600; color: var(--dot);
}

/* --- Assistant: a column of text, not a chat window --- */
.aside {
  position: sticky; top: 51px;
  height: calc(100vh - 51px);
  display: flex; flex-direction: column;
  background: var(--white); border-left: 1px solid var(--rule-strong);
}
.aside h2 { font-size: 14px; font-weight: 600; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.aside h2 em { font-style: normal; color: var(--soft); font-weight: 400; }
.log { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px; }
.turn { margin-bottom: 18px; }
.turn.me { color: var(--soft); }
.turn.me p::before { content: '— '; }
.turn ul { margin: 8px 0 0; padding-left: 18px; }
.turn li { font-size: 14.5px; margin-bottom: 3px; }
.turn .proposals { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 12px; }
.ask { border-top: 1px solid var(--rule); padding: 12px 18px 16px; }
.ask form { display: flex; gap: 8px; }
.ask input { flex: 1 1 auto; min-width: 0; }
.ask .examples { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.ask .examples button {
  border: 1px solid var(--rule); background: none; border-radius: 2px;
  padding: 3px 9px; font-size: 13px; cursor: pointer; color: var(--soft);
}

/* --- Action announcement --- */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 12px);
  background: var(--ink); color: var(--white); padding: 11px 20px; border-radius: 2px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 32px); z-index: 20;
}
.toast.up { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--alert); }

/* --- Dish catalogue, while building a menu --- */
.picker { display: grid; gap: 14px; }
.course-group > h3 { font-size: 13px; color: var(--soft); font-weight: 400; margin: 0 0 6px; }
.course-group label {
  display: flex; gap: 10px; align-items: baseline;
  padding: 6px 0; border-top: 1px solid var(--rule);
}
.course-group label span { flex: 1 1 auto; }
.course-group .price { color: var(--soft); font-size: 14px; }
.picker-total {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 2px solid var(--ink); padding-top: 10px; font-weight: 600;
}

@media (max-width: 1080px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; height: auto; border-left: 0; border-top: 1px solid var(--rule-strong); }
  .log { max-height: 46vh; }
  .row { grid-template-columns: 130px minmax(0, 1fr) 72px; row-gap: 6px; }
  .row .flag, .row .todo { grid-column: 2 / -1; }
}

@media (max-width: 620px) {
  .wordmark span { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) 70px; }
  .row .when { grid-column: 1 / -1; }
  .rail { padding-left: 86px; }
  .rail::before { left: 62px; }
  .step::before { left: -28px; }
  .step .at { left: -86px; width: 54px; font-size: 17px; }
  .now span { left: -86px; width: 54px; }
  .step .tick { position: static; margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0s !important; }
}

/* --- 2025 shell: stable navigation, calm workspace, assistant on demand --- */
:root {
  --canvas: #f5f6f2;
  --nav: #173f36;
  --nav-soft: #dce9e2;
  --accent: #e96b3c;
  --accent-soft: #fff0e9;
  --ink: #172420;
  --soft: #66736e;
  --rule: #dfe4df;
  --rule-strong: #cbd3cd;
  --steel: var(--canvas);
}

body { background: var(--canvas); }
.login-screen { display: none; min-height: 100vh; grid-template-columns: 1.05fr .95fr; background: #fff; }
.auth-required .login-screen { display: grid; }
.auth-required .app-shell { display: none; }
.login-brand { position: relative; display: grid; place-items: center; overflow: hidden; padding: 64px; color: #fff; background: var(--nav); }
.login-brand::after { content: ''; position: absolute; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; transform: translate(38%, 42%); }
.login-brand-inner { position: relative; z-index: 1; max-width: 500px; }
.login-logo { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 32px; border-radius: 14px; background: var(--accent); }
.login-logo svg { width: 56px; height: 56px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.login-brand p { font-family: Georgia, serif; font-size: 24px; font-weight: 700; }
.login-brand h1 { max-width: 440px; margin: 48px 0 18px; font-family: Georgia, serif; font-size: clamp(42px, 5vw, 66px); line-height: 1.02; }
.login-brand-inner > span:last-child { display: block; max-width: 430px; color: var(--nav-soft); font-size: 17px; }
.login-panel { display: grid; place-items: center; padding: 48px; }
.login-form { width: min(100%, 410px); }
.login-form h2 { margin: 5px 0 8px; font-family: Georgia, serif; font-size: 38px; }
.login-form > p:not(.login-error) { margin-bottom: 32px; color: var(--soft); }
.login-form label, .create-user label { display: grid; gap: 7px; margin: 16px 0; font-size: 13px; font-weight: 600; }
.login-form input, .create-user input, .create-user select { width: 100%; min-height: 44px; }
.login-form .act { width: 100%; justify-content: center; margin-top: 8px; min-height: 46px; border-color: var(--accent); background: var(--accent); }
.login-error { min-height: 22px; margin: 4px 0; color: var(--alert); font-size: 13px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px 16px;
  display: flex; flex-direction: column; color: #fff; background: var(--nav);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 28px; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 9px; background: var(--accent); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.brand-mark svg { width: 36px; height: 36px; overflow: visible; }
.logo-plate, .logo-rim, .logo-fork { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; }
.logo-plate { stroke-width: 3; }
.logo-rim { stroke-width: 2; opacity: .9; }
.logo-fork { stroke-width: 2.7; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 21px; }
.brand small { margin-top: 1px; color: var(--nav-soft); font-size: 11px; text-transform: uppercase; }
.main-nav { display: grid; gap: 6px; }
.main-nav button {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px;
  border: 0; border-radius: 7px; color: var(--nav-soft); background: transparent;
  text-align: left; cursor: pointer;
}
.main-nav button span { width: 20px; font-size: 20px; text-align: center; }
.main-nav button:hover { color: #fff; background: rgba(255,255,255,.08); }
.main-nav button[aria-current='page'] { color: var(--nav); background: #fff; font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 16px 12px 2px; border-top: 1px solid rgba(255,255,255,.15); }
.sidebar-foot p { color: var(--nav-soft); font-size: 12px; }
.sidebar-foot strong { display: block; margin-top: 3px; font-size: 14px; }
.account { display: grid; grid-template-columns: 34px minmax(0, 1fr) 28px; align-items: center; gap: 9px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); }
.account-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--nav); background: #fff; font-weight: 700; }
.account strong, .account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account strong { margin: 0; font-size: 12px; }
.account small { color: var(--nav-soft); font-size: 10px; }
.account button { border: 0; color: var(--nav-soft); background: none; cursor: pointer; font-size: 19px; }
.workspace { min-width: 0; }
.top {
  min-height: 72px; padding: 13px clamp(20px, 3vw, 44px); align-items: center;
  border-bottom: 1px solid var(--rule); background: rgba(255,255,255,.9); backdrop-filter: blur(12px);
}
.top > div { display: grid; }
.top strong { font-family: Georgia, serif; font-size: 20px; }
.eyebrow { color: var(--soft); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.assistant-toggle {
  margin-left: auto; padding: 9px 13px; border: 1px solid var(--rule-strong); border-radius: 7px;
  background: #fff; cursor: pointer; font-weight: 600;
}
.assistant-toggle span { color: var(--accent); margin-right: 5px; }
.shell { display: contents; }
.work { max-width: 1280px; width: 100%; margin: 0 auto; padding: clamp(24px, 4vw, 48px); }
.aside {
  position: fixed; z-index: 30; top: 0; right: 0; width: min(420px, 92vw); height: 100vh;
  border-left: 1px solid var(--rule); box-shadow: -20px 0 60px rgba(19,32,34,.16);
  transform: translateX(105%); transition: transform .24s ease;
}
.assistant-open .aside { transform: translateX(0); }
.aside-head { display: flex; align-items: center; justify-content: space-between; padding: 18px; border-bottom: 1px solid var(--rule); }
.aside-head h2 { padding: 0; border: 0; font-family: Georgia, serif; font-size: 19px; }
.assistant-close { width: 36px; height: 36px; border: 0; background: none; font-size: 26px; cursor: pointer; }
.scrim { display: none; position: fixed; z-index: 29; inset: 0; border: 0; background: rgba(17,31,27,.28); }
.assistant-open .scrim { display: block; }

/* --- Action-oriented overview --- */
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-intro h1 { margin-top: 4px; font-family: Georgia, serif; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; }
.page-intro p { margin-top: 8px; color: var(--soft); }
.create-event { position: relative; }
.create-event > summary { list-style: none; white-space: nowrap; }
.create-event > summary::-webkit-details-marker { display: none; }
.create-popover {
  position: absolute; z-index: 8; top: calc(100% + 10px); right: 0; width: min(680px, calc(100vw - 40px));
  padding: 18px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; box-shadow: 0 18px 50px rgba(23,36,32,.15);
}
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 36px; }
.metric { padding: 18px 20px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; }
.metric > span { color: var(--soft); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.metric strong { display: block; margin: 4px 0 2px; font-family: Georgia, serif; font-size: 32px; line-height: 1; }
.metric small { color: var(--soft); }
.metric-action { border-left: 4px solid var(--accent); }
.metric-alert { border-left: 4px solid var(--alert); background: #fffafa; }
.event-section { margin-top: 34px; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 11px; }
.section-head h2 { margin-top: 2px; font-family: Georgia, serif; font-size: 23px; }
.section-head > span { color: var(--soft); font-size: 13px; }
.event-list { display: grid; gap: 10px; }
.row {
  position: relative; grid-template-columns: 164px minmax(190px, 1fr) 84px 120px minmax(210px, 1fr);
  gap: 18px; min-height: 100px; padding: 17px 20px; overflow: hidden;
  border: 1px solid var(--rule); border-radius: 8px; background: #fff;
}
.row::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--dot); }
.row:hover, .row:focus-visible { border-color: var(--rule-strong); background: #fff; box-shadow: 0 10px 28px rgba(23,36,32,.08); transform: translateY(-1px); }
.row small { display: block; margin-bottom: 5px; color: var(--soft); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.date-block { display: flex; align-items: center; gap: 10px; }
.date-block b, .date-block em { display: block; font-style: normal; }
.date-block em { margin-top: 2px; color: var(--soft); font-size: 13px; }
.row .what b { display: block; font-size: 16px; }
.row .what i { margin-top: 3px; }
.row .count { text-align: left; }
.row .count .num { font-size: 20px; font-weight: 700; }
.row .status-block .flag { display: inline-block; padding: 4px 7px; border-radius: 4px; background: #edf3ef; }
.row .status-block .flag.hot { background: #fff0ef; }
.row .todo { position: relative; padding-right: 24px; }
.row .todo b { font-size: 13px; line-height: 1.35; }
.row .todo > span { position: absolute; right: 0; top: 22px; color: var(--accent); font-size: 20px; }
.event-list.waiting .row { opacity: .84; }

/* --- Job: progress visible before the tools --- */
.event-head { padding-bottom: 20px; }
.event-head .back::before { content: '← '; }
.workflow { display: grid; grid-template-columns: repeat(7, 1fr); margin: 22px 0 8px; }
.workflow-step { position: relative; display: grid; justify-items: center; gap: 6px; color: var(--rule-strong); text-align: center; }
.workflow-step::before { content: ''; position: absolute; z-index: 0; top: 14px; right: 50%; width: 100%; height: 2px; background: var(--rule); }
.workflow-step:first-child::before { display: none; }
.workflow-step span { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--rule); border-radius: 50%; background: var(--canvas); font-size: 11px; font-weight: 700; }
.workflow-step.done, .workflow-step.current { color: var(--nav); }
.workflow-step.done::before, .workflow-step.current::before { background: var(--nav); }
.workflow-step.done span { border-color: var(--nav); color: #fff; background: var(--nav); }
.workflow-step.current span { border-color: var(--accent); color: #fff; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.workflow-step small { font-size: 11px; }
.tabs { gap: 8px; padding: 9px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; }
.tabs button { flex: 1 1 auto; border: 0; border-radius: 6px; color: var(--soft); }
.tabs button[aria-selected='true'] { color: var(--nav); background: #e9f0ec; }
.panel { border-radius: 8px; }
.panel > h2 { font-size: 16px; }
.next-action { border-left: 4px solid var(--accent); background: #fffaf7; }
.next-action.theirs { border-left-color: var(--rule-strong); background: #fff; }
.team-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 18px; align-items: start; }
.team-intro { margin-bottom: 18px; }
.member { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--rule); }
.member:first-of-type { border-top: 0; }
.member.inactive { opacity: .5; }
.member-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--nav); background: #e7f0eb; font-weight: 700; }
.member-info b, .member-info small { display: block; }
.member-info small { margin-top: 2px; color: var(--soft); font-size: 12px; }
.role-badge, .you { padding: 4px 8px; border-radius: 4px; color: var(--soft); background: #eef1ef; font-size: 11px; font-weight: 600; }
.role-badge.admin { color: #8a3d20; background: var(--accent-soft); }
.you { color: var(--nav); background: #e7f0eb; }
.create-user > h2 { margin: 4px 0; font-family: Georgia, serif; font-size: 25px; }
.create-user form { margin-top: 20px; }
.create-user .act { width: 100%; justify-content: center; margin-top: 8px; }

@media (max-width: 760px) {
  body { font-size: 14px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { min-height: 250px; padding: 32px 24px; place-items: start; }
  .login-logo { width: 52px; height: 52px; margin-bottom: 16px; }
  .login-logo svg { width: 42px; height: 42px; }
  .login-brand p { font-size: 20px; }
  .login-brand h1 { margin: 18px 0 8px; font-size: 36px; }
  .login-brand-inner > span:last-child { font-size: 14px; }
  .login-panel { padding: 32px 24px; place-items: start center; }
  .app-shell { grid-template-columns: 1fr; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .sidebar {
    position: fixed; z-index: 20; top: auto; bottom: 0; width: 100%; height: calc(76px + env(safe-area-inset-bottom));
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); flex-direction: row; align-items: center;
  }
  .brand, .sidebar-foot { display: none; }
  .main-nav { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .main-nav button { min-width: 0; flex-direction: column; justify-content: center; gap: 2px; padding: 5px 2px; font-size: 10px; line-height: 1.15; white-space: nowrap; }
  .main-nav button span { width: auto; height: 16px; font-size: 14px; line-height: 16px; }
  .top { min-height: 64px; padding: 10px 18px; }
  .top strong { font-size: 18px; }
  .workspace, .work, .panel { min-width: 0; max-width: 100%; }
  .work { padding: 24px 18px; overflow-x: hidden; }
  .page-intro { align-items: flex-start; }
  .page-intro h1, .event-head h1 { font-size: 25px; line-height: 1.08; }
  .event-head .back, .event-head .facts { font-size: 12px; }
  .event-head .facts { align-items: center; gap: 6px 14px; }
  .event-head .fact-venue, .event-head .fact-client { display: none; }
  .section-head h2 { font-size: 19px; }
  .metrics { grid-template-columns: 1fr; gap: 8px; }
  .metric { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 14px 16px; }
  .metric strong { grid-row: 1 / 3; grid-column: 2; }
  .row { grid-template-columns: 1fr 76px; gap: 14px; }
  .date-block { grid-column: 1; }
  .row .count { grid-column: 2; grid-row: 1; }
  .row .what, .row .status-block, .row .todo { grid-column: 1 / -1; }
  .workflow { overflow-x: auto; grid-template-columns: repeat(7, 82px); padding: 4px; }
  .workflow-step small { font-size: 9px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .tabs button { flex: 0 0 auto; padding: 7px 11px; font-size: 12px; }
  .panel { padding: 16px; }
  .panel > h2 { font-size: 14px; margin-bottom: 11px; }
  .panel p.hint, .conflict .fix { font-size: 12px; }
  .act, .act.small { padding: 7px 12px; font-size: 13px; }
  .conflict { padding: 10px 0 10px 11px; overflow-wrap: anywhere; font-size: 13px; line-height: 1.4; }
  .counts .n { font-size: 28px; }
  .counts label, th, .chip, .state-dot { font-size: 11px; }
  td { font-size: 13px; }
  .team-layout { grid-template-columns: 1fr; }
  .member { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .member .act, .member .you { grid-column: 2 / -1; justify-self: start; }
}
