/* ── SBG Events — calendar styles ─────────────────────────────
   Palette:
     forest  #1e3a2f   mid green #2d5a45   accent #4a7c2f
     cream   #f7f3ec   ink #243029
   No em dashes anywhere in UI copy.
*/

:root {
  --forest: #1e3a2f;
  --mid:    #2d5a45;
  --accent: #4a7c2f;
  --cream:  #f7f3ec;
  --ink:    #243029;
  --line:   #e0d9cb;
  --panel:  #ffffff;
  --muted:  #6f7a72;
  --shadow: 0 2px 8px rgba(30, 58, 47, 0.10);
}

* { box-sizing: border-box; }

/* The HTML hidden attribute must always win over class display rules
   (e.g. .modal-overlay sets display:flex, which otherwise defeats [hidden]). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

h1, h2, h3 { margin: 0; font-weight: 600; }

/* ── Header ─────────────────────────────────────────────────── */

.app-header {
  background: var(--forest);
  color: var(--cream);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--accent), var(--mid) 70%);
  flex: none;
  box-shadow: inset 0 0 0 2px rgba(247, 243, 236, 0.25);
}
.brand h1 { font-size: 1.25rem; letter-spacing: 0.3px; }
.brand-sub { margin: 0; font-size: 0.78rem; opacity: 0.78; }

.header-nav { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #3f6b28; }
/* Ghost button defaults for light backgrounds (cards, tables, forms) */
.btn-ghost { background: transparent; color: var(--mid); border-color: var(--line); }
.btn-ghost:hover { background: #eef4ec; border-color: #cfe0c6; }
/* On the dark green header, ghost buttons need light text/border */
.app-header .btn-ghost { color: var(--cream); border-color: rgba(247,243,236,0.45); }
.app-header .btn-ghost:hover { background: rgba(247,243,236,0.12); border-color: rgba(247,243,236,0.6); }

/* ── Layout ─────────────────────────────────────────────────── */

.layout {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding: 20px;
  align-items: start;
}

/* ── Sidebar ────────────────────────────────────────────────── */

.sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.sidebar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sidebar-head h2 { font-size: 1rem; color: var(--forest); }

.filter-group {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.filter-group:first-of-type { border-top: none; padding-top: 4px; }
.filter-group h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  margin-bottom: 8px;
}
.filter-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}
.link-btn:hover { text-decoration: underline; }

.check-list { display: flex; flex-direction: column; gap: 6px; }
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}
.check input { accent-color: var(--accent); width: 15px; height: 15px; flex: none; }
.swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
  flex: none;
  border: 1px solid rgba(0,0,0,0.12);
}

/* Venue list grouped by location */
.venue-list { max-height: 260px; overflow-y: auto; padding-right: 4px; }
.venue-loc-head {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mid);
  margin: 8px 0 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.venue-loc-head:first-child { margin-top: 0; }
.venue-list .check { padding-left: 4px; font-size: 0.84rem; }

.muted { color: var(--muted); font-size: 0.84rem; margin: 4px 0; }

/* Segmented control */
.seg-control {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.seg { flex: 1; text-align: center; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  padding: 7px 4px;
  font-size: 0.82rem;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
}
.seg input:checked + span { background: var(--mid); color: #fff; font-weight: 600; }

/* ── Calendar area ──────────────────────────────────────────── */

.content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow);
  min-height: 600px;
  position: relative;   /* positioning context for the loading overlay */
}

/* ── Staged loading overlay ─────────────────────────────────── */
.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(247, 243, 236, 0.92);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.3s ease;
}
.loading-overlay.fade-out { opacity: 0; }
.loading-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 26px 30px;
  max-width: 320px;
  width: 100%;
  text-align: center;
}
.loading-spinner {
  width: 38px; height: 38px;
  margin: 0 auto 14px;
  border: 3px solid #e0d9cb;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: sbg-spin 0.8s linear infinite;
}
@keyframes sbg-spin { to { transform: rotate(360deg); } }
.loading-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--forest);
  margin: 0 0 14px;
}
.loading-steps {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  text-align: left;
  display: inline-block;
}
.loading-steps li {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 4px 0 4px 26px;
  position: relative;
}
/* Pending: hollow ring. Active: spinning ring. Done: green check. */
.loading-steps li::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 14px; height: 14px;
  margin-top: -7px;
  border: 2px solid var(--line);
  border-radius: 50%;
  box-sizing: border-box;
}
.loading-steps li.active { color: var(--ink); }
.loading-steps li.active::before {
  border-color: #e0d9cb;
  border-top-color: var(--accent);
  animation: sbg-spin 0.8s linear infinite;
}
.loading-steps li.done { color: var(--mid); }
.loading-steps li.done::before {
  content: '\2713';
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
.loading-hint { font-size: 0.78rem; color: var(--muted); margin: 0; }

/* Inline loading state (Daily Sheet, Search) sharing the calendar spinner. */
.loading-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--muted);
}
.loading-inline p { margin: 0; font-size: 0.92rem; }
.loading-spinner-sm {
  display: inline-block;
  width: 15px; height: 15px;
  margin: 0;
  border-width: 2px;
  vertical-align: -2px;
}

