/* ============================================================================
 * The Hattor · Operations — styles
 * Palette & fonts taken directly from thehattor.co.uk for a matching identity.
 * ========================================================================== */

:root {
  /* palette taken directly from the live thehattor.co.uk source */
  --blush: #e3a7ac;
  --blush-soft: #f7e7e2;
  --blush-deep: #cf8f95;
  --rose-ink: #a86a70;
  --rose: #cf8f95;
  --rose-dk: #b87b81;
  --gold: #bf9b4e;
  --gold-deep: #a9802f;
  --gold-pale: #e6cb86;
  --ivory: #fbf2ef;
  --paper: #fffdfc;
  --ink: #4a3f3b;
  --ink-soft: #7a6c66;
  --line: #f0ddd6;
  --ok: #5d8a63;
  --ok-bg: #e7f0e8;
  --hold: #b3833a;
  --hold-bg: #f6ecd6;
  --gone: #a8565f;
  --gone-bg: #f6e2e4;
  --info: #6a6f9c;
  --info-bg: #e8e8f2;

  --ff-display: 'Cormorant Garamond', Georgia, serif;
  --ff-script: 'Playfair Display', Georgia, serif;
  --ff-body: 'Montserrat', 'Segoe UI', sans-serif;

  --radius: 12px;
  --shadow: 0 1px 3px rgba(74, 63, 59, 0.06), 0 10px 30px rgba(168, 106, 112, 0.07);
  --sidebar: linear-gradient(180deg, #eaa9bb 0%, #d1899d 55%, #c67f95 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--ivory); color: var(--ink);
  font-family: var(--ff-body); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3 { font-family: var(--ff-display); font-weight: 500; }

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 246px; flex: 0 0 246px; background: var(--sidebar); color: #e8d9dd;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 26px 22px 18px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.22); }
.brand .logo { width: 92px; height: auto; margin: 0 auto 6px; display: block; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.25)); }
.brand .brand-name { font-family: var(--ff-script); font-style: italic; font-size: 1.9rem; color: var(--gold-pale); line-height: 1; }
.brand .tag { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: #fff0f4; margin-top: 4px; }

.nav { padding: 14px 12px; flex: 1; }
.nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; color: #fff2f6;
  padding: 11px 14px; margin-bottom: 3px; border-radius: 9px; font-size: 14.5px;
  font-family: var(--ff-body); transition: background 0.15s, color 0.15s;
}
.nav button .ico { width: 18px; text-align: center; color: #fff; opacity: 0.85; }
.nav button .nav-count {
  margin-left: auto; background: #fff; color: var(--rose-ink); font-size: 11px;
  font-weight: 700; min-width: 20px; text-align: center; padding: 1px 7px; border-radius: 20px;
}
.nav button:hover { background: rgba(255,255,255,0.16); color: #fff; }
.nav button.active { background: #fff2f6; color: var(--rose-ink); box-shadow: 0 2px 8px rgba(120,60,80,0.18); }
.nav button.active .ico { color: var(--gold-deep); opacity: 1; }

.sidebar .foot { padding: 14px; border-top: 1px solid rgba(255,255,255,0.22); display: flex; flex-direction: column; gap: 7px; }
.sidebar .foot button {
  background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.28);
  border-radius: 8px; padding: 8px; cursor: pointer; font-size: 12.5px; font-family: var(--ff-body);
}
.sidebar .foot button:hover { background: rgba(255,255,255,0.28); color: #fff; }
.sidebar .foot #btn-sample { background: var(--gold); color: #fff; border-color: var(--gold-deep); font-weight: 600; }
.sidebar .foot #btn-sample:hover { background: var(--gold-deep); }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 24px 36px 12px; gap: 16px; }
.topbar .title { font-size: 30px; margin: 0; color: var(--ink); }
.topbar .sub { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.content { padding: 10px 36px 64px; }

.btn {
  background: #c46a86; color: #fff; border: none; padding: 9px 17px; border-radius: 999px;
  cursor: pointer; font-weight: 700; font-size: 13px; letter-spacing: 0.04em;
  font-family: var(--ff-body); transition: background 0.18s, transform 0.15s;
}
.btn:hover { background: #af5673; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--rose-ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: var(--blush-soft); border-color: var(--rose-ink); transform: none; }
.btn.rose { background: var(--rose-ink); }
.btn.rose:hover { background: #834854; }
.btn.sm { padding: 6px 13px; font-size: 12px; }
.btn.danger { background: var(--gone); }
.btn.danger:hover { background: #8f4750; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--blush); }
.stat.accent::before { background: var(--gold); }
.stat.alert::before { background: var(--gone); }
.stat.good::before { background: var(--ok); }
.stat .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--rose-ink); font-weight: 700; }
.stat .value { font-family: var(--ff-display); font-size: 34px; margin-top: 6px; line-height: 1; color: var(--ink); }
.stat .value.small { font-size: 25px; }
.stat .hint { font-size: 12px; color: var(--ink-soft); margin-top: 7px; }

/* ---------- Panels ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 22px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 20px; color: var(--ink); }
.panel-head .eyebrow { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--rose-ink); font-weight: 700; }
.panel-body.pad { padding: 20px 22px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar input[type="search"], .toolbar select {
  padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink);
}
.toolbar input[type="search"] { min-width: 230px; }
.toolbar .spacer { flex: 1; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.9px; color: var(--rose-ink); font-weight: 700; padding: 12px 22px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody td { padding: 13px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--blush-soft); }
td .primary { font-weight: 700; color: var(--ink); }
td .hat-title { font-family: var(--ff-display); font-size: 16px; font-weight: 600; color: var(--ink); }
td .muted { color: var(--ink-soft); font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.actions-cell { white-space: nowrap; text-align: right; }
.actions-cell button { margin-left: 5px; }
.link { color: var(--rose-ink); cursor: pointer; border-bottom: 1px dotted var(--blush-deep); }
.link:hover { color: var(--gold-deep); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; letter-spacing: 0.02em; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.hold { background: var(--hold-bg); color: var(--hold); }
.badge.gone { background: var(--gone-bg); color: var(--gone); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.rose { background: var(--blush-soft); color: var(--rose-ink); }
.badge.gold { background: var(--gold-pale); color: var(--gold-deep); }
.badge.mute { background: #efe6e8; color: var(--ink-soft); }
.pill { display: inline-block; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; color: var(--ink-soft); background: var(--ivory); }
.pill.excl { border-color: var(--gold); color: var(--gold-deep); background: var(--gold-pale); font-weight: 700; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-soft); }
.empty .big { font-size: 40px; margin-bottom: 8px; color: var(--blush-deep); }

/* ---------- Two-column ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

/* ---------- Calendar ---------- */
.cal { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.cal-head h3 { margin: 0; font-size: 21px; }
.cal-nav button { background: var(--blush-soft); border: 1px solid var(--line); color: var(--rose-ink); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 16px; }
.cal-nav button:hover { background: var(--blush); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--rose-ink); font-weight: 700; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 92px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 7px; position: relative; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.out { background: #fcfafb; color: var(--ink-soft); }
.cal-cell.today { background: var(--blush-soft); }
.cal-cell .dnum { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.cal-cell.today .dnum { color: var(--rose-ink); }
.cal-ev { display: block; font-size: 11px; padding: 2px 6px; margin-top: 3px; border-radius: 5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.event { background: var(--gold-pale); color: var(--gold-deep); }
.cal-ev.hire { background: var(--blush-soft); color: var(--rose-ink); }
.cal-ev.due { background: var(--gone-bg); color: var(--gone); }
.cal-legend { display: flex; gap: 16px; padding: 12px 20px; font-size: 12px; color: var(--ink-soft); flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(60,43,48,0.42); display: flex; align-items: flex-start; justify-content: center; padding: 46px 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--paper); border-radius: 16px; width: 100%; max-width: 580px; box-shadow: 0 24px 60px rgba(60,43,48,0.3); overflow: hidden; }
.modal.wide { max-width: 760px; }
.modal-head { padding: 20px 26px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; background: var(--blush-soft); }
.modal-head h3 { margin: 0; font-size: 23px; color: var(--ink); }
.modal-head .x { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--rose-ink); line-height: 1; }
.modal-body { padding: 22px 26px; }
.modal-foot { padding: 16px 26px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.modal-foot .right { display: flex; gap: 10px; margin-left: auto; }

/* ---------- Forms ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--rose-ink); margin-bottom: 5px; letter-spacing: 0.02em; }
.field input, .field select, .field textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(179,141,78,0.14); }
.field textarea { min-height: 64px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.hint-text { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.form-error { background: var(--gone-bg); color: var(--gone); padding: 9px 13px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; }
.form-note { background: var(--gold-pale); color: var(--gold-deep); padding: 9px 13px; border-radius: 9px; font-size: 12.5px; margin-bottom: 14px; }

/* ---------- Detail list ---------- */
.detail-list { list-style: none; padding: 0; margin: 0; }
.detail-list li { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.detail-list li:last-child { border: none; }
.detail-list .k { color: var(--ink-soft); }
.detail-list .v { text-align: right; }
.section-title { font-family: var(--ff-display); font-size: 18px; margin: 22px 0 10px; color: var(--ink); }

.circle-meter { height: 8px; background: var(--blush-soft); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.circle-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--blush-deep), var(--gold)); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 10px 26px rgba(0,0,0,0.28); font-size: 14px; border-left: 3px solid var(--gold); animation: pop 0.2s ease; }
.toast.good { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--gone); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 900px) {
  .sidebar { width: 66px; flex-basis: 66px; }
  .brand .brand-name, .brand .tag, .nav button span:not(.ico):not(.nav-count), .sidebar .foot { display: none; }
  .brand .logo { width: 40px; }
  .nav button { justify-content: center; padding: 12px 0; }
  .nav button .nav-count { position: absolute; margin: 0; transform: translate(14px,-12px); }
  .two-col, .three-col, .grid2, .grid3 { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 18px; padding-right: 18px; }
}

/* ---------- Daily reports ---------- */
.report-band { margin: 26px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--blush); display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.report-band:first-child { margin-top: 4px; }
.report-band h2 { font-size: 24px; color: var(--rose-ink); margin: 0; }
.report-band span { font-size: 13px; color: var(--ink-soft); }

/* Print: run-sheet only, ink-friendly */
@media print {
  .sidebar, #view-action, .toast-wrap { display: none !important; }
  .main { width: 100%; }
  body { background: #fff; }
  .panel { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .topbar { padding-top: 0; }
  a[href]:after { content: ''; }
}

/* ---------- Admin guide ---------- */
.guide .guide-lead, .guide-lead { font-size: 16px; color: var(--ink-soft); max-width: 70ch; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.guide-toc a { font-size: 12.5px; font-weight: 700; color: var(--rose-ink); background: var(--blush-soft); border: 1px solid var(--line); padding: 6px 13px; border-radius: 999px; text-decoration: none; }
.guide-toc a:hover { background: var(--blush); color: #fff; }
.guide-body { font-size: 14.5px; color: var(--ink); line-height: 1.7; }
.guide-body p { margin: 0 0 12px; max-width: 74ch; }
.guide-body ul, .guide-body ol { margin: 0 0 12px; padding-left: 22px; max-width: 74ch; }
.guide-body li { margin-bottom: 7px; }
.guide-body h4 { font-family: var(--ff-display); font-size: 18px; color: var(--rose-ink); margin: 0 0 6px; }
.guide-card { background: var(--blush-soft); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.guide-card:last-child { margin-bottom: 0; }
.guide-card ul { margin-bottom: 0; }
.guide-ol { counter-reset: gstep; list-style: none; padding-left: 0; }
.guide-ol li { position: relative; padding-left: 40px; margin-bottom: 12px; }
.guide-ol li::before { counter-increment: gstep; content: counter(gstep); position: absolute; left: 0; top: -2px; width: 27px; height: 27px; border-radius: 50%; background: var(--rose); color: #fff; font-family: var(--ff-display); font-size: 16px; display: flex; align-items: center; justify-content: center; }
.guide-foot { font-family: var(--ff-display); font-size: 18px; color: var(--rose-ink); margin-top: 8px; }
.kbd { display: inline-block; font-family: var(--ff-body); font-size: 12px; font-weight: 700; background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; color: var(--ink); }
.warn-text { color: var(--gone); }

/* ---------- Customer event editor ---------- */
.ev-row { display: flex; gap: 8px; align-items: center; margin-bottom: 7px; }
.ev-row .ev-name { flex: 1; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; }
.ev-row .ev-date { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; }
.ev-row .ev-del { width: 32px; height: 32px; border: 1px solid var(--line); background: var(--blush-soft); color: var(--rose-ink); border-radius: 8px; cursor: pointer; flex: 0 0 auto; }
.ev-row .ev-del:hover { background: var(--gone-bg); color: var(--gone); }
