/* T1 CRM — the centre's side of DANK, in the look of dank-visitor (web/src/styles.css):
   navy evening sky over Ülemiste, the warm light of the Skywheel, photo cards with a yellow mark on the edge. */

:root {
  /* dank-visitor tokens */
  --ink: #14213d;
  --ink-soft: #2a3a63;
  --paper: #eef1f6;
  --surface: #ffffff;
  --lamp: #ffc933;
  --lamp-strong: #f5b700;
  --lamp-tint: #fff3cc;
  --teal: #0b6f6d;
  --teal-tint: #e3f1f0;
  --text: #14213d;
  --muted: #56607a;
  --line: #d5dbe7;
  --danger: #a3261b;
  --danger-tint: #fdecea;
  --ok: #0f7b4b;
  --ok-tint: #e2f4ea;
  --warn: #8a4b00;
  --warn-tint: #fff1dc;

  --display: 'Bricolage Grotesque Variable', 'Avenir Next', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible Next', 'Segoe UI', system-ui, sans-serif;
  --radius-card: 18px;
  --radius-field: 24px;
  color-scheme: light;

  /* Data colors: validated categorical palette, one slot per profile type (dataviz check) */
  --series-1: #257de0;
  --series-2: #f47230;
  --series-3: #00b894;
  --series-4: #f2a600;
  --series-5: #ee7fac;
  --seq: var(--teal);
  --neutral-mark: #9aa3ad;
  --grid: #e3e7ee;
  --axis: #c2c8d3;
  --rail: #e6eaf1;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -0.01em; }
h1 { font: 700 clamp(1.7rem, 4vw, 2.3rem) / 1.08 var(--display); letter-spacing: -0.02em; margin-bottom: 0.6rem; }
h2 { font: 650 22px/1.2 var(--display); margin-bottom: 0.5rem; }
h3 { font: 650 17px/1.25 var(--display); margin: 1.2rem 0 0.5rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--teal); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
code { font-size: 0.88em; }
/* long names (AI models) break on a phone instead of pushing the table out */
td code { overflow-wrap: anywhere; }
/* names of settings (CRM_AI_DAILY_MEDIA_SUGGEST_LIMIT) break on a phone instead of widening the page */
.break { overflow-wrap: anywhere; }
button { font: inherit; color: inherit; cursor: pointer; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.hint { color: var(--muted); font-size: 0.86rem; margin: 0.3rem 0 0; }

main { max-width: 1180px; margin: 0 auto; padding: 26px 16px 48px; }

/* ------------------------------------------------------------ top bar (as visitor's hero bar) */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px max(16px, calc((100vw - 1180px) / 2 + 16px));
  background: var(--ink); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-width: 0; }
.brand__mark { color: var(--lamp); flex: none; display: grid; }
.brand__text { display: grid; line-height: 1.15; }
.brand__name { font: 650 17px/1.15 var(--display); }
.brand__mall { font-size: 13px; color: rgb(255 255 255 / 0.72); }
.topbar .menu {
  display: flex; gap: 2px; padding: 3px; margin-left: 8px;
  border: 1px solid rgb(255 255 255 / 0.3); border-radius: 999px; flex-wrap: wrap;
}
.topbar .menu a {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 999px; color: #fff; font-weight: 700; font-size: 14px; text-decoration: none;
}
.topbar .menu a:hover { background: rgb(255 255 255 / 0.1); }
.topbar .menu a.active { background: #fff; color: var(--ink); }
.topbar .menu .count {
  min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--lamp); color: var(--ink); font-size: 12px; font-weight: 700;
}
.topbar :focus-visible { outline-color: var(--lamp); }
.logout { display: flex; gap: 12px; align-items: center; }
.logout .muted { color: rgb(255 255 255 / 0.72); font-size: 14px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar button.link { color: var(--lamp); font-weight: 700; }

/* ------------------------------------------------------------ hero (overview, tenant card, login) */

.hero {
  position: relative; overflow: hidden; overflow: clip;
  background: var(--ink); color: #fff;
}
.hero__media { position: absolute; inset: 0; }
.hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Pages before sign-in belong to no centre: the platform's own colours, no centre's photo */
.hero__media--plain {
  background:
    radial-gradient(60% 50% at 82% 18%, rgb(11 111 109 / 0.55) 0%, rgb(11 111 109 / 0) 70%),
    radial-gradient(45% 40% at 12% 30%, rgb(255 201 51 / 0.16) 0%, rgb(255 201 51 / 0) 70%),
    linear-gradient(160deg, var(--ink-soft) 0%, var(--ink) 60%);
}
.hero__media--plain .hero__shade { background: linear-gradient(180deg, rgb(20 33 61 / 0) 55%, var(--ink) 100%); }
.hero__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgb(20 33 61 / 0.66) 0%, rgb(20 33 61 / 0.22) 26%, rgb(20 33 61 / 0.5) 50%, rgb(20 33 61 / 0.9) 72%, var(--ink) 100%);
}
.hero__content { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 56px 16px 30px; }
.headline {
  max-width: 16ch; margin: 0 0 18px;
  text-shadow: 0 2px 28px rgb(10 16 32 / 0.45);
  font: 700 clamp(2.1rem, 6vw, 3.4rem) / 1.02 var(--display); letter-spacing: -0.025em; text-wrap: balance;
}
.hero__sub { color: rgb(255 255 255 / 0.82); max-width: 60ch; margin: -6px 0 18px; }
.hero--compact .hero__content { padding: 40px 16px 24px; }
.hero--compact .headline { font-size: clamp(1.9rem, 5vw, 2.8rem); max-width: none; }
.hero .breadcrumbs a { color: rgb(255 255 255 / 0.85); }
.hero .breadcrumbs { color: rgb(255 255 255 / 0.6); margin-bottom: 10px; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* composer: visitor's input pill + round buttons, here a tenant search */
.composer { max-width: 760px; }
.composer__row { display: flex; align-items: center; gap: 12px; }
.composer__field {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 18px; background: var(--surface); border-radius: var(--radius-field); color: var(--ink);
}
.composer__field:focus-within { outline: 3px solid var(--lamp); outline-offset: 2px; }
.composer__field input {
  flex: 1; min-width: 0; height: 48px; border: 0; outline: none; background: transparent;
  color: var(--ink); font: 400 18px/1.4 var(--body); padding: 0;
}
.composer__field input::placeholder { color: #7a8399; }
.composer__send {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; min-height: 0; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: var(--ink); color: #fff;
}
.composer__send:hover { background: var(--ink-soft); }
.lamp-button {
  flex: none; display: grid; place-items: center; width: 64px; height: 64px;
  border-radius: 50%; background: var(--lamp); color: var(--ink); text-decoration: none;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.28);
}
.lamp-button:hover { background: var(--lamp-strong); }
.lamp-button:focus-visible { outline-color: #fff; }
.composer__status { margin: 12px 4px 0; font-size: 15px; color: rgb(255 255 255 / 0.78); }

/* ------------------------------------------------------------ section titles, cards, notices */

.section-title { font: 650 22px/1.2 var(--display); letter-spacing: -0.01em; margin: 0 0 4px; }
.section-hint { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.title-row h1, .title-row h2 { margin-bottom: 0; }
.breadcrumbs { margin: 0 0 4px; color: var(--muted); font-size: 15px; }
.subtitle { margin: -4px 0 14px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 18px 20px; margin-bottom: 16px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.grid.charts { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; }
.row.three { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }

.notice, .error, .invite-link {
  margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; font-size: 16px;
}
.notice { background: var(--teal-tint); border-left: 4px solid var(--teal); }
.error { background: var(--danger-tint); color: var(--danger); border-left: 4px solid var(--danger); }
.error p { margin: 0; }
.invite-link { background: var(--lamp-tint); border-left: 4px solid var(--lamp-strong); }
.invite-link p { margin: 0 0 8px; }
.invite-link input { width: 100%; font: 14px/1.4 ui-monospace, Consolas, monospace; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.field-error { color: var(--danger); font-size: 0.9rem; margin: 0.3rem 0 0; }

/* ------------------------------------------------------------ buttons & forms */

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; margin-top: 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { border-color: var(--ink); }
.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.primary:hover { background: var(--ink-soft); }
.button.lamp, button.lamp { background: var(--lamp); border-color: var(--lamp); color: var(--ink); }
.button.lamp:hover, button.lamp:hover { background: var(--lamp-strong); }
button.link { min-height: 0; margin: 0; padding: 0; border: 0; background: none; color: var(--teal); text-decoration: underline; font-weight: 700; }
.approve { background: var(--ok-tint); border-color: var(--ok); color: var(--ok); }
.approve:hover { background: var(--ok); color: #fff; }
.button.danger { color: var(--danger); border-color: var(--danger); }
.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
button.link.danger { color: var(--danger); }

label { display: block; font-weight: 700; margin: 14px 0 6px; font-size: 15px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--lamp); outline-offset: 1px; border-color: var(--ink); }
input[readonly] { background: var(--paper); color: var(--muted); }
[aria-invalid=true] { border-color: var(--danger); }
textarea { resize: vertical; }
.form-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 8px 0 32px; }
.form-actions button { margin-top: 0; }
.form-actions .push { margin-left: auto; }
.inline-form .inline { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form .inline input { flex: 1 1 220px; width: auto; }
.inline-form .inline button { margin-top: 0; }

.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filters > div { flex: 1 1 170px; }
.filters label { margin-top: 0; }
.filters button { margin-top: 0; }

/* ------------------------------------------------------------ chips & pills */

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chips a {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none;
}
.chips a span { color: var(--muted); font-weight: 400; }
.chips a.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips a.active span { color: var(--lamp); }

.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill.published { background: var(--ok-tint); color: var(--ok); }
.pill.draft { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.pill.paused { background: var(--warn-tint); color: var(--warn); }
.pill.removed { background: var(--danger-tint); color: var(--danger); }
.pill.review.approved { background: transparent; color: var(--ok); padding-left: 2px; }
.pill.review.needs_review { background: var(--lamp); color: var(--ink); }
.pill.review.changes_requested { background: var(--lamp-tint); color: var(--ink); border: 1px solid var(--lamp-strong); }
.hero .pill.draft { background: rgb(255 255 255 / 0.14); color: #fff; border-color: rgb(255 255 255 / 0.3); }
.hero .pill.review.approved { color: #8fe0b4; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--paper); color: var(--muted); }
.badge.ok { background: var(--ok-tint); color: var(--ok); }
.badge.off { background: var(--paper); color: var(--muted); }

.type-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.type-badge::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--neutral-mark); }
.type-badge.type-shops::before { background: var(--series-1); }
.type-badge.type-dining::before { background: var(--series-2); }
.type-badge.type-entertainment::before { background: var(--series-3); }
.type-badge.type-sport::before { background: var(--series-4); }
.type-badge.type-services::before { background: var(--series-5); }

.stage { font-weight: 700; font-size: 14px; }
.stage.not_invited { color: var(--muted); }
.stage.approved { color: var(--ok); }

/* ------------------------------------------------------------ "What needs the centre": one list, a line per task */

.todo__list { list-style: none; margin: 0; padding: 0; }
.todo__list > li + li { border-top: 1px solid var(--line); }
.todo__row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 6px; color: var(--text); text-decoration: none; border-radius: 8px;
}
.todo__row:hover { background: var(--paper); }
.todo__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--paper); color: var(--ink); }
.todo__text { display: grid; gap: 2px; }
.todo__title { font-weight: 700; font-size: 16px; line-height: 1.25; }
.todo__desc { font-size: 14px; line-height: 1.35; color: var(--muted); }
.todo__count { min-width: 44px; text-align: right; font: 700 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.todo__go { color: var(--muted); }
/* the centre has to act: the line lights up */
.todo__row.is-hot .todo__icon { background: var(--lamp); }
.todo__row.is-hot .todo__count { color: var(--ink); }
.todo__row.is-hot { background: var(--lamp-tint); }
/* nothing there: still listed so the centre sees it is clear, but quiet */
.todo__row.is-zero .todo__title, .todo__row.is-zero .todo__count { color: var(--muted); font-weight: 600; }
.todo__row.is-zero .todo__desc { display: none; }

/* floor badge, as on the visitor's route */
.floor {
  display: grid; place-content: center; justify-items: center; width: 52px; height: 52px;
  border-radius: 14px; background: var(--ink); color: #fff; flex: none;
}
.floor__n { font: 700 24px/1 var(--display); }
.floor__label { font-size: 11px; line-height: 1.2; opacity: 0.8; }
.hero .floor { background: var(--lamp); color: var(--ink); }

/* ------------------------------------------------------------ stats */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 16px 18px; text-decoration: none; color: var(--text); }
.stat .value { font: 700 30px/1.05 var(--display); }
.stat .label { color: var(--muted); font-size: 14px; }
a.stat:hover { border-color: var(--ink); }

/* ------------------------------------------------------------ tables */

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.actions { text-align: right; white-space: nowrap; }
.actions form { display: inline; }
.table-scroll { overflow-x: auto; }
.title-cell { display: flex; align-items: center; gap: 10px; }
.mini { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; background: var(--paper); }
.mini.empty { display: inline-block; border: 1px dashed var(--line); background: transparent; }
.tenants-table tr.pending td:first-child { box-shadow: inset 3px 0 0 var(--lamp-strong); }
.completeness { min-width: 110px; }
.completeness .track { display: inline-block; width: 70%; vertical-align: middle; }
.plain { list-style: none; padding: 0; margin: 0 0 1rem; }
.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------ tracks (meters) */

.track { display: block; }
.track .rail, .meters .rail { fill: var(--rail); }
.track .fill, .meters .fill { fill: var(--seq); }
.track .fill.done, .meters .fill.done { fill: var(--series-3); }
.meters { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 14px; }
.meter-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }

/* ------------------------------------------------------------ charts */

.chart-card h2 { margin-bottom: 4px; }
.chart-card > .muted { margin-top: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.chart-head p { margin: 0; }
.chart { position: relative; margin-top: 12px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .axis-labels text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--seq); stroke-width: 2; stroke-linejoin: round; }
.chart .area { fill: var(--seq); opacity: 0.14; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: var(--seq); stroke: var(--surface); stroke-width: 2; }
.chart .hits rect { fill: transparent; cursor: crosshair; }
svg [hidden] { display: none; }
.tooltip {
  position: absolute; pointer-events: none; padding: 6px 10px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: 14px; white-space: nowrap; box-shadow: 0 6px 18px rgb(0 0 0 / 0.2);
}
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); flex-wrap: wrap; }
.segmented a { padding: 4px 11px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 700; }
.segmented a.active { background: var(--ink); color: #fff; }
.bars { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 2.5rem; align-items: center; gap: 12px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar.seq { fill: var(--seq); }
.bar.neutral { fill: var(--neutral-mark); }
.bar.type-shops { fill: var(--series-1); }
.bar.type-dining { fill: var(--series-2); }
.bar.type-entertainment { fill: var(--series-3); }
.bar.type-sport { fill: var(--series-4); }
.bar.type-services { fill: var(--series-5); }
.data-table { margin-top: 12px; }
.data-table summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.data-table table { margin-top: 8px; }

.attention-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.attention-list li { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 14px; background: var(--paper); border-left: 4px solid var(--lamp-strong); }

/* ------------------------------------------------------------ tenant card */

.decision-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.decision-actions form { margin: 0; }
.decision-actions button, .decision-actions .button { margin-top: 0; }
.with-comment { flex: 0 0 auto; }
.with-comment[open] { flex: 1 1 100%; max-width: 560px; }
.with-comment summary { list-style: none; }
.with-comment summary::-webkit-details-marker { display: none; }
.with-comment[open] summary { background: var(--paper); }
.with-comment form { margin-top: 8px; }
.with-comment button { margin-top: 8px; }
.review-comment { margin: 12px 0 0; padding: 12px 14px; border-left: 4px solid var(--lamp-strong); background: var(--lamp-tint); border-radius: 0 12px 12px 0; color: var(--ink); }
.hero .review-comment { max-width: 760px; }
.review-comment p { margin: 4px 0 0; }
.checklist { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 10px; align-items: center; }
.checklist .tick { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none; }
.checklist li.done .tick { background: var(--ok-tint); color: var(--ok); }
.checklist li.todo .tick { border: 2px dashed var(--line); }
.checklist li.todo { color: var(--muted); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.photo-strip { display: flex; gap: 10px; overflow-x: auto; }
.photo-strip img { height: 120px; width: auto; border-radius: 14px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px dashed rgb(42 58 99 / 0.35); }
.timeline li { position: relative; padding: 0 0 14px 16px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }
.timeline li.approved::before { border-color: var(--ok); background: var(--ok); }
.timeline li.changes_requested::before, .timeline li.paused::before { border-color: var(--lamp-strong); background: var(--lamp); }
.timeline li.removed::before { border-color: var(--danger); }
.timeline li.published::before, .timeline li.resumed::before { border-color: var(--teal); }
.timeline p { margin: 4px 0 0; }

/* ------------------------------------------------------------ photos & lightbox */

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px; margin: 12px 0; }
.photo { margin: 0; }
.photo a { display: block; border-radius: 14px; overflow: hidden; background: var(--paper); }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.2s ease; }
.photo a:hover img { transform: scale(1.04); }
.photo figcaption { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; flex-wrap: wrap; }
.photo figcaption form { margin-left: auto; }
.kind-badge { font-weight: 700; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; background: var(--paper); }
.kind-badge.entrance { background: var(--lamp-tint); }
.kind-badge.view { background: var(--teal-tint); }
.upload summary { cursor: pointer; font-weight: 700; color: var(--teal); margin-top: 8px; }
.upload input[type=file] { width: 100%; padding: 8px 0; }
.lightbox { max-width: min(1200px, 94vw); padding: 0; border: 0; border-radius: 16px; background: #0b0f1a; color: #fff; }
.lightbox::backdrop { background: rgb(10 16 32 / 0.8); }
.lightbox img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; }
.lightbox-caption { margin: 8px 16px; color: #dde; font-size: 14px; }
.lightbox-nav { display: flex; justify-content: center; gap: 8px; padding: 0 16px 16px; }
.lightbox-nav button { margin: 0; min-width: 48px; background: rgb(255 255 255 / 0.12); color: #fff; border-color: rgb(255 255 255 / 0.25); }

/* ------------------------------------------------------------ opening hours */

.hours { width: auto; }
.hours th[scope=row] { white-space: nowrap; font-weight: 700; color: var(--text); font-size: 15px; }
.hours th[scope=row] .muted { font-weight: 400; margin-left: 4px; }
.hours td { vertical-align: middle; }
.hours input[type=time] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; }
.hours input[type=time]:disabled { opacity: 0.4; }
.hours input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ink); }
.hours-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.hours-preview { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--teal-tint); }
.hours-preview dt { font-weight: 700; color: var(--teal); }
.hours-preview dd { margin: 0; font-family: ui-monospace, Consolas, monospace; }

