/* Boulders Scheduler. Desert luxury theme. */
:root {
  --background: #f8f1e9;
  --foreground: #3f2e1e;
  --primary: #166534;
  --primary-dark: #10502a;
  --primary-foreground: #fff;
  --accent: #d97706;
  --accent-foreground: #fff;
  --muted: #e6d9c7;
  --muted-text: #8a7357;
  --border: #d1b48c;
  --card: #fffdf9;
  --danger: #b91c1c;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(63, 46, 30, 0.08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--background);
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}
h1, h2, h3 { margin: 0 0 8px; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 24px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
p { margin: 0 0 10px; }
a { color: var(--primary); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(248, 241, 233, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--primary); }
.brand svg { flex: 0 0 auto; }
.topbar .who { font-size: 13px; color: var(--muted-text); text-align: right; }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.wide { max-width: 1100px; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px;
}
.card.tight { padding: 12px; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted-text); margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; padding: 12px; font-size: 16px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--foreground); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.12); }

button {
  font-size: 16px; font-weight: 700; padding: 13px 18px;
  border: none; border-radius: 12px; cursor: pointer;
  background: var(--primary); color: var(--primary-foreground);
  width: 100%; margin-top: 14px; transition: transform 0.05s ease, opacity 0.15s;
}
button:active { transform: scale(0.985); }
button:disabled { opacity: 0.55; }
button.secondary { background: var(--muted); color: var(--foreground); }
button.accent { background: var(--accent); color: var(--accent-foreground); }
button.danger { background: var(--danger); color: #fff; }
button.small { width: auto; padding: 8px 14px; font-size: 14px; margin: 0; border-radius: 10px; }
button.link { background: none; color: var(--primary); width: auto; padding: 4px; margin: 0; font-weight: 600; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: rgba(255, 253, 249, 0.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; background: none; color: var(--muted-text); margin: 0;
  border-radius: 0; padding: 9px 2px 8px; font-size: 11px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tabbar button.active { color: var(--primary); }
.tabbar svg { width: 22px; height: 22px; }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.pill.approved { background: #dcefe2; color: var(--primary); }
.pill.pending { background: #fdeccc; color: #92400e; }
.pill.denied, .pill.inactive { background: #fbdddd; color: var(--danger); }
.pill.admin { background: var(--primary); color: #fff; }
.pill.holiday { background: var(--accent); color: #fff; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row > * { margin: 0; }
.cols { display: flex; gap: 10px; }
.cols > * { flex: 1; }
.stack-list > div { padding: 12px 0; border-bottom: 1px solid var(--muted); }
.stack-list > div:last-child { border-bottom: none; }
.dim { color: var(--muted-text); font-size: 13px; }
.msg { padding: 12px; border-radius: 10px; margin-top: 12px; font-size: 14px; display: none; }
.msg.err { background: #fbdddd; color: var(--danger); display: block; }
.msg.ok { background: #dcefe2; color: var(--primary); display: block; }

.day-head { font-weight: 800; color: var(--primary); margin: 18px 0 6px; font-size: 15px; }
.shift-card {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-left: 5px solid var(--primary);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
}
.shift-card .time { font-weight: 800; font-size: 17px; }
.shift-card .role { color: var(--muted-text); font-size: 14px; }

/* Admin grid */
.grid-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
table.sched { border-collapse: collapse; min-width: 760px; width: 100%; font-size: 13px; }
table.sched th, table.sched td { border: 1px solid var(--muted); padding: 6px; vertical-align: top; }
table.sched th { background: var(--primary); color: #fff; position: sticky; top: 0; font-size: 12px; }
table.sched th.today { background: var(--accent); }
table.sched td.name-cell {
  position: sticky; left: 0; background: var(--card); font-weight: 700;
  min-width: 110px; max-width: 130px; z-index: 5; font-size: 13px;
}
table.sched td.day-cell { min-width: 96px; cursor: pointer; }
table.sched td.day-cell:active { background: var(--muted); }
table.sched td.closed { background: repeating-linear-gradient(45deg, #f3e4cf, #f3e4cf 6px, #efdcc2 6px, #efdcc2 12px); }
table.sched td.off { background: #fdeccc; }
.chip {
  background: #dcefe2; border: 1px solid var(--primary); color: var(--primary-dark);
  border-radius: 8px; padding: 3px 6px; margin: 1px 0; font-size: 12px; font-weight: 600; display: block;
}
.chip .r { display: block; font-weight: 500; color: var(--muted-text); font-size: 11px; }
.off-chip { color: #92400e; font-size: 11px; font-weight: 700; }

/* Modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(63, 46, 30, 0.45); z-index: 50;
  display: none; align-items: flex-end; justify-content: center;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--card); border-radius: 18px 18px 0 0; width: 100%; max-width: 560px;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 88dvh; overflow-y: auto;
}
@media (min-width: 600px) {
  .modal-back { align-items: center; }
  .modal { border-radius: 18px; }
}

.footer-legal { color: var(--muted-text); font-size: 11px; margin-top: 16px; text-align: center; }
.center { text-align: center; }
.auth-logo { text-align: center; margin: 26px 0 6px; }
.week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.week-nav .label { font-weight: 800; font-size: 15px; }
.avail-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 6px; }
.avail-grid button { margin: 0; padding: 10px 0; font-size: 13px; border-radius: 10px; background: var(--muted); color: var(--muted-text); }
.avail-grid button.on { background: var(--primary); color: #fff; }
.seg { display: flex; background: var(--muted); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; margin: 0; padding: 9px; font-size: 14px; border-radius: 10px; background: none; color: var(--muted-text); }
.seg button.active { background: var(--card); color: var(--foreground); box-shadow: var(--shadow); }
textarea { min-height: 74px; }
.hidden { display: none !important; }
