/* Luccombe Hotels trading dashboard — Luccombe Hall brand.
   Navy #003255 and gold #B4954C off the hotel logo, Cormorant Garamond over
   Cabin as on luccombehall.co.uk. */

:root {
  --navy: #003255;
  --navy-deep: #002340;
  --navy-soft: #1b4a6b;
  --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: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --sans: 'Cabin', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --shadow: 0 1px 2px rgba(0, 50, 85, .05), 0 8px 24px -12px rgba(0, 50, 85, .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; margin-right: auto; }
.mark svg { height: 42px; width: auto; flex: none; }
.mark-text { line-height: 1.15; }
.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 { 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); }

/* ---------- 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); }
@media (prefers-color-scheme: dark) { .ch-cy { stroke: var(--gold-light); } }

.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; }
}