/* ------------------------------------------------------------ login / invite / error */

.login-page .hero { min-height: 100vh; display: grid; align-items: end; }
.login-page .hero__content { width: 100%; padding-bottom: 48px; }
.login-card { max-width: 440px; background: var(--surface); color: var(--text); border-radius: var(--radius-card); padding: 22px; box-shadow: 0 18px 48px rgb(0 0 0 / 0.35); }
.login-card h2 { margin-bottom: 4px; }
.login-card button { width: 100%; }
.login-card .error, .login-card .notice { margin-top: 12px; }

/* ------------------------------------------------------------ larger screens / phones */

@media (max-width: 720px) {
  .topbar { gap: 10px; }
  .topbar .menu { margin-left: 0; order: 3; width: 100%; justify-content: space-between; }
  .topbar .menu a { padding: 0 10px; }
  .topbar__end { margin-left: auto; }
  .brand__mall { display: none; }
  .lamp-button { width: 56px; height: 56px; }
  .tenants-table th:nth-child(2), .tenants-table td:nth-child(2),
  .tenants-table th:nth-child(5), .tenants-table td:nth-child(5),
  .tenants-table th:nth-child(6), .tenants-table td:nth-child(6),
  .tenants-table th:nth-child(7), .tenants-table td:nth-child(7) { display: none; }
  .chart .axis-labels text { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .photo img { transition: none; }
}

.login-page .brand { margin: 0 0 auto; padding-bottom: 40px; }
.login-page .hero__content { min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; padding-top: 24px; }
.login-title { font-size: 1.7rem; }
.login-card form { margin: 0; }
main.hero { max-width: none; margin: 0; padding: 0; }
.filters-box { margin-bottom: 16px; }
.filters-box > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 700; color: var(--teal); margin-bottom: 10px; }
.filters-box[open] > summary { margin-bottom: 12px; }

