/* ============================================================
   FBC Forney Run Sheet Builder — Main Styles
   Clean, professional, ministry-staff-friendly
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

:root {
  --navy:        #3d6d9e;
  --navy-dark:   #2d5278;
  --navy-light:  #4a9fd4;
  --navy-very-light:  #9ad1f3;

  --gold:        #f0a83a;
  --gold-light:  #f7c96a;
  --bg:          #f0f4f8;
  --surface:     #FFFFFF;
  --surface-alt: #f7f9fc;
  --border:      #dde3ec;
  --text:        #2d3748;
  --text-muted:  #718096;
  --text-light:  #a0aec0;
  --success:     #59cd59;
  --warning:     #ff9059;
  --cloning:     #66b9b3;
  --danger:      #de5959;
  

  --dirty-bg:    #fffbeb;
  --dirty-border:#f0a83a;

  /* ── Time slot pill colors (modify to re-theme) ─── */
  --pill-t1-bg:   #6a89a5; --pill-t1-text: #fff; /* slot 1 — peach  9  */
  --pill-t2-bg:   #7d9aa7; --pill-t2-text: #fff; /* slot 2 — teal   11 */
  --pill-t3-bg:   #F3E3D0; --pill-t3-text: #5e5e5e; /* slot 3 — yellow    */
  --pill-t4-bg:   #D2C4B4; --pill-t4-text: #5e5e5e; /* slot 4 — purple  */

  --sidebar-w:   200px;
  --header-h:    60px;
  --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius:      6px;
  --shadow:      0 1px 4px rgba(0,0,0,.1);
  --shadow-md:   0 4px 16px rgba(0,0,0,.12);
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* ── Layout ───────────────────────────────────────────────── */
body {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  transition: width .2s ease, min-width .2s ease;
}

/* ── State 1: icons-only (48px) ───────────────────────────── */
body.sidebar-icons #sidebar {
  width: 48px;
  min-width: 48px;
  overflow: hidden;
}
body.sidebar-icons .sidebar-logo {
  padding: 12px 0;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
body.sidebar-icons .sidebar-logo__church,
body.sidebar-icons .sidebar-logo__app,
body.sidebar-icons .sidebar-logo__img { display: none; }
body.sidebar-icons .sidebar-toggle { margin-bottom: 0; }
body.sidebar-icons .sidebar-nav li {
  justify-content: center;
  padding: 10px 0;
}
body.sidebar-icons .nav-text { display: none; }
body.sidebar-icons .sidebar-nav li .nav-icon { font-size: 24px; width: 24px; display: inline-block; }

/* ── Toggle buttons ───────────────────────────────────────── */
.sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,.1); }
.sidebar-toggle .mi { font-size: 22px; }


.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

/* here */
.sidebar-logo__church {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--surface);
}

.sidebar-logo__app {
  font-size: 14px;
  color: rgba(255,255,255,.55);
  margin-top: 2px;
}

.sidebar-logo__img {
  display: block;
  width: 100%;
  max-width: 150px;
  margin: 14px auto 0;
  /* opacity: .35; */
}

.sidebar-nav {
  list-style: none;
  padding: 10px 0;
  flex: 1;
}

.sidebar-nav li {
  padding: 10px 18px;
  cursor: pointer;
  font-size: 16px;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-nav li:hover  { background: rgba(255,255,255,.08); }
.sidebar-nav li.active {
  background: rgba(255,255,255,.12);
  border-left-color: var(--navy-very-light);
  font-weight: 600;
}

.sidebar-nav li.nav-group-label {
  padding: 5px 18px 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  cursor: default;
  border-left: 3px solid transparent;
  pointer-events: none;
}
.sidebar-nav li.nav-group-label:hover { background: none; }

.sidebar-nav li.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.12);
  margin: 8px 14px;
  padding: 0;
  border: none;
  cursor: default;
  pointer-events: none;
}
.sidebar-nav li.nav-divider:hover { background: rgba(255,255,255,.12); }

body.sidebar-icons .sidebar-nav li.nav-group-label { display: none; }
body.sidebar-icons .sidebar-nav li.nav-divider { margin: 6px 8px; }

