/* The Skyfall Residence — reservations desk */

:root {
  --ivory: #f7f4ed;
  --cream: #efe9dd;
  --pine: #16281f;
  --pine-soft: #21382b;
  --brass: #a98f5b;
  --brass-light: #c3ac7e;
  --brass-text: #8a7142;
  --ink: #20241f;
  --muted: #6d7167;
  --line: rgba(22, 40, 31, 0.16);
  --red: #8c3a2b;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h2, h3, .name { font-family: var(--serif); font-weight: 500; }
code { font-size: 0.85em; background: var(--cream); padding: 0.1em 0.4em; }

.btn {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  padding: 0.9em 2em; border: 1px solid var(--pine);
  background: var(--pine); color: var(--ivory); cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.btn:hover { background: transparent; color: var(--pine); }
.btn.ghost { background: transparent; color: var(--pine); }
.btn.ghost:hover { background: var(--pine); color: var(--ivory); }
.btn.danger { border-color: var(--red); background: transparent; color: var(--red); }
.btn.danger:hover { background: var(--red); color: var(--ivory); }
.btn.small { padding: 0.6em 1.3em; font-size: 0.65rem; }

/* ---- login ---- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--pine); padding: 1.5rem;
}
.login-card {
  background: var(--ivory); padding: 3rem; width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 0.9rem; border: 1px solid var(--brass);
}
.login-card .brand { text-align: center; margin-bottom: 1rem; }
.login-card .name { font-size: 1.9rem; }
.login-card .sub { font-size: 0.6rem; letter-spacing: 0.4em; text-transform: uppercase; color: var(--brass-text); }
.login-card label { font-size: 0.64rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }
.login-card input {
  border: 1px solid var(--line); background: transparent; padding: 0.85em 1em;
  font-family: var(--sans); font-size: 1rem; border-radius: 0;
}
.login-card input:focus { outline: none; border-color: var(--brass); }
.login-msg { color: var(--red); font-size: 0.85rem; min-height: 1.3em; text-align: center; }

/* ---- topbar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 0.9rem clamp(1rem, 3vw, 2.5rem);
  background: var(--pine); color: var(--ivory);
  flex-wrap: wrap;
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { display: flex; flex-direction: column; line-height: 1.2; }
.topbar .name { font-size: 1.3rem; }
.topbar .sub { font-size: 0.52rem; letter-spacing: 0.4em; text-transform: uppercase; opacity: 0.75; }
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tabs button {
  font-family: var(--sans); font-size: 0.68rem; font-weight: 400; letter-spacing: 0.18em; text-transform: uppercase;
  background: transparent; border: 1px solid transparent; color: rgba(247, 244, 237, 0.75);
  padding: 0.6em 1.2em; cursor: pointer; transition: color 0.25s, border-color 0.25s;
}
.tabs button:hover { color: var(--ivory); }
.tabs button.active { color: var(--ivory); border-color: var(--brass); }
.top-actions { display: flex; gap: 1.2rem; align-items: center; }
.top-actions a, .top-actions button {
  font-family: var(--sans); font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(247, 244, 237, 0.75); background: none; border: none; cursor: pointer; text-decoration: none;
}
.top-actions a:hover, .top-actions button:hover { color: var(--ivory); }

/* ---- stats ---- */
.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line); background: var(--cream);
}
.stat-tile { padding: 1.4rem 1rem; text-align: center; border-left: 1px solid var(--line); }
.stat-tile:first-child { border-left: none; }
.stat-tile .num { font-family: var(--serif); font-size: 2rem; line-height: 1.1; }
.stat-tile .num.alert { color: var(--brass-text); }
.stat-tile .lbl { font-size: 0.6rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 700px) { .stat-row { grid-template-columns: 1fr 1fr; } }

