/* ============ Cabin — cabin.juliemsp.com ============ */
:root {
  --forest: #2f4a3d;
  --forest-dark: #22382d;
  --moss: #5c7a5a;
  --pine: #3d6b4f;
  --wood: #b0824f;
  --wood-light: #d8b88a;
  --sand: #f5f0e6;
  --cream: #fbf8f1;
  --ink: #2b2b28;
  --muted: #6f6b62;
  --line: #e3dccd;
  --ok: #3d8b5f;
  --low: #d9922b;
  --out: #c0472f;
  --shadow: 0 2px 10px rgba(40, 55, 45, 0.12);
  --radius: 12px;
}

* { box-sizing: border-box; }
/* The `hidden` attribute must always win over component display rules
   (.modal-overlay, .login-screen and .app-screen all set display:flex). */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.45;
}
h1, h2, h3 { font-family: "Georgia", "Times New Roman", serif; color: var(--forest-dark); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid transparent; border-radius: 8px; padding: 0.5rem 0.9rem;
  font-size: 0.9rem; font-weight: 600; background: #fff; color: var(--ink);
  transition: filter 0.15s, background 0.15s;
}
.btn:hover { filter: brightness(0.97); }
.btn-primary { background: var(--pine); color: #fff; }
.btn-primary:hover { background: var(--forest); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--forest-dark); }
.btn-ghost:hover { background: rgba(0,0,0,0.05); }
.btn-danger { background: #fff; color: var(--out); border-color: var(--out); }
.btn-danger:hover { background: var(--out); color: #fff; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(160deg, var(--forest) 0%, var(--forest-dark) 55%, #1a2c22 100%);
}
.login-card {
  background: var(--cream); border-radius: 18px; box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  padding: 2.25rem 2rem; width: 100%; max-width: 380px;
}
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-logo { font-size: 2.75rem; display: block; }
.login-brand h1 { margin: 0.35rem 0 0.15rem; font-size: 1.9rem; }
.login-tagline { margin: 0; color: var(--muted); font-size: 0.9rem; }
.login-form { display: flex; flex-direction: column; gap: 0.9rem; }
.login-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.login-form input {
  padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.login-form input:focus { outline: 2px solid var(--moss); border-color: var(--moss); }
.login-error { color: var(--out); font-size: 0.85rem; margin: 0; text-align: center; }

/* ---------- App shell ---------- */
.app-screen { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--forest); color: var(--sand); padding: 0.6rem 1rem; box-shadow: var(--shadow);
}
.topbar-brand { font-family: Georgia, serif; font-size: 1.2rem; font-weight: 700; color: #fff; }
.tabs { display: flex; gap: 0.25rem; flex: 1; flex-wrap: wrap; }
.tab {
  background: transparent; border: none; color: var(--wood-light); padding: 0.45rem 0.8rem;
  border-radius: 8px; font-weight: 600; font-size: 0.9rem;
}
.tab:hover { background: rgba(255,255,255,0.08); color: #fff; }
.tab.active { background: var(--sand); color: var(--forest-dark); }
.topbar-user { display: flex; align-items: center; gap: 0.5rem; }
.user-name { font-size: 0.85rem; color: var(--wood-light); }
.topbar .btn-ghost { color: var(--wood-light); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,0.1); color: #fff; }

.content { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.panel-head h2 { margin: 0; }
.panel-hint { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 1rem; }

/* ---------- Calendar ---------- */
.cal-controls { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 0.75rem 0; }
.cal-controls h3 { margin: 0; min-width: 12rem; text-align: center; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-dow { background: var(--forest); color: var(--sand); text-align: center; padding: 0.4rem 0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.cal-cell { background: #fff; min-height: 84px; padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.cal-cell.other { background: #f2efe7; }
.cal-cell.today { outline: 2px solid var(--wood); outline-offset: -2px; }
.cal-daynum { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.cal-chip { font-size: 0.68rem; padding: 1px 5px; border-radius: 5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }

.upcoming { margin-top: 1.5rem; }
.reservation-list { display: flex; flex-direction: column; gap: 0.5rem; }
.res-row { display: flex; align-items: center; gap: 0.75rem; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--pine); border-radius: 10px; padding: 0.6rem 0.8rem; box-shadow: var(--shadow); }
.res-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.res-main { flex: 1; }
.res-who { font-weight: 700; color: var(--forest-dark); }
.res-when { font-size: 0.85rem; color: var(--muted); }
.res-note { font-size: 0.85rem; color: var(--ink); margin-top: 2px; }

/* ---------- Cards / lists ---------- */
.card-list { display: flex; flex-direction: column; gap: 0.5rem; }
.inv-row { display: flex; align-items: center; gap: 0.75rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.8rem; box-shadow: var(--shadow); }
.inv-main { flex: 1; }
.inv-name { font-weight: 600; }
.inv-cat { font-size: 0.78rem; color: var(--muted); }
.chip { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; color: #fff; }
.chip.ok { background: var(--ok); }
.chip.low { background: var(--low); }
.chip.out { background: var(--out); }

/* ---------- Wishlist ---------- */
.inline-add { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.inline-add input { flex: 1; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; }
.wishlist-list { display: flex; flex-direction: column; gap: 0.4rem; }
.wish-row { display: flex; align-items: center; gap: 0.6rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0.55rem 0.8rem; }
.wish-row.done .wish-text { text-decoration: line-through; color: var(--muted); }
.wish-text { flex: 1; }
.wish-by { font-size: 0.75rem; color: var(--muted); }

/* ---------- Boats ---------- */
.boats-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.boat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.boat-card h3 { margin: 0 0 0.75rem; }
.gauge { height: 22px; background: #eee; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.gauge-fill { height: 100%; background: linear-gradient(90deg, var(--out), var(--low) 45%, var(--ok)); transition: width 0.3s; }
.boat-meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; }
.boat-set { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
.boat-set input[type=range] { flex: 1; }

/* ---------- Status ---------- */
.status-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.status-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); position: relative; }
.status-card h3 { margin: 0 0 0.6rem; display: flex; align-items: center; gap: 0.5rem; }
.status-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; font-size: 0.92rem; }
.status-row .label { color: var(--muted); }
.status-row .value { font-weight: 600; text-align: right; }
.reminder-badge { position: absolute; top: 0.8rem; right: 0.8rem; font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; }
.reminder-badge.due { background: var(--out); color: #fff; }
.reminder-badge.ok { background: #e7f0e9; color: var(--pine); }
.wifi-cred { background: var(--sand); border: 1px dashed var(--wood); border-radius: 8px; padding: 0.6rem 0.75rem; margin-top: 0.5rem; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.wifi-cred .k { color: var(--muted); font-size: 0.75rem; }
.wifi-cred .v { font-weight: 700; }
.pill { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 999px; }
.pill.up { background: #e7f0e9; color: var(--pine); }
.pill.down { background: #f3e2d8; color: var(--wood); }
.status-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(30,40,32,0.55); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 100; }
.modal { background: var(--cream); border-radius: var(--radius); width: 100%; max-width: 440px; box-shadow: 0 20px 50px rgba(0,0,0,0.35); max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-close { background: none; border: none; font-size: 1.1rem; color: var(--muted); }
.modal-body { padding: 1.25rem; }
.form-field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.9rem; }
.form-field label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.form-field input, .form-field select, .form-field textarea {
  padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.form-field textarea { resize: vertical; min-height: 60px; }
.form-row { display: flex; gap: 0.75rem; }
.form-row .form-field { flex: 1; }
.modal-actions { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.5rem; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); background: var(--forest-dark); color: #fff; padding: 0.6rem 1.1rem; border-radius: 999px; font-size: 0.9rem; box-shadow: var(--shadow); z-index: 200; }
.toast.error { background: var(--out); }

.empty { color: var(--muted); font-style: italic; padding: 1rem 0; text-align: center; }

@media (max-width: 620px) {
  .cal-cell { min-height: 60px; }
  .topbar { gap: 0.5rem; }
  .user-name { display: none; }
}

/* ============ Home: message board + week calendar ============ */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 820px) {
  .home-grid { grid-template-columns: 1fr; }
}
.home-left, .home-right {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.message-form { display: flex; gap: 0.5rem; margin-bottom: 0.9rem; }
.message-form textarea {
  flex: 1; resize: vertical; min-height: 2.6rem;
  border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.6rem;
}
.message-list { display: flex; flex-direction: column; gap: 0.6rem; max-height: 60vh; overflow-y: auto; }
.msg {
  border-left: 4px solid var(--pine);
  background: var(--sand);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}
.msg-head { display: flex; align-items: center; gap: 0.5rem; }
.msg-author { font-weight: 700; color: var(--forest-dark); }
.msg-time { color: var(--muted); font-size: 0.8rem; }
.msg-del { margin-left: auto; padding: 0.15rem 0.45rem; }
.msg-text { white-space: pre-wrap; margin-top: 0.2rem; }

/* Week calendar */
.week-controls { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.75rem; }
.week-controls h3 { flex: 1; text-align: center; margin: 0; font-size: 1rem; }
.week-view { display: flex; flex-direction: column; gap: 0.4rem; }
.week-day {
  display: flex; gap: 0.6rem; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem 0.6rem;
}
.week-day.today { border-color: var(--pine); background: rgba(61, 107, 79, 0.06); }
.week-dow { display: flex; flex-direction: column; align-items: center; min-width: 2.6rem; }
.week-dow-name { font-size: 0.72rem; text-transform: uppercase; color: var(--muted); }
.week-dow-num { font-weight: 700; font-size: 1.1rem; }
.week-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; flex: 1; }
.week-empty { color: var(--muted); }

/* ============ Kitchen: four columns ============ */
.pantry-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 1000px) { .pantry-cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pantry-cols { grid-template-columns: 1fr; } }
.pantry-col {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.75rem 0.85rem; box-shadow: var(--shadow);
}
.pantry-col .panel-head { margin-bottom: 0.4rem; }
.pantry-col h3 { margin: 0; font-size: 1rem; }

/* ============ Toggle (fishing license, fresh sheets) ============ */
.toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; color: var(--ink); cursor: pointer;
}
.toggle input { width: 1.05rem; height: 1.05rem; }

/* ============ Bedrooms block ============ */
.bedrooms-block { margin-top: 1.5rem; }
.block-title { margin: 0 0 0.6rem; }
.bedroom-card .reminder-badge.ok { background: var(--ok); }
.bedroom-card .reminder-badge.due { background: var(--wood); }