.sidebar-nav li.nav-sub-item {
  padding: 5px 18px 5px 28px;
  font-size: 13px;
  color: rgba(255,255,255,.6);
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-nav li.nav-sub-item .nav-icon { font-size: 16px; width: 16px; opacity: .7; }
body.sidebar-icons .sidebar-nav li.nav-sub-item { display: none; }

.sidebar-nav li .nav-icon { font-size: 24px; width: 24px; display: inline-block; }

.mi {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  vertical-align: middle;
  display: inline-block;
  white-space: nowrap;
  user-select: none;
}
button .mi { pointer-events: none; }

/* ── Main content ─────────────────────────────────────────── */
#main-content {
  flex: 1;
  overflow-y: auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Views ────────────────────────────────────────────────── */
.view { display: none; flex-direction: column; flex: 1; min-height: 0; }
.view.active { display: flex; }


/* ── View header ──────────────────────────────────────────── */
.view-header {
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.view-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  flex: 1;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}

.btn:disabled { opacity: .5; cursor: default; }

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

.btn-primary  { background: var(--navy); color: #fff; }
.btn-primary:hover { opacity: .75; }

.btn-secondary { background: #6B7280; color: #fff; border-color: #6B7280; }
.btn-secondary:hover { background: #4B5563; border-color: #4B5563; }

.btn-cloning { background: var(--cloning); color: #fff; border-color: #6cb980; }
.btn-cloning:hover { opacity: .75; }

.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .75; }

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 7px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  transition: background .1s, color .1s;
}
.btn-icon:hover { background: var(--bg); color: var(--navy); }
.btn-icon--danger:hover { background: #fee2e2; color: var(--danger); border-color: var(--danger); }

/* Section "+ Add" button (inside section header row) */
.btn-section-add {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 4px;
  padding: 2px 9px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font);
  transition: background .1s;
  white-space: nowrap;
}
.btn-section-add:hover { background: rgba(255,255,255,.3); }

/* ── Services list ────────────────────────────────────────── */
#view-services .view-content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.services-grid {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 1200px;
}

.svc-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.svc-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.svc-pill {
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .1s, color .1s, border-color .1s;
}
.svc-pill:hover { border-color: var(--navy-light); color: var(--navy); }
.svc-pill--active { background: var(--navy); color: #fff; border-color: var(--navy); }
.svc-pill--active:hover { color: #fff; }

/* Month/year group header */
.svc-month-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 20px 0 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.svc-month-header:first-child { padding-top: 0; }

/* Service row */
.svc-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.svc-row:hover { background: var(--surface-alt); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 6px; }

.svc-row__date {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  width: 160px;
  flex-shrink: 0;
}

.svc-row__name {
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
  background: #F3F4F6;
  border-radius: 4px;
  padding: 2px 7px;
  flex: 1;
}

.svc-row__times {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.time-chip {
  background: var(--navy-light);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 15px;
  letter-spacing: .04em;
}

.svc-row__actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  min-width: 420px;
  justify-content: flex-end;
}

/* ── Service editor ───────────────────────────────────────── */
#view-service {
  overflow: hidden;
}

.service-editor-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Service time tabs */
.time-tabs-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.role-tabs-rows .time-tabs-bar {
  background: #EEF1F8;
  border-bottom: 1px solid var(--border);
  padding: 2px 8px;
}

.time-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.time-tab:hover  { color: var(--navy); }
.time-tab.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

#service-time-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

/* Role tabs */
.role-tabs-bar {
  background: #EEF1F8;
  border-bottom: 1px solid var(--border);
  padding: 0 16px 0 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex-shrink: 0;
}

.role-tab--master {
  border-right: 2px solid var(--navy) !important;
  border-bottom: none !important;
  padding: 0 18px;
  font-size: 13px !important;
  font-weight: 700 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  background: #E4E8F2;
}
.role-tab--master:hover:not(.active) {
  background: #D8DCE8;
  color: var(--navy);
}
.role-tab--master.active {
  background: var(--surface);
  color: var(--navy);
  border-bottom: none !important;
  border-right: 2px solid var(--navy) !important;
}

.role-tabs-rows {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.role-tabs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  flex: 1;
}
.role-tabs-row + .role-tabs-row {
  border-top: 1px solid var(--border);
}

.role-tab-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 6px 0 10px;
  opacity: 0.7;
  white-space: nowrap;
  user-select: none;
}
.role-tabs-row > .role-tab-group-label:first-child {
  width: 130px;
  flex-shrink: 0;
}

.role-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 7px 10px;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  min-width: 110px;
}
.role-tab:hover  { color: var(--navy); }
.role-tab.active {
  color: var(--navy);
  background: var(--surface);
  border-bottom-color: var(--navy);
  font-weight: 700;
}

/* Tab panels */
.tab-panel {
  display: none;
  overflow-y: auto;
  overflow-x: auto;
  padding: 20px 24px;
  flex: 1;
  min-height: 0;
}
.tab-panel.active {
  display: flex;
  flex-direction: column;
}

/* ── Master plan ──────────────────────────────────────────── */
.master-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
/* ── Reusable horizontal rule ─────────────────────────────────
   Usage: <div class="hr"></div>
   On dark backgrounds (sidebar): <div class="hr hr--dark"></div>  */
.hr {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
  border: none;
}
.hr--dark { background: rgba(255,255,255,.12); }

.master-filter-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}
.master-filter-pill {
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.master-filter-pill:hover {
  border-color: var(--navy);
  color: var(--navy);
}
.master-filter-pill.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.master-filter-pill--action.active {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}
.master-row--hidden {
  display: none !important;
}
.master-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.master-plan-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.master-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
}

/* Drag handle */
.drag-handle {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  opacity: .35;
  cursor: grab;
  padding: 2px 0;
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
}
.drag-handle:hover { opacity: .7; }
.master-row:active .drag-handle { cursor: grabbing; }
.master-row--section .drag-handle { color: rgba(255,255,255,0.6); }
.master-row--section .drag-handle:hover { color: #fff; opacity: 1; }

/* Row being dragged */
.master-row.dragging {
  opacity: .4;
  border-style: dashed;
}

/* Drop position indicators */
.master-row.drag-over--top::before,
.master-row.drag-over--bottom::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--navy-light);
  border-radius: 2px;
  pointer-events: none;
}
.master-row.drag-over--top::before    { top: -2px; }
.master-row.drag-over--bottom::after  { bottom: -2px; }

.master-row--section {
  background: var(--navy);
  border-color: var(--navy-dark);
  color: #fff;
  font-weight: 700;
  letter-spacing: .05em;
  font-size: 12px;
  text-transform: uppercase;
}


.master-row--action {
  background: var(--surface-alt);
  border-style: dashed;
  color: var(--text-muted);
  font-size: 12px;
}

.master-row__label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.master-row__main {
  flex: 1;
}