/* ---- main ---- */
main { padding: clamp(1.5rem, 3vw, 2.5rem); max-width: 1200px; margin: 0 auto; }
.panel-head { margin: 2rem 0 1.2rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.panel-head:first-child { margin-top: 0; }
.panel-head h2 { font-size: 1.8rem; }
.sub-note { font-size: 0.88rem; color: var(--muted); max-width: 72ch; }

/* ---- request cards ---- */
.req-card {
  border: 1px solid var(--line); background: #fff;
  padding: 1.4rem 1.6rem; margin-bottom: 1rem;
  display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem;
}
.req-card.overdue { border-left: 3px solid var(--brass); }
.req-card .who { font-family: var(--serif); font-size: 1.35rem; }
.req-card .meta { font-size: 0.88rem; color: var(--muted); }
.req-card .meta strong { color: var(--ink); font-weight: 400; }
.req-card .msg { font-size: 0.9rem; color: var(--muted); font-style: italic; margin-top: 0.5rem; max-width: 62ch; }
.req-card .actions { display: flex; flex-direction: column; gap: 0.5rem; align-items: stretch; justify-content: center; min-width: 170px; }
.badges { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.badge {
  display: inline-block; font-size: 0.58rem; letter-spacing: 0.22em; text-transform: uppercase;
  padding: 0.35em 0.9em; border: 1px solid currentColor;
}
.badge.days { color: var(--brass-text); }
.badge.conflict { color: var(--red); }
.badge.overdue-b { color: var(--brass-text); background: rgba(169, 143, 91, 0.12); }
.decline-box { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 1rem; display: flex; gap: 0.7rem; flex-wrap: wrap; }
.decline-box input { flex: 1; min-width: 220px; border: 1px solid var(--line); padding: 0.7em 1em; font-family: var(--sans); border-radius: 0; }
.decline-box input:focus { outline: none; border-color: var(--brass); }
.empty-note { color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 1.15rem; padding: 2rem 0; }
@media (max-width: 700px) { .req-card { grid-template-columns: 1fr; } }

/* ---- table ---- */
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chips button {
  font-family: var(--sans); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 0.45em 1.1em; cursor: pointer;
}
.chips button.active { border-color: var(--pine); color: var(--pine); background: #fff; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 760px; }
th {
  text-align: left; font-weight: 400; font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 0.85rem 1rem; border-bottom: 1px solid rgba(22, 40, 31, 0.07); vertical-align: middle; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td .status {
  font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; padding: 0.3em 0.8em; border: 1px solid currentColor;
}
.status.pending { color: #8a6d2f; }
.status.approved { color: #2e5339; }
.status.declined, .status.cancelled { color: var(--red); }

/* ---- occupancy calendar ---- */
.occ-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 2.5rem; }
@media (max-width: 860px) { .occ-months { grid-template-columns: 1fr; } }
.occ-month { border: 1px solid var(--line); background: #fff; padding: 1.1rem; }
.occ-month .m-title { font-family: var(--serif); font-size: 1.15rem; text-align: center; margin-bottom: 0.7rem; }
.occ-month .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.occ-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; color: var(--ink); background: var(--ivory);
}
.occ-day.blank { background: transparent; }
.occ-day.past { color: rgba(32, 36, 31, 0.25); }
.occ-day.res { background: var(--pine); color: var(--ivory); }
.occ-day.block { background: var(--brass); color: var(--ivory); }
.occ-day.ext { background: #9aa39b; color: var(--ivory); }
.legend { display: flex; gap: 1.4rem; font-size: 0.78rem; color: var(--muted); flex-wrap: wrap; }
.legend .sw { display: inline-block; width: 12px; height: 12px; margin-right: 0.45em; vertical-align: -1px; }
.sw-res { background: var(--pine); }
.sw-block { background: var(--brass); }
.sw-ext { background: #9aa39b; }

/* ---- forms / blocks / sync ---- */
.block-form { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1.4rem; background: #fff; border: 1px solid var(--line); padding: 1.2rem; }
.bf-field { display: flex; flex-direction: column; gap: 0.35rem; }
.bf-field.grow { flex: 1; min-width: 220px; }
.bf-field label { font-size: 0.6rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.bf-field input { border: 1px solid var(--line); padding: 0.65em 0.9em; font-family: var(--sans); border-radius: 0; min-height: 44px; }
.bf-field input:focus { outline: none; border-color: var(--brass); }

.row-item {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: #fff; border: 1px solid var(--line); padding: 0.9rem 1.2rem; margin-bottom: 0.6rem; flex-wrap: wrap;
}
.row-item .r-main { font-size: 0.92rem; }
.row-item .r-sub { font-size: 0.78rem; color: var(--muted); }
.row-item .r-sub.err { color: var(--red); }

.sync-export, .sync-import { margin-bottom: 2.5rem; }
.sync-export h3, .sync-import h3 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.copy-row { display: flex; gap: 0.7rem; margin: 0.9rem 0; max-width: 640px; }
.copy-row input {
  flex: 1; border: 1px solid var(--line); background: #fff; padding: 0.7em 1em;
  font-family: var(--sans); font-size: 0.88rem; color: var(--muted); border-radius: 0; min-width: 0;
}
.fetch-log { font-size: 0.8rem; color: var(--muted); }
.fetch-log .fl-title { font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; margin: 0.8rem 0 0.3rem; }
.fetch-log ul { list-style: none; }
.fetch-log li { padding: 0.2rem 0; border-top: 1px solid rgba(22, 40, 31, 0.07); }

.warn-banner {
  border: 1px solid var(--brass); background: rgba(169, 143, 91, 0.1);
  padding: 0.9rem 1.2rem; margin-bottom: 1.2rem; font-size: 0.88rem; color: var(--brass-text);
}

/* ---- toast ---- */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--pine); color: var(--ivory); padding: 0.9em 1.8em;
  font-size: 0.85rem; opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s;
  z-index: 100; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }
