/* WHITE MAGE MUSIC CRM — Styles */

/* ── Viewer Mode ────────────────────────────────────────────────────────── */
body.viewer-mode input,
body.viewer-mode select,
body.viewer-mode textarea {
  pointer-events: none !important;
  opacity: 0.45;
}

/* Checkboxes: block label clicks from toggling them in viewer mode */
body.viewer-mode .check-label,
body.viewer-mode .role-check {
  pointer-events: none !important;
  opacity: 0.55;
}

/* Hide all action/edit/delete/save buttons in viewer mode */
body.viewer-mode .collab-btn-save,
body.viewer-mode .collab-btn-delete,
body.viewer-mode .collab-btn-edit,
body.viewer-mode .btn-action,
body.viewer-mode .btn-marching,
body.viewer-mode .btn-university,
body.viewer-mode .btn-drum-corps,
body.viewer-mode .btn-comp,
body.viewer-mode .btn-undo,
body.viewer-mode .note-actions,
body.viewer-mode .btn-add-note,
body.viewer-mode #btn-collab-from-email,
body.viewer-mode .ai-summary-rescan,
body.viewer-mode #btn-people-briefing-refresh,
body.viewer-mode .drive-action-row,
body.viewer-mode .invoice-actions,
body.viewer-mode .btn-send-email,
body.viewer-mode .broadcast-section,
body.viewer-mode #btn-director-change,
body.viewer-mode .collab-toolbar,
/* Client detail action buttons */
body.viewer-mode .btn-yeet,
body.viewer-mode #btn-edit-client,
body.viewer-mode .btn-send-contract,
body.viewer-mode .btn-send-invoice,
body.viewer-mode #btn-add-year-show,
body.viewer-mode .show-title-btn,
body.viewer-mode #btn-briefing,
body.viewer-mode .briefing-refresh,
body.viewer-mode #btn-add-show,
body.viewer-mode .btn-gen-schedule-pill,
body.viewer-mode .btn-provision-drive,
body.viewer-mode .btn-drive-paste-save,
body.viewer-mode .btn-invite-collabs,
body.viewer-mode #btn-save-alt-payee,
body.viewer-mode .btn-fin-remove-line,
body.viewer-mode .drive-paste-wrap { display: none !important; }

/* Hide fee field and finances tab entirely — financial data not for viewers */
body.viewer-mode .show-field-fee,
body.viewer-mode .tab-btn[data-tab="finances"],
body.viewer-mode #tab-finances,
/* Hide director contact details (email/phone) */
body.viewer-mode .client-contact { display: none !important; }

/* Collaborators table: hide phone and email columns */
body.viewer-mode .collaborators-table th:nth-child(3),
body.viewer-mode .collaborators-table td:nth-child(3),
body.viewer-mode .collaborators-table th:nth-child(4),
body.viewer-mode .collaborators-table td:nth-child(4) { display: none !important; }

/* Drive access list (shows email addresses of people with folder access) */
body.viewer-mode [id^="drive-access-"],
body.viewer-mode .drive-access-header { display: none !important; }

/* ── Broadcast "To Name" autocomplete ─────────────────────────────────── */
.bc-suggestions {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #1e1535;
  border: 1px solid #3a2d5c;
  border-radius: 8px;
  z-index: 200;
  max-height: 260px;
  overflow-y: auto;
}

.bc-suggest-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
}
.bc-suggest-item:hover { background: rgba(124,58,237,0.18); }

.bc-suggest-name  { color: #e8e0f8; font-weight: 600; }
.bc-suggest-org   { color: #9d8ec4; font-size: 12px; }
.bc-suggest-email { color: #6b6080; font-size: 11px; margin-left: auto; }

/* Hint text below Draft button */
.bc-draft-hint {
  font-size: 11px;
  color: #6b6080;
  align-self: center;
  margin-left: 8px;
}

/* Logout button in header */
.header-logout-btn {
  margin-left: 8px;
  font-size: 11px;
  opacity: 0.6;
  flex-shrink: 0;
}
.header-logout-btn:hover { opacity: 1; }

/* "View Only" badge */
/* ── Notifications popup ─────────────────────────────────────────────────── */
#notif-popup {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1e1535;
  border: 1px solid rgba(255, 45, 120, 0.35);
  border-radius: 10px;
  padding: 10px 14px 10px 16px;
  z-index: 9999;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  max-width: calc(100vw - 32px);
  flex-wrap: wrap;
}
.notif-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ff2d78;
  white-space: nowrap;
}
.notif-text {
  font-size: 13px;
  color: #e0d6f0;
  line-height: 1.4;
}
.notif-dismiss {
  background: none;
  border: none;
  color: #7a6a9a;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  margin-left: 4px;
  line-height: 1;
  flex-shrink: 0;
}
.notif-dismiss:hover { color: #e0d6f0; }

.viewer-badge {
  position: fixed;
  bottom: 16px;
  left: 16px;
  background: rgba(124, 58, 237, 0.25);
  border: 1px solid rgba(124, 58, 237, 0.5);
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 5px 10px;
  z-index: 9998;
  pointer-events: none;
}

:root {
  --bg-base:        #150f22;
  --bg-surface:     #1e1535;
  --bg-card:        #251c3a;
  --bg-card-hover:  #2d2245;
  --surface-card:   #251c3a;
  --surface-hover:  #2d2245;
  --border:         #3a2555;
  --border-light:   #4a3065;

  --marching-primary:   #ff2d78;
  --marching-secondary: #ff6b9d;
  --marching-dim:       rgba(255,45,120,0.15);

  --comp-primary:   #00b4d8;
  --comp-secondary: #48cae4;
  --comp-dim:       rgba(0,180,216,0.15);

  --text-primary:   #f0eaf8;
  --text-secondary: #a890c8;
  --text-muted:     #6b5585;

  --success: #2ecc71;
  --warning: #f39c12;
  --danger:  #e74c3c;
  --success-dim: rgba(46,204,113,0.15);
  --warning-dim: rgba(243,156,18,0.15);
  --danger-dim:  rgba(231,76,60,0.15);

  --font-arcade:  'puffin-arcade-chrome', sans-serif;
  --font-display: 'Sora', 'SF Pro Display', -apple-system, sans-serif;
  --font-body:    'Sora', 'SF Pro Display', -apple-system, sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-brand { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-arcade); font-size: 28px; font-weight: 800; font-style: normal; }
.brand-sub { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }

.app-nav { display: flex; gap: 4px; }
.nav-btn {
  background: none; border: none; color: var(--text-secondary);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-btn.active { background: var(--border); color: var(--text-primary); }

/* ── Global Search ── */
.header-search {
  position: relative;
  flex: 1;
  max-width: 360px;
  margin: 0 24px;
}
.global-search-input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 13px;
  padding: 7px 16px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  font-family: var(--font-body);
}
.global-search-input::placeholder { color: var(--text-muted); }
.global-search-input:focus {
  border-color: var(--comp-primary);
  background: rgba(255,255,255,0.1);
}
.global-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #1a1030;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 9999;
  max-height: 480px;
  overflow-y: auto;
  padding: 6px 0;
}
.search-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 14px 4px;
}
.search-result-item {
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.1s;
}
.search-result-item:hover,
.search-result-active { background: rgba(255,255,255,0.07); }
.search-result-main { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.search-result-sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-empty { font-size: 13px; color: var(--text-muted); padding: 14px; text-align: center; }

/* ── Layout ── */
.app-main { padding: 32px; max-width: 1400px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

.view-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.header-actions { display: flex; gap: 10px; align-items: center; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm); border: none;
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: opacity 0.15s, transform 0.1s;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--marching-primary); color: #fff; }
.btn-marching { background: var(--marching-primary); color: #fff; }
.btn-university { background: #7c3aed; color: #fff; }
.btn-drum-corps { background: #b45309; color: #fff; }
.btn-undo {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: #1e40af; color: #fff;
  border: none; border-radius: 8px; padding: 10px 18px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: opacity 0.2s;
}
.btn-undo:hover { opacity: 0.88; }
.btn-comp { background: var(--comp-primary); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background: var(--danger); color: #fff; }

.btn-back {
  background: none; border: none; color: var(--text-secondary);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; padding: 0; margin-bottom: 24px;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-back:hover { color: var(--text-primary); }

/* ── Dashboard Top Bar ── */
.dashboard-top-bar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; margin-bottom: 16px;
}
.dashboard-top-left { flex-shrink: 0; }
.dashboard-center-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.header-actions-col { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.dashboard-divider { border: none; border-top: 1px solid var(--border-light); margin: 0 0 20px 0; }

/* ── Dashboard Three-Column Layout ── */
.dashboard-body { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; align-items: start; margin-bottom: 32px; }
.dashboard-main { min-width: 0; }

/* ── Priorities Panel ── */
.priorities-panel, .upcoming-writing-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  min-height: 408px; display: flex; flex-direction: column;
}
.priorities-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border-light);
}
.priorities-title {
  font-family: var(--font-arcade); font-size: 24px; font-weight: 800;
  letter-spacing: 0.04em; color: var(--text-primary);
}
.priorities-content { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.priority-item {
  background: rgba(139,92,246,0.06); border: 1px solid rgba(139,92,246,0.2);
  border-radius: 8px; padding: 10px 12px;
}
.priority-num {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--comp-secondary); margin-bottom: 4px;
}
.priority-desc { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; line-height: 1.4; }
.priority-rationale { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.priority-client-link {
  display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600;
  color: var(--marching-secondary); cursor: pointer; text-decoration: underline;
}
.priority-client-link:hover { color: var(--marching-primary); }
.priorities-footer {
  margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--border-light);
  font-size: 11px; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center;
}
.priorities-status-badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.status-on-track { background: rgba(46,204,113,0.15); color: #2ecc71; }
.status-attention { background: rgba(243,156,18,0.15); color: var(--warning); }
.status-behind { background: rgba(231,76,60,0.15); color: var(--danger); }

/* ── Portfolio Analytics Widget ── */
.portfolio-widget {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-top: 16px;
}
.portfolio-widget-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border-light);
}
.portfolio-content { display: flex; flex-direction: column; gap: 14px; }

/* Headline stat tiles */
.portfolio-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.pstat {
  background: rgba(139,92,246,0.05); border: 1px solid rgba(139,92,246,0.15);
  border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; gap: 3px;
}
.pstat-value {
  font-size: 22px; font-weight: 800; font-family: var(--font-arcade);
  color: var(--marching-primary); line-height: 1;
}
.pstat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }

/* Caption signature bar */
.portfolio-captions { display: flex; flex-direction: column; gap: 6px; }
.portfolio-section-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
}
.pcaption-row {
  display: flex; align-items: center; gap: 10px; font-size: 12px;
}
.pcaption-name { width: 140px; color: var(--text-primary); font-weight: 600; flex-shrink: 0; }
.pcaption-bar-wrap { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.pcaption-bar { height: 100%; border-radius: 3px; background: var(--marching-primary); }
.pcaption-bar.negative { background: var(--danger); }
.pcaption-delta { width: 52px; text-align: right; font-size: 11px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.pcaption-delta.positive { color: #2ecc71; }
.pcaption-delta.negative { color: var(--danger); }

/* Growth row */
.portfolio-growth-row {
  display: flex; align-items: center; gap: 18px; font-size: 13px;
}
.portfolio-growth-stat { display: flex; flex-direction: column; gap: 2px; }
.portfolio-growth-val {
  font-size: 18px; font-weight: 800; font-family: var(--font-arcade);
  color: #2ecc71;
}
.portfolio-growth-val.neutral { color: var(--text-muted); }

/* Prospects */
.portfolio-prospects { display: flex; flex-wrap: wrap; gap: 8px; }
.prospect-chip {
  background: rgba(231,76,60,0.08); border: 1px solid rgba(231,76,60,0.2);
  border-radius: 20px; padding: 3px 10px; font-size: 11px; color: var(--text-muted);
}
.prospect-chip strong { color: var(--text-primary); }

/* Empty / no data */
.portfolio-no-data {
  font-size: 13px; color: var(--text-muted); font-style: italic; padding: 8px 0;
}

/* ── Upcoming Writing Panel ── */
.upcoming-writing-list { flex: 1; overflow-y: auto; }
.writing-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 7px 4px; border-bottom: 1px solid var(--border-light); font-size: 13px;
}
.writing-item:last-child { border-bottom: none; }
.writing-item-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; min-width: 52px; }
.writing-item-school { font-weight: 600; color: var(--text-primary); }
.writing-item-step { color: var(--text-muted); font-size: 12px; }
.writing-item-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 3px;
}

