/* Shanklin Villa — trading dashboard and marketing budget.
   Navy #003C6A and gold #B4954C off the Shanklin Villa logo, Playfair Display
   over Raleway as on shanklinvilla.co.uk. */

:root {
  --navy: #003c6a;
  --navy-deep: #002a4c;
  --navy-soft: #245277;
  --gold: #b4954c;
  --gold-light: #cbaa5c;
  --gold-dark: #8b7340;
  --cream: #f5edd8;

  --paper: #fbfaf7;
  --card: #ffffff;
  --ink: #12242f;
  --ink-soft: #4a5f6d;
  --ink-faint: #8496a1;
  --rule: #e4e0d6;
  --rule-firm: #cfc9b9;

  --up: #2e6f5e;
  --up-wash: #e8f2ee;
  --down: #a8422f;
  --down-wash: #f8ebe8;

  --serif: 'Playfair Display', 'Iowan Old Style', Georgia, serif;
  --sans: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --shadow: 0 1px 2px rgba(0, 60, 106, .05), 0 8px 24px -12px rgba(0, 60, 106, .16);
  --radius: 10px;
  --pad: clamp(16px, 3.2vw, 34px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #061821;
    --card: #0d2836;
    --ink: #e9eef1;
    --ink-soft: #a3b6c1;
    --ink-faint: #6c8290;
    --rule: #1b3f52;
    --rule-firm: #2a5568;
    --up: #6ec5a8;
    --up-wash: #113029;
    --down: #e08a76;
    --down-wash: #331914;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: .01em; }

/* ---------- masthead ---------- */

.masthead {
  background: var(--navy-deep);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}
.masthead-inner {
  max-width: 1360px; margin: 0 auto; padding: 18px var(--pad);
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.mark { display: flex; align-items: center; gap: 14px; }
.mark svg { height: 42px; width: auto; flex: none; }
.mark-text { line-height: 1.15; }
/* The two halves have different titles — "Trading Dashboard" is fourteen pixels
   narrower than "Marketing Budget" — and the switch sits just after them. Giving
   the wordmark a floor means the switch lands in exactly the same place on both,
   so a site-level control does not shuffle sideways as you use it. Dropped on
   narrow screens, where the masthead has no room to spare. */
@media (min-width: 700px) { .mark-text { min-width: 236px; } }
.mark-text b {
  display: block; font-family: var(--serif); font-size: 25px;
  font-weight: 500; letter-spacing: .015em;
}
.mark-text span {
  display: block; font-size: 10.5px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--gold-light);
}
.masthead .stamp { margin-left: auto; text-align: right; font-size: 13px; color: #b9cbd8; }
.masthead .stamp b { display: block; font-size: 15px; color: #fff; font-weight: 600; }

/* ---------- controls ---------- */

.toolbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.toolbar-inner {
  max-width: 1360px; margin: 0 auto; padding: 11px var(--pad);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.segmented {
  display: inline-flex; border: 1px solid var(--rule-firm);
  border-radius: 999px; padding: 3px; background: var(--card);
}
.segmented button {
  border: 0; background: none; cursor: pointer; color: var(--ink-soft);
  font: inherit; font-size: 14px; padding: 6px 17px; border-radius: 999px;
  white-space: nowrap; transition: background .15s, color .15s;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--navy-deep); color: #fff; }
@media (prefers-color-scheme: dark) {
  .segmented button[aria-pressed="true"] { background: var(--gold); color: #06202c; }
}
.toolbar .spacer { margin-left: auto; }
.toolbar label { font-size: 13px; color: var(--ink-soft); }

.linkish {
  color: var(--ink-soft); text-decoration: none; font-size: 14px;
  border-bottom: 1px solid var(--rule-firm); padding-bottom: 1px;
}
.linkish:hover { color: var(--gold-dark); border-color: var(--gold); }

/* ---------- layout ---------- */

main { max-width: 1360px; margin: 0 auto; padding: 26px var(--pad) 70px; }

section { margin-top: 40px; }
section > header { margin-bottom: 14px; }
section > header h2 { font-size: 26px; }
section > header p { margin: 3px 0 0; color: var(--ink-soft); font-size: 14px; }

.rule-heading {
  display: flex; align-items: baseline; gap: 14px;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 12px;
}
.rule-heading::after { content: ''; flex: 1; height: 1px; background: var(--rule); }

.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }
.grid.charts { grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); }
.grid.halves { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}

/* ---------- KPI cards ---------- */

.kpi { position: relative; overflow: hidden; }
.kpi::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--gold);
}
.kpi h3 {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint);
}
.kpi .value {
  font-family: var(--serif); font-size: clamp(31px, 3.6vw, 41px);
  font-weight: 500; line-height: 1.1; margin: 7px 0 2px;
  font-variant-numeric: tabular-nums;
}
.kpi .sub { font-size: 13px; color: var(--ink-soft); }
.kpi .marks { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }

.pill {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pill span { font-weight: 400; opacity: .78; }
.pill.up { background: var(--up-wash); color: var(--up); }
.pill.down { background: var(--down-wash); color: var(--down); }
.pill.flat { background: var(--rule); color: var(--ink-soft); }

/* The against-target block stacks a KPI row, charts and a table; the grids bring
   their own gap, so only the gaps between them need stating. */
.targets > * + * { margin-top: 16px; }
.targets .waiting { color: var(--gold-dark); font-weight: 600; }
/* The weeks nobody has reported yet sit below the ones that have; greying them
   keeps the eye on the part of the year that actually happened. */
.targets tr.future td { color: var(--ink-faint); }
.targets tr.future td:first-child { color: var(--ink-soft); }
@media (prefers-color-scheme: dark) { .targets .waiting { color: var(--gold-light); } }

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

.chart-card h3 { font-size: 20px; }
.chart-card .note { font-size: 13px; color: var(--ink-soft); margin: 2px 0 0; }
.chart-card figure { margin: 14px 0 0; }
.chart-card svg { display: block; width: 100%; height: auto; overflow: visible; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-right: 7px; vertical-align: middle; }
.legend i.dash { background: none; border-top: 3px dashed currentColor; height: 0; }

.ch-grid { stroke: var(--rule); stroke-width: 1; }
.ch-axis { fill: var(--ink-faint); font-size: 11px; font-family: var(--sans); }
.ch-cy { stroke: var(--navy); }
.ch-py { stroke: var(--ink-faint); }
.ch-target { stroke: var(--gold); }
/* Two years back, and the older years behind them on the long view. */
.ch-pp { stroke: var(--gold); opacity: .8; }
.ch-hist { stroke: var(--rule-firm); }
@media (prefers-color-scheme: dark) {
  .ch-cy { stroke: var(--gold-light); }
  .ch-pp { stroke: #7fa6c4; }
}
.scroller tr.current td { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.month-note { margin: -4px 0 14px; font-size: 14px; color: var(--ink-soft); }

.ch-hit { fill: transparent; cursor: crosshair; }
.ch-cursor { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.ch-dot { opacity: 0; }

.tip {
  position: fixed; z-index: 60; pointer-events: none; opacity: 0;
  transition: opacity .1s; background: var(--navy-deep); color: #fff;
  border-radius: 8px; padding: 9px 12px; font-size: 13px; line-height: 1.45;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .55); max-width: 260px;
}
.tip b { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 4px; }
.tip .row { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.tip .row span { color: #b9cbd8; }

/* ---------- table ---------- */

/* Narrow screens scroll the table sideways. Wider ones don't need to, and
   dropping the scroll container there lets the header row stick to the page. */
.scroller { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
@media (min-width: 900px) { .scroller { overflow: visible; margin: 0; padding: 0; } }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
caption { text-align: left; color: var(--ink-soft); font-size: 13px; padding-bottom: 10px; }
th, td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--rule); }
th:first-child, td:first-child { text-align: left; }
thead th {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; border-bottom: 1px solid var(--rule-firm);
}
@media (min-width: 900px) {
  /* A full year is fifty-odd rows — keep the column names in view, just below
     the toolbar. --toolbar-h is measured in app.js. */
  thead th {
    position: sticky; top: calc(var(--toolbar-h, 56px) - 1px);
    background: var(--card); z-index: 5;
  }
}
tbody tr:hover { background: color-mix(in srgb, var(--cream) 40%, transparent); }
@media (prefers-color-scheme: dark) { tbody tr:hover { background: rgba(203, 170, 92, .07); } }
td.up { color: var(--up); } td.down { color: var(--down); }

/* ---------- footer ---------- */

footer.page {
  border-top: 1px solid var(--rule); margin-top: 56px;
  padding: 22px var(--pad) 46px; color: var(--ink-faint); font-size: 13px;
}
footer.page .inner { max-width: 1360px; margin: 0 auto; display: flex; gap: 16px; flex-wrap: wrap; }
footer.page a { color: inherit; }

/* ---------- admin ---------- */

.slim { max-width: 780px; }

.drop {
  border: 2px dashed var(--rule-firm); border-radius: var(--radius);
  padding: 46px 26px; text-align: center; background: var(--card);
  transition: border-color .15s, background .15s;
}
.drop.hot { border-color: var(--gold); background: color-mix(in srgb, var(--cream) 45%, var(--card)); }
.drop h3 { font-size: 23px; margin-bottom: 6px; }
.drop p { color: var(--ink-soft); margin: 0 0 18px; font-size: 14px; }

.btn {
  display: inline-block; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  font-size: 15px; padding: 11px 26px; border-radius: 999px;
  background: var(--gold); color: #12242f; transition: background .15s;
}
.btn:hover { background: var(--gold-light); }
.btn[disabled] { opacity: .5; cursor: progress; }
.btn.ghost { background: none; border: 1px solid var(--rule-firm); color: var(--ink-soft); }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold-dark); background: none; }

.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 5px; }
.field input {
  width: 100%; font: inherit; padding: 11px 13px; border-radius: 8px;
  border: 1px solid var(--rule-firm); background: var(--card); color: var(--ink);
}
.field input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }

.notice { border-radius: 8px; padding: 13px 16px; font-size: 14px; margin: 18px 0 0; }
.notice.ok { background: var(--up-wash); color: var(--up); }
.notice.bad { background: var(--down-wash); color: var(--down); }
.notice.info { background: color-mix(in srgb, var(--cream) 55%, var(--card)); color: var(--ink-soft); border: 1px solid var(--rule); }

.summary { list-style: none; padding: 0; margin: 18px 0 0; font-size: 14px; }
.summary li { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.summary li b { font-variant-numeric: tabular-nums; font-weight: 600; }

.steps { color: var(--ink-soft); font-size: 14.5px; padding-left: 20px; }
.steps li { margin-bottom: 7px; }

@media (max-width: 620px) {
  .masthead-inner { gap: 12px; }
  .masthead .stamp { text-align: left; }
  .mark svg, .mark img { height: 34px !important; }
  .mark-text b { font-size: 20px; }
  .mark-text span { letter-spacing: .16em; font-size: 9.5px; }
  /* Three hotel names won't fit across a phone — let the row slide instead of
     spilling off the edge. */
  .toolbar-inner { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .toolbar-inner::-webkit-scrollbar { display: none; }
  .segmented { flex: none; }
  .grid.charts { grid-template-columns: 1fr; }
  .card { padding: 16px; }
}

@media print {
  .toolbar, .drop, footer.page { display: none; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- the switch between the two halves of the site ---------- */

.areas {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid rgba(255, 255, 255, .26); border-radius: 999px;
}
.areas a {
  padding: 5px 16px; border-radius: 999px; font-size: 13px; line-height: 1.4;
  color: #cfe0ea; text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.areas a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.areas a[aria-current="page"] { background: var(--gold); color: #12242f; font-weight: 600; }
.areas a[aria-current="page"]:hover { background: var(--gold-light); }

@media (max-width: 620px) {
  .areas { order: 3; width: 100%; justify-content: center; }
  .areas a { padding: 5px 14px; font-size: 12.5px; }
}

/* ---------- booking link builder ---------- */

.builder [hidden], .result [hidden] { display: none !important; }
.builder fieldset { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.builder fieldset:last-child { margin-bottom: 0; }
.builder legend {
  font-family: var(--serif); font-size: 20px; font-weight: 500; padding: 0; margin-bottom: 10px;
}
.builder .segmented { margin-bottom: 14px; }
.builder .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; }
.builder .field { margin-bottom: 12px; }
.builder .field em { font-style: normal; color: var(--ink-faint); }
.field select {
  width: 100%; font: inherit; padding: 11px 13px; border-radius: 8px;
  border: 1px solid var(--rule-firm); background: var(--card); color: var(--ink);
}
.field select:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.field input:disabled { opacity: .5; }
.hint { font-size: 13px; color: var(--ink-soft); margin: 0; }
.hint:empty { display: none; }

.result .url {
  display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  line-height: 1.55; word-break: break-all; padding: 14px 16px; border-radius: 8px;
  background: var(--paper); border: 1px solid var(--rule);
  user-select: all;
}
.result .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.result .btn.ghost { text-decoration: none; }
.result .btn[disabled] { cursor: not-allowed; }
.result .summary li span { color: var(--ink-soft); }
.result .summary li b { text-align: right; }

.recent { list-style: none; margin: 0; padding: 0; }
.recent li {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--rule);
}
.recent li:last-child { border-bottom: 0; }
.recent .what { font-size: 14px; font-weight: 600; }
.recent code { grid-column: 1; font-size: 12px; color: var(--ink-faint); word-break: break-all; }
.recent .btn { grid-column: 2; grid-row: 1 / span 2; }
.btn.small { padding: 6px 16px; font-size: 13px; }

/* ==================================================================
   Booking sources
   ================================================================== */

/* These come from the marketing half's stylesheet, which grew them first. The
   two files are separate copies, so anything used on both has to exist in both. */

.chip {
  display: inline-block; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px;
}
.chip.good { background: var(--up-wash); color: var(--up); }
.chip.warn { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold-dark); }
.chip.bad  { background: var(--down-wash); color: var(--down); }
.chip.idle { background: var(--rule); color: var(--ink-faint); }
@media (prefers-color-scheme: dark) { .chip.warn { color: var(--gold-light); } }

.grid-table { min-width: 100%; }
.grid-table th, .grid-table td { vertical-align: middle; padding: 9px 12px; text-align: left; }
.grid-table th.r, .grid-table td.r { text-align: right; }
.grid-table thead th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
/* Every column but the first carries a figure. */
.grid-table td:not(:first-child), .grid-table th:not(:first-child) { text-align: right; }
.grid-table tr.future td { color: var(--ink-faint); }

.cellfield {
  font: inherit; font-size: 13.5px; padding: 6px 8px; border-radius: 6px; color: var(--ink);
  border: 1px solid var(--rule-firm); background: var(--card); min-width: 128px;
}
.cellfield:focus {
  outline: 0; border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent);
}

.row-actions { margin-top: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.btn.small { font-size: 13.5px; padding: 9px 18px; }
.save-status { font-size: 13.5px; color: var(--ink-soft); }

/* The Shanklin Villa logo only exists as navy-and-gold artwork on white, so on
   the navy masthead it sits on its own white tile rather than being recoloured. */
.logo-tile {
  display: inline-flex; align-items: center; flex: none;
  background: #fff; border-radius: 8px; padding: 5px 10px;
}
.logo-tile img { display: block; height: 40px; width: auto; }
@media (max-width: 700px) { .logo-tile img { height: 32px; } }
