/* Dollhouse Diary — brand stylesheet (matched to dollhouse.hadley.it.com) */
:root {
  --bg: #0b0a0d;
  --bg2: #131117;
  --bg3: #191620;
  --gold: #c9a24b;
  --gold-soft: #e7d2a0;
  --ink: #f4efe8;
  --muted: #b0a8a0;
  --line: rgba(201, 162, 75, .26);
  --line-soft: rgba(201, 162, 75, .14);
  --ok: #7fc79a;
  --ok-bg: rgba(76, 175, 125, .16);
  --warn: #e3c27e;
  --warn-bg: rgba(233, 185, 73, .14);
  --bad: #e08a9b;
  --bad-bg: rgba(212, 87, 110, .16);
  --radius: 14px;
  --shadow: 0 2px 14px rgba(0, 0, 0, .45);
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-ui: Jost, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); font-size: 16px; line-height: 1.55;
  min-height: 100dvh;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--ink); letter-spacing: .4px; }
h1 em, .brand-name em { font-style: italic; color: var(--gold); }
a { color: var(--gold-soft); }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  background: var(--bg2); color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 10px 18px; padding-top: max(10px, env(safe-area-inset-top));
  position: sticky; top: 0; z-index: 40; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-logo-lg { height: 74px; margin: 0 auto; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--gold); color: var(--bg);
  font-family: var(--font-display); font-size: 24px; font-weight: 700;
}
.brand-mark-lg { width: 64px; height: 64px; font-size: 40px; margin: 0 auto; }
.brand-name { font-family: var(--font-display); font-size: 19px; letter-spacing: 2px; text-transform: uppercase; }
.topnav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.topnav a {
  color: var(--ink); text-decoration: none; padding: 9px 12px; border-radius: 9px; font-size: 15px;
  letter-spacing: .3px;
}
.topnav a:hover { background: var(--bg3); color: var(--gold-soft); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.bell { position: relative; color: var(--gold-soft); display: grid; place-items: center; padding: 8px; }
.bell-count {
  position: absolute; top: 0; right: 0; background: var(--gold); color: var(--bg);
  font-size: 11px; font-weight: 700; border-radius: 9px; padding: 1px 5px;
}
.usermenu summary {
  list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 9px;
  border: 1px solid var(--line); font-size: 15px; white-space: nowrap; color: var(--gold-soft);
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu { position: relative; }
.usermenu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--bg3);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 180px; padding: 8px; display: flex; flex-direction: column; z-index: 50;
}
.usermenu-panel a, .usermenu-panel .linklike { padding: 10px 12px; text-decoration: none; border-radius: 8px; text-align: left; color: var(--ink); }
.usermenu-panel a:hover, .usermenu-panel .linklike:hover { background: var(--bg2); color: var(--gold-soft); }

/* ---- layout ---- */
.page { max-width: 1180px; margin: 0 auto; padding: 22px 18px 90px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-title { font-size: 32px; margin: 8px 0 18px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.card {
  background: var(--bg2); border: 1px solid var(--line-soft);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.card h2 { margin: 0 0 12px; font-size: 22px; }
.card-accent { border-top: 3px solid var(--gold); }
.card-nudge { border-top: 3px solid var(--gold-soft); }
.big-number { font-family: var(--font-display); font-size: 40px; margin: 4px 0; color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 14px; }
.inline { display: inline; }
code { color: var(--gold-soft); }

/* ---- buttons & forms ---- */
.btn {
  display: inline-block; border: 1px solid transparent; border-radius: 11px; cursor: pointer;
  padding: 12px 20px; font-size: 16px; text-decoration: none; font-family: var(--font-ui);
  min-height: 44px; line-height: 1.2; letter-spacing: .4px;
}
.btn-primary { background: var(--gold); color: var(--bg); font-weight: 600; }
.btn-primary:hover { background: var(--gold-soft); }
.btn-ghost { background: transparent; color: var(--gold-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg3); }
.btn-danger { background: var(--bad); color: #1a0d11; font-weight: 600; }
.btn-danger:hover { background: #ef9fae; }
.btn-danger-ghost { color: var(--bad); border-color: rgba(224, 138, 155, .4); }
.btn-danger-ghost:hover { background: var(--bad-bg); }
.impact-list { margin: 8px 0 18px; padding-left: 20px; line-height: 1.8; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; min-height: 36px; font-size: 14px; }
.linklike { background: none; border: none; color: var(--gold-soft); cursor: pointer; font-size: 15px; padding: 0; text-decoration: underline; }

label { display: block; margin: 14px 0 6px; font-weight: 500; font-size: 15px; color: var(--gold-soft); }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 12px 14px; font-size: 16px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--bg3); color: var(--ink); font-family: var(--font-ui);
  min-height: 44px;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
input[type="date"], input[type="time"], input[type="datetime-local"] { color-scheme: dark; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 10px 0; color: var(--ink); }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--gold); }
fieldset { border: 1px solid var(--line-soft); border-radius: 11px; margin: 16px 0; padding: 10px 14px; }
legend { font-weight: 500; padding: 0 6px; color: var(--gold-soft); }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.form-error { color: var(--bad); font-weight: 600; margin: 6px 0; }
.form-card { max-width: 560px; }
.code-input { text-align: center; font-size: 28px; letter-spacing: 10px; }

/* ---- flash & toast ---- */
.flash { max-width: 1180px; margin: 14px auto 0; padding: 13px 18px; border-radius: 11px; font-weight: 500; }
.flash-success { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); }
.flash-info { background: var(--bg3); color: var(--gold-soft); border: 1px solid var(--line); }
.update-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--bg3); color: var(--ink); border: 1px solid var(--gold);
  padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow);
}
.update-toast button { margin-left: 10px; background: var(--gold); color: var(--bg); border: none; border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 700; }