.master-row__header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.master-row__shared {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.master-row__actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.section-badge {
  font-size: 9px;
  font-weight: 700;
  background: rgba(255,255,255,.25);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .05em;
}

.section-name {
  outline: none;
  font-weight: 700;
}
.section-name:focus {
  background: rgba(255,255,255,.15);
  border-radius: 3px;
  padding: 0 3px;
}

.item-name {
  font-weight: 600;
  font-size: 13.5px;
  outline: none;
  min-width: 60px;
}
.item-name:focus {
  background: #f0f4ff;
  border-radius: 3px;
  padding: 0 4px;
}

/* Shared field inputs */
.field-pair {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.field-pair span {
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.shared-input {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
  font-family: var(--font);
  background: var(--bg);
  width: 250px;
  outline: none;
}
.field-pair--narrow .shared-input { width: 60px; }

.btn-action-role-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.btn-action-role-toggle:hover { border-color: var(--navy-light); color: var(--navy); }
.btn-action-role-toggle.has-overrides { color: var(--navy); border-color: var(--navy-light); }
.master-row__per-role {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
}
.master-row__per-role .field-pair {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.master-row__per-role .shared-input { width: 250px; }
.shared-input:focus {
  border-color: var(--navy-light);
  background: #fff;
}

/* Badges */
.cat-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-transform: capitalize;
}
.cat-badge--worship-song  { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.cat-badge--song          { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.cat-badge--response-song { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.cat-badge--action        { background: #fef9c3; color: #854d0e; border-color: #fde047; }
.cat-badge--action-fw     { background: #fef9c3; color: #854d0e; border-color: #fde047; }
.cat-badge--variable      { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.cat-badge--standard      { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }

.role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

/* ── AD sheet preview ─────────────────────────────────────── */
.ad-sheet-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.ad-sheet-preview .cell-data {
  pointer-events: none;
  outline: none !important;
}
.ad-sheet-preview .cell-lib-edit-btn,
.ad-sheet-preview .cell-reset-btn {
  display: none;
}

/* ── Role sheet tables ────────────────────────────────────── */
.sheet-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 768px;
}

.sheet-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.sheet-panel-checks {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 260px;
  justify-content: flex-end;
}

.sheet-panel-title strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

.time-label {
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}

.sheet-panel-note {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.tech-names-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary, #555);
  cursor: pointer;
  user-select: none;
}

.sheet-table {
  width: 768px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── Fixed column widths — screen matches print layout ── */
/* foh-audio: ITEM(340) + input(140) + notes(288) = 768px */
[data-role="foh-audio"] .sheet-table colgroup > col:nth-child(1) { width: 340px !important; }
[data-role="foh-audio"] .sheet-table colgroup > col:nth-child(2) { width: 140px !important; }
[data-role="foh-audio"] .sheet-table colgroup > col:nth-child(3) { width: 288px !important; }

/* broadcast-audio: ITEM(261) + subLabel(154) + input(115) + notes(238) = 768px */
[data-role="broadcast-audio"] .sheet-table colgroup > col:nth-child(1) { width: 261px !important; }
[data-role="broadcast-audio"] .sheet-table colgroup > col:nth-child(2) { width: 154px !important; }
[data-role="broadcast-audio"] .sheet-table colgroup > col:nth-child(3) { width: 115px !important; }
[data-role="broadcast-audio"] .sheet-table colgroup > col:nth-child(4) { width: 238px !important; }

/* graphics: ITEM(261) + screens(138) + led(177) + notes(192) = 768px */
[data-role="graphics"] .sheet-table colgroup > col:nth-child(1) { width: 261px !important; }
[data-role="graphics"] .sheet-table colgroup > col:nth-child(2) { width: 138px !important; }
[data-role="graphics"] .sheet-table colgroup > col:nth-child(3) { width: 177px !important; }
[data-role="graphics"] .sheet-table colgroup > col:nth-child(4) { width: 192px !important; }

/* lights: ITEM(190) + cues(70) + slide(55) + label(215) + notes(238) = 768px */
[data-role="lights"] .sheet-table colgroup > col:nth-child(1) { width: 190px !important; }
[data-role="lights"] .sheet-table colgroup > col:nth-child(2) { width: 70px  !important; }
[data-role="lights"] .sheet-table colgroup > col:nth-child(3) { width: 55px  !important; }
[data-role="lights"] .sheet-table colgroup > col:nth-child(4) { width: 215px !important; }
[data-role="lights"] .sheet-table colgroup > col:nth-child(5) { width: 238px !important; }

/* director: BROADCAST(131) + LIVE(115) + ITEM(230) + SL(38) + SCREENS(123) + LED(131) = 768px */
[data-role="director"] .sheet-table colgroup > col:nth-child(1) { width: 131px !important; }
[data-role="director"] .sheet-table colgroup > col:nth-child(2) { width: 115px !important; }
[data-role="director"] .sheet-table colgroup > col:nth-child(3) { width: 230px !important; }
[data-role="director"] .sheet-table colgroup > col:nth-child(4) { width: 38px  !important; }
[data-role="director"] .sheet-table colgroup > col:nth-child(5) { width: 123px !important; }
[data-role="director"] .sheet-table colgroup > col:nth-child(6) { width: 131px !important; }

/* broadcast-td / live-td: KEY(154) + ITEM(261) + SCREENS(161) + LED(192) = 768px */
[data-role="broadcast-td"] .sheet-table colgroup > col:nth-child(1) { width: 154px !important; }
[data-role="broadcast-td"] .sheet-table colgroup > col:nth-child(2) { width: 261px !important; }
[data-role="broadcast-td"] .sheet-table colgroup > col:nth-child(3) { width: 161px !important; }
[data-role="broadcast-td"] .sheet-table colgroup > col:nth-child(4) { width: 192px !important; }
[data-role="live-td"] .sheet-table colgroup > col:nth-child(1) { width: 154px !important; }
[data-role="live-td"] .sheet-table colgroup > col:nth-child(2) { width: 261px !important; }
[data-role="live-td"] .sheet-table colgroup > col:nth-child(3) { width: 161px !important; }
[data-role="live-td"] .sheet-table colgroup > col:nth-child(4) { width: 192px !important; }

/* extras: single full-width column */
[data-role="extras"] .sheet-table colgroup > col:nth-child(1) { width: 768px !important; }

/* ep, cam1, cam4, stage-manager: ITEM(307) + notes(461) = 768px  [40/60] */
[data-role="ep"] .sheet-table colgroup > col:nth-child(1),
[data-role="cam1"] .sheet-table colgroup > col:nth-child(1),
[data-role="cam4"] .sheet-table colgroup > col:nth-child(1),
[data-role="stage-manager"] .sheet-table colgroup > col:nth-child(1) { width: 307px !important; }
[data-role="ep"] .sheet-table colgroup > col:nth-child(2),
[data-role="cam1"] .sheet-table colgroup > col:nth-child(2),
[data-role="cam4"] .sheet-table colgroup > col:nth-child(2),
[data-role="stage-manager"] .sheet-table colgroup > col:nth-child(2) { width: 461px !important; }

/* mio: ITEM(230) + sermonTitle(192) + notes(346) = 768px  [30/25/45] */
[data-role="mio"] .sheet-table colgroup > col:nth-child(1) { width: 230px !important; }
[data-role="mio"] .sheet-table colgroup > col:nth-child(2) { width: 192px !important; }
[data-role="mio"] .sheet-table colgroup > col:nth-child(3) { width: 346px !important; }

/* ptz: ITEM(250) + startShot(160) + baptismSlide(90) + notes(268) = 768px */
[data-role="ptz"] .sheet-table colgroup > col:nth-child(1) { width: 250px !important; }
[data-role="ptz"] .sheet-table colgroup > col:nth-child(2) { width: 160px !important; }
[data-role="ptz"] .sheet-table colgroup > col:nth-child(3) { width: 90px  !important; }
[data-role="ptz"] .sheet-table colgroup > col:nth-child(4) { width: 268px !important; }

/* director only — smaller data rows to fit 6 columns */
[data-role="director"] .sheet-table td { font-size: 13px; }

.sheet-table th {
  background: var(--navy);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,.18);
}
.sheet-table th:last-child { border-right: none; }

.sheet-table td {
  padding: 6px 10px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: middle;
  min-height: 28px;
  line-height: 1.4;
  white-space: nowrap;
}
.sheet-table td:last-child { border-right: none; }

.sheet-table th[data-col-id="cues"],
.sheet-table td[data-col-id="cues"],
.sheet-table th[data-col-id="subCue"],
.sheet-table td[data-col-id="subCue"] { text-align: center; }

.sheet-table tr:last-child td { border-bottom: none; }

/* Section header rows */
.sheet-row--section td {
  background: var(--section-bg, var(--navy-light));
  color: var(--section-text, #fff);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 6px 10px;
}


/* Action rows */
.sheet-row--action td {
  background: var(--action-color, #dbeafe);
  color: var(--action-text-color, var(--text));
  font-weight: 700;
  letter-spacing: .04em;
  padding: 5px 10px;
}

/* Full-width action rows — single spanning centered cell */
.sheet-row--action-fw td {
  text-align: center;
  letter-spacing: .06em;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Sub-rows */
.sheet-row--subrow td { background: var(--surface-alt); }
.cell-name--sub { padding-left: 20px !important; color: var(--text-muted); }


/* Remove bottom border between parent and its sub-rows so they read as one group */
.sheet-table tbody tr.sheet-row--data:has(+ tr.sheet-row--subrow) td,
.sheet-table tbody tr.sheet-row--subrow:has(+ tr.sheet-row--subrow) td { border-bottom: none; }

/* Data cells */
.cell-name {
  font-weight: 400;
  color: var(--text);
}

.cell-data {
  outline: none;
  cursor: text;
  transition: background .1s;
}
.cell-data:hover  { background: #f0f4ff; }
.cell-data.cell-editing { background: #e8efff; outline: 2px solid var(--navy-light); outline-offset: -1px; border-radius: 3px; }

.cell-dirty::after {
  content: '*';
  font-size: 11px;
  color: var(--warning);
  margin-left: 3px;
  vertical-align: super;
}

.cell-reset-btn {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 0 3px 3px 0;
  font-size: 13px;
  padding: 0 7px;
  cursor: pointer;
  opacity: .75;
  z-index: 1;
  align-items: center;
  justify-content: center;
}
.cell-dirty { position: relative; }
.cell-dirty:hover .cell-reset-btn { display: flex; }
.cell-reset-btn:hover { opacity: 1; }

/* Library edit button — appears on row hover in the first cell */
.cell-has-lib-btn { position: relative; }
.cell-lib-edit-btn {
  display: none;
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  background: transparent;
  color: var(--navy-light);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  padding: 2px 4px;
  cursor: pointer;
  opacity: .55;
  z-index: 2;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cell-lib-edit-btn:hover { opacity: 1; background: rgba(61,109,158,.12); }
tr.sheet-row--data:hover .cell-lib-edit-btn,
tr.sheet-row--action:hover .cell-lib-edit-btn { display: flex; }

/* Unresolved {token} placeholder — styled on screen, hidden in print via .no-print */
.unresolved-token {
  color: #d97706;
  font-style: italic;
  font-size: 0.85em;
  opacity: 0.8;
}

/* Notes prefixed with ! render in red — use for critical cues e.g. "! TURN OFF FRONT SUBS / FILLS" */
.cell-alert {
  color: var(--danger) !important;
  font-weight: 700;
}

/* Text longer than the cell width — red outline to signal truncation */
.cell-overflow {
  outline: 2px solid var(--danger) !important;
  outline-offset: -2px;
}

.page-overflow-warn {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #d97706;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: .03em;
  margin-left: 8px;
}

/* ── Alternating row shading (group-aware: sub-rows share parent's shade) ── */
.sheet-table tbody tr.row-group--even td { background: #EEF2F7; }
.sheet-table tbody tr.row-group--odd  td { background: #fff; }

/* ── Condensed print mode (screen preview) ────────────────────────────── */
.print-area.condensed .sheet-table         { font-size: 13px; }
.print-area.condensed .sheet-table td      { padding: 4px 10px; min-height: 0; }
.print-area.condensed .sheet-row--section td { font-size: 13px; padding: 4px 10px; }
.print-area.condensed .sheet-row--action td  { font-size: 13px; padding: 3px 10px; }
.print-area.condensed .sheet-row--subrow td  { font-size: 13px; }
.print-area.condensed [data-role="director"] .sheet-table td { font-size: 12px; }

/* ── Add item modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border-radius: 10px;
  padding: 24px;
  width: 500px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.modal.hidden { display: none; }

.modal h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-muted);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.form-actions .modal-close { background: #6B7280; color: #fff; border: 1px solid #6B7280; font-size: 13px; padding: 7px 14px; }
.form-actions .modal-close:hover { background: #4B5563; border-color: #4B5563; }
.modal-library-footer .modal-close {
  background: #6B7280;
  border: 1px solid #6B7280;
  font-size: 12px;
  color: #fff;
  padding: 5px 10px;
  border-radius: var(--radius);
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
}
.modal-library-footer .modal-close:hover {
  background: #4B5563;
  border-color: #4B5563;
}

/* Event type picker */
.event-list-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.event-list-section:first-child { border-top: none; margin-top: 0; }

.event-list-item {
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 7px 10px;
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .1s;
}
.event-list-item:hover { background: var(--bg); border-color: var(--border); }
.event-list-item > span:first-child { flex: 1; }

.event-list-divider {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 0 4px;
  border-top: 1px solid var(--border);
}

/* ── New service form ─────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-group input[type="date"],
.form-group input[type="text"],
.form-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  background: var(--bg);
}
.form-group input:focus {
  border-color: var(--navy-light);
  background: #fff;
}
.form-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 0 4px;
}

/* ── Templates view ──────────────────────────────────────── */
#templates-list-wrap .master-toolbar {
  padding: 0 0 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
#templates-editor-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
#template-editor-inner {
  display: flex;
  flex-direction: column;
}
#template-editor-inner .master-toolbar {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  flex-shrink: 0;
}
#template-editor-inner .master-plan-list {
  padding: 20px 24px;
}
.template-list {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.template-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.template-row__info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.template-row__name {
  font-weight: 600;
  font-size: 14px;
}
.template-row__count {
  font-size: 12px;
  color: var(--text-muted);
}
.template-row__actions {
  display: flex;
  gap: 6px;
}

/* ── Library view ─────────────────────────────────────────── */
#view-library .view-content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

#library-list {
  padding: 24px;
  max-width: 1200px;
}

#templates-list-wrap {
  max-width: 1200px;
}

#template-editor-inner {
  max-width: 1200px;
}

#templates-list {
  padding: 24px;
}

.library-section-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin: 24px 0 10px;
}
.library-section-header:first-child { margin-top: 0; }

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

.library-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.library-card__header strong { font-size: 14px; color: var(--navy); }

.library-card__roles {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.library-card__role {
  font-size: 12px;
  color: var(--text-muted);
}
.library-card__role strong {
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  background: #e8edfa;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 6px;
}
.library-card__role em { color: var(--text); font-style: normal; }

.library-card__subrow {
  font-size: 11px;
  color: var(--text-muted);
  padding-left: 28px;
  margin-top: 1px;
}
.library-card__subrow em { color: var(--text); font-style: normal; }

/* ── Settings view ────────────────────────────────────────── */
.settings-section {
  padding: 24px;
  max-width: 1200px;
}

.settings-section h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.settings-section p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.settings-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.settings-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.settings-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--navy);
}

.settings-info {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

/* ── Markup Colors Settings ───────────────────────────────── */
.markup-colors-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.markup-colors-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.markup-key-input {
  width: 110px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: monospace;
  background: var(--surface);
  color: var(--text);
}
.markup-key-input:focus {
  outline: 2px solid var(--navy-light);
  outline-offset: -1px;
}

.markup-color-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}

.markup-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.markup-color-input {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
}

.markup-color-hex {
  font-size: 12px;
  font-family: monospace;
  color: var(--text-muted);
  width: 62px;
}

.markup-preview {
  font-size: 13px;
  font-family: monospace;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.markup-delete-btn {
  flex-shrink: 0;
  color: var(--text-muted);
}

.markup-colors-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* ── Misc ─────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
  font-size: 14px;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Print area: visible in app, styled for print in print.css */
.print-area { position: relative; }
.sheet-print-header { display: none; } /* shown in print CSS */
.sheet-print-footer { display: none; } /* shown in print CSS */

/* ── Library list ─────────────────────────────────────────── */
.library-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.lib-search-input {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  width: 200px;
  outline: none;
  background: var(--bg);
}
.lib-search-input:focus { border-color: var(--navy-light); }
.lib-filter-chips {
  display: flex;
  gap: 6px;
}
.lib-chip {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .1s, color .1s, border-color .1s;
}
.lib-chip:hover { border-color: var(--navy-light); color: var(--navy); }
.lib-chip--active { background: var(--navy); color: #fff; border-color: var(--navy); }
.lib-chip--active:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.library-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
  background: #fff;
  gap: 12px;
}
.library-row[draggable="true"] { cursor: default; }
.lib-drag-handle {
  color: #9CA3AF;
  cursor: grab;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  /* opacity: 0;
  transition: opacity .15s; */
}
.library-row[draggable="true"]:hover .lib-drag-handle { opacity: 1; }
.library-row[draggable="true"].lib-dragging { opacity: 0.4; }
.library-row[draggable="true"].lib-drag-over-above { border-top: 2px solid var(--navy); }
.library-row[draggable="true"].lib-drag-over-below { border-bottom: 2px solid var(--navy); }
.library-row__info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.library-row__name {
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  white-space: nowrap;
}
.library-row__name + .cat-badge,
.library-row__name + .role-badge {
  margin-left: auto;
}
.library-row__info .cat-badge {
  flex-shrink: 0;
}
.library-row__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Library editor modal ─────────────────────────────────── */
.modal--fullscreen {
  width: 96vw;
  max-width: 1400px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.modal-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-library-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--navy);
}
.modal-library-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.modal-library-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Metadata row */
.lib-meta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.lib-meta-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}
.lib-meta-field label,
.lib-var-field span,
.lib-vars-title,
.lib-roles-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.lib-meta-field input,
.lib-meta-field select,
.lib-var-field input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--navy);
}

/* Variable defaults */
.lib-vars-row,
.lib-roles-row {
  background: #f8f9fb;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
}
.lib-vars-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* ── Chip UI ── */
.lib-var-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lib-var-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #e8f0fb;
  border: 1px solid #c3d5f0;
  border-radius: 20px;
  padding: 4px 10px 4px 12px;
  font-size: 12px;
}
.lib-var-chip__name {
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}
.lib-var-chip__field-label {
  color: #6b7280;
  white-space: nowrap;
  margin-left: 4px;
}
.lib-var-chip__input {
  padding: 2px 6px;
  border: 1px solid #c3d5f0;
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
  width: 90px;
}
.lib-var-chip__input:focus {
  outline: none;
  border-color: var(--navy);
}
.lib-var-chip__label-input {
  width: 80px;
}
.lib-var-chip__remove {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 4px;
  border-radius: 50%;
}
.lib-var-chip__remove:hover {
  color: #ef4444;
}

/* Add Variable dropdown */
.lib-var-add {
  position: relative;
  display: inline-block;
}
.lib-var-add-btn {
  font-size: 12px;
}
.lib-var-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  min-width: 220px;
  padding: 6px;
}
.lib-var-search {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 4px;
  box-sizing: border-box;
}
.lib-var-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
}
.lib-var-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
}
.lib-var-list li:hover {
  background: #f0f4ff;
}
.lib-var-list__token {
  font-size: 11px;
  color: #6b7280;
  font-family: monospace;
}
.lib-var-list__empty {
  color: #9ca3af;
  font-size: 12px;
  cursor: default !important;
}
.lib-var-list__empty:hover {
  background: none !important;
}

/* ─── Variables view ────────────────────────────────── */
.vars-add-section {
  margin-bottom: 20px;
}
.vars-add-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 12px;
  background: #f8f9fb;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.vars-form-input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  width: 200px;
}
.vars-form-input--narrow {
  width: 140px;
  font-family: monospace;
}
.vars-form-select {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
}
.vars-form-token-preview {
  font-size: 12px;
  color: #6b7280;
}
.vars-section {
  margin-bottom: 24px;
}
.vars-section-heading {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin: 0 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.vars-section--builtin {
  opacity: 0.7;
}
.vars-builtin-note {
  font-size: 12px;
  color: #9ca3af;
  margin: 0 0 10px 0;
}
.vars-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vars-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  background: #f8f9fb;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 5px;
}
.vars-row__name {
  width: 160px;
  flex-shrink: 0;
  font-weight: 500;
  font-size: 14px;
}
.vars-row__token {
  width: 130px;
  flex-shrink: 0;
  font-family: monospace;
  font-size: 12px;
  color: var(--navy);
  background: #e8f0fb;
  padding: 2px 8px;
  border-radius: 4px;
}
.vars-row__type {
  width: 48px;
  flex-shrink: 0;
  font-size: 12px;
  color: #6b7280;
}
.vars-row__value {
  font-size: 13px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex: 1;
  min-width: 0;
}
.vars-pipe-hint {
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #374151;
  margin-bottom: 16px;
}
.vars-pipe-hint code {
  background: #e0e7ff;
  border-radius: 3px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 12px;
}
.vars-row--builtin .vars-row__name {
  color: #6b7280;
}