/* ── Information notices on the calendar (out of office, closures) ──
   Rendered all-day so they sit in the top band of Day/Week views.
   Styled as blue notices (matching the daily sheet) regardless of the
   event type color, so they read as info rather than a venue booking. */
.fc-event.is-info {
  background: #eef4f8 !important;
  border: 1px solid #cfe0ea !important;
  border-left: 3px solid #5b8aa6 !important;
  color: #3f6c86 !important;
  box-shadow: none !important;
}
.fc-event.is-info .fc-event-title,
.fc-event.is-info .fc-event-time { color: #3f6c86 !important; font-weight: 600; }
.cal-status {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.88rem;
}
.cal-status.error { background: #fbeaea; color: #8a2020; border: 1px solid #e8c4c4; }
.cal-status.info  { background: #eef4ec; color: var(--mid); border: 1px solid #d6e3cf; }

/* FullCalendar SBG overrides */
.fc { --fc-border-color: var(--line); --fc-today-bg-color: #f1f6ee; }
.fc .fc-toolbar-title { color: var(--forest); font-size: 1.3rem; }
.fc .fc-button-primary {
  background: var(--mid);
  border-color: var(--mid);
  text-transform: capitalize;
  font-weight: 500;
}
.fc .fc-button-primary:hover { background: var(--forest); border-color: var(--forest); }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--accent); border-color: var(--accent);
}
.fc .fc-button-primary:focus { box-shadow: 0 0 0 3px rgba(74,124,47,0.3); }
.fc-event { cursor: pointer; border: none; }
.fc-event.is-cancelled { opacity: 0.55; text-decoration: line-through; }
.fc-event.is-draft { border: 1px dashed rgba(255,255,255,0.85) !important; }
.fc-daygrid-event .fc-event-title { font-weight: 500; }

/* Overlap conflict: red outline + warning glyph. Back-to-back turnaround:
   amber outline + warning glyph (softer, not a conflict). */
.fc-event.has-conflict {
  box-shadow: 0 0 0 2px #c0392b, 0 0 0 3px rgba(192,57,43,0.25);
}
.fc-event.has-warning {
  box-shadow: 0 0 0 2px #d68910, 0 0 0 3px rgba(214,137,16,0.25);
}
.fc-event.has-conflict .fc-event-title::before,
.fc-event.has-warning .fc-event-title::before { content: '\26A0\FE0F '; }

/* Setup/teardown occupancy "hold" bands (timeGrid background events).
   Gray = normal hold; red = the hold belongs to a conflicting event. */
.fc-bg-event.hold-band { background: #6f7a72 !important; opacity: 0.18; }
.fc-bg-event.hold-band.hold-band-conflict {
  background: repeating-linear-gradient(
    45deg, #c0392b, #c0392b 8px, #a93226 8px, #a93226 16px
  ) !important;
  opacity: 0.30;
}
.fc-bg-event.hold-band.hold-band-warning {
  background: repeating-linear-gradient(
    45deg, #d68910, #d68910 8px, #b9770e 8px, #b9770e 16px
  ) !important;
  opacity: 0.26;
}
.fc-daygrid-day-frame { position: relative; }
.fc-daygrid-day-number { font-weight: 600; }
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number { color: var(--accent); }

/* Clickable day numbers (navLinks) */
.fc-daygrid-day-number:hover { text-decoration: underline; cursor: pointer; }

/* Per-day badges: a neutral event count plus a separate conflict count */
.sbg-day-badges {
  position: absolute;
  top: 4px; left: 4px;
  z-index: 2;
  display: flex;
  gap: 4px;
}
.sbg-badge {
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 7px;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
}
.sbg-badge-count {
  color: var(--mid);
  background: #eef4ec;
  border-color: #d6e3cf;
}
.sbg-badge-count:hover { background: #e2ecdd; }
.sbg-badge-conflict {
  color: #fff;
  background: #c0392b;
  border-color: #a93226;
}
.sbg-badge-conflict:hover { background: #a93226; }
.sbg-badge-warning {
  color: #fff;
  background: #d68910;
  border-color: #b9770e;
}
.sbg-badge-warning:hover { background: #b9770e; }

/* Calendar controls bar (month picker + legend) */
.cal-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cal-controls label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.cal-controls input[type="month"] {
  font: inherit;
  font-size: 0.88rem;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}
.cal-controls input[type="month"]:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,124,47,0.18);
}
.cal-legend { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.legend-badge {
  font-size: 0.7rem; font-weight: 700; border-radius: 10px; padding: 1px 8px;
  border: 1px solid transparent;
}
.legend-count { color: var(--mid); background: #eef4ec; border-color: #d6e3cf; }
.legend-conflict { color: #fff; background: #c0392b; border-color: #a93226; }
.legend-warning { color: #fff; background: #d68910; border-color: #b9770e; }

.modal-conflict, .modal-warning {
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.modal-conflict {
  background: #fbeaea;
  border: 1px solid #e8c4c4;
  color: #8a2020;
}
.modal-warning {
  background: #fdf3e3;
  border: 1px solid #ecd9b4;
  color: #8a5d12;
}

/* ── Modal ──────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 58, 47, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal {
  background: #fff;
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}
.modal-accent { height: 6px; background: var(--mid); flex: none; }
.modal-close {
  position: absolute;
  top: 10px; right: 12px;
  background: rgba(255,255,255,0.85);
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  z-index: 2;
}
.modal-close:hover { background: #fff; }
.modal-body { padding: 20px 24px 24px; overflow-y: auto; }
.modal-body h2 { font-size: 1.3rem; color: var(--forest); margin-bottom: 4px; padding-right: 24px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}
.status-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--mid);
  background: #f3f7f1;
}
.status-pill.Cancelled { color: #8a2020; background: #fbeaea; border-color: #e8c4c4; }
.status-pill.Draft { color: #8a6d1f; background: #fbf5e3; border-color: #e8dcb4; }

.detail-grid { display: grid; grid-template-columns: 1fr; gap: 2px; margin-top: 8px; }
.detail-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.detail-row .label { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.detail-row .value { word-break: break-word; }
.detail-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  font-weight: 700;
  margin: 14px 0 0;
}

/* ── Mobile ─────────────────────────────────────────────────── */

.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 18px; right: 18px;
  z-index: 60;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  cursor: pointer;
}

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 84%;
    max-width: 320px;
    max-height: 100vh;
    border-radius: 0;
    z-index: 120;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: block; }
  .header-nav .btn-ghost { display: none; }
  .fc .fc-toolbar { flex-direction: column; gap: 8px; }
}

/* ── Submit form ────────────────────────────────────────────── */

.auth-status { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.auth-status .who { opacity: 0.9; }
.auth-status .link-btn { color: var(--cream); }
.auth-status .link-btn:hover { color: #fff; }

.form-wrap { max-width: 880px; margin: 0 auto; padding: 24px 20px 60px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card h2 { color: var(--forest); font-size: 1.25rem; margin-bottom: 14px; }
.subhead {
  font-size: 0.95rem; color: var(--mid); margin: 20px 0 4px;
  padding-top: 14px; border-top: 1px solid var(--line);
}

.gate { text-align: center; padding: 40px 24px; }
.gate h2 { margin-bottom: 8px; }
.gate .btn { margin-top: 14px; }

/* Stepper */
.stepper {
  list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 18px;
}
.stepper .step {
  flex: 1; display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--muted);
  padding: 10px 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px;
}
.stepper .step span {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--line); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; flex: none;
}
.stepper .step.active { color: var(--forest); border-color: var(--accent); font-weight: 600; }
.stepper .step.active span { background: var(--accent); }
.stepper .step.done span { background: var(--mid); }

/* Fields */
.field { margin-bottom: 14px; display: flex; flex-direction: column; }
.field label { font-size: 0.82rem; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.field .req { color: #b54034; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 0.92rem;
  padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,124,47,0.18);
}
.field input.input-error { border-color: #b54034; box-shadow: 0 0 0 3px rgba(181,64,52,0.18); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.small { font-size: 0.82rem; }

/* Date + time picker pair (replaces datetime-local spinner) */
.dt-pair { display: flex; gap: 6px; }
.dt-pair .dt-date { flex: 1 1 56%; min-width: 0; }
.dt-pair .dt-time { flex: 1 1 44%; min-width: 0; }
.dt-pair input, .dt-pair select {
  font: inherit; font-size: 0.92rem;
  padding: 9px 8px;
  border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--ink);
}
.dt-pair input:focus, .dt-pair select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,124,47,0.18);
}

.step-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.actions-left { display: flex; gap: 10px; align-items: center; }
.btn-cancel { background: transparent; color: var(--muted); border-color: transparent; }
.btn-cancel:hover { color: #8a2020; background: #fbeaea; border-color: #e8c4c4; }

.form-error {
  color: #8a2020; background: #fbeaea; border: 1px solid #e8c4c4;
  padding: 9px 12px; border-radius: 7px; font-size: 0.88rem; margin-top: 10px;
}

/* Venue gallery */
.venue-filter-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.venue-filter-bar label { font-size: 0.82rem; font-weight: 600; }
.venue-filter-bar select {
  font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px;
}
.pill-count {
  margin-left: auto; background: var(--mid); color: #fff;
  padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600;
}
.venue-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.venue-card {
  border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.venue-card.picked { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(74,124,47,0.18); }
.venue-pick { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.venue-pick input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.venue-name { font-weight: 600; font-size: 0.92rem; display: block; }
.venue-meta { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.venue-extra { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.venue-extra .field { margin-bottom: 10px; }
.venue-extra label { font-size: 0.76rem; }

/* Review */
.review-summary { display: flex; flex-direction: column; gap: 14px; }
.rev-block h3 { color: var(--forest); font-size: 1.1rem; }
.rev-label {
  display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--accent); font-weight: 700; margin-bottom: 4px;
}
.rev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.rev-grid > div { font-size: 0.9rem; }
.rev-venues { margin: 4px 0 0; padding-left: 18px; }
.rev-venues li { margin-bottom: 4px; font-size: 0.9rem; }

/* Result */
.result-ok { text-align: center; padding: 10px 0 18px; }
.result-check {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 1.8rem; line-height: 56px; margin: 0 auto 12px;
}
.result-ok h2 { color: var(--forest); }
.conflict-warn {
  border-radius: 9px;
  padding: 16px 18px; margin-top: 16px;
}
.conflict-warn h3 { font-size: 1rem; margin-bottom: 6px; }
/* Red = overlap conflict; amber = tight turnaround warning */
.conflict-warn.conflict { background: #fbeaea; border: 1px solid #e8c4c4; }
.conflict-warn.conflict h3 { color: #8a2020; }
.conflict-warn.warning { background: #fdf3e3; border: 1px solid #ecd9b4; }
.conflict-warn.warning h3 { color: #8a5d12; }
.conflict-list { margin: 10px 0 0; padding-left: 18px; }
.conflict-list li { margin-bottom: 6px; font-size: 0.9rem; }

/* ── Admin ───────────────────────────────────────────────────── */

.admin-wrap { max-width: 1100px; }

.admin-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.admin-tab {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: #f0ece2;
  color: var(--muted);
  cursor: pointer;
}
.admin-tab:hover { background: #e8e2d4; }
.admin-tab.active { background: #fff; color: var(--forest); border-color: var(--line); }

.btn-sm { padding: 5px 12px; font-size: 0.8rem; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.admin-table .cell-input {
  font: inherit;
  font-size: 0.86rem;
  width: 100%;
  min-width: 70px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.admin-table .cell-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74,124,47,0.18);
}
.admin-table .cell-num { width: 70px; min-width: 56px; }
.admin-table input[type="color"] {
  width: 44px; height: 30px; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer;
}
.admin-table input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
.admin-table .drag-handle {
  cursor: grab;
  color: var(--muted);
  text-align: center;
  width: 26px;
  user-select: none;
  font-size: 1rem;
}
.admin-table .drag-handle:active { cursor: grabbing; }
.admin-table tr.dragging { opacity: 0.5; background: #eef4ec; }
.admin-add-row {
  background: #f3f7f1;
}
.admin-add-row td { border-bottom: 2px solid var(--line); }
.row-inactive { opacity: 0.55; }
.admin-table tbody tr:hover { background: #faf8f3; }
.admin-table .admin-add-row:hover { background: #eef4ec; }

@media (max-width: 760px) {
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ── Import ──────────────────────────────────────────────────── */

.import-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.import-source { font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.import-source input {
  font: inherit; font-weight: 400; padding: 6px 9px;
  border: 1px solid var(--line); border-radius: 7px; width: 130px;
}
.import-file-label { cursor: pointer; }
.preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chk-ok { color: var(--accent); font-weight: 700; }
.chk-err { color: #8a2020; font-size: 0.82rem; }
.admin-table tr.row-error { background: #fbeaea; }
.admin-table .audit-detail { max-width: 360px; font-size: 0.8rem; color: var(--muted); white-space: normal; }

/* ── View sign-in gate ───────────────────────────────────────── */

.view-gate {
  position: fixed; inset: 0; z-index: 200;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.view-gate-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 34px 30px; max-width: 420px; text-align: center;
}
.view-gate-card h2 { color: var(--forest); margin-bottom: 8px; }
.view-gate-card .btn { margin-top: 14px; }
.view-gate-card .form-error { margin-top: 12px; text-align: left; }

/* ── Search ──────────────────────────────────────────────────── */

.search-bar input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.search-bar input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,124,47,0.18);
}

.search-result { padding: 0; overflow: hidden; display: flex; }
.search-accent { width: 6px; flex: none; }
.search-body { padding: 14px 18px; flex: 1; min-width: 0; }
.search-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-head h3 { color: var(--forest); font-size: 1.08rem; }
.search-meta { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.search-meta > div { font-size: 0.9rem; }
.search-meta .rev-label { display: inline-block; min-width: 72px; margin: 0 6px 0 0; }
.search-actions { display: flex; gap: 8px; margin-top: 12px; }

.search-dates { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.search-dates label { font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.search-dates input[type="date"] {
  font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font-weight: 400;
}

/* ── Daily sheet ─────────────────────────────────────────────── */

.daily-wrap { max-width: 900px; }
.daily-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.daily-controls label { font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.daily-controls input[type="date"] {
  font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px;
}
.daily-controls #dailyPrint { margin-left: auto; }

.daily-report {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 24px 26px; box-shadow: var(--shadow);
}
.daily-sheet-head { border-bottom: 2px solid var(--forest); padding-bottom: 10px; margin-bottom: 14px; }
.daily-sheet-head h2 { color: var(--forest); font-size: 1.4rem; }
.daily-date { font-size: 1.05rem; font-weight: 600; color: var(--mid); margin: 2px 0; }

.daily-event {
  display: grid; grid-template-columns: 120px 1fr; gap: 14px;
  padding: 14px 0; border-top: 1px solid var(--line);
  break-inside: avoid; page-break-inside: avoid;
}
.daily-event:first-of-type { border-top: none; }
.d-time { font-size: 0.95rem; }
.d-time strong { display: block; font-size: 1.05rem; color: var(--forest); }
.d-title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.d-title-row h3 { font-size: 1.1rem; color: var(--ink); }
.d-status {
  font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--mid); background: #f3f7f1;
}
.d-status.Cancelled { color: #8a2020; background: #fbeaea; border-color: #e8c4c4; }
.d-status.Draft { color: #8a6d1f; background: #fbf5e3; border-color: #e8dcb4; }
.d-flag { font-size: 0.68rem; font-weight: 800; padding: 2px 8px; border-radius: 10px; color: #fff; }
.d-flag.conflict { background: #c0392b; }
.d-flag.warn { background: #d68910; }
.d-grid { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; }
.d-row { display: grid; grid-template-columns: 132px 1fr; gap: 10px; font-size: 0.9rem; }
.d-label { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px; }

/* ── Daily sheet: Information notices (non-blocking) ───────────── */
.daily-info-section {
  background: #eef4f8; border: 1px solid #cfe0ea; border-left: 4px solid #5b8aa6;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 16px;
  break-inside: avoid; page-break-inside: avoid;
}
.daily-info-head {
  font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  color: #3f6c86; margin-bottom: 6px;
}
.daily-info-item {
  display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline;
  padding: 4px 0; font-size: 0.9rem; border-top: 1px solid #d8e6ef;
}
.daily-info-item:first-of-type { border-top: none; }
.daily-info-item .info-when { color: #3f6c86; font-weight: 600; min-width: 110px; }
.daily-info-item .info-title { font-weight: 700; color: var(--ink); }
.daily-info-item .info-detail { color: var(--mid); flex-basis: 100%; }

/* ── Print ───────────────────────────────────────────────────── */

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .form-wrap, .daily-wrap { padding: 0; max-width: none; }
  .daily-report { border: none; box-shadow: none; border-radius: 0; padding: 0; }
  .daily-event { border-top: 1px solid #999; }
  .d-status, .d-flag,
  .daily-info-section { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a[href]:after { content: ''; } /* don't append URLs */
}