/* ---- install banner ---- */
.install-banner {
  max-width: 1180px; margin: 14px auto 0; padding: 12px 18px; border-radius: 11px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.install-actions { display: flex; align-items: center; gap: 12px; }
.ios-steps { margin: 12px 0; padding-left: 20px; line-height: 1.7; }
.ios-steps li { margin-bottom: 6px; }
.brand-wordmark {
  font-family: var(--font-display); font-size: 22px; letter-spacing: 4px;
  color: var(--gold); text-transform: uppercase;
}
.brand-wordmark-lg { font-size: 30px; display: block; text-align: center; }

/* ---- pills, rows, feed ---- */
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; vertical-align: middle; letter-spacing: .3px; }
.pill-provisional { background: var(--warn-bg); color: var(--warn); }
.pill-confirmed, .pill-ok, .pill-completed { background: var(--ok-bg); color: var(--ok); }
.pill-cancelled, .pill-no_show, .pill-off { background: rgba(176, 168, 160, .15); color: var(--muted); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-role { background: var(--gold); color: var(--bg); }
.rowlink { display: block; padding: 10px 8px; border-radius: 9px; text-decoration: none; color: var(--ink); }
.rowlink:hover { background: var(--bg3); }
.feed-item { margin: 8px 0; }
.meter { display: block; height: 10px; background: var(--bg3); border-radius: 999px; overflow: hidden; border: 1px solid var(--line-soft); }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); }
.meter-row { padding: 8px; }
.meter-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }

/* ---- tables ---- */
.table-card { padding: 8px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; padding: 12px; color: var(--gold-soft); font-weight: 500; border-bottom: 1px solid var(--line); white-space: nowrap; letter-spacing: .4px; }
.table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.row-inactive td { opacity: .5; }
.pager { display: flex; gap: 10px; padding: 12px; }

/* ---- enquiry pipeline ---- */
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.pipeline-col h2 { font-size: 20px; }
.pipeline-card { display: block; margin-bottom: 10px; padding: 14px; text-decoration: none; color: var(--ink); }
.pipeline-card:hover { border-color: var(--gold); }

