/* Scriben owner dashboard: the website's palette (navy, bone, mist, ember), quieter. */
:root {
  --ink: #1f2a44;
  --ink-soft: #3a4560;
  --bone: #f3f1ec;
  --sand: #e9e7e1;
  --paper: #fbfaf7;
  --line: #dcd8cf;
  --muted: #5d6370;
  --mist: #8daeb6;
  --aqua: #bfe3e6;
  --ember: #e8742c;
  --ember-dk: #b4511b;
  --deep: #0b0e14;
  --ok: #2f7a55;
  --warn: #a86512;
  --bad: #a83a2c;
  --display: "Cormorant Garamond", Georgia, serif;
  --giant: "Oswald", "Arial Narrow", sans-serif;
  --body: "Inter Tight", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bone); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2 { font-family: var(--display); font-weight: 500; text-transform: uppercase; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: 40px; line-height: 1; }
h2 { font-size: 22px; line-height: 1.1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--bad); min-height: 1.2em; margin: 8px 0 0; font-size: 14px; }
.eyebrow { font: 500 12px/1 var(--giant); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.brand { font: 400 20px/1 var(--giant); letter-spacing: 0.32em; margin: 0; }
.link { color: var(--ink); font-size: 14px; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 2px;
  font: 500 13px/1 var(--giant); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: transform 0.12s, background 0.2s, border-color 0.2s; }
.btn:active { transform: translateY(1px); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--deep); }
.btn-ember { background: var(--ember); color: #fff; }
.btn-ember:hover { background: var(--ember-dk); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }

/* Login */
.login { min-height: 100svh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(80% 60% at 50% 0%, #2b3a5e 0%, var(--ink) 55%, var(--deep) 100%); }
.login-card { width: min(420px, 100%); background: var(--bone); padding: 40px 36px; display: grid; gap: 14px; }
.login-card h1 { font-size: 34px; }
.login-card label, .dialog label { display: grid; gap: 6px; font: 500 12px/1 var(--giant); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
input, select { font: 15px var(--body); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 2px; min-height: 40px; padding: 0 12px; width: 100%; }
input:focus, select:focus { border-color: var(--ink); outline: none; }
textarea { font: 15px/1.5 var(--body); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 2px; padding: 10px 12px; width: 100%; min-height: 80px; resize: vertical; }

/* Shell */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100svh; }
.side { background: var(--ink); color: #fff; padding: 28px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100svh; }
.side-sub { color: var(--aqua); font-size: 13px; margin: 8px 0 28px; }
#nav { display: grid; gap: 2px; }
#nav a { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; text-decoration: none; color: rgba(255,255,255,0.75); border-left: 2px solid transparent; font-size: 15px; }
#nav a:hover { color: #fff; background: rgba(255,255,255,0.05); }
#nav a.on { color: #fff; border-left-color: var(--ember); background: rgba(255,255,255,0.07); }
.badge { background: var(--ember); color: #fff; font: 500 11px/1 var(--giant); padding: 4px 7px; border-radius: 999px; }
.side-foot { margin-top: auto; display: grid; gap: 6px; }
.side-link { background: none; border: 0; color: rgba(255,255,255,0.7); text-align: left; font: 14px var(--body); padding: 8px 12px; cursor: pointer; text-decoration: none; }
.side-link:hover { color: #fff; }
.main { padding: 36px 40px 80px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.view { animation: rise 0.35s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Cards */
.card { background: var(--paper); border: 1px solid var(--line); padding: 22px 24px; margin-bottom: 20px; }
.card.flush { padding: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--paper); border: 1px solid var(--line); padding: 18px 20px; position: relative; overflow: hidden; }
.kpi.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.dark .kpi-label, .kpi.dark .kpi-sub { color: var(--aqua); }
.kpi-label { font: 500 12px/1.2 var(--giant); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font: 400 36px/1.1 var(--giant); margin-top: 10px; }
.kpi-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kpi-bar { height: 4px; background: var(--sand); margin-top: 12px; }
.kpi-bar > span { display: block; height: 100%; background: var(--ember); transition: width 0.8s ease-out; }
.kpi.dark .kpi-bar { background: rgba(255,255,255,0.15); }

/* Chart */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; border-bottom: 1px solid var(--line); }
.chart .bar { flex: 1; background: var(--mist); min-height: 2px; position: relative; transition: background 0.2s; transform-origin: bottom; animation: grow 0.6s ease-out both; }
.chart .bar:hover { background: var(--ember); }
.chart .bar[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--ink); color: #fff; font-size: 12px; padding: 4px 8px; z-index: 2; }
@keyframes grow { from { transform: scaleY(0); } }

/* Today and feeds */
.today-group + .today-group { margin-top: 16px; }
.today-group h3 { font: 500 12px/1 var(--giant); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.today-row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.feed li:first-child { border-top: 0; }
.feed time { color: var(--muted); font-size: 13px; }
.feed b { font-weight: 600; }

/* Tables */
.filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filters select { width: auto; }
.filters input { width: 260px; }
.seg { display: inline-flex; border: 1px solid var(--line); background: var(--paper); }
.seg button { border: 0; background: none; padding: 0 14px; min-height: 38px; font: 500 12px var(--giant); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font: 500 11px/1 var(--giant); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--sand); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr { cursor: pointer; transition: background 0.15s; }
.table tbody tr:hover { background: #f6f4ef; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .sub { color: var(--muted); font-size: 12px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

.chip { display: inline-block; font: 500 11px/1 var(--giant); letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 8px; border-radius: 2px; background: var(--sand); color: var(--ink-soft); }
.chip.awaiting-advance, .chip.awaiting-payment, .chip.new { background: #fbe7d8; color: var(--ember-dk); }
.chip.confirmed, .chip.paid, .chip.replied { background: #dfeef0; color: #2d5c66; }
.chip.checked-in, .chip.shipped { background: var(--ink); color: #fff; }
.chip.completed, .chip.delivered, .chip.won { background: #dcefe4; color: var(--ok); }
.chip.cancelled, .chip.lost { background: #f3dede; color: var(--bad); }
.src { font-size: 12px; color: var(--muted); }

/* Calendar */
.cal { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.cal th, .cal td { border: 1px solid var(--line); text-align: center; padding: 0; }
.cal th { background: var(--sand); font: 500 11px/1.2 var(--giant); letter-spacing: 0.04em; padding: 8px 4px; min-width: 46px; }
.cal th.wknd { background: #e2ded5; }
.cal th.today { background: var(--ink); color: #fff; }
.cal th.room { text-align: left; padding: 10px 14px; min-width: 160px; position: sticky; left: 0; z-index: 1; }
.cal th.room small { display: block; color: var(--muted); font: 12px var(--body); text-transform: none; letter-spacing: 0; }
.cal td button { width: 100%; height: 52px; border: 0; cursor: pointer; font: 500 15px var(--giant); color: var(--ink); background: #e5f1ec; transition: filter 0.15s; }
.cal td button:hover { filter: brightness(0.94); box-shadow: inset 0 0 0 2px var(--ink); }
.cal td button.some { background: #f7e6c8; }
.cal td button.full { background: var(--ink); color: #fff; }
.cal td button.closed { background: repeating-linear-gradient(135deg, #e7e3da 0 6px, #d8d3c8 6px 12px); color: var(--muted); }
.legend { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.sw { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--line); vertical-align: -2px; margin-right: -8px; }
.sw-free { background: #e5f1ec; } .sw-some { background: #f7e6c8; } .sw-full { background: var(--ink); }
.sw-closed { background: repeating-linear-gradient(135deg, #e7e3da 0 3px, #d8d3c8 3px 6px); }

/* Enquiry cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.enq { background: var(--paper); border: 1px solid var(--line); padding: 20px; display: grid; gap: 10px; align-content: start; }
.enq-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.enq h3 { font: 500 26px/1 var(--display); margin: 0; }
.enq dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.enq dt { color: var(--muted); text-transform: capitalize; }
.enq dd { margin: 0; }
.enq .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.enq select { width: auto; }
.wa { color: var(--ok); font-weight: 600; text-decoration: none; font-size: 14px; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 30; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(11,14,20,0.45); animation: fade 0.2s both; }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 100%); background: var(--bone); padding: 32px; overflow-y: auto; animation: slide 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.x { position: absolute; right: 18px; top: 14px; border: 0; background: none; font-size: 30px; cursor: pointer; color: var(--ink); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 22px 0; }
.facts div { border-top: 1px solid var(--line); padding-top: 8px; }
.facts dt { font: 500 11px/1 var(--giant); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-size: 15px; }
.bill { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 20px; }
.bill td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.bill td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.bill tr.total td { font-weight: 600; border-bottom: 0; }
.edit { display: grid; gap: 12px; background: var(--paper); border: 1px solid var(--line); padding: 18px; }
.edit label { display: grid; gap: 6px; font: 500 12px/1 var(--giant); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

/* Dialogs */
.dialog { border: 0; padding: 0; width: min(620px, calc(100% - 32px)); background: var(--bone); color: var(--ink); }
.dialog::backdrop { background: rgba(11,14,20,0.5); }
.dialog form { padding: 30px; display: grid; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.span2 { grid-column: span 2; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; font-size: 14px; opacity: 0; transition: 0.25s; pointer-events: none; z-index: 50; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Phones and small laptops */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { min-width: 0; }
  .side { position: static; height: auto; padding: 18px 16px; }
  .side-sub { margin-bottom: 12px; }
  #nav { grid-auto-flow: column; overflow-x: auto; }
  #nav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  #nav a.on { border-bottom-color: var(--ember); }
  .side-foot { display: none; }
  .main { padding: 24px 16px 60px; }
  h1 { font-size: 32px; }
  .filters input { width: 100%; }
  .form-grid, .facts { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .feed li { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