/* Legacy single-field style (keep for backwards compat) */
.lib-var-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}

/* Show on roles */
.lib-roles-checks {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.lib-role-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}

/* Per-role sections */
#lib-role-tables {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lib-role-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.lib-role-section--dimmed {
  opacity: 0.45;
}
.lib-role-section--active .lib-role-section__abbr {
  background: #e53e3e;
  border-color: #e53e3e;
}
.lib-role-section__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--navy);
  color: #fff;
}
.lib-role-section__name {
  font-weight: 700;
  font-size: 13px;
}
.lib-role-section__abbr {
  font-size: 10px;
  background: rgba(255,255,255,.15);
  color: #fff;
  border-color: rgba(255,255,255,.2);
}
.lib-role-section__restricted {
  margin-left: auto;
  font-size: 10px;
  opacity: .7;
  font-style: italic;
}

/* Role mini-table */
.lib-role-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.lib-role-table th {
  background: var(--navy-light);
  color: #fff;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-align: left;
}
.lib-role-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.lib-role-table tr.lib-subrow td {
  background: #f8f9fb;
}
.lib-role-table tr.lib-row--action td {
  background: #fef3c7;
}
.lib-cell-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 13px;
  background: transparent;
  color: var(--navy);
}
.lib-cell-input:focus {
  border-color: var(--navy-light);
  background: #fff;
  outline: none;
}
.lib-col-actions {
  width: 120px;
  white-space: nowrap;
}
.lib-add-row-btn {
  margin: 6px 10px;
  font-size: 12px;
}
.btn-xs {
  padding: 2px 7px;
  font-size: 11px;
  border-radius: 3px;
}
.lib-action-clear {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  margin-right: 4px;
  cursor: pointer;
}