/* ---- filter bar & field rows ---- */
.filter-bar { display: flex; gap: 10px; margin: 0 0 16px; flex-wrap: wrap; }
.filter-bar input[type="search"] { flex: 1; min-width: 200px; }
.filter-bar select { width: auto; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row > div { flex: 1; min-width: 150px; }
.field-row-tight { align-items: center; gap: 8px; margin: 4px 0; }
.form-wide { max-width: 860px; }
.form-card h2 { margin-top: 22px; font-size: 19px; border-bottom: 1px solid var(--line-soft); padding-bottom: 6px; }
.table-scroll { overflow-x: auto; }
.unread { border-left: 3px solid var(--gold); padding-left: 10px; }
.matrix-table td { padding: 6px 4px; text-align: center; }
.matrix-table td:first-child { text-align: left; white-space: nowrap; }
.matrix-table th.daycol { padding: 6px 4px; text-align: center; line-height: 1.15; }
.matrix-table th.daycol .dow {
  display: block; font-size: 10px; font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase; color: var(--muted);
}
.matrix-table th.daycol .dnum { display: block; font-size: 13px; color: var(--gold-soft); }
.matrix-table .weekend { background: rgba(201, 162, 75, .07); }
.matrix-table th.weekend .dow { color: var(--gold); }
.matrix-table .today-col { background: rgba(201, 162, 75, .16); }
.matrix-table th.today-col .dnum { color: var(--gold); font-weight: 700; }
/* Keep the name visible while panning across the month. */
.matrix-table th:first-child,
.matrix-table td:first-child {
  position: sticky; left: 0; z-index: 2;
  background: var(--bg2); border-right: 1px solid var(--line);
}

/* ---- availability & diary grids ---- */
.avail-grid, .diary-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.grid-dow { text-align: center; font-weight: 600; color: var(--gold-soft); font-size: 13px; padding: 4px 0; letter-spacing: .5px; }
.day {
  min-height: 74px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--bg3);
  padding: 6px; cursor: pointer; position: relative; font-size: 14px; user-select: none;
  -webkit-user-select: none; touch-action: manipulation; color: var(--ink);
}
.day[disabled], .day.day-empty { background: transparent; border-color: transparent; cursor: default; }
.day .d-num { font-weight: 600; }
.day.today { outline: 2px solid var(--gold); }
.day .d-note { position: absolute; bottom: 4px; left: 6px; right: 6px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-available { background: var(--ok-bg); border-color: var(--ok); }
.day-ask_first { background: var(--warn-bg); border-color: var(--warn); }
.day-unavailable { background: var(--bad-bg); border-color: var(--bad); }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; border: 1px solid rgba(0, 0, 0, .3); }
.dot-available { background: #4caf7d; }
.dot-ask_first { background: #e9b949; }
.dot-unavailable { background: #d4576e; }
.dot-none { background: #565059; }

.viab { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; }
.viab-strong, .day-viab-strong { background: var(--ok-bg); color: var(--ok); }
.day-viab-strong { border-color: var(--ok); }
.viab-possible, .day-viab-possible { background: var(--warn-bg); color: var(--warn); }
.day-viab-possible { border-color: var(--warn); }
.viab-limited, .day-viab-limited { background: var(--bad-bg); color: var(--bad); }
.day-viab-limited { border-color: var(--bad); }
.viab-awaiting, .day-viab-awaiting { background: var(--bg3); color: var(--muted); }
.day-booking {
  display: block; font-size: 11.5px; background: var(--gold); color: var(--bg); font-weight: 600;
  border-radius: 6px; padding: 2px 6px; margin-top: 3px; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.day-block { display: block; font-size: 11.5px; background: var(--bg); color: var(--gold-soft); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; margin-top: 3px; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-label { font-family: var(--font-display); font-size: 21px; min-width: 150px; text-align: center; color: var(--gold-soft); }
.month-select { width: auto; min-width: 165px; font-family: var(--font-display); font-size: 18px; text-align: center; color: var(--gold-soft); }
.month-list { list-style: none; margin: 8px 0 0; padding: 0; }
.month-list li { border-bottom: 1px solid var(--line-soft); }
.month-list li:last-child { border-bottom: none; }
.month-list .rowlink { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.note-dialog { border: 1px solid var(--line); background: var(--bg2); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; max-width: 420px; width: 92vw; }
.note-dialog::backdrop { background: rgba(0, 0, 0, .65); }

/* ---- auth ---- */
.minimal { display: grid; place-items: center; padding: 20px; }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-brand h1 { font-size: 30px; letter-spacing: 4px; text-transform: uppercase; margin: 12px 0 2px; }
.auth-sub { color: var(--muted); margin: 0 0 8px; }
.auth-card h2 { margin-top: 0; }
.auth-links { margin-top: 16px; text-align: center; }

/* ---- bottom nav (mobile) ---- */
.bottomnav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: var(--bg2); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 4px 7px; text-decoration: none; color: var(--muted); font-size: 12px; min-height: 52px;
}
.bn-ico { font-size: 18px; color: var(--gold); }

@media (max-width: 860px) {
  .topnav { display: none; }
  .bottomnav { display: flex; }
  .page { padding-bottom: 96px; }
  .page-title { font-size: 26px; }
  .avail-grid, .diary-grid { gap: 4px; }
  .day { min-height: 64px; font-size: 13px; }
}