/* ── Calendar List View ── */
.calendar-list { width: 100%; }
.calendar-month-group { margin-bottom: 24px; }
.calendar-month-label {
  font-family: var(--font-arcade); font-size: 18px; font-weight: 700;
  color: var(--text-secondary); padding: 6px 0; margin-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.calendar-row {
  display: grid; grid-template-columns: 44px 1fr;
  gap: 12px; padding: 7px 4px; border-bottom: 1px solid var(--border-light);
  align-items: baseline; font-size: 13px;
}
.calendar-row:last-child { border-bottom: none; }
.calendar-row.cal-completed { opacity: 0.45; }
.cal-date { font-size: 13px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.cal-detail { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cal-client { font-weight: 600; color: var(--text-primary); }
.cal-title { color: var(--text-muted); }
.cal-type-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 1px 6px; border-radius: 10px; letter-spacing: 0.05em;
}
.cal-type-milestone { background: rgba(99,102,241,0.15); color: #818cf8; }
.cal-type-competition { background: rgba(46,204,113,0.15); color: #2ecc71; }
.cal-type-task { background: rgba(243,156,18,0.15); color: var(--warning); }
.cal-type-event { background: rgba(0,180,216,0.15); color: var(--marching-primary); }
.cal-time { font-size: 11px; color: var(--text-muted); margin-left: 4px; }
.cal-loc { font-size: 11px; color: var(--text-muted); margin-left: 4px; font-style: italic; }
.cal-filter-label { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

/* ── Overnight Activity Panel ── */
.overnight-panel {
  background: rgba(243,156,18,0.05); border: 1px solid rgba(243,156,18,0.25);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px;
}
.inbox-panel-count.overnight { background: var(--warning); color: #000; }
.overnight-item {
  padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13px;
}
.overnight-item:last-child { border-bottom: none; }
.overnight-item-info { flex: 1; min-width: 0; margin-bottom: 6px; }
.overnight-item-subject { font-weight: 600; color: var(--text-primary); }
.overnight-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.overnight-item-body {
  margin-top: 8px; padding: 8px 10px;
  background: var(--bg-hover); border-radius: 6px;
  font-size: 12px; color: var(--text-secondary);
  white-space: pre-wrap; max-height: 200px; overflow-y: auto;
  font-family: monospace; line-height: 1.5;
}
.overnight-item-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.overnight-status {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
.overnight-routed { background: rgba(46,204,113,0.15); color: #2ecc71; }
.overnight-holding { background: rgba(243,156,18,0.15); color: var(--warning); }
.overnight-na { background: var(--bg-hover); color: var(--text-muted); }
.overnight-btn-dismiss { opacity: 0.45; margin-left: auto; }
.overnight-btn-dismiss:hover { opacity: 1; color: var(--danger); }
.overnight-type-badge {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 8px; vertical-align: middle; margin-right: 4px; text-transform: uppercase; letter-spacing: 0.04em;
}
.overnight-type-text  { background: rgba(46,204,113,0.15); color: #2ecc71; }
.overnight-type-email { background: rgba(99,102,241,0.15); color: #818cf8; }

/* ── Inbox breathing badge animation ── */
@keyframes breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.25); }
}
.inbox-badge-breathing {
  animation: breathe 2s ease-in-out infinite;
  background: var(--warning) !important;
  color: #000 !important;
}

/* ── Admin Tasks Panel ── */
.admin-tasks-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  position: sticky; top: 16px; min-height: 408px;
  display: flex; flex-direction: column;
}
.admin-tasks-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border-light);
}
.admin-tasks-title {
  font-family: var(--font-arcade); font-size: 24px; font-weight: 800;
  letter-spacing: 0.04em; color: var(--text-primary);
}
.btn-add-task {
  background: var(--marching-primary); color: #fff; border: none;
  border-radius: 50%; width: 24px; height: 24px; font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.btn-add-task:hover { opacity: 0.85; }
.task-input-wrap { display: flex; gap: 6px; margin-bottom: 10px; }
.task-direct-input {
  flex: 1; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 10px; font-size: 12px;
  color: var(--text-primary); font-family: var(--font-body);
}
.btn-save-task {
  background: var(--marching-primary); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 6px 12px; font-size: 12px;
  font-weight: 700; cursor: pointer;
}
.admin-tasks-list { display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; max-height: 323px; }
.admin-task-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--bg-surface); border: 1px solid var(--border-light);
  font-size: 12px;
}
.admin-task-item:hover { border-color: var(--border); }
.task-complete-btn {
  background: none; border: 1px solid var(--border); border-radius: 50%;
  width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; margin-top: 1px;
  color: var(--text-muted); font-size: 10px; display: flex; align-items: center; justify-content: center;
}
.task-complete-btn:hover { border-color: #2ecc71; color: #2ecc71; }
.task-delete-btn {
  background: none; border: none; cursor: pointer; flex-shrink: 0;
  color: var(--text-muted); font-size: 12px; padding: 0 2px; opacity: 0.4; line-height: 1;
}
.task-delete-btn:hover { color: var(--danger); opacity: 1; }
.task-summary {
  flex: 1; color: var(--text-secondary); line-height: 1.4; word-break: break-word;
}
.task-summary.task-link { color: #64b4ff; cursor: pointer; text-decoration: underline; }
.task-summary.task-link:hover { color: var(--text-primary); }
.admin-tasks-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 20px 0; }

/* ── Stats Row ── */
.stats-row { display: flex; gap: 6px; flex-wrap: nowrap; flex: 1; min-width: 0; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 10px; min-width: 0; flex: 1;
  text-align: center;
}
.btn-action { padding: 10px 20px; font-size: 15px; }
.stat-label { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-family: var(--font-display); font-size: 18px; font-weight: 700; }

/* ── Note Highlight (task navigation) ── */
@keyframes noteFlash {
  0%, 100% { background: var(--bg-card); }
  50% { background: rgba(255, 215, 0, 0.12); border-color: rgba(255, 215, 0, 0.4); }
}
.note-item.note-highlight { animation: noteFlash 0.6s ease 3; }

/* ── Client Grid ── */
.client-grids { display: flex; flex-direction: column; gap: 32px; }
.client-section {}
.section-label {
  font-family: var(--font-arcade); font-size: 24px; font-weight: 800; font-style: normal;
  margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.section-label.marching { color: var(--marching-secondary); }
.section-label.university { color: #a78bfa; }
.section-label.drum-corps { color: #f59e0b; }
.section-label.comp { color: var(--comp-secondary); }
.univ-badge {
  display: inline-block; font-size: 9px; font-weight: 800; font-family: var(--font-body);
  background: rgba(124,58,237,0.2); color: #a78bfa; border-radius: 4px;
  padding: 1px 5px; letter-spacing: 0.08em; vertical-align: middle; margin-left: 4px;
}
.corps-badge {
  display: inline-block; font-size: 9px; font-weight: 800; font-family: var(--font-body);
  background: rgba(180,83,9,0.2); color: #f59e0b; border-radius: 4px;
  padding: 1px 5px; letter-spacing: 0.08em; vertical-align: middle; margin-left: 4px;
}

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.client-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.client-card:hover { background: var(--bg-card-hover); border-color: var(--border-light); }
.client-card.marching { border-left: 3px solid var(--marching-primary); }
.client-card.composition { border-left: 3px solid var(--comp-primary); }

.card-name { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.card-org { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.card-show-title { font-size: 13px; color: var(--comp-primary); font-style: italic; font-weight: 500; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.badge-marching { background: var(--marching-dim); color: var(--marching-secondary); }
.badge-comp { background: var(--comp-dim); color: var(--comp-secondary); }
.badge-success { background: var(--success-dim); color: var(--success); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-danger { background: var(--danger-dim); color: var(--danger); }
.badge-neutral { background: rgba(255,255,255,0.07); color: var(--text-secondary); }

/* ── Client Table ── */
.client-table { width: 100%; border-collapse: collapse; }
.client-table th {
  text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.client-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.client-table tr:hover td { background: var(--bg-card); cursor: pointer; }

/* ── Search / Filter ── */
.search-input, .filter-select {
  background: var(--bg-card); border: 1px solid var(--border-light);
  color: var(--text-primary); font-family: var(--font-body); font-size: 14px;
  padding: 8px 14px; border-radius: var(--radius-sm); outline: none;
}
.search-input:focus, .filter-select:focus { border-color: var(--text-secondary); }
.search-input { width: 220px; }

/* ── Client Detail ── */
.client-detail-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.client-detail-name { font-family: var(--font-display); font-size: 30px; font-weight: 700; }
.client-detail-org { font-size: 15px; color: var(--text-secondary); margin-top: 2px; }
.client-detail-meta { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.client-contact { display: flex; gap: 20px; margin-top: 8px; font-size: 14px; color: var(--text-secondary); }
.client-contact a { color: var(--text-secondary); text-decoration: none; }
.client-contact a:hover { color: var(--text-primary); }
.client-address-website-row {
  display: flex; align-items: flex-start; gap: 20px; margin-top: 6px; flex-wrap: wrap;
}
.client-detail-address { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-top: 0; }
.client-website-row { display: flex; align-items: center; gap: 6px; padding-top: 2px; }
.band-website-link {
  font-size: 13px; color: var(--comp-secondary); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.band-website-link:hover { text-decoration: underline; }
.btn-website-clear {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 13px; padding: 0 2px; opacity: 0.5; line-height: 1;
  transition: opacity 0.15s, color 0.15s;
}
.btn-website-clear:hover { opacity: 1; color: var(--danger, #ef4444); }

.detail-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; align-items: center; flex-direction: column; align-items: flex-end; }
.circuit-field-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.circuit-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); white-space: nowrap; }
.circuit-input { font-size: 12px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--input-bg, #fff); width: 180px; }

/* ── Tabs ── */
.tab-bar { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  background: none; border: none; color: var(--text-muted);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  padding: 10px 18px; cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color 0.15s;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--text-primary); border-bottom-color: var(--marching-primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Client Card Status ── */
.card-status-row {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  margin: 8px 0 6px;
}
.status-pip {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 2px 8px; border-radius: 20px;
}
.pip-off { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.pip-on { background: var(--success-dim); color: var(--success); }
.pip-paid { background: rgba(46,204,113,0.3); color: #2ecc71; font-weight: 800; }
.card-fee { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-left: 4px; }
.card-parts-row { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.part-chip {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 4px;
  background: rgba(0,180,216,0.12); color: var(--comp-secondary);
}
.next-movement-badge { font-size: 11px; }

/* Status badge colors */
.badge-prospect   { background: rgba(138,99,210,0.2); color: #a78bfa; }
.badge-inprogress { background: rgba(243,156,18,0.2); color: #f39c12; }
.badge-ready      { background: rgba(241,196,15,0.2); color: #f1c40f; }
.badge-complete   { background: rgba(46,204,113,0.2); color: #2ecc71; }

/* Generate schedule pill */
.btn-gen-schedule-pill {
  display: inline-block; margin-top: 6px;
  background: none; border: 1px solid var(--border-light);
  color: var(--text-muted); font-family: var(--font-body);
  font-size: 11px; font-weight: 700; padding: 3px 12px;
  border-radius: 20px; cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.btn-gen-schedule-pill:hover { color: var(--text-primary); border-color: var(--text-secondary); }

/* ── Show Section Dividers & Checks ── */
.show-section-divider {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin: 14px 0 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.show-checkrow { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 4px; }

/* ── Drive folder section ── */
.show-drive-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 8px;
  flex-wrap: wrap;
}
.show-drive-link {
  font-size: 12px;
  color: var(--marching-primary);
  text-decoration: none;
  word-break: break-all;
}
.show-drive-link:hover { text-decoration: underline; }
.show-drive-access {
  padding: 6px 0 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 4px;
}
.drive-access-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.drive-access-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
}
.drive-access-email {
  font-size: 12px;
  color: var(--text-secondary);
  flex: 1;
}
.drive-role-select {
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
}
.drive-access-error {
  font-size: 11px;
  color: var(--danger);
}
.drive-paste-wrap {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.drive-paste-input {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-primary); font-size: 12px;
  padding: 5px 10px; width: 280px; font-family: inherit;
}
.drive-paste-input:focus { outline: none; border-color: var(--comp-secondary); }
.btn-drive-clear {
  color: var(--text-muted) !important;
  font-size: 11px;
  opacity: 0.7;
}
.btn-drive-clear:hover { color: #e74c3c !important; border-color: rgba(231,76,60,0.4) !important; opacity: 1; }
.btn-drive-rescan { color: var(--text-muted) !important; font-size: 11px; }
.btn-drive-rescan:hover { color: var(--marching-primary) !important; border-color: var(--marching-primary) !important; }
.btn-invite-done {
  color: #2ecc71 !important; border-color: rgba(46,204,113,0.3) !important;
  opacity: 0.8; cursor: default;
}
.check-label {
  display: flex; align-items: center; gap: 7px; font-size: 14px;
  color: var(--text-secondary); cursor: pointer;
}
.check-label input { cursor: pointer; accent-color: var(--marching-primary); width: 15px; height: 15px; }

/* ── Milestones ── */
.milestones-list { display: flex; flex-direction: column; gap: 8px; }
.milestone-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--bg-surface); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.milestone-row.milestone-done { opacity: 0.5; }
.milestone-row.milestone-done .milestone-name { text-decoration: line-through; }
.milestone-name { font-size: 14px; font-weight: 600; }
.milestone-date { font-size: 12px; }

/* ── Shows ── */
.show-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px;
}
.show-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.show-title-text { font-weight: 700; font-size: 16px; }
.show-fields { display: flex; flex-direction: row; align-items: flex-start; gap: 14px; flex-wrap: nowrap; margin-bottom: 12px; }
.show-fields .show-field:first-child { flex: 0 0 160px; }
.show-fields .show-field-roles { flex: 1 1 auto; }
.show-field label { display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 4px; }
.show-field input, .show-field select {
  background: var(--bg-surface); border: 1px solid var(--border-light);
  color: var(--text-primary); font-family: var(--font-body); font-size: 14px;
  padding: 7px 10px; border-radius: var(--radius-sm); width: 100%; outline: none;
}
.show-field input:focus, .show-field select:focus { border-color: var(--text-secondary); }
.show-field-roles { grid-column: 1 / -1; }

/* Role multi-select checkboxes */
.role-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding-top: 2px;
}
.role-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
}
.role-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--marching-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Master Progress Bar ── */
.master-progress-wrap {
  margin-bottom: 28px;
}
.master-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.master-progress-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.master-progress-time {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
}
.master-bar-track {
  background: var(--border);
  border-radius: 6px;
  height: 12px;
  overflow: hidden;
  margin-bottom: 28px;
}
.master-bar-fill {
  height: 100%;
  border-radius: 6px;
  width: 0%;
  transition: width 0.4s ease, background-color 0.4s ease;
}

.progress-wrap { margin-top: 12px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.progress-bar-track { background: var(--border); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 4px; background: var(--marching-primary); transition: width 0.3s, background-color 0.3s; }
.progress-bar-fill.comp { background: var(--comp-primary); }
.progress-slider { width: 100%; accent-color: var(--marching-primary); margin-top: 6px; }

.due-date-on-track { color: var(--success); }
.due-date-soon { color: var(--warning); }
.due-date-late { color: var(--danger); }

/* ── Notes AI Summary ── */
.notes-ai-summary { margin-bottom: 16px; }
.ai-summary-loading {
  color: var(--text-muted); font-size: 13px; font-style: italic; padding: 4px 0;
}
.ai-summary-card {
  background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(99,102,241,0.05));
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: var(--radius); padding: 14px 18px;
}
.ai-summary-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--comp-secondary); margin-bottom: 8px;
}
.ai-summary-body {
  font-size: 14px; line-height: 1.6; color: var(--text-primary);
}
.ai-summary-age {
  font-size: 10px; font-weight: 400; color: var(--text-muted);
  text-transform: none; letter-spacing: 0; margin-left: 8px;
}
.ai-summary-rescan {
  margin-top: 10px; font-size: 12px; opacity: 0.7;
}
.ai-summary-rescan:hover { opacity: 1; }
.copyright-advisor-panel { margin-bottom: 20px; }
.copyright-advisor-panel .ai-summary-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.05));
  border-color: rgba(99,102,241,0.25);
}

/* ── Notes ── */
.notes-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.note-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 10px;
}
.note-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.note-timestamp { font-size: 12px; color: var(--text-muted); }
.note-actions { display: flex; gap: 6px; }
.note-body { font-size: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.note-edit-area {
  width: 100%; background: var(--bg-surface); border: 1px solid var(--border-light);
  color: var(--text-primary); font-family: var(--font-body); font-size: 14px;
  padding: 10px; border-radius: var(--radius-sm); resize: vertical; min-height: 80px; outline: none;
}
.note-edit-area:focus { border-color: var(--text-secondary); }
.note-edit-actions { display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end; }
.note-attachments { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-wrap { display: inline-flex; align-items: center; gap: 4px; margin-right: 4px; }
.attachment-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 4px 10px; font-size: 12px; color: var(--text-secondary);
  text-decoration: none;
}
.attachment-chip:hover { color: var(--text-primary); }
.btn-inline.btn-file-drive { border-color: rgba(46,204,113,0.3); color: #2ecc71; font-size: 11px; padding: 2px 7px; }
.btn-inline.btn-file-drive:hover { background: rgba(46,204,113,0.12); border-color: rgba(46,204,113,0.6); }
.att-saved-badge { font-size: 11px; color: #2ecc71; white-space: nowrap; }
.btn-note-expand { background: none; border: none; color: var(--text-muted); font-size: 11px; cursor: pointer; padding: 2px 0; margin-top: 4px; display: block; }
.btn-note-expand:hover { color: var(--text-secondary); }
.btn-dismiss-note { color: var(--text-muted) !important; opacity: 0.6; margin-left: auto; }
.btn-dismiss-note:hover { color: var(--danger) !important; opacity: 1; }
.note-revisions-link { font-size: 11px; color: var(--text-muted); margin-top: 6px; cursor: pointer; text-decoration: underline; }

/* New note composer */
.note-composer {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px; display: none;
}
.note-composer.open { display: block; }
.note-composer textarea {
  width: 100%; background: var(--bg-surface); border: 1px solid var(--border-light);
  color: var(--text-primary); font-family: var(--font-body); font-size: 14px;
  padding: 10px; border-radius: var(--radius-sm); resize: vertical; min-height: 100px; outline: none;
}
.note-composer textarea:focus { border-color: var(--text-secondary); }
.composer-actions { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }

/* ── Source Materials ── */
.materials-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.material-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px;
}
.material-icon { font-size: 20px; flex-shrink: 0; }
.material-info { flex: 1; }
.material-label { font-weight: 700; font-size: 14px; }
.material-url { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.material-url a { color: var(--comp-secondary); text-decoration: none; }
.material-url a:hover { text-decoration: underline; }
.material-thumb { width: 80px; height: 45px; object-fit: cover; border-radius: 4px; }

/* ── Source Material Suggestions ── */
.source-suggestions-section {
  margin-top: 32px; border-top: 1px solid var(--border); padding-top: 20px;
}
.source-suggestions-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.source-suggestions-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-secondary);
}
.source-suggestions-list { display: flex; flex-direction: column; gap: 10px; }
.suggestions-prompt { font-size: 13px; color: var(--text-muted); font-style: italic; }
.suggestion-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
}
.suggestion-top {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.suggestion-label { flex: 1; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.suggestion-url { font-size: 12px; margin-bottom: 4px; }
.suggestion-url a { color: var(--comp-secondary); text-decoration: none; word-break: break-all; }
.suggestion-url a:hover { text-decoration: underline; }
.suggestion-source { font-size: 11px; color: var(--text-muted); font-style: italic; }
.suggestion-type-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 99px; flex-shrink: 0;
}
.type-youtube { background: rgba(255,0,0,0.15); color: #ff4444; }
.type-spotify { background: rgba(29,185,84,0.15); color: #1db954; }
.type-url { background: rgba(99,102,241,0.15); color: var(--comp-secondary); }
.type-reference { background: rgba(245,158,11,0.15); color: var(--warning); }
.btn-dismiss-suggestion {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0 4px; flex-shrink: 0;
  opacity: 0.5; transition: opacity 0.15s, color 0.15s;
}
.btn-dismiss-suggestion:hover { opacity: 1; color: var(--danger, #ef4444); }

/* ── Note links ── */
.note-link {
  color: var(--comp-secondary); text-decoration: none; word-break: break-all;
}
.note-link:hover { text-decoration: underline; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group label { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.07em; }
.form-group input, .form-group select, .form-group textarea {
  background: var(--bg-surface); border: 1px solid var(--border-light);
  color: var(--text-primary); font-family: var(--font-body); font-size: 14px;
  padding: 9px 12px; border-radius: var(--radius-sm); outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--text-secondary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Modals ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal {
  background: var(--bg-surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 28px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.modal-close {
  background: none; border: none; color: var(--text-muted); font-size: 22px;
  cursor: pointer; line-height: 1; padding: 0 4px;
}
.modal-close:hover { color: var(--text-primary); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── Misc ── */
.status-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; color: var(--text-secondary); }
.empty-state { text-align: center; padding: 40px; color: var(--text-muted); font-size: 14px; }

.inline-edit-form { display: flex; flex-direction: column; gap: 8px; }

/* ── Year Selector ── */
.year-selector-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  min-width: 0;
}
.year-pill-scroller {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Fade both edges */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 32px, black calc(100% - 32px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 32px, black calc(100% - 32px), transparent 100%);
  cursor: grab;
  padding: 2px 4px;
}
.year-pill-scroller::-webkit-scrollbar { display: none; }
.year-pill-scroller:active { cursor: grabbing; }
.year-selector-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-right: 4px;
}
.year-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 20px;
  padding: 4px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
}
.year-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.year-btn.active {
  background: var(--marching-primary);
  border-color: var(--marching-primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(255,45,120,0.4);
}

/* ── Detail Year Selector ── */
.detail-year-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.detail-year-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.detail-year-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.detail-year-selector .year-btn.active {
  background: var(--comp-primary);
  border-color: var(--comp-primary);
  box-shadow: 0 0 10px rgba(0,180,216,0.4);
}

/* Show title inline editor */
.show-title-editor {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  flex: 1;
  min-width: 0;
}
.show-title-display {
  font-size: 15px;
  font-weight: 600;
  color: var(--comp-primary);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
  cursor: default;
}
.show-title-display:empty::before { content: 'Add show title…'; opacity: 0.35; font-weight: 400; font-size: 13px; }
.show-title-input {
  font-size: 14px;
  background: var(--surface-input, rgba(255,255,255,0.07));
  border: 1px solid var(--comp-primary);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 3px 8px;
  width: 260px;
}
.show-title-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 5px;
  border-radius: 3px;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.show-title-btn:hover { opacity: 1; }
.show-title-btn-save { color: var(--success, #4caf50); opacity: 0.85; }
.show-title-btn-cancel { color: var(--error, #ef5350); opacity: 0.85; }

/* ── Deliver By on card ── */
.card-deliver-by {
  font-size: 11px;
  margin-top: 8px;
  font-weight: 600;
}
.card-project-desc {
  font-size: 12px;
  color: var(--comp-secondary);
  font-style: italic;
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Project Description textarea ── */
.project-description-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px;
  border-radius: var(--radius-sm);
  resize: vertical;
  outline: none;
  margin-top: 8px;
}
.project-description-input:focus { border-color: var(--text-secondary); }

/* ── Competitions ── */
.comp-table { margin-top: 12px; }
.comp-table td { padding: 6px 8px; vertical-align: middle; }
.comp-table td input {
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.comp-table td input:focus { border-bottom-color: var(--text-secondary); }

.comp-add-form {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
}

/* Competitions score chart */
.comp-chart {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
}
.comp-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100px;
  padding-bottom: 4px;
}
.comp-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.comp-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.3s;
}
.comp-bar-label {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
.comp-trend {
  font-size: 12px;
  font-weight: 700;
  margin-top: 10px;
  text-align: right;
}

/* ── btn-gen-schedule-pill fix: ensure consistent margin ── */
.btn-gen-schedule-pill { margin-top: 6px; }

/* ── Gmail Status Indicator ── */
.header-gmail-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.header-gmail-status:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.gmail-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.gmail-dot-on { background: var(--success); box-shadow: 0 0 6px var(--success); }
.gmail-dot-off { background: var(--danger); }
.gmail-dot-unknown { background: var(--text-muted); }

/* ── Contract / Invoice Buttons ── */
.btn-send-contract {
  background: var(--warning);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: var(--font-body);
}
.btn-send-contract:hover { opacity: 0.85; }
.btn-send-invoice {
  background: var(--comp-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: var(--font-body);
}
.btn-send-invoice:hover { opacity: 0.85; }

/* ── Send Preview Modal Content ── */
.send-preview { padding: 4px 0 16px; }
.send-preview-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.send-preview-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.send-preview-table td:first-child {
  width: 130px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}
.send-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
  font-style: italic;
}
.send-status {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════
   INBOX VIEW
   ══════════════════════════════════════════════════════ */

.inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.inbox-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

/* ── Gmail accounts status chips ── */
.gmail-accounts-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.gmail-account-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.gmail-account-chip.connected {
  border-color: rgba(46,204,113,0.4);
  background: rgba(46,204,113,0.08);
}
.gmail-account-chip.disconnected {
  border-color: rgba(231,76,60,0.4);
  background: rgba(231,76,60,0.08);
}
.gmail-account-chip.icloud {
  border-color: rgba(0,180,216,0.4);
  background: rgba(0,180,216,0.08);
}
.gmail-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.connected .gmail-chip-dot { background: var(--success); }
.disconnected .gmail-chip-dot { background: var(--danger); }
.icloud .gmail-chip-dot, .always-on { background: var(--comp-primary); }
.gmail-chip-link {
  color: var(--comp-secondary);
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 4px;
}
.gmail-chip-disconnect { color: var(--danger); opacity: 0.7; }
.gmail-chip-disconnect:hover { opacity: 1; }

/* ── Gmail header dot ── */
.gmail-dot-partial {
  background: var(--warning) !important;
  box-shadow: 0 0 6px rgba(243,156,18,0.6) !important;
}

/* ── Inbox badge on nav ── */
.inbox-badge {
  display: inline-block;
  background: var(--marching-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 14px;
}

/* ── Two-panel layout ── */
.inbox-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 800px) {
  .inbox-panels { grid-template-columns: 1fr; }
}
.inbox-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.inbox-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.inbox-panel-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}
.inbox-panel-count {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.inbox-panel-count.action {
  background: rgba(255,45,120,0.15);
  border-color: rgba(255,45,120,0.3);
  color: var(--marching-secondary);
}
.inbox-panel-items {
  max-height: 480px;
  overflow-y: auto;
}
.inbox-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Inbox item card ── */
.inbox-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.inbox-item:last-child { border-bottom: none; }
.inbox-item:hover { background: var(--bg-card-hover); }
.inbox-item.inbox-action {
  border-left: 3px solid var(--marching-primary);
}
.inbox-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.inbox-client {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
}
.inbox-time {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
.inbox-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.inbox-item-summary {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 4px;
}
.inbox-item-full-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 6px;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--border);
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
}
.inbox-review-note {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 6px;
  line-height: 1.4;
}
.inbox-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.btn-inline {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-inline:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-inline.btn-dismiss:hover,
.btn-inline.btn-dismiss-action:hover { border-color: rgba(231,76,60,0.4); color: var(--danger); }

.action-assign-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}
.action-assign-select {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 8px;
}
.btn-assign-action {
  background: rgba(124,58,237,0.18);
  border-color: rgba(124,58,237,0.4) !important;
  color: #c4b5fd !important;
  white-space: nowrap;
}
.btn-inline.btn-complete:hover { border-color: rgba(46,204,113,0.4); color: var(--success); }
.btn-inline.btn-reply-email { border-color: rgba(100,180,255,0.3); color: #64b4ff; }
.btn-inline.btn-reply-email:hover { background: rgba(100,180,255,0.12); border-color: rgba(100,180,255,0.6); }
.btn-inline.btn-assign {
  background: rgba(0,180,216,0.15);
  border-color: rgba(0,180,216,0.3);
  color: var(--comp-secondary);
}
.btn-inline.btn-assign:hover { background: rgba(0,180,216,0.25); }

/* ── Type badges ── */
.inbox-type-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.inbox-type-copyright { background: rgba(243,156,18,0.2); color: var(--warning); }
.inbox-type-action, .inbox-type-client_inquiry { background: rgba(255,45,120,0.15); color: var(--marching-secondary); }
.inbox-type-drive_link, .inbox-type-google_drive_share { background: rgba(0,180,216,0.15); color: var(--comp-secondary); }
.inbox-type-info, .inbox-type-general_info { background: rgba(104,85,133,0.3); color: var(--text-secondary); }
.inbox-type-feedback { background: rgba(46,204,113,0.15); color: var(--success); }
.inbox-type-unclassifiable { background: rgba(107,85,133,0.2); color: var(--text-muted); }
.inbox-type-tresona_new, .inbox-type-tresona_update { background: rgba(243,156,18,0.2); color: var(--warning); }

/* ── Priority badges ── */
.priority-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.priority-high { background: rgba(231,76,60,0.2); color: #e74c3c; }
.priority-medium { background: rgba(243,156,18,0.2); color: var(--warning); }
.priority-normal, .priority-low { background: rgba(104,85,133,0.3); color: var(--text-muted); }

/* ── Holding Queue ── */
.holding-queue-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.holding-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.holding-queue-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--warning);
}
.holding-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid rgba(243,156,18,0.4);
}
.holding-item:last-child { border-bottom: none; }
.holding-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.holding-from {
  font-size: 11px;
  color: var(--text-secondary);
  flex: 1;
  font-weight: 500;
}
.holding-summary {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
}
.holding-assign-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.holding-client-select {
  flex: 1;
  min-width: 200px;
  max-width: 340px;
  padding: 5px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
}

/* ── Full-width action panel (no info panel) ── */
.inbox-panel-full {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

/* ══════════════════════════════════════════════════════
   COPYRIGHT TAB
   ══════════════════════════════════════════════════════ */

.cr-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 12px 0 8px;
}
.cr-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}
.cr-empty p { margin-bottom: 16px; }
.cr-year-section { margin-bottom: 24px; }
.cr-year-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.cr-record {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.cr-record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  gap: 12px;
}
.cr-record-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.cr-request-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
}
.cr-org {
  font-size: 12px;
  color: var(--text-secondary);
}
.cr-show {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}
.cr-record-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cr-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cr-status-pending  { background: rgba(243,156,18,0.2); color: var(--warning); }
.cr-status-approved { background: rgba(46,204,113,0.2); color: var(--success); }
.cr-status-denied   { background: rgba(231,76,60,0.2);  color: var(--danger); }
.cr-status-invoiced { background: rgba(0,180,216,0.15); color: var(--comp-secondary); }
.cr-status-select {
  padding: 3px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
}
.cr-songs {
  padding: 0 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.cr-song-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.cr-song-title {
  flex: 1;
  color: var(--text-secondary);
}
.cr-song-badge {
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.cr-song-pending  { background: rgba(243,156,18,0.15); color: var(--warning); }
.cr-song-approved { background: rgba(46,204,113,0.15); color: var(--success); }
.cr-song-denied   { background: rgba(231,76,60,0.15);  color: var(--danger); }
.cr-song-fee {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Copyright Overview Table ── */
.cr-filter-select, .cr-filter-input {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 10px; font-size: 12px;
  color: var(--text-secondary); font-family: var(--font-body);
}
.cr-overview-table {
  width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px;
}
.cr-overview-table th {
  text-align: left; padding: 8px 12px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.cr-overview-row td { padding: 9px 12px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.cr-overview-row:hover td { background: var(--bg-card-hover, rgba(255,255,255,0.03)); }
.cr-row-urgent td { border-left: 3px solid var(--warning); }
.cr-row-urgent td:first-child { padding-left: 9px; }
.cr-ov-client { font-weight: 600; color: var(--text-primary); }
.cr-client-link { color: #64b4ff; cursor: pointer; text-decoration: underline; }
.cr-client-link:hover { color: var(--text-primary); }
.cr-ov-show { color: var(--text-secondary); }
.cr-ov-year { font-size: 10px; color: var(--text-muted); }
.cr-ov-req { font-family: monospace; color: var(--warning); font-size: 11px; }
.cr-ov-songs { color: var(--text-muted); max-width: 160px; }
.cr-ov-select { font-size: 10px; padding: 2px 6px; }
.cr-source-badge {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
}
.cr-source-tresona     { background: rgba(0,180,216,0.15); color: var(--comp-secondary); }
.cr-source-direct      { background: rgba(155,89,182,0.15); color: #c39bd3; }
.cr-source-public_domain { background: rgba(46,204,113,0.15); color: var(--success); }
.cr-source-other       { background: rgba(149,165,166,0.15); color: var(--text-muted); }
.btn-cr-confirm {
  background: rgba(243,156,18,0.15); border: 1px solid rgba(243,156,18,0.4);
  color: var(--warning); border-radius: 4px; font-size: 10px; font-weight: 700;
  padding: 2px 8px; cursor: pointer; white-space: nowrap;
}
.btn-cr-confirm:hover { background: rgba(243,156,18,0.3); }
.cr-confirmed-label { color: var(--success); font-size: 13px; }
.cr-invoice-label { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.cr-overview-footer { font-size: 11px; color: var(--text-muted); padding: 10px 12px; }

/* ── Collaborators Tab ─────────────────────────────────────────────────── */
.collaborators-wrap {
  padding: 16px 0;
}
.collaborators-table {
  width: 100%;
  border-collapse: collapse;
}
.collaborators-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 8px 8px;
  border-bottom: 1px solid var(--border);
}
.collaborators-table thead th:last-child { width: 60px; }
.collaborator-row td {
  padding: 4px 8px;
  vertical-align: middle;
}
.collaborator-row:not(:last-child) td {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.collab-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 5px 7px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.collab-input:not(.collab-locked):hover { border-color: var(--border); }
.collab-input:not(.collab-locked):focus { outline: none; border-color: var(--marching-primary); background: var(--surface-hover); }
.collab-input option { background: var(--surface); }
.collab-input.collab-locked {
  pointer-events: none;
  border-color: transparent !important;
  background: transparent !important;
}
select.collab-input.collab-locked {
  -webkit-appearance: none;
  appearance: none;
}
.collab-link {
  display: block;
  font-size: 13px;
  padding: 5px 7px;
  color: var(--marching-primary);
  text-decoration: none;
  border-radius: 4px;
  transition: opacity 0.15s;
}
.collab-link:hover { opacity: 0.75; text-decoration: underline; }
.collab-actions {
  white-space: nowrap;
  text-align: right;
}
.collab-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 3px 4px;
  border-radius: 3px;
  opacity: 0.75;
  transition: opacity 0.15s;
  line-height: 1;
}
.collab-btn:hover { opacity: 1; }
.collab-btn-delete { color: var(--danger, #e05252); }
.collab-btn-save   { color: #2ecc71; }
.collab-btn-edit   { color: #f0b429; }

/* ── Phone action menu ─────────────────────────────────────────────────── */
/* ── Email Reply Modal ────────────────────────────────────────────────── */
.modal-reply {
  width: 620px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.reply-ai-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.reply-sending-via {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}
.reply-fields {
  border-bottom: 1px solid var(--border);
}
.reply-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.reply-field-row:last-child { border-bottom: none; }
.reply-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  width: 52px;
  flex-shrink: 0;
}
.reply-to-display {
  font-size: 13px;
  color: var(--text-primary);
}
.reply-subject-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.reply-body {
  flex: 1;
  min-height: 200px;
  resize: vertical;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  padding: 14px 20px;
  outline: none;
  line-height: 1.6;
}
.reply-body:focus { background: rgba(255,255,255,0.02); }
.reply-signature {
  padding: 10px 20px 4px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: pre-wrap;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}

.phone-action-menu {
  position: absolute;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  overflow: hidden;
  min-width: 180px;
}
.phone-action-item {
  display: block;
  padding: 10px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.1s;
}
.phone-action-item:hover { background: var(--surface-hover); }

/* ── Finances Tab ─────────────────────────────────────────────────── */
.finance-tab-wrap { padding: 20px; }
.finance-tab-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; max-width: 960px; }
.fin-col-left { min-width: 0; }
.fin-col-right { min-width: 0; }
.finance-section { margin-bottom: 8px; }
.finance-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.finance-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
.finance-hint { font-size: 12px; color: var(--text-muted, #888); margin-bottom: 10px; line-height: 1.5; }
.finance-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.fin-payee-set-badge { font-size: 11px; background: var(--comp-primary); color: #fff; padding: 2px 8px; border-radius: 10px; }
.fin-toggle-row { display: flex; gap: 8px; margin-bottom: 14px; }
.fin-toggle-on { background: var(--comp-primary) !important; color: #fff !important; border-color: var(--comp-primary) !important; }
.fin-panel { margin-bottom: 16px; }
.fin-panel-hidden { display: none; }
.fin-split-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.fin-split-label { font-size: 13px; color: var(--text-primary); flex: 1; }
.fin-split-input-wrap { display: flex; align-items: center; gap: 2px; }
.fin-dollar { font-size: 13px; color: var(--text-secondary); }
.fin-split-input { width: 100px; text-align: right; }
.fin-split-auto { font-size: 14px; font-weight: 600; color: var(--comp-primary); min-width: 80px; text-align: right; }
.fin-fee-note { font-size: 11px; color: var(--text-muted, #888); margin-top: 6px; }
.fin-line-item { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.fin-line-desc { flex: 1; }
.fin-line-amt { width: 90px; text-align: right; }
.btn-fin-remove-line { background: none; border: none; color: var(--danger); font-size: 16px; cursor: pointer; padding: 0 4px; line-height: 1; }
.btn-fin-remove-line:hover { color: #ff6b6b; }
.fin-items-total { margin-top: 8px; font-size: 13px; color: var(--text-secondary); }
.fin-empty-items { font-size: 12px; color: var(--text-muted, #888); padding: 8px 0; }
.fin-save-status { font-size: 12px; color: var(--comp-secondary); margin-left: 10px; }

/* ── Invoices View ── */
.invoice-view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.invoice-filters-row { display: flex; gap: 8px; align-items: center; }
.inv-filter-select { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); padding: 6px 10px; font-family: var(--font-body); font-size: 13px; }

.invoice-summary-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.inv-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 20px; min-width: 160px; }
.inv-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.inv-stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.inv-stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.inv-stat-outstanding .inv-stat-value { color: #f39c12; }
.inv-stat-paid .inv-stat-value { color: #2ecc71; }
.inv-stat-alltime .inv-stat-value { color: var(--comp-secondary); }
.inv-stat-writtenoff .inv-stat-value { color: var(--text-muted); }

.invoice-ledger-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.invoice-ledger-table th { text-align: left; padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.invoice-ledger-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.inv-row:hover td { background: rgba(255,255,255,0.02); }
.inv-num { font-family: var(--font-display); font-weight: 700; color: var(--text-secondary); }
.inv-amount { font-weight: 700; }
.inv-payee { color: var(--text-muted); font-size: 12px; }
.inv-actions { display: flex; gap: 6px; }
.inv-btn-paid { background: rgba(46,204,113,0.15); color: #2ecc71; border: 1px solid rgba(46,204,113,0.3); }
.inv-btn-paid:hover { background: rgba(46,204,113,0.25); }
.inv-notes-row td { padding: 2px 12px 10px; }
.inv-note-text { font-size: 12px; color: var(--text-muted); font-style: italic; }
.inv-due-cell { white-space: nowrap; }
.inv-due-input {
  background: transparent; border: 1px solid var(--border-light); border-radius: 4px;
  color: var(--text-secondary); font-size: 12px; padding: 3px 6px;
  font-family: inherit; cursor: pointer;
}
.inv-due-input:hover { border-color: var(--comp-secondary); }
.inv-due-input.inv-due-overdue { color: #e74c3c; border-color: rgba(231,76,60,0.4); }
.inv-due-date { font-size: 12px; color: var(--text-muted); }

/* ── Broadcast Composer ── */
.broadcast-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 24px; margin-bottom: 24px;
}
.broadcast-panel-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 0; user-select: none;
}
.broadcast-panel-header:hover .broadcast-expand-icon { color: var(--comp-secondary); }
.broadcast-panel-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--comp-secondary); }
.broadcast-panel-sub { font-size: 12px; color: var(--text-muted); flex: 1; }
.broadcast-expand-icon { font-size: 12px; color: var(--text-muted); margin-left: auto; transition: transform 0.2s; flex-shrink: 0; }
.broadcast-panel:not(.collapsed) .broadcast-expand-icon { transform: rotate(90deg); }
.broadcast-panel:not(.collapsed) .broadcast-panel-header { margin-bottom: 16px; }
.broadcast-form { display: flex; flex-direction: column; gap: 12px; }
.broadcast-panel.collapsed .broadcast-form { display: none; }
.broadcast-row { display: flex; gap: 12px; }
.broadcast-row-two .broadcast-field { flex: 1; }
.broadcast-field { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.broadcast-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.broadcast-input {
  background: var(--bg-input, rgba(255,255,255,0.05)); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-primary); font-size: 13px;
  padding: 8px 10px; font-family: inherit;
}
.broadcast-input:focus { outline: none; border-color: var(--comp-secondary); }
.broadcast-select { appearance: none; cursor: pointer; }
.broadcast-textarea {
  background: var(--bg-input, rgba(255,255,255,0.05)); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-primary); font-size: 13px;
  padding: 10px 12px; font-family: inherit; resize: vertical; width: 100%; box-sizing: border-box;
}
.broadcast-textarea:focus { outline: none; border-color: var(--comp-secondary); }
.broadcast-draft { font-size: 13px; line-height: 1.7; }
.broadcast-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.broadcast-sent-msg { font-size: 12px; color: #2ecc71; font-weight: 600; }
.broadcast-sending-progress { font-size: 12px; color: var(--text-muted); font-style: italic; }

/* Mode + Year tabs */
.bc-mode-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bc-mode-tabs, .bc-year-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.bc-mode-tab, .bc-year-tab {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.bc-mode-tab:hover, .bc-year-tab:hover { border-color: var(--comp-secondary); color: var(--comp-secondary); }
.bc-mode-tab.active, .bc-year-tab.active {
  background: rgba(139,92,246,0.15); border-color: var(--comp-secondary);
  color: var(--comp-secondary); font-weight: 600;
}

/* Recipient preview */
.bc-recipient-preview { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.bc-count-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.bc-recipient-list {
  border: 1px solid var(--border-light); border-radius: 6px;
  max-height: 180px; overflow-y: auto; margin-top: 4px;
}
.bc-recipient-item {
  display: flex; gap: 12px; padding: 7px 12px; font-size: 12px;
  border-bottom: 1px solid var(--border-light); align-items: center;
}
.bc-recipient-item:last-child { border-bottom: none; }
.bc-rec-name { font-weight: 500; color: var(--text-primary); min-width: 140px; }
.bc-rec-org { color: var(--text-muted); flex: 1; }
.bc-rec-email { color: var(--comp-secondary); font-size: 11px; }

.badge-warning { background: rgba(243,156,18,0.15); color: #f39c12; border: 1px solid rgba(243,156,18,0.3); }
.badge-success { background: rgba(46,204,113,0.15); color: #2ecc71; border: 1px solid rgba(46,204,113,0.3); }

/* ── Yeet / Delete ── */
.btn-yeet {
  background: transparent;
  border: 1px solid rgba(255, 45, 120, 0.4);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-yeet:hover { background: rgba(255,45,120,0.12); border-color: var(--danger); }
.btn-yeet:disabled { opacity: 0.7; cursor: default; font-style: italic; }

.yeet-modal-box {
  max-width: 480px;
  width: 100%;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
}
.yeet-modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.yeet-modal-client {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.yeet-modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.btn-yeet-season {
  width: 100%;
  background: rgba(243,156,18,0.1);
  border: 1px solid rgba(243,156,18,0.4);
  color: #f39c12;
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  transition: background 0.2s;
  letter-spacing: 0.04em;
}
.btn-yeet-season:hover { background: rgba(243,156,18,0.2); }
.btn-yeet-season:disabled { opacity: 0.6; cursor: default; }
.yeet-sub {
  font-size: 11px;
  font-weight: 400;
  color: rgba(243,156,18,0.7);
  letter-spacing: 0;
}
.yeet-divider {
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 0 14px;
}
.btn-yeet-full {
  width: 100%;
  background: rgba(255,45,120,0.1);
  border: 1px solid rgba(255,45,120,0.4);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: background 0.2s;
  margin-bottom: 12px;
}
.btn-yeet-full:hover { background: rgba(255,45,120,0.2); }
.yeet-permadeath-warn {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.btn-permadeath {
  width: 100%;
  background: var(--danger);
  border: none;
  color: #fff;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 900;
  font-family: var(--font-display);
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: opacity 0.2s, transform 0.1s;
  margin-bottom: 0;
}
.btn-permadeath:hover { opacity: 0.9; transform: scale(1.01); }
.btn-permadeath:disabled { opacity: 0.5; cursor: default; transform: none; }

/* ── David Thorne Avatar ── */
.david-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.david-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.david-avatar-sm {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.david-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0,180,216,0.15);
}

/* ── Assistant Brain Briefing Panel ── */
.briefing-panel {
  display: none;
  background: linear-gradient(135deg, rgba(0,180,216,0.06), rgba(147,51,234,0.06));
  border: 1px solid rgba(0,180,216,0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.briefing-panel.briefing-has-content { display: block; }
.briefing-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
}
.briefing-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
}
.briefing-meta a { color: var(--comp-secondary); text-decoration: none; }
.briefing-meta a:hover { text-decoration: underline; }
.briefing-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--comp-secondary); }
.briefing-loading { font-size: 13px; color: var(--text-muted); font-style: italic; }
.briefing-error { font-size: 13px; color: var(--danger); }

/* ── Collaborator email suggestions ── */
.collab-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
#collab-email-suggestions {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
}
.collab-suggest-header { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.collab-suggest-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-light); gap: 12px; }
.collab-suggest-row:last-child { border-bottom: none; }
.collab-suggest-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.collab-suggest-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.collab-suggest-email { font-size: 12px; color: var(--comp-secondary); }
.collab-suggest-subject { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.collab-suggest-empty { font-size: 13px; color: var(--text-muted); padding: 4px 0; }

/* Collaborator people intelligence panel */
.collab-intel-divider { border: none; border-top: 1px solid var(--border-light); margin: 24px 0 20px; }
.people-briefing-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.people-briefing-header .ai-summary-label { flex: 1; }
.people-briefing-panel { padding: 0 2px 16px; }
.people-briefing-text { font-size: 13px; line-height: 1.7; color: var(--text-secondary); font-style: italic; }
.people-briefing-meta { font-size: 11px; color: var(--text-muted); margin-top: 8px; }
.people-briefing-loading { font-size: 12px; color: var(--text-muted); padding: 8px 0; }
.people-briefing-empty { font-size: 12px; color: var(--text-muted); padding: 8px 0; }

/* Collaborator name autocomplete dropdown */
.collab-ac-dropdown {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 9999;
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}
.collab-ac-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}
.collab-ac-item:last-child { border-bottom: none; }
.collab-ac-item:hover { background: var(--surface-hover, rgba(255,255,255,0.06)); }
.collab-ac-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.collab-ac-meta { font-size: 11px; color: var(--text-muted); }

/* ── Schedule Tab ─────────────────────────────────────────────────────────── */
.schedule-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .schedule-layout { grid-template-columns: 1fr; } }

.schedule-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.schedule-left-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.schedule-right { background: var(--surface-card); border-radius: 10px; padding: 16px; }
.schedule-right .schedule-section-title { display: block; margin-bottom: 14px; }

.schedule-event-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.sched-event-row {
  background: var(--surface-card);
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--border-light);
}
.sched-event-row:hover { border-left-color: var(--marching-primary); }
.sched-event-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sched-event-date { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.sched-event-time { font-size: 12px; color: var(--text-muted); }
.sched-event-loc { font-size: 12px; color: var(--text-secondary); }
.sched-event-sub { margin-top: 4px; font-size: 12px; color: var(--text-secondary); padding-left: 4px; }
.sched-event-notes { margin-top: 4px; font-size: 12px; color: var(--text-muted); font-style: italic; padding-left: 4px; }
.sched-comp-info { color: var(--marching-primary); }

/* Schedule event type badges */
.sched-type-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.sched-badge-rehearsal   { background: rgba(100,149,237,0.15); color: cornflowerblue; }
.sched-badge-show_day    { background: rgba(46,204,113,0.15);  color: #2ecc71; }
.sched-badge-competition { background: rgba(231,76,60,0.15);   color: #e74c3c; }
.sched-badge-clinic      { background: rgba(243,156,18,0.15);  color: #f39c12; }
.sched-badge-meeting     { background: rgba(155,89,182,0.15);  color: #9b59b6; }
.sched-badge-other       { background: rgba(149,165,166,0.15); color: #95a5a6; }

/* Add event form */
.sched-add-form { background: var(--surface-card); border-radius: 10px; padding: 16px; margin-top: 10px; }
.sched-comp-fields { margin-top: 4px; }

/* Inline edit form */
.sched-inline-edit {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.sched-edit-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.sched-edit-row input,
.sched-edit-row textarea {
  flex: 1;
  min-width: 120px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--text-primary);
}
.sched-edit-row textarea { min-height: 60px; resize: vertical; }
.sched-edit-actions { display: flex; gap: 8px; }

/* ── Shows Tab — Role & Override styles ───────────────────────────────────── */
.show-checkrow-override { margin-bottom: 8px; opacity: 0.75; }
.check-label-override { font-size: 12px; font-style: italic; }
.show-field-full { grid-column: 1 / -1; }

/* ── Contacts — Person-First List View ────────────────────────────────────── */
.contacts-list-table { display: flex; flex-direction: column; gap: 0; padding: 4px 0; }
.contact-list-row {
  display: grid;
  grid-template-columns: 220px 160px 1fr;
  align-items: start;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
}
.contact-list-row:last-child { border-bottom: none; }
.contact-list-row:hover { background: var(--surface-hover); }
.contact-col-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.contact-name-text { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.contact-col-phone { font-size: 13px; color: var(--text-secondary); padding-top: 1px; }
.contact-col-phone a { color: var(--text-secondary); text-decoration: none; }
.contact-col-phone a:hover { text-decoration: underline; }
.contact-col-programs { display: flex; flex-direction: column; gap: 4px; }
.contact-prog-line { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.contact-prog-line.prog-marching .contact-prog-role { color: var(--marching-primary); }
.contact-prog-line.prog-comp .contact-prog-role { color: var(--comp-secondary); }
.contact-prog-role { font-weight: 700; min-width: 120px; }
.contact-prog-sep { color: var(--text-muted); }
.contact-prog-email { color: var(--text-secondary); text-decoration: none; font-size: 12px; }
.contact-prog-email:hover { text-decoration: underline; }
.btn-link-plain { background: none; border: none; padding: 0; cursor: pointer; color: var(--text-secondary); font-size: 12px; }
.btn-link-plain:hover { color: var(--comp-secondary); text-decoration: underline; }
.btn-contact-name { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.btn-contact-name:hover { color: var(--comp-secondary); }
.badge-xs { font-size: 9px !important; padding: 1px 5px !important; }
.btn-xs { font-size: 11px !important; padding: 2px 8px !important; }

/* ── Person identity ──────────────────────────────────────────────────────── */
.person-linked-badge { font-size: 13px; color: var(--comp-secondary); margin-left: 2px; cursor: default; }
.contact-person-actions { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border-light); }

/* ── Director header inline editor ───────────────────────────────────────── */
.director-header-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.director-display { display: flex; align-items: center; gap: 8px; }
.director-change-btn { font-size: 11px; opacity: 0.6; transition: opacity 0.15s; }
.director-change-btn:hover { opacity: 1; }
.director-edit-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.director-edit-input { font-size: 13px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border-light); background: var(--surface-input, rgba(255,255,255,0.07)); color: var(--text-primary); width: auto; }
.director-edit-input:first-child { min-width: 180px; }
.director-edit-input:not(:first-child) { min-width: 160px; }

/* ── David Thorne Chat Button ─────────────────────────────────────────────── */
.david-chat-trigger-row {
  margin-top: 8px;
}
.btn-david-chat {
  background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(255,45,120,0.12));
  border: 1px solid rgba(139,92,246,0.35);
  border-radius: 20px;
  color: #c4b5fd;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 18px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn-david-chat:hover {
  background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(255,45,120,0.2));
  border-color: rgba(139,92,246,0.6);
  color: #ede9fe;
}

/* ── David Thorne Chat Modal ──────────────────────────────────────────────── */
.david-chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.david-chat-modal {
  background: #13102a;
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 14px;
  width: 680px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  overflow: hidden;
}
.david-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(139,92,246,0.2);
  background: rgba(139,92,246,0.08);
  flex-shrink: 0;
}
.david-chat-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.david-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(139,92,246,0.5);
  object-fit: cover;
}
.david-chat-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.david-chat-title {
  font-size: 11px;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 1px;
}
.david-chat-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.david-chat-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.07); }

/* Messages area */
.david-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(139,92,246,0.3) transparent;
}
.david-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.david-msg.ryan {
  justify-content: flex-end;
}
.david-msg.david {
  justify-content: flex-start;
}
.david-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(139,92,246,0.4);
}
.david-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
}
.ryan-bubble {
  background: var(--marching-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
  text-align: right;
}
.david-bubble-text {
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.2);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  white-space: pre-wrap;
}

/* Typing indicator */
.david-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
}
.david-typing span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a78bfa;
  animation: davidTypingDot 1.2s infinite ease-in-out;
}
.david-typing span:nth-child(2) { animation-delay: 0.2s; }
.david-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes davidTypingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Input row */
.david-chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(139,92,246,0.15);
  flex-shrink: 0;
}
.david-chat-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 14px;
  outline: none;
  resize: none;
  transition: border-color 0.15s;
  line-height: 1.4;
}
.david-chat-input:focus { border-color: rgba(139,92,246,0.6); }
.david-chat-input::placeholder { color: var(--text-muted); }
.david-chat-send {
  background: linear-gradient(135deg, #7c3aed, rgba(255,45,120,0.8));
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.david-chat-send:hover { opacity: 0.88; }
.david-chat-send:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 768px) {
  .david-chat-modal { height: calc(100vh - 32px); border-radius: 12px; }
  .david-bubble { max-width: 88%; font-size: 13px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — max-width: 768px
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Header ── */
  .app-header {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 16px 0;
    gap: 8px;
  }
  .header-brand {
    flex: 1;
  }
  .brand-name {
    font-size: 20px;
  }
  .brand-sub {
    font-size: 9px;
  }
  /* Search bar drops to its own full-width row */
  .header-search {
    order: 3;
    flex: 0 0 100%;
    max-width: 100%;
    margin: 0 0 10px;
  }
  /* Nav scrolls horizontally on its own row */
  .app-nav {
    order: 2;
    flex: 0 0 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    gap: 2px;
  }
  .app-nav::-webkit-scrollbar { display: none; }
  .nav-btn {
    font-size: 13px;
    padding: 7px 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  /* Logout button stays in top-right corner */
  .header-logout-btn {
    order: 1;
  }

  /* ── Main content area ── */
  .app-main {
    padding: 16px;
  }

  /* ── Dashboard top bar ── */
  .dashboard-top-bar {
    flex-direction: column;
    gap: 12px;
  }
  .dashboard-top-left,
  .dashboard-center-col,
  .header-actions-col {
    width: 100%;
  }
  .header-actions-col {
    flex-direction: row;
    flex-wrap: wrap;
  }
  /* Stats row: allow wrapping to 2×2 */
  .stats-row {
    flex-wrap: wrap;
  }
  .stat-card {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  /* ── Dashboard 3-col → 1-col ── */
  .dashboard-body {
    grid-template-columns: 1fr;
  }

  /* ── Client grid: single column ── */
  .client-grid {
    grid-template-columns: 1fr;
  }
  .section-label {
    font-size: 18px;
  }

  /* ── Client detail header ── */
  .client-detail-header {
    flex-direction: column;
    gap: 14px;
  }
  .client-detail-name {
    font-size: 22px;
  }
  .client-detail-org {
    font-size: 13px;
  }
  .detail-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .detail-actions .btn {
    font-size: 12px;
    padding: 7px 12px;
  }
  /* Contact links stack vertically */
  .client-contact {
    flex-direction: column;
    gap: 6px;
  }

  /* ── Tab bar: scrollable horizontally ── */
  .tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    gap: 0;
    padding-bottom: 0;
  }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-btn {
    font-size: 12px;
    padding: 8px 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ── Show cards ── */
  .show-fields {
    grid-template-columns: 1fr 1fr;
  }
  .show-checkrow {
    gap: 12px;
  }
  .show-card-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .show-card-header .btn {
    font-size: 11px;
    padding: 5px 10px;
  }

  /* ── Collaborators table: horizontal scroll ── */
  .collaborators-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .collaborators-table {
    min-width: 560px;
  }

  /* ── Contacts list: stack the 3-col grid ── */
  .contact-list-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .contact-col-phone {
    font-size: 12px;
  }

  /* ── Copyright table: horizontal scroll ── */
  .cr-overview-table-wrap,
  .copyright-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Inbox panels: already 1-col at 800px, just tighten padding ── */
  .inbox-item {
    padding: 10px 12px;
  }
  .action-assign-row,
  .holding-assign-row {
    flex-wrap: wrap;
  }
  .action-assign-row select,
  .holding-client-select {
    width: 100%;
    margin-bottom: 6px;
  }

  /* ── Priorities / upcoming panels ── */
  .priorities-panel,
  .upcoming-writing-panel {
    min-height: auto;
  }

  /* ── Dashboard header ── */
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  /* ── View title ── */
  .view-title {
    font-size: 20px;
  }

  /* ── Modal / overlays: full-width on mobile ── */
  .modal-box,
  .compose-modal {
    width: calc(100vw - 32px) !important;
    max-width: 100% !important;
    margin: 0 16px;
  }

  /* ── Notes toolbar ── */
  .notes-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* ── Back button spacing ── */
  .btn-back {
    margin-bottom: 16px;
  }

  /* ── Director edit form ── */
  .director-edit-form {
    flex-direction: column;
    align-items: flex-start;
  }
  .director-edit-input,
  .director-edit-input:first-child,
  .director-edit-input:not(:first-child) {
    min-width: 0;
    width: 100%;
  }

  /* ── AI advisor boxes ── */
  .ai-advisor-box {
    padding: 12px;
  }
  .ai-advisor-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* ============================================================
   RESULTS TAB — Competition Intelligence
   ============================================================ */

.results-tab-inner {
  padding: 16px 0;
}

.results-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.results-header-row h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.results-season-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.results-season-controls label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.results-season-controls select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
}

.results-latest-badge {
  font-size: 0.75rem;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 2px 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Section containers ── */
.results-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.results-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0 0 14px 0;
}

/* ── Velocity cards ── */
.velocity-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.velocity-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vel-caption-name {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.vel-scores {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
}

.vel-score-label {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.vel-score-val {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.vel-vel {
  font-size: 0.8rem;
  font-weight: 600;
  color: #3b9e5a;
}

.vel-vel.negative {
  color: #c0392b;
}

.vel-gap {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.vel-gap span {
  font-weight: 600;
  color: var(--text);
}

.vel-status {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-block;
  align-self: flex-start;
  margin-top: 2px;
}

.vel-status.closing   { background: #d4edda; color: #155724; }
.vel-status.widening  { background: #f8d7da; color: #721c24; }
.vel-status.maxed     { background: #d1ecf1; color: #0c5460; }
.vel-status.plateau   { background: #fff3cd; color: #856404; }
.vel-status.unknown   { background: var(--bg-card); color: var(--text-muted); }

/* ── SVG sparklines ── */
.vel-sparkline {
  margin-top: 4px;
  overflow: hidden;
  border-radius: 4px;
}

/* ── Arc chart ── */
.arc-chart-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.arc-chart-wrap svg {
  display: block;
  max-width: 100%;
}

.arc-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.arc-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.arc-legend-item .legend-swatch {
  width: 24px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

.arc-legend-item .legend-swatch.dashed {
  background: repeating-linear-gradient(
    90deg,
    currentColor 0px, currentColor 5px,
    transparent 5px, transparent 9px
  );
}

/* ── Caption selector tabs ── */
.caption-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.caption-selector button {
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.caption-selector button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.caption-selector button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Same-week + competitors tables ── */
.results-field-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.results-field-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}

.results-field-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.results-field-table tr.wmm-row td {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Tier badge colors — 0.3/0.6/0.9/1.0+ framework */
.tier-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.tier-badge.tier-0   { background: #d4edda; color: #155724; }  /* any given night */
.tier-badge.tier-1   { background: #fff3cd; color: #856404; }  /* competitive      */
.tier-badge.tier-2   { background: #fde8d0; color: #7a3e00; }  /* clear separation */
.tier-badge.tier-3   { background: #f8d7da; color: #721c24; }  /* different tier   */

.tier-delta-pos { color: #3b9e5a; font-weight: 600; }
.tier-delta-neg { color: #c0392b; font-weight: 600; }
.tier-delta-neu { color: var(--text-muted); }

/* WMM client badge */
.wmm-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 4px;
}

/* ── Placement medals ── */
.medal-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}
.medal-gold   { background: #b8860b; color: #fff; }
.medal-silver { background: #7a8a9b; color: #fff; }
.medal-bronze { background: #8a5a2e; color: #fff; }

/* ── AI briefing panel ── */
.briefing-output {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 0.87rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  min-height: 80px;
}

.briefing-output.loading-msg {
  color: var(--text-muted);
  font-style: italic;
}

.loading-msg {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
  padding: 12px 0;
}

/* ── Schedule confirm inbox panel ── */
.inbox-panel.inbox-panel-full {
  grid-column: 1 / -1;
}

.schedule-confirm-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--bg);
}

.schedule-confirm-card h4 {
  margin: 0 0 8px 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.schedule-confirm-events {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.6;
}

.schedule-confirm-actions {
  display: flex;
  gap: 8px;
}

/* ── Show Design Band (all horizontal: Design Status → dates → parts → survey) ── */
.show-design-band {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 8px;
}
.show-field-compact {
  flex: 0 0 auto;
}
.show-field-compact select,
.show-field-compact input[type="date"] {
  width: auto;
  min-width: 140px;
}
.show-field-schedule-btn .btn-gen-schedule-pill {
  margin-top: 0;
  white-space: nowrap;
}
.show-field-parts {
  flex: 0 0 auto;
}
.show-field-survey {
  flex: 0 0 auto;
}
.show-checkrow-parts {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px 14px;
  align-items: center;
  padding-top: 4px;
}

/* ── Survey Button States ── */
.survey-btn-wrap {
  margin-top: 4px;
}
.btn-survey-send {
  background: var(--marching-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  letter-spacing: 0.01em;
}
.btn-survey-send:hover { opacity: 0.85; }
.btn-survey-send:disabled { opacity: 0.5; cursor: default; }

.survey-sent-state {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.survey-sent-label {
  font-size: 12px;
  color: var(--text-muted);
}
.btn-survey-resend {
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
}
.btn-survey-resend:hover { color: var(--text-primary); border-color: var(--text-muted); }

.btn-survey-returned {
  background: #16a34a22;
  color: #4ade80;
  border: 1px solid #16a34a55;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-survey-returned:hover { background: #16a34a33; }

/* ── Bookkeeping Tab additions ── */
.fin-fee-row { margin-bottom: 12px; }
.fin-invoice-desc-row { margin-bottom: 12px; }
.fin-overrides-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.fin-status-checks {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ── Survey Results Modal ── */
.modal-survey { max-width: 720px; width: 95vw; max-height: 80vh; overflow-y: auto; }
.survey-results-body { padding: 8px 0; }

.sv-doc { font-size: 13px; }
.sv-doc-header { margin-bottom: 16px; }
.sv-doc-title { font-size: 15px; font-weight: 700; color: var(--marching-primary); }
.sv-section { margin-bottom: 20px; }
.sv-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.sv-table { width: 100%; border-collapse: collapse; }
.sv-table th { font-size: 11px; color: var(--text-muted); font-weight: 600; padding: 4px 8px; text-align: left; }
.sv-table td { padding: 5px 8px; vertical-align: top; border-bottom: 1px solid var(--border-subtle, #2a2a40); }
.sv-instrument { font-weight: 500; width: 140px; }
.sv-count { width: 40px; text-align: center; color: var(--marching-primary); font-weight: 600; }
.sv-notes { color: var(--text-secondary); }
.sv-extra-field {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 8px;
  background: var(--bg-card);
  border-radius: 4px;
}

/* ── Survey note in Notes tab ── */
.note-item-survey { border-left: 3px solid var(--marching-primary) !important; }
.badge-survey {
  background: var(--marching-primary);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.survey-note-body {
  font-family: monospace;
  font-size: 12px;
  white-space: pre-wrap;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 6px;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .velocity-cards {
    grid-template-columns: 1fr 1fr;
  }

  .results-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .results-field-table th,
  .results-field-table td {
    padding: 6px 6px;
    font-size: 0.78rem;
  }
}

@media (max-width: 480px) {
  .velocity-cards {
    grid-template-columns: 1fr;
  }
}

/* ── Client Chat / Portal Tab ───────────────────────────────────────────── */
.client-chat-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0 40px;
}

.portal-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.portal-media-pair {
  display: flex;
  gap: 12px;
}
.portal-media-pair .portal-section {
  flex: 1;
  min-width: 0;
}

.portal-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}

.portal-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.portal-section-body {
  padding: 14px 16px;
}

.portal-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-url-display {
  font-size: 0.82rem;
  color: var(--accent);
  font-family: monospace;
  word-break: break-all;
  flex: 1;
}

.portal-media-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-url-input {
  flex: 1;
  background: var(--input-bg, #1e2130);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 7px 12px;
  font-size: 0.88rem;
  outline: none;
}
.portal-url-input:focus { border-color: var(--accent); }

.portal-media-value {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-secondary);
  word-break: break-all;
}

/* Access toggle summary */
.portal-access-toggle { user-select: none; }
.portal-access-toggle:hover { background: rgba(255,255,255,0.04); }
.portal-access-summary {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 8px;
  text-transform: none;
  letter-spacing: 0;
}
.portal-toggle-arrow {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Access table */
.portal-access-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}
.portal-access-table thead tr {
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}
.portal-access-table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.portal-access-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.portal-access-table tbody tr:last-child td { border-bottom: none; }
.portal-access-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.portal-access-ungrant { opacity: 0.75; }
.portal-access-ungrant:has(.portal-access-cb:checked) { opacity: 1; background: rgba(124,106,247,0.06); }

.pac-name  { font-weight: 500; }
.pac-email { color: var(--text-secondary); font-size: 0.82rem; }
.pac-muted { opacity: 0.7; }
.pac-no-access {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
}

.pin-code {
  font-family: monospace;
  background: rgba(124,106,247,0.15);
  color: #a89af9;
  border: 1px solid rgba(124,106,247,0.3);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
}
.pin-actions { display: flex; gap: 4px; }
.pin-actions .btn { font-size: 16px !important; line-height: 1; }

.portal-access-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.1);
}

.portal-empty-pins {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-style: italic;
  margin: 0;
}

.portal-msg-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Portal messages (CRM side) */
.portal-compose-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.portal-compose-ta {
  flex: 1;
  background: var(--input-bg, #1e2130);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 64px;
  outline: none;
}
.portal-compose-ta:focus { border-color: var(--accent); }
.portal-reply-ta { min-height: 50px; }

.portal-msg {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  background: rgba(0,0,0,0.1);
}

.portal-msg-reply {
  margin-left: 24px;
  margin-top: 8px;
  border-style: dashed;
  background: rgba(0,0,0,0.05);
}

.portal-msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.portal-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.portal-badge-ryan {
  background: rgba(124,106,247,0.2);
  color: #a89af9;
  border: 1px solid rgba(124,106,247,0.35);
}
.portal-badge-client {
  background: rgba(76,175,125,0.15);
  color: #72c99a;
  border: 1px solid rgba(76,175,125,0.3);
}

.portal-msg-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.portal-msg-body {
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.portal-msg-actions {
  margin-top: 6px;
}

.portal-replies {
  margin-top: 8px;
}

.portal-reply-compose {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.btn-portal-reply-toggle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.btn-portal-reply-toggle:hover { color: var(--accent); }