/* Action color picker */
.lib-action-color-row {
  background: #f8f9fb;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.lib-color-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lib-color-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.lib-color-swatches {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lib-color-row {
  display: flex;
  gap: 6px;
}
.lib-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .1s, border-color .1s;
}
.lib-color-swatch--empty {
  background: #fff !important;
  border: 2px dashed #d1d5db !important;
  cursor: default;
  pointer-events: none;
}
.lib-color-swatch:not(.lib-color-swatch--empty):hover { transform: scale(1.15); }
.lib-color-swatch--active { border-color: var(--navy); }
.lib-color-divider {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.lib-color-picker-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.lib-color-picker-wrap::after {
  content: '+';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  background: var(--navy);
  color: #fff;
  font-size: 10px;
  line-height: 12px;
  text-align: center;
  border-radius: 2px 0 2px 0;
  pointer-events: none;
}
#lib-field-color {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  display: block;
}

/* ── Library tab bar ──────────────────────────────────────────────────────── */
.lib-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 12px;
  padding-bottom: 0;
}
.lib-tab {
  padding: 8px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.lib-tab:hover { color: var(--navy); }
.lib-tab--active { color: var(--navy); border-bottom-color: var(--navy); }

/* ── Song library panel ───────────────────────────────────────────────────── */
.song-lib-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.song-lib-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.song-lib-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  gap: 10px;
}
.song-lib-row__info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.song-lib-row__name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}
.song-lib-row__name + .song-meta-badge {
  margin-left: auto;
}
.song-lib-row__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.song-meta-badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 15px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Song editor modal form ───────────────────────────────────────────────── */
.song-editor-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}
.song-editor-form .field-pair span { min-width: 100px; }
.song-editor-form .field-pair input { flex: 1; }
.field-pair--hint { font-size: 11px; color: var(--text-muted); padding-left: 108px; margin-top: -4px; }
.field-pair--checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.field-pair--checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--navy);
  cursor: pointer;
}

