/* Ink Me Well on the web: the app's paper and ink (mobile_app/lib/theme.dart).
   70 per cent paper, 20 ink, 10 the near-black of a call to action. Only the thing
   to press next is a solid dark block; everything else is drawn in ink lines.
   Status colours are functional and small, never decoration. */

:root {
  --bg: #FFFFFF;
  --surface: #F6F4F1;
  --hairline: #E7E3DD;
  --fg: #111111;
  --muted: #5C5751;
  --cta: #1C1917;
  --on-cta: #FFFFFF;
  --ok: #2E6A43;
  --danger: #9E2A2A;
  --warn: #8A5A12;
  --radius: 6px;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: Caveat, 'Segoe Print', cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--sans); }
img { max-width: 100%; display: block; }
a { color: var(--fg); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--muted); }
p { margin: 0 0 12px; }
h1, h2, h3 { margin: 0; font-weight: 500; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: 24px 0; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* ----- type ----------------------------------------------------------------- */
.serif { font-family: var(--serif); }
.hand { font-family: var(--hand); font-weight: 600; }
.cap { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--ok); }
.display { font: 500 clamp(34px, 4.6vw, 52px)/1.04 var(--serif); letter-spacing: -.01em; }
.title { font: 600 28px/1.1 var(--serif); }
.subtitle { font: 600 21px/1.2 var(--serif); }
.lede { font-size: 16px; color: var(--muted); max-width: 60ch; }

/* ----- buttons ---------------------------------------------------------------
   .cta is the one solid block, set in the quill's hand like every CTA in the app.
   .btn is secondary: ink outline, Inter. */
