/* Reitschule styles — terracotta / cream / charcoal theme */
:root {
  --bg: #faf6ee; --card: #ffffff; --ink: #2e2a25; --muted: #857c70;
  --brand: #a8503a; --brand-dark: #8a3e2c; --brand-light: #f3e2da;
  --green: #66714f; --green-dark: #4e5740; --green-light: #e9ebdc;
  --outdoor: #b0863f; --outdoor-bg: #f6ecd8;
  --woods: #7d6488; --woods-bg: #ece6f0;
  --tent: #5b7a8c; --tent-bg: #e4ebef;
  --red: #9c3b2e; --red-bg: #f3e2da;
  --border: #e3dccd; --slot: 52px;
  --head: #3d372e;
  --serif: Georgia, "Times New Roman", "Palatino Linotype", serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand-dark); }
h1 { font-family: var(--serif); font-size: 1.55rem; margin: 0 0 1rem; }
h2 { font-family: var(--serif); font-size: 1.08rem; margin: 0 0 .8rem; }
.container { max-width: 1280px; margin: 1.2rem auto 3rem; padding: 0 1rem; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
code { background: var(--brand-light); padding: .1rem .35rem; border-radius: 4px; font-size: .85em; }
.topstrip { background: var(--brand); color: #fff; font-size: .8rem; }
.strip-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: .8rem; padding: .35rem 1rem; }
.strip-tag { opacity: .92; }
.strip-user { margin-left: auto; }
.strip-user small { opacity: .75; }
.lang-picker { display: inline-flex; border: 1px solid rgba(255,255,255,.4); border-radius: 6px; overflow: hidden; margin-left: .5rem; }
.lang-picker a { display: inline-block; padding: .1rem .5rem; font-size: .75rem; font-weight: 600; color: #fff; text-decoration: none; opacity: .8; }
.lang-picker a + a { border-left: 1px solid rgba(255,255,255,.3); }
.lang-picker a:hover { opacity: 1; background: rgba(255,255,255,.12); }
.lang-picker a.active { background: rgba(255,255,255,.22); opacity: 1; }
.btn-outline-light { background: transparent; border-color: rgba(255,255,255,.55); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.14); color: #fff; }
.topnav { background: var(--card); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: .4rem; padding: .45rem 1rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; margin-right: 1.1rem; text-decoration: none; }
.brand img { display: block; height: 44px; width: auto; }
.topnav a:not(.btn) { color: var(--ink); text-decoration: none; padding: .4rem .65rem; border-radius: 6px; font-size: .93rem; font-weight: 600; }
.topnav a:not(.btn):hover { background: var(--bg); color: var(--brand); }
.topnav a.active { background: var(--brand-light); color: var(--brand-dark); }
.nav-btn { margin-left: .4rem; }
/* Settings dropdown in the owner nav */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-btn { background: transparent; border: 0; border-radius: 6px; padding: .4rem .65rem; font-size: .93rem; font-weight: 600; color: var(--ink); cursor: pointer; font-family: inherit; }
.nav-dropdown-btn:hover { background: var(--bg); color: var(--brand); }
.nav-dropdown-btn .caret { font-size: .7em; opacity: .7; }
.nav-dropdown-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 150px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 24px rgba(0,0,0,.12); padding: .35rem; z-index: 70; }
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; padding: .5rem .65rem; border-radius: 6px; font-size: .9rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.nav-dropdown-menu a:hover { background: var(--bg); color: var(--brand); }
.nav-dropdown-menu a.active { background: var(--brand-light); color: var(--brand-dark); }
.btn { display: inline-block; border: 1px solid transparent; border-radius: 7px; padding: .5rem .95rem; font-size: .92rem; cursor: pointer; text-decoration: none; font-family: inherit; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { background: var(--brand-light); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #7e2f25; }
.btn-ghost.danger { color: var(--red); border-color: var(--red); }
.btn-ghost.danger:hover { background: var(--red-bg); }
.btn-sm { padding: .3rem .65rem; font-size: .85rem; }
.inline-form { display: inline; }
.row-actions { display: flex; gap: .4rem; justify-content: flex-end; align-items: center; }
.btn-block { width: 100%; }
input, select, textarea { font-family: inherit; font-size: .92rem; padding: .45rem .55rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
input:focus, select:focus { outline: 2px solid var(--brand-light); border-color: var(--brand); }
label { display: block; font-size: .85rem; font-weight: 600; color: #57503f; margin-bottom: .8rem; }
label input, label select { display: block; width: 100%; margin-top: .3rem; font-weight: 400; }
.recur-wrap { display: flex; align-items: center; gap: .5rem; font-weight: 600; margin: 0; }
.recur-wrap input { width: auto; margin: 0; }
.recur-opts { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.recur-opts label { display: flex; align-items: center; gap: .4rem; margin: 0; font-weight: 400; }
.recur-opts select { width: auto; margin: 0; }
.hidden { display: none; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.head-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.personal-day-form { display: inline-flex; align-items: center; gap: .4rem; }
.personal-day-form input[type="date"] { padding: .3rem .4rem; font-size: .85rem; }
/* List-page search box */
.list-search { width: 100%; max-width: 320px; margin-bottom: .8rem; }
/* New-stable onboarding checklist */
.setup-card { border-left: 4px solid var(--brand); }
.setup-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.setup-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.setup-list li { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.setup-list li:last-child { border-bottom: 0; }
.setup-list li.done { opacity: .6; }
.setup-check { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--brand-light); color: var(--brand-dark); font-weight: 700; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; }
.setup-list li.done .setup-check { background: var(--green-light); color: var(--green-dark); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.stat-row-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 700px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { text-align: center; }
.stat-num { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--brand-dark); }
.stat-label { color: var(--muted); font-size: .85rem; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem 1rem; }
@media (max-width: 900px) { .form-grid { grid-template-columns: repeat(2, 1fr); } }
.service-info { font-size: .85rem; color: var(--muted); min-height: 1.1rem; margin: 0 0 .6rem; }
.service-info .price { color: var(--ink); font-weight: 600; }
.group-wrap { border: 1px dashed var(--border); border-radius: 8px; padding: .6rem .8rem; background: var(--card, #fff); margin-bottom: .6rem; }
.form-section { font-family: var(--serif); font-size: 1.05rem; color: var(--brand-dark); margin: 1.1rem 0 .5rem; padding-bottom: .25rem; border-bottom: 1px solid var(--border); }
.form-section:first-of-type { margin-top: .2rem; }
.end-time-cell { display: flex; align-items: center; gap: .4rem; font-size: .95rem; }
.booking-summary { display: none; align-items: center; flex-wrap: wrap; gap: .3rem .9rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .8rem; margin-bottom: .8rem; font-size: .9rem; }
.booking-summary.has { display: flex; }
.booking-summary .bs-item { display: inline-flex; align-items: center; gap: .3rem; }
.booking-summary .bs-item .muted { font-size: .78rem; }
.booking-summary .bs-item strong { color: var(--ink); }
.group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; font-weight: 600; }
.participant-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.participant-row select { width: 100%; }
@media (max-width: 600px) { .participant-row { grid-template-columns: 1fr; } }
.form-actions { margin-top: .5rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.detail-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.detail-when { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.detail-list { margin: 0 0 1rem; }
.detail-row { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-row dt { color: var(--muted); font-size: .85rem; }
.detail-row dd { margin: 0; color: var(--ink); }
.detail-actions { margin-top: 1rem; }
@media (max-width: 600px) { .detail-row { grid-template-columns: 1fr; gap: .15rem; } }
.hours-day { display: flex; align-items: baseline; gap: .8rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.hours-day:last-child { border-bottom: none; }
.hours-day-name { flex: 0 0 6.5rem; font-weight: 600; color: var(--ink); }
.hours-day-slots { display: flex; flex-wrap: wrap; gap: .35rem; }
.hours-chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: .15rem .5rem; }
.hours-chip .btn { padding: 0 .25rem; }
@media (max-width: 600px) { .hours-day { flex-direction: column; gap: .25rem; } .hours-day-name { flex: none; } }
.guardian-fields { border: 1px dashed var(--border); border-radius: 8px; padding: .6rem .8rem .2rem; margin: 0 0 .8rem; background: var(--bg); }
.guardian-fields legend { font-size: .8rem; font-weight: 700; color: var(--brand-dark); padding: 0 .4rem; }
.horse-checks { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .8rem; margin-bottom: .8rem; }
@media (max-width: 600px) { .horse-checks { grid-template-columns: 1fr; } }
.horse-check { display: flex; align-items: center; gap: .45rem; font-weight: 400; margin: 0; }
.horse-check input { width: auto; margin: 0; }
.card-sep { border: 0; border-top: 1px dashed var(--border); margin: .8rem 0; }
.admin-edit { border: 1px solid var(--border); border-radius: 8px; padding: .8rem .9rem; margin-bottom: .8rem; }
.admin-edit-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.flashes { margin-bottom: 1rem; }
.flash { padding: .6rem .9rem; border-radius: 7px; margin-bottom: .4rem; font-size: .9rem; }
.flash-success { background: var(--green-light); border: 1px solid #c8cdaa; }
.flash-danger { background: var(--red-bg); border: 1px solid #dcaaa3; }
.flash-info { background: #e3ecf5; border: 1px solid #b9cee3; }
.badge { display: inline-block; font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.badge-scheduled { background: var(--green-light); color: var(--green-dark); }
.badge-completed { background: #e3ecf5; color: #33566f; }
.badge-no_show { background: var(--red-bg); color: var(--red); }
.badge-cancelled { background: #eee; color: #777; text-decoration: line-through; }
.badge-block { background: var(--outdoor-bg); color: #8a5f1d; }
.badge-personal_day { background: var(--woods-bg); color: var(--woods); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--border); padding: .35rem .5rem; }
.table td { padding: .45rem .5rem; border-bottom: 1px solid var(--border); }
.block-list { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.block-list li { padding: .4rem 0; border-bottom: 1px dashed var(--border); }
.login-wrap { display: flex; justify-content: center; padding-top: 8vh; }
.login-card { width: 360px; max-width: 100%; }
.login-brand { text-align: center; margin-bottom: .2rem; }
.login-brand img { display: inline-block; height: 72px; width: auto; }
.hint-box { margin-top: 1rem; font-size: .82rem; color: var(--muted); border-top: 1px dashed var(--border); padding-top: .8rem; }
.week-nav { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.week-label { font-weight: 600; min-width: 170px; text-align: center; }
.cal-controls { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.view-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: var(--card); }
.view-switch a { display: inline-block; padding: .35rem .85rem; font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--ink); }
.view-switch a + a { border-left: 1px solid var(--border); }
.view-switch a:hover { background: var(--brand-light); }
.view-switch a.active { background: var(--brand); color: #fff; }
.legend { display: flex; gap: 1rem; font-size: .82rem; margin: .6rem 0; align-items: center; flex-wrap: wrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; }
.dot.loc-indoor { background: var(--green); }
.dot.loc-outdoor { background: var(--outdoor); }
.dot.loc-woods { background: var(--woods); }
.dot.loc-tent { background: var(--tent); }
.dot-block { background: var(--outdoor); outline: 2px dashed #8a5f1d; }
.dot-task { background: #33566f; }
.dot-personal { background: var(--woods); outline: 2px dashed var(--woods); }
.cal-head { display: flex; background: var(--card); border: 1px solid var(--border); border-bottom: none; border-radius: 10px 10px 0 0; position: sticky; top: 0; z-index: 5; }
.cal-time-col { width: 64px; flex: none; font-size: .75rem; color: var(--muted); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 2px; }
.cal-day-head { flex: 1; min-width: 0; text-align: center; font-weight: 600; font-size: .85rem; padding: .5rem 0; border-left: 1px solid var(--border); }
.cal-day-head.today { background: var(--brand-light); color: var(--brand-dark); }
.cal-body { background: var(--card); border: 1px solid var(--border); border-radius: 0 0 10px 10px; overflow: hidden; }
.cal-row { display: flex; }
.slot-cell { flex: 1; min-width: 0; min-height: var(--slot); border-left: 1px solid var(--border); border-bottom: 1px solid #ece7da; padding: 2px; cursor: pointer; position: relative; }
.slot-cell:hover { background: #f7f3e8; }
.cal-body .cal-time-col { border-bottom: 1px solid #ece7da; }
.lesson-card { border-radius: 6px; padding: 3px 6px; font-size: .8rem; line-height: 1.3; color: #fff; margin-bottom: 3px; cursor: pointer; overflow: hidden; }
.lesson-card:hover { filter: brightness(1.08); }
.lesson-card.loc-indoor { background: var(--green); }
.lesson-card.loc-outdoor { background: var(--outdoor); }
.lesson-card.loc-woods { background: var(--woods); }
.lesson-card.loc-tent { background: var(--tent); }
.lesson-card.st-cancelled { background: #999 !important; opacity: .7; text-decoration: line-through; }
.lesson-card.st-completed { opacity: .75; }
.lesson-card.personal-day-card { background: var(--woods); opacity: .8; cursor: default; }
.lesson-card.personal-day-card .l-rider { text-decoration: line-through; }
.lesson-card.task-card { background: #33566f; }
.lesson-card.task-card.st-completed { opacity: .75; }
.lesson-card.task-card.st-cancelled { background: #999 !important; opacity: .7; text-decoration: line-through; }
.l-time { font-weight: 700; }
.l-rider { font-weight: 600; }
.l-sub { opacity: .9; }
.block-chip { background: var(--outdoor-bg); border: 1px dashed #b98a3d; color: #8a5f1d; font-size: .7rem; padding: 2px 5px; border-radius: 5px; margin-bottom: 3px; }
.cal-body.day-view { --slot: 64px; }
.cal-body.day-view .lesson-card { font-size: .8rem; }
.horse-calendar-head { margin-top: 1.25rem; }
.horse-calendar-head h2 { margin: 0; }
.horse-block-slot { cursor: default; }
.horse-block-slot.blocked, .horse-block-slot.blocked:hover { background: var(--outdoor-bg); box-shadow: inset 3px 0 #b98a3d; }
/* Same amber/dashed look as the main calendar's .block-chip */
.horse-block-card { position: relative; z-index: 1; background: var(--outdoor-bg); border: 1px dashed #b98a3d; color: #8a5f1d; border-radius: 5px; padding: 3px 5px; margin-bottom: 3px; font-size: .7rem; line-height: 1.3; overflow-wrap: anywhere; }
.horse-block-type { font-weight: 700; }
.horse-block-time { opacity: .85; font-size: .95em; }
.cal-body.day-view .horse-block-card { font-size: .8rem; padding: 5px 7px; }
.overflow-x { overflow-x: auto; }
.hours-table th { text-align: right; }
.hours-table th:first-child { text-align: left; }
.hours-table td.hours-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hours-table td:first-child, .hours-table th:first-child { white-space: nowrap; }
.util-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); font-size: .8rem; }
.util-table th { background: var(--head); color: #fff; padding: .5rem; text-align: left; font-size: .78rem; }
.util-table th.today { background: var(--brand); }
.util-table td { border-top: 1px solid var(--border); vertical-align: top; padding: .4rem; }
.horse-col { width: 170px; }
.horse-name a { font-size: .9rem; }
.util-cell { min-width: 120px; }
.u-chip { font-size: .7rem; color: #fff; border-radius: 4px; padding: 2px 5px; margin-bottom: 2px; }
.u-chip.loc-indoor { background: var(--green); }
.u-chip.loc-outdoor { background: var(--outdoor); }
.u-chip.loc-woods { background: var(--woods); }
.u-chip.loc-tent { background: var(--tent); }
.u-chip.st-cancelled { background: #999; text-decoration: line-through; opacity: .7; }
.u-chip.st-completed { opacity: .75; }
.u-block { background: var(--red-bg); color: var(--red); border: 1px dashed var(--red); border-radius: 4px; padding: 2px 5px; margin-bottom: 2px; font-size: .7rem; }
.u-total { width: 90px; text-align: center; }
.avail-status { margin: .4rem 0 .8rem; min-height: 1.4rem; font-size: .85rem; }
.avail-status .ok { color: var(--green-dark); font-weight: 600; }
.avail-status .bad { color: var(--red); font-weight: 600; }
.slot-picker { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; margin-bottom: .8rem; background: var(--card, #fff); }
.slot-picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.slot-week-label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.slot-picker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; }
.slot-day { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.slot-day.past { opacity: .45; }
.slot-day-name { font-size: .75rem; font-weight: 600; color: var(--muted); text-align: center; text-transform: capitalize; }
.slot-day-times { display: flex; flex-direction: column; gap: .25rem; }
.slot-btn { border: 1px solid var(--border); background: var(--bg); border-radius: 6px; padding: .25rem 0; font-size: .78rem; cursor: pointer; color: var(--ink); transition: background .12s, border-color .12s; }
.slot-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.slot-none { font-size: .72rem; color: var(--muted); text-align: center; }
@media (max-width: 700px) {
  .slot-picker-grid { grid-template-columns: repeat(2, 1fr); }
  .slot-day-times { flex-direction: row; flex-wrap: wrap; }
  .slot-btn { flex: 1 1 auto; }
}
.avail-msg { padding: .25rem 0; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem 0 2rem; }
.footer-link { display: inline-block; margin-top: .4rem; color: var(--brand-dark); text-decoration: none; font-weight: 600; }
.footer-link:hover { text-decoration: underline; }
.inline-form { display: inline; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1.5rem; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
/* ============================================================
   Mobile / responsive — tuned for modern 6" phones (~360–430px)
   ============================================================ */
/* --- Navigation: hamburger toggle (hidden on desktop) --- */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  margin-left: auto;
}
.nav-toggle:hover { background: var(--brand-light); }
.nav-links { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
/* --- Horizontal scroll wrapper for wide tables --- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap > table { margin: 0; }
/* --- Tablet / small laptop --- */
@media (max-width: 900px) {
  .stat-row-5 { grid-template-columns: repeat(3, 1fr); }
}
/* --- Mobile --- */
@media (max-width: 760px) {
  .container { padding: 0 .75rem; margin-top: .9rem; }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.02rem; }
  .card { padding: .9rem .85rem; }
  /* Nav collapses to a hamburger dropdown and stays pinned while scrolling */
  .nav-toggle { display: inline-flex; }
  .topnav { position: sticky; top: 0; z-index: 40; }
  .nav-inner { flex-wrap: nowrap; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: .1rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .12);
    padding: .5rem .9rem 1rem;
    z-index: 60;
  }
  .nav-links.open { display: flex; }
  .nav-links a:not(.btn) { padding: .8rem .65rem; font-size: 1rem; border-radius: 8px; }
  .nav-links .nav-btn { margin-left: 0; margin-top: .5rem; }
  /* Settings dropdown becomes a flat section on mobile */
  .nav-dropdown-btn { display: none; }
  .nav-dropdown-menu { display: block; position: static; border: 0; box-shadow: none; padding: 0; min-width: 0; }
  .nav-dropdown-menu a { padding: .8rem .65rem; font-size: 1rem; }
  /* Top strip: drop the tag line, keep language + user + logout */
  .strip-inner { flex-wrap: wrap; gap: .35rem .6rem; padding: .35rem .75rem; }
  .strip-tag { display: none; }
  /* Stat rows */
  .stat-row, .stat-row-5 { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .stat-num { font-size: 1.7rem; }
  /* Forms: full-width stacked actions */
  .form-grid { grid-template-columns: repeat(2, 1fr); gap: .3rem .7rem; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { width: 100%; }
  /* Tables: any card holding a table scrolls horizontally instead of
     cramming. Cells don't wrap, so genuinely wide tables overflow (and
     scroll) while narrow tables still fill the width. The first (name)
     column stays pinned while scrolling.
     FIX: the card is the scroll container, so its horizontal padding must
     be 0 — otherwise sticky left:0 pins inside the padding and scrolled
     columns show through in the gap. The side padding moves onto the
     first/last cells instead. */
  .card:has(> table.table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-left: 0;
    padding-right: 0;
  }
  .card:has(> table.table) > table.table {
    border-collapse: separate; /* keeps borders on sticky cells */
    border-spacing: 0;
  }
  .card:has(> table.table) > table.table th,
  .card:has(> table.table) > table.table td { white-space: nowrap; }
  .card:has(> table.table) > table.table th:first-child,
  .card:has(> table.table) > table.table td:first-child {
    position: sticky;
    left: 0;
    background: var(--card);
    z-index: 1;
    padding-left: .85rem;
    box-shadow: 2px 0 4px -2px rgba(0, 0, 0, .15);
  }
  .card:has(> table.table) > table.table th:first-child { z-index: 2; }
  .card:has(> table.table) > table.table th:last-child,
  .card:has(> table.table) > table.table td:last-child { padding-right: .85rem; }
  /* Calendar: horizontal scroll with a pinned time column */
  .cal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cal-head, .cal-body { min-width: 680px; }
  /* Day view has a single column: fit the screen instead of forcing the
     680px week-view minimum (which made it overflow on phones). */
  .cal-head.day-view, .cal-body.day-view { min-width: 0; width: 100%; }
  .cal-head { position: static; }
  /* The time column pins to the left while the days scroll. It only sticks
     relative to .cal-scroll if no ancestor in between is a scroll box, so
     drop .cal-body's overflow:hidden (it was only clipping the rounded
     corners) and round the last row's end cells instead. */
  .cal-body { overflow: visible; }
  .cal-time-col { position: sticky; left: 0; background: var(--card); z-index: 3; }
  .cal-body .cal-row:last-child > .cal-time-col { border-bottom-left-radius: 10px; }
  .cal-body .cal-row:last-child > .slot-cell:last-child { border-bottom-right-radius: 10px; }
  /* Utilization table: scroll with pinned horse column */
  .util-table { min-width: 720px; }
  .util-table th:first-child, .util-table td:first-child {
    position: sticky; left: 0; background: var(--card); z-index: 1;
  }
  .util-table thead th:first-child { background: var(--head); z-index: 2; }
  /* Controls wrap nicely */
  .legend { gap: .5rem .8rem; }
  .week-nav { gap: .4rem; }
  .week-label { font-size: .85rem; }
  /* Larger touch targets */
  .btn { padding: .55rem 1rem; }
  .btn-sm { padding: .45rem .7rem; }
  .topnav a:not(.btn) { padding: .55rem .6rem; }
  input, select, textarea { padding: .55rem .6rem; font-size: 1rem; }
  .mini { min-width: 34px; min-height: 34px; }
}
/* --- Very small phones --- */
@media (max-width: 420px) {
  .form-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .brand img { height: 38px; }
  .stat-row, .stat-row-5 { gap: .6rem; }
}

/* --- Landing / marketing page --- */
html { scroll-behavior: smooth; }
#features { scroll-margin-top: 1rem; }
.landing-hero { background: linear-gradient(160deg, var(--brand-light), var(--bg)); border-bottom: 1px solid var(--border); }
.landing-hero-inner { max-width: 1280px; margin: 0 auto; padding: 4rem 1rem 4.5rem; text-align: center; }
.landing-title { font-family: var(--serif); font-size: 2.4rem; line-height: 1.15; margin: 0 0 1rem; color: var(--head); }
.landing-sub { font-size: 1.1rem; color: var(--muted); max-width: 46rem; margin: 0 auto 1.8rem; }
.landing-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.btn-lg { padding: .7rem 1.4rem; font-size: 1.02rem; }
.landing-section-title { text-align: center; font-size: 1.5rem; margin: 2.5rem 0 1.4rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.feature { margin-bottom: 0; }
.feature-icon { font-size: 1.8rem; margin-bottom: .4rem; }
.feature h3 { font-family: var(--serif); font-size: 1.05rem; margin: 0 0 .4rem; }
.feature p { margin: 0; font-size: .92rem; }
.landing-cta-band { background: var(--brand); color: #fff; margin-top: 2.5rem; }
.landing-cta-band-inner { max-width: 1280px; margin: 0 auto; padding: 2.6rem 1rem; text-align: center; }
.landing-cta-band h2 { color: #fff; font-size: 1.5rem; margin: 0 0 .4rem; }
.landing-cta-band .muted { color: rgba(255,255,255,.85); margin: 0 0 1.2rem; }

/* --- Feature screenshots (mockups) --- */
.mockup { max-width: 1080px; margin: 0 auto 2.5rem; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 18px 40px rgba(0,0,0,.12); background: var(--card); }
.mockup-bar { display: flex; align-items: center; gap: .4rem; background: #f1ece1; border-bottom: 1px solid var(--border); padding: .55rem .8rem; }
.mockup-dot { width: 11px; height: 11px; border-radius: 50%; background: #d8d0bf; }
.mockup-url { margin-left: .6rem; font-size: .78rem; color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: .15rem .7rem; }
.mockup-body { background: var(--bg); padding: 1.2rem; }
.mockup-body h1 { font-size: 1.3rem; margin: 0 0 .9rem; }
.mockup-body .card { margin-bottom: 1rem; }
.mockup-body .card:last-child { margin-bottom: 0; }
.mockup-body .stat-row { margin-bottom: 1rem; }
.mockup-body .cal-head { border-radius: 10px 10px 0 0; }
.mockup-body .cal-body { border-radius: 0 0 10px 10px; }
.mockup-body .cal-head, .mockup-body .cal-body { min-width: 0; }
.mockup-body .cal-day-head { font-size: .78rem; padding: .4rem 0; }
.mockup-body .cal-time-col { width: 52px; font-size: .72rem; }
.mockup-body .slot-cell { min-height: 46px; }
.mockup-body .lesson-card { font-size: .72rem; padding: 2px 5px; line-height: 1.25; }
.mockup-body .block-chip { font-size: .72rem; }
.mockup-body .table th, .mockup-body .table td { padding: .35rem .45rem; font-size: .85rem; }
.mockup-body .stat-num { font-size: 1.7rem; }
.mockup-body .page-head { margin-bottom: .9rem; }
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .landing-title { font-size: 1.9rem; }
}
@media (max-width: 600px) {
  .feature-grid { grid-template-columns: 1fr; }
  .landing-hero-inner { padding: 2.5rem 1rem 3rem; }
  .landing-title { font-size: 1.6rem; }
}