/* ── Subs off toggle on song rows ────────────────────────────────────────── */
.song-subs-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-alt);
  user-select: none;
  white-space: nowrap;
  transition: background .1s, color .1s, border-color .1s;
}
.song-subs-toggle:has(input:checked) {
  background: #fec3c3;
  border-color: #fa7777;
  color: #850e0e;
  font-weight: 600;
}
.song-subs-toggle input { display: none; }

/* ── Song slot in master plan ─────────────────────────────────────────────── */
.song-name-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.song-search-input {
  flex: 1;
  min-width: 160px;
  max-width: 320px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.song-search-input:focus {
  border-color: var(--navy-light);
  background: #fff;
}
.song-search-input::placeholder { color: var(--text-light); }

/* Linked state */
.song-name-wrap--linked { gap: 4px; }
.song-link-icon {
  font-size: 16px;
  color: var(--navy-light);
  flex-shrink: 0;
}
.song-name-linked {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  outline: none;
  border-radius: 4px;
  padding: 2px 4px;
}
.song-name-linked:focus {
  background: #f0f4f8;
  outline: 1px solid var(--navy-light);
}
.btn-song-unlink {
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity .15s, color .15s;
}
.btn-song-unlink:hover { opacity: 1; color: #dc2626; }

/* Autocomplete dropdown */
.song-autocomplete {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 260px;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  z-index: 200;
  overflow: hidden;
}
.song-autocomplete.hidden { display: none; }
.song-ac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  gap: 10px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.song-ac-item:hover,
.song-ac-item:focus { background: var(--surface-alt); }
.song-ac-name { font-weight: 500; }
.song-ac-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.song-ac-item--add {
  color: var(--navy);
  font-size: 13px;
  border-top: 1px solid var(--border);
  gap: 6px;
}
.song-ac-item--add .mi { font-size: 16px; vertical-align: middle; }

/* ── Audio sheets INPUT/LEAD column — display uppercase ─────────── */
[data-role="foh-audio"] [data-col-id="input"],
[data-role="broadcast-audio"] [data-col-id="input"] { text-transform: uppercase; }

/* ── Songs / Staff view padding ──────────────────────────────── */
#songs-view-content,
#staff-view-content {
  padding: 24px;
  max-width: 1200px;
}

/* ════════════════════════════════════════════════════════════════════
   STAFF VIEW
   ════════════════════════════════════════════════════════════════════ */

.staff-section {
  margin-bottom: 32px;
}
.staff-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.staff-people-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.staff-person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.staff-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.staff-person-row__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.staff-person-row__top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.staff-person-row__name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}
.staff-person-row__title {
  font-size: 12px;
  color: var(--text-muted);
}
.staff-person-row__email {
  font-size: 12px;
  color: var(--navy);
  text-decoration: none;
}
.staff-person-row__email:hover { text-decoration: underline; }
.staff-person-row__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 0;
}
.staff-person-row__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Role chips */
.staff-role-chip {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 15px;
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 500;
}