.cta, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: var(--radius);
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .15s ease, background-color .15s ease; }
.cta { position: relative; overflow: hidden; background: var(--cta); color: var(--on-cta); border: 0; padding: 0 22px; font: 600 23px/1 var(--hand); }
.cta:hover { color: var(--on-cta); background: #2b2622; }
.cta:active, .btn:active { transform: translateY(1px); }
.cta.lg { min-height: 56px; padding: 0 28px; font-size: 27px; }
.cta.block, .btn.block { width: 100%; }
.cta.wet { background: linear-gradient(100deg, #1C1917 0%, #1C1917 38%, #6B625A 50%, #1C1917 62%, #1C1917 100%);
  background-size: 260% 100%; animation: sheen 3.4s ease-in-out infinite; }
.cta.ripple::after { content: ""; position: absolute; inset: 0; border-radius: inherit; animation: ripple 2.8s ease-out infinite; pointer-events: none; }
.cta.danger { background: var(--danger); }
.btn { background: var(--bg); color: var(--fg); border: 1px solid var(--fg); padding: 0 16px; font: 600 14px/1 var(--sans); }
.btn:hover { background: var(--surface); color: var(--fg); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.quiet { border-color: var(--hairline); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #F8EEEE; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--fg); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
button[disabled], .btn[aria-disabled=true] { opacity: .45; pointer-events: none; }

@keyframes sheen { 0% { background-position: 100% 0 } 60%, 100% { background-position: 0% 0 } }
@keyframes ripple { 0% { box-shadow: 0 0 0 0 rgba(28,25,23,.28) } 80%, 100% { box-shadow: 0 0 0 14px rgba(28,25,23,0) } }

/* ----- surfaces ---------------------------------------------------------------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; }
.panel { background: var(--bg); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 20px; }
.panel.ink { border-color: var(--fg); }
.panel > .cap:first-child, .card > .cap:first-child { display: block; margin-bottom: 10px; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
@media (max-width: 900px) { .grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid.two, .grid.three, .grid.four { grid-template-columns: minmax(0, 1fr); } }

/* A stat: small caps label, a serif figure, one line of context. */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .figure { font: 600 30px/1 var(--serif); font-variant-numeric: tabular-nums; }
.stat .note { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* Status tags: small, functional. */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; line-height: 1; padding: 5px 8px;
  border-radius: 999px; border: 1px solid var(--hairline); color: var(--muted); white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.ok { color: var(--ok); border-color: #CFE0D4; }
.tag.bad { color: var(--danger); border-color: #EBCFCF; }
.tag.warn { color: var(--warn); border-color: #EADCC4; }
.tag.ink { color: var(--fg); border-color: var(--fg); }
.tag.plain::before { display: none; }

/* Week line marks, as on the app's desk. */
.mark-booked { background: var(--fg); border-radius: 4px; }
.mark-hold { border-radius: 4px; background: linear-gradient(100deg, #1C1917 0%, #1C1917 38%, #6B625A 50%, #1C1917 62%, #1C1917 100%);
  background-size: 260% 100%; animation: sheen 3.4s ease-in-out infinite; }
.mark-open { background: repeating-linear-gradient(180deg, var(--fg) 0 3px, transparent 3px 7px); }

/* ----- tables ------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500;
  padding: 10px 10px; border-bottom: 1px solid var(--fg); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.table tr:hover td { background: #FBFAF8; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table a.rowlink { text-decoration: none; font-weight: 500; }
.table a.rowlink:hover { text-decoration: underline; }
.empty { padding: 28px 0; text-align: center; color: var(--muted); font: 600 22px/1.3 var(--hand); }

/* Key/value lists on record pages. */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ----- forms ------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-size: 13px; font-weight: 600; }
.field .help, .helptext { font-size: 12px; color: var(--muted); }
.field .errorlist, ul.errorlist { list-style: none; margin: 0; padding: 0; color: var(--danger); font-size: 13px; font-weight: 500; }
input[type=text], input[type=tel], input[type=number], input[type=email], input[type=url], input[type=search],
input[type=date], input[type=time], input[type=datetime-local], input[type=password], select, textarea {
  width: 100%; font: 400 15px/1.4 var(--sans); color: var(--fg); padding: 11px 12px; border: 1px solid var(--hairline);
  border-radius: var(--radius); background: var(--surface); transition: border-color .15s ease, background-color .15s ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fg); background: var(--bg); }
textarea { min-height: 96px; resize: vertical; }
input[type=file] { font: 13px var(--sans); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--cta); }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-grid label { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--hairline); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.check-grid label:has(input:checked) { border-color: var(--fg); background: var(--surface); font-weight: 600; }
.check-grid input { accent-color: var(--cta); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.searchbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.searchbar input[type=search] { max-width: 320px; }
.searchbar select { width: auto; }

/* ----- messages ------------------------------------------------------------------ */
.messages { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { border: 1px solid var(--hairline); border-left-width: 1px; border-radius: var(--radius); padding: 12px 14px; font-size: 14px; background: var(--bg);
  display: flex; gap: 10px; align-items: center; animation: fadein .4s ease both; }
.messages li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fg); flex-shrink: 0; }
.messages li.success::before { background: var(--ok); }
.messages li.error { border-color: #EBCFCF; color: var(--danger); }
.messages li.error::before { background: var(--danger); }
.messages li.warning::before { background: var(--warn); }

/* ----- line art ------------------------------------------------------------------ */
.art { display: block; width: 100%; height: auto; overflow: visible; }
.art path.line { fill: none; stroke: var(--fg); stroke-linecap: round; stroke-linejoin: round; }
.art path.fill { fill: var(--fg); stroke: none; opacity: 0; transition: opacity 1.1s ease; }
.art.packed path.fill { opacity: 1; }
.art circle.nib { fill: var(--fg); filter: drop-shadow(0 0 2px rgba(17,17,17,.45)); }

/* ----- the app shell (studio and console) ------------------------------------------ */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { border-right: 1px solid var(--hairline); padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.side .brand { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; text-decoration: none; }
.side .brand b { font: 600 22px/1 var(--serif); }
.side .brand span { font: 600 17px/1 var(--hand); color: var(--muted); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav .cap { padding: 14px 10px 6px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius); text-decoration: none; color: var(--muted); font-size: 14px; }
.side nav a svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.side nav a:hover { color: var(--fg); background: var(--surface); }
.side nav a.on { color: var(--fg); font-weight: 600; background: var(--surface); }
.side nav a .count { margin-left: auto; font-size: 11px; font-weight: 600; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--fg); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; }
.side .who { margin-top: auto; border-top: 1px solid var(--hairline); padding: 14px 8px 0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.side .who b { font-weight: 600; }
.main { padding: 28px 36px 64px; max-width: 1200px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .cap { display: block; margin-bottom: 6px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 12px; text-decoration: none; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--fg); border-bottom-color: var(--fg); font-weight: 600; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 16px; font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--hairline); padding: 14px 16px; gap: 10px; }
  .side nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .side nav .cap { display: none; }
  .side nav a { white-space: nowrap; }
  .side .who { display: none; }
  .main { padding: 20px 16px 48px; }
}

/* The bar that says a staff member is acting as someone. Never a solid block:
   the only solid thing in it is the button to stop. */
.imp-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px; background: #FBF3F3; border-bottom: 1px solid var(--danger); color: var(--danger); font-size: 14px; }
.imp-bar b { color: var(--fg); }
.imp-bar form { margin: 0; }
.imp-bar .cta { min-height: 36px; font-size: 20px; padding: 0 16px; }

/* ----- the quill (static/web/quill.js) ------------------------------------------------
   Pages opt in with <html class="quill-on">. Text marked data-write stays unseen until
   the quill has split it into words, then each word is uncovered under the nib. */
.quill-layer { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; overflow: visible; }
.quill-mark { fill: none; stroke: var(--fg); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.quill-on [data-write]:not(.qw-ready) { visibility: hidden; }
.qw-ready .qw { display: inline-block; clip-path: inset(-40% calc(100% - var(--qw, -20%)) -45% -14%); }
.qw-done .qw { clip-path: none; }

/* ----- small motion ---------------------------------------------------------------- */
.fade-in { animation: fadein .5s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
.lift { transition: transform .25s ease, border-color .25s ease; }
.lift:hover { transform: translateY(-2px); }
.bob { animation: bob 3.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translate(0,0) rotate(-8deg) } 50% { transform: translate(3px,-4px) rotate(-3deg) } }
.breathe { animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 1 } 50% { opacity: .55 } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .art path.fill { opacity: 1; }
}