/* ------------------------------------------------------------ EN / ET switch (as visitor's .lang) */
.topbar__end { margin-left: auto; display: flex; align-items: center; gap: 14px; min-width: 0; }
.lang { display: flex; padding: 3px; border: 1px solid rgb(255 255 255 / 0.3); border-radius: 999px; flex: none; }
.lang a {
  min-width: 44px; height: 34px; padding: 0 10px; display: grid; place-items: center;
  border-radius: 999px; color: #fff; font-weight: 700; font-size: 14px; text-decoration: none;
}
.lang a:hover { background: rgb(255 255 255 / 0.1); }
.lang a.active { background: var(--lamp); color: var(--ink); }
.login-page .brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 auto; padding-bottom: 40px; }
.login-page .brand-row .brand { margin: 0; padding: 0; }
@media (max-width: 720px) {
  .logout .muted { display: none; }
  .lang a { min-width: 40px; height: 32px; }
}
@media (max-width: 720px) {
  /* Estonian labels are longer: the menu scrolls sideways instead of wrapping */
  .topbar .menu { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .topbar .menu a { flex: none; padding: 0 12px; }
}

/* Experiences in the centre workspace */
.pill.live { background: var(--ok-tint); color: var(--ok); }
.pill.completed { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.hero .pill.completed { background: rgb(255 255 255 / 0.14); color: #fff; border-color: rgb(255 255 255 / 0.3); }
.timeline li.completed::before { border-color: var(--muted); background: var(--muted); }
.lang-cols { margin-bottom: 0; }
.lang-cols h3 { margin: 0 0 8px; color: var(--muted); font-size: 14px; letter-spacing: 0.06em; }
.facts.stacked { grid-template-columns: 1fr; gap: 2px; }
.facts.stacked dd { margin-bottom: 10px; }
.prose { white-space: pre-line; }
.quality-ok { color: var(--ok); font-weight: 700; }
.offering + .offering { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.offering h3 { margin: 16px 0 4px; }

/* Campaigns */
.pill.collecting { background: var(--lamp-tint); color: var(--ink); border: 1px solid var(--lamp-strong); }
.pill.cancelled { background: var(--danger-tint); color: var(--danger); }
.pill.invite-invited { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.pill.invite-accepted { background: var(--ok-tint); color: var(--ok); }
.pill.invite-declined { background: var(--danger-tint); color: var(--danger); }
.participants { list-style: none; margin: 0 0 16px; padding: 0; }
.participants > li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.participants > li.is-attention { border-left: 4px solid var(--lamp-strong); padding-left: 12px; }
.participants .submissions { margin: 10px 0 0; }
.participants .submissions li { align-items: center; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; margin: 8px 0 12px; }
.checks label { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.checks input { width: auto; }

/* Results: plain numbers, engagement and participation in separate cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 0; }
.stats > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.stats dt { color: var(--muted); font-size: 14px; }
.stats dd { margin: 4px 0 0; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* =====================================================================================================
   Tenant skin (owner's request 27.11.2026): the centre's workspace in the look of dank-tenant
   (src/styles.css, "Prototype skin"): cream paper, a light header with DANK≡, heavy rounded type,
   amber primary buttons with a soft glow, 8px corners. Later rules win; photo heroes stay dark.
   ===================================================================================================== */

:root {
  --ink: oklch(22% 0.045 248);
  --ink-soft: oklch(32% 0.045 248);
  --paper: oklch(97.5% 0.018 89);
  --surface: #ffffff;
  --lamp: oklch(79% 0.16 82);
  --lamp-strong: oklch(72% 0.16 78);
  --lamp-tint: oklch(94% 0.06 92);
  --cream: oklch(94% 0.04 92);
  --soft: oklch(93% 0.018 88);
  --teal: oklch(50% 0.11 155);
  --teal-tint: oklch(93% 0.045 150);
  --accent: oklch(62% 0.17 35);
  --text: oklch(22% 0.045 248);
  --muted: oklch(48% 0.035 245);
  --line: oklch(84% 0.025 87);
  --field-line: oklch(78% 0.03 88);
  --danger: oklch(52% 0.2 28);
  --danger-tint: oklch(92% 0.04 25);
  --ok: oklch(50% 0.11 155);
  --ok-tint: oklch(93% 0.045 150);
  --warn: oklch(45% 0.1 70);
  --warn-tint: oklch(94% 0.06 92);
  --ring: oklch(79% 0.16 82 / 0.35);
  --shadow-button: 0 8px 20px oklch(70% 0.12 80 / 0.22);
  --display: 'Nunito Sans', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body: 'Nunito Sans', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius-card: 8px;
  --radius-field: 8px;
  --grid: oklch(91% 0.015 88);
  --axis: oklch(80% 0.025 87);
  --rail: var(--soft);
}

h1, h2, h3 { font-weight: 900; letter-spacing: -0.015em; color: var(--ink); }
h1 { font: 900 clamp(1.9rem, 6vw, 2.25rem) / 1.1 var(--display); }
h2, .section-title { font: 900 1.25rem/1.25 var(--display); }
h3 { font: 900 1.05rem/1.3 var(--display); }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 2px; }
main { padding-top: 40px; }

/* header: cream, translucent, a line under it; DANK≡ in heavy type */
.topbar {
  background: oklch(97.5% 0.018 89 / 0.95); color: var(--ink);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
}
.brand { color: var(--ink); }
.brand__mark { color: var(--lamp-strong); }
.brand__name { font: 900 1.45rem/1 var(--display); letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 3px; }
.brand__name::after {
  content: ""; width: 14px; height: 12px;
  background: linear-gradient(var(--lamp) 0 3px, transparent 3px 4.5px, var(--lamp) 4.5px 7.5px, transparent 7.5px 9px, var(--lamp) 9px 12px);
}
.brand__mall { color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.topbar .menu { border: 0; padding: 0; gap: 4px; }
.topbar .menu a { color: var(--muted); border-radius: 8px; }
.topbar .menu a:hover { background: var(--soft); color: var(--ink); }
.topbar .menu a.active { background: var(--lamp-tint); color: var(--ink); box-shadow: inset 0 -3px 0 var(--lamp); }
.topbar .menu .count { background: var(--accent); color: #fff; }
.logout .muted { color: var(--muted); font-weight: 700; font-size: 0.75rem; }
.topbar button.link { color: var(--muted); font-size: 0.75rem; text-decoration: none; }
.topbar button.link:hover { color: var(--ink); }
.lang { border: 0; gap: 6px; padding: 0; }
.lang a { min-width: 40px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 400; font-size: 1rem; }
.lang a:hover { background: var(--soft); }
.lang a.active { background: var(--lamp); border-color: var(--lamp); color: var(--ink); }

/* photo heroes keep the dark shade over the picture */
.hero { background: var(--ink); }
.hero h1, .hero h2, .hero h3, .hero .headline { color: #fff; }
.headline { font-weight: 900; }
.hero .lang a { background: rgb(255 255 255 / 0.12); border-color: rgb(255 255 255 / 0.3); color: #fff; }
.hero .lang a.active { background: var(--lamp); border-color: var(--lamp); color: var(--ink); }

/* pages before sign-in (sign in, invitation, errors): one column on the cream page, as the tenant's sign-in */
.hero:has(> .hero__media--plain) { background: var(--paper); color: var(--text); }
.hero:has(> .hero__media--plain) .hero__media--plain { display: none; }
.hero:has(> .hero__media--plain) .headline { color: var(--ink); text-shadow: none; font-size: clamp(1.9rem, 5vw, 2.5rem); }
.hero:has(> .hero__media--plain) .hero__sub,
.hero:has(> .hero__media--plain) .breadcrumbs,
.hero:has(> .hero__media--plain) .breadcrumbs a { color: var(--muted); }
.hero:has(> .hero__media--plain) h1, .hero:has(> .hero__media--plain) h2 { color: var(--ink); }
.hero:has(> .hero__media--plain) .lang a { background: var(--surface); border-color: var(--line); color: var(--ink); }
.hero:has(> .hero__media--plain) .lang a.active { background: var(--lamp); border-color: var(--lamp); }
.hero:has(> .hero__media--plain) .brand,
.hero:has(> .hero__media--plain) .brand__mall { color: var(--ink); }
.login-page .hero__content { max-width: 480px; justify-content: center; padding-top: clamp(40px, 10vh, 120px); }
.login-page .brand-row { padding-bottom: 32px; margin: 0; }
.login-card { padding: 0; background: transparent; box-shadow: none; border-radius: 0; }
.login-title { font-size: 1.875rem; }

/* cards, notices */
.card { border-radius: 8px; border-color: var(--line); }
a.stat:hover { border-color: var(--lamp); }
.floor { border-radius: 8px; }
.attention-list li { background: oklch(79% 0.16 82 / 0.06); border-radius: 8px; }
.stat .value { font-weight: 900; }
.stat .label, th { font-weight: 700; font-size: 0.75rem; }
.notice, .error, .invite-link, .review-comment, .hours-preview { border: 1px solid transparent; border-radius: 8px; }
.notice { background: var(--teal-tint); border-color: oklch(85% 0.06 150); }
.invite-link, .review-comment { background: var(--cream); border-color: oklch(85% 0.08 85); }
.error { background: oklch(58% 0.2 28 / 0.1); color: oklch(52% 0.2 28); font-weight: 600; }

/* buttons: amber primary with a soft glow, white outline secondary */
button, .button { min-height: 48px; padding: 0 22px; border-radius: 8px; border: 1px solid var(--line); font-weight: 700; }
button:hover, .button:hover { background: var(--soft); border-color: var(--line); }
.primary, .button.lamp, button.lamp {
  background: var(--lamp); border-color: var(--lamp); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-button);
}
.primary:hover, .button.lamp:hover, button.lamp:hover { background: var(--lamp-strong); border-color: var(--lamp-strong); }
button.link { min-height: 0; padding: 0; border: 0; background: none; color: var(--ink); box-shadow: none; }
button.link:hover { background: none; }
button.link.danger { color: var(--danger); }
.approve { background: var(--teal-tint); border-color: var(--teal); color: var(--teal); }
.approve:hover { background: var(--teal); color: #fff; }
.button.danger { background: var(--surface); border-color: var(--danger-tint); color: var(--danger); }
.danger-solid, .danger-solid:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.composer__send, .composer__field { border-radius: 8px; }
.composer__send:hover { background: var(--ink-soft); }
.lamp-button { border-radius: 16px; box-shadow: var(--shadow-button); }
.lightbox-nav button:hover { background: rgb(255 255 255 / 0.2); }

/* fields */
label { font-weight: 800; font-size: 1rem; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea, .hours input[type=time] {
  min-height: 48px; padding: 12px 16px; border: 1px solid var(--field-line); border-radius: 8px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lamp); box-shadow: 0 0 0 3px var(--ring); }
input::placeholder, textarea::placeholder { color: oklch(62% 0.03 245); }
.hours input[type=checkbox], .checks input { accent-color: var(--lamp-strong); }

/* chips, switches and tags */
.chips a { border-color: var(--field-line); font-weight: 400; }
.chips a.active { background: var(--lamp-tint); border-color: var(--lamp); color: var(--ink); }
.chips a.active span { color: var(--muted); }
.pill, .badge, .kind-badge { border-radius: 999px; font-size: 0.6875rem; font-weight: 900; }
.pill.draft, .pill.completed, .pill.invite-invited, .badge, .badge.off { background: var(--soft); color: var(--muted); border-color: transparent; }
.pill.published, .pill.live, .pill.invite-accepted, .badge.ok { background: oklch(55% 0.11 155 / 0.15); color: oklch(45% 0.11 155); }
.pill.review.needs_review { background: var(--accent); color: oklch(98% 0.01 90); }
.pill.review.changes_requested, .pill.collecting, .pill.paused { background: oklch(79% 0.16 82 / 0.15); color: var(--warn); border-color: transparent; }
.hero .pill.draft, .hero .pill.completed { background: rgb(255 255 255 / 0.14); color: #fff; }
.upload summary, .filters-box > summary { color: var(--ink); }
.breadcrumbs { font-weight: 700; }
.tooltip { border-radius: 8px; }