/* Roles management section */
.staff-roles-section {
  border-top: 2px solid var(--border);
  padding-top: 24px;
}
.staff-roles-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.staff-roles-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.staff-role-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.staff-roles-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.staff-role-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.staff-role-row__name {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

/* Staff person editor modal */
.staff-person-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}
.staff-person-form .field-pair span { min-width: 100px; }
.field-pair--top { align-items: flex-start; }
.staff-role-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}
.staff-role-check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface-alt);
}
.staff-role-check-label input { accent-color: var(--navy); }
.staff-role-check-label:has(input:checked) {
  background: #e0e7ff;
  border-color: #818cf8;
  color: #3730a3;
}

/* ════════════════════════════════════════════════════════════════════
   STAFF PICKER DROPDOWN
   ════════════════════════════════════════════════════════════════════ */

.staff-picker-dropdown {
  display: none;
  position: absolute;
  z-index: 1200;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 220px;
  overflow-y: auto;
  min-width: 280px;
}
.staff-picker-dropdown--open {
  display: block;
}
.staff-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.staff-picker-item:hover {
  background: var(--surface-alt);
}
.staff-picker-item__name {
  flex: 1;
}
.staff-picker-item__role {
  font-size: 11px;
  font-weight: 500;
  color: #3730a3;
  background: #e0e7ff;
  padding: 1px 7px;
  border-radius: 99px;
  white-space: nowrap;
}
.staff-picker-item--add {
  color: var(--navy);
  font-size: 13px;
  border-top: 1px solid var(--border);
  font-weight: 500;
}

/* ── Baptism multi-name list ──────────────────────────────── */
.blf-names-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.blf-add-name-row {
  padding: 4px 0 8px 112px; /* align under inputs (label width + gap) */
}

/* ── Log editor modal form grid ───────────────────────────── */
.modal-form-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px 12px;
  align-items: center;
  padding: 4px 0 16px;
}
.modal-form-grid label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

/* ── Time pills (log tables) ──────────────────────────────── */
.log-time-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.log-time-pill  { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.log-time-pill--t1 { background: var(--pill-t1-bg); color: var(--pill-t1-text); }
.log-time-pill--t2 { background: var(--pill-t2-bg); color: var(--pill-t2-text); }
.log-time-pill--t3 { background: var(--pill-t3-bg); color: var(--pill-t3-text); }
.log-time-pill--t4 { background: var(--pill-t4-bg); color: var(--pill-t4-text); }

/* ── Logs view ────────────────────────────────────────────── */
#view-logs .view-content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}
.log-panel {
  padding: 16px 0;
}
.log-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.log-filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.log-search-input {
  flex: 1;
  max-width: 360px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
}
.log-search-input:focus { outline: none; border-color: var(--navy); }
.log-date-input {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.log-date-input:focus { outline: none; border-color: var(--navy); }
.log-date-sep {
  color: var(--text-muted);
  font-size: 13px;
  padding: 0 2px;
}
.log-table {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}
.log-table-header,
.log-table-row {
  display: flex;
  align-items: center;
  gap: 0;
}
.log-table-header {
  background: var(--surface-alt);
  font-weight: 600;
  font-size: 12px;
  color: #6b7280;
  border-bottom: 1px solid var(--border);
}
.log-table-row {
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.log-table-row:last-child {
  border-bottom: none;
}
.log-table-row:hover {
  background: var(--surface-alt);
}
.log-col {
  padding: 8px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-col--date    { width: 155px; flex-shrink: 0; }
.log-col--service { width: 155px; flex-shrink: 0; }
.log-col--svctime { width: 250px; flex-shrink: 0; overflow: visible; white-space: normal; }
.log-col--speaker { width: 185px; flex-shrink: 0; }
.log-col--title   { width: 185px; flex-shrink: 0; }
.log-col--series  { width: 185px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-col--idea    { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-col--bname   { flex: 1; min-width: 0; }
.log-col--actions { width: 230px; flex-shrink: 0; display: flex; gap: 4px; justify-content: flex-end; }

/* Log form */
.log-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}
.log-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.log-form-row label {
  width: 90px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.log-form-row .shared-input {
  flex: 1;
}

/* Sermon pill / button on service cards */
.svc-sermon-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 5px;
}
.svc-sermon-pill--logged {
  background: #adffaa;
  color: #000;
  border: 1px solid #bbf7d0;
  opacity: .75;
}
.svc-sermon-pill--pending {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

/* Team picker modal select */
.team-pick-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
}

/* Load Team button on service cards */
.btn-load-team {
  width: 200px;
  justify-content: center;
}

.btn-load-team-default {  
  background:#ffde7f;
  color: #000;    
}

.btn-load-team-default:hover {  
  opacity: .75;  
}

.btn-load-team--loaded {  
  background:#9599a2;
  color: #fff;    
}
.btn-load-team--loaded:hover {
  opacity: .75;
}

/* Team grid — screen preview on Extras tab */
.team-grid-section {
  width: 768px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 2px solid #000;
}
.team-grid-heading {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}
.team-grid {
  display: grid;
  grid-template-columns: 215px repeat(3, 1fr);
  grid-auto-flow: column;
  gap: 8px 16px;
}
.team-grid-position {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.team-grid-name {
  font-size: 13px;
  color: var(--text-muted);
}
