@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────── */
:root {
  --bg:          #0f1117;
  --surface:     #1a1d27;
  --surface-hover: #2c3050;
  --border:      #2e3248;
  --accent:      #7c6fcd;
  --accent-dim:  rgba(124,111,205,0.15);
  --green:       #4caf88;
  --orange:      #e8956d;
  --text:        #e8e9f0;
  --muted:       #6b7280;
  --link:        #7c6fcd;
  --danger:      #e05252;
  --danger-dim:  rgba(224,82,82,0.15);
  --panel-w:     480px;
  --sidebar-w:   220px;
  --workspace-rail-w-collapsed: 68px;
  --workspace-rail-w-expanded: 200px;
  --workspace-rail-w: var(--workspace-rail-w-collapsed);
  --radius:      8px;
  --radius-sm:   5px;
  --transition:  0.22s ease;
  --content-header-h: 86px;
  --app-zoom: 1;
}

/* ── Partnership Dashboard: Clay & Ember palette ─── */

/* Dark mode tokens (always active for partnership regardless of theme toggle) */
#app[data-dash="partnership"] {
  --bg:            #16130F;
  --surface:       #1F1C17;
  --surface-hover: #34302A;
  --border:        #36322A;
  --text:          #F4ECD6;
  --muted:         #A39882;
  --accent:        #E68445;
  --green:         #84A87A;
  --danger:        #D26656;
  --orange:        #E2AE52;
  --accent-dim:    rgba(230,132,69,0.15);
  --danger-dim:    rgba(210,102,86,0.12);
  --sidebar-bg:    #1A1712;
}

/* Light mode tokens */
[data-theme="light"] #app[data-dash="partnership"] {
  --bg:            #F9F5EE;
  --surface:       #FFFFFF;
  --surface-hover: #E8DFD0;
  --border:        #DCD2BC;
  --text:          #1B1814;
  --muted:         #7B7468;
  --accent:        #D26A2E;
  --green:         #62895A;
  --danger:        #B4453A;
  --orange:        #D29438;
  --accent-dim:    rgba(210,106,46,0.12);
  --danger-dim:    rgba(180,69,58,0.1);
}

/* Sidebar */
#app[data-dash="partnership"] .sidebar { background: #1A1712; border-right-color: #36322A; }
[data-theme="light"] #app[data-dash="partnership"] .sidebar { background: #FFFFFF; border-right-color: #DCD2BC; }

/* Dash toggle pill */
#app[data-dash="partnership"] .dash-toggle { background: #2D2922; }
[data-theme="light"] #app[data-dash="partnership"] .dash-toggle { background: #E2D8C1; }
#app[data-dash="partnership"] .dash-toggle-btn.active { background: #1F1C17; color: #F4ECD6; }
[data-theme="light"] #app[data-dash="partnership"] .dash-toggle-btn.active { background: #FFFFFF; color: #1B1814; }

/* Partnership nav active: chip style */
#app[data-dash="partnership"] .p-nav-item.active {
  background: #28241E;
  border-left-color: #E68445;
  color: #F4ECD6;
}
[data-theme="light"] #app[data-dash="partnership"] .p-nav-item.active {
  background: #FFFFFF;
  border: 1px solid #DCD2BC;
  border-left-color: #D26A2E;
  color: #1B1814;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
[data-theme="light"] #app[data-dash="partnership"] .p-nav-item:hover { background: #F0EADD; color: #1B1814; }

/* Primary CTA (Add Partnership etc.) — near-black in light, cream in dark */
[data-theme="light"] #app[data-dash="partnership"] .btn-primary { background: #2A2622; color: #F9F5EE; }
#app[data-dash="partnership"] .btn-primary { background: #F4ECD6; color: #16130F; }

/* Partnership add buttons */
[data-theme="light"] #app[data-dash="partnership"] .p-add-deliverable-btn,
[data-theme="light"] #app[data-dash="partnership"] .p-add-submit,
[data-theme="light"] #app[data-dash="partnership"] .cal-panel-add-btn { background: #2A2622; border-color: #2A2622; }

/* Partnership stat/deal cards */
[data-theme="light"] #app[data-dash="partnership"] .p-stat-card,
[data-theme="light"] #app[data-dash="partnership"] .p-deliverables,
[data-theme="light"] #app[data-dash="partnership"] .p-contact-info,
[data-theme="light"] #app[data-dash="partnership"] .p-notes-field,
[data-theme="light"] #app[data-dash="partnership"] .p-deal-row { background: #FFFFFF; border-color: #DCD2BC; }

/* Partnership table hover */
[data-theme="light"] #app[data-dash="partnership"] .p-table tr:hover { background: #F0EADD; }
#app[data-dash="partnership"] .p-table tr:hover { background: #28241E; }

/* Partnership search bar: plain white stands out against the cream header */
[data-theme="light"] #app[data-dash="partnership"] #p-search-input { background: #FFFFFF; }

/* Sidebar footer */
#app[data-dash="partnership"] .sidebar-footer { border-top-color: #36322A; }
[data-theme="light"] #app[data-dash="partnership"] .sidebar-footer { border-top-color: #DCD2BC; }

/* ── Light mode — clean minimal theme ───────────── */
[data-theme="light"] {
  --bg:            #ffffff;
  --surface:       #fafafa;
  --surface-hover: #e8e8e8;
  --border:        #e8e8e8;
  --text:          #111111;
  --muted:         #737373;
  --link:          #7c6fcd;
  --accent-dim:    rgba(0,0,0,0.05);
  --danger-dim:    rgba(224,82,82,0.08);
  --radius:        8px;
  --radius-sm:     6px;
}

/* ── Sidebar ── */
[data-theme="light"] .sidebar { background: #ffffff; border-right-color: #e8e8e8; }
[data-theme="light"] .sidebar-logo-brand { border-bottom-color: #e8e8e8; }
[data-theme="light"] .sidebar-brand-name { color: #111111; }
[data-theme="light"] .sidebar-footer { border-top-color: #e8e8e8; color: #737373; }

/* ── Nav icons ── */
[data-theme="light"] .nav-icon { color: #737373; }
[data-theme="light"] .nav-item { color: #737373; font-weight: 400; border-left-color: transparent; }
[data-theme="light"] .nav-item:hover { background: #f0f0f0; color: #111111; border-left-color: transparent; text-decoration: none; }
[data-theme="light"] .nav-item.active { background: #f0f0f0; color: #111111; border-left-color: transparent; font-weight: 600; }
[data-theme="light"] .nav-item.active .nav-icon { color: #111111; }
[data-theme="light"] .p-nav-item { color: #737373; font-weight: 400; border-left-color: transparent; }
[data-theme="light"] .p-nav-item:hover { background: #f0f0f0; color: #111111; border-left-color: transparent; text-decoration: none; }
[data-theme="light"] .p-nav-item.active { background: #f0f0f0; color: #111111; border-left-color: transparent; font-weight: 600; }
[data-theme="light"] .snav-item { color: #737373; font-weight: 400; border-left-color: transparent; }
[data-theme="light"] .snav-item:hover { background: #f0f0f0; color: #111111; border-left-color: transparent; text-decoration: none; }
[data-theme="light"] .snav-item.active { background: #f0f0f0; color: #111111; border-left-color: transparent; font-weight: 600; }
[data-theme="light"] .snav-item.active .nav-icon { color: #111111; }

/* ── Dash toggle ── */
[data-theme="light"] .dash-toggle { background: #f0f0f0; }
[data-theme="light"] .dash-toggle-btn { color: #737373; font-weight: 400; }
[data-theme="light"] .dash-toggle-btn.active { background: #ffffff; color: #111111; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

/* ── Table ── */
[data-theme="light"] .videos-table thead { background: #ffffff; }
[data-theme="light"] .videos-table th { color: #737373; border-bottom-color: #e8e8e8; font-weight: 700; }
[data-theme="light"] .videos-table td { border-bottom-color: #f0f0f0; }
[data-theme="light"] .table-row:hover { background: #f5f5f5; }
[data-theme="light"] .table-row.selected { background: rgba(124,111,205,0.06); border-left-color: var(--accent); }

/* ── Edit panel ── */
[data-theme="light"] .edit-panel { background: #ffffff; border-color: #e8e8e8; box-shadow: 0 8px 30px rgba(0,0,0,0.12); border-radius: 12px; }
[data-theme="light"] .panel-backdrop { background: rgba(0,0,0,0.3); }
[data-theme="light"] .panel-header { border-bottom-color: #e8e8e8; background: #ffffff; }
[data-theme="light"] .panel-body { background: #ffffff; }
[data-theme="light"] .panel-footer { border-top-color: #e8e8e8; background: #ffffff; }

/* ── Inputs ── */
[data-theme="light"] .field-input,
[data-theme="light"] .field-select,
[data-theme="light"] .field-textarea { background: #fafafa; border-color: #e8e8e8; color: #111111; }
[data-theme="light"] .field-input:focus,
[data-theme="light"] .field-select:focus,
[data-theme="light"] .field-textarea:focus { border-color: #111111; background: #ffffff; }
[data-theme="light"] .search-input { background: #f5f5f5; border-color: #e8e8e8; }
[data-theme="light"] .search-input:focus { border-color: #111111; background: #ffffff; }

/* ── Context menu & dialogs ── */
[data-theme="light"] .context-menu { border-color: #e8e8e8; box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-radius: 10px; }
[data-theme="light"] .dialog { border-color: #e8e8e8; box-shadow: 0 8px 30px rgba(0,0,0,0.12); border-radius: 12px; }
[data-theme="light"] .dialog-backdrop { background: rgba(0,0,0,0.3); }

/* ── Bulk toolbar ── */
[data-theme="light"] .bulk-toolbar { background: #ffffff; border-color: #e8e8e8; box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

/* ── Login ── */
[data-theme="light"] .login-overlay { background: #f5f5f5; }
[data-theme="light"] .login-card { border-color: #e8e8e8; box-shadow: 0 8px 30px rgba(0,0,0,0.08); border-radius: 12px; }
[data-theme="light"] .login-btn { background: #111111; }
[data-theme="light"] .login-input { background: #f5f5f5; border-color: #e8e8e8; }
[data-theme="light"] .login-input:focus { border-color: #111111; }

/* ── Archive ── */
[data-theme="light"] .archive-group-header td { background: #fafafa; }
[data-theme="light"] .archive-group-label { color: var(--accent); }

/* ── Calendar ── */
[data-theme="light"] .cal-grid { border-color: #e8e8e8; }
[data-theme="light"] .cal-day-header { background: #fafafa; border-color: #e8e8e8; color: #737373; }
[data-theme="light"] .cal-cell { border-color: #e8e8e8; }
[data-theme="light"] .cal-cell:hover { background: #f5f5f5; }
[data-theme="light"] .cal-today { background: rgba(124,111,205,0.06); }
[data-theme="light"] .cal-today-num { background: #111111; }
[data-theme="light"] .cal-ondeck-panel, [data-theme="light"] .cal-notepad-panel { border-color: #e8e8e8; border-radius: 8px; }
[data-theme="light"] .cal-panel-header { border-bottom-color: #e8e8e8; }
[data-theme="light"] .cal-panels { border-top-color: #e8e8e8; }
[data-theme="light"] .cal-panel-add-btn { background: #111111; border-color: #111111; }

/* ── More btn ── */
[data-theme="light"] .more-btn { background: #f0f0f0; border-color: #e8e8e8; }
[data-theme="light"] .more-btn:hover { border-color: #111111; color: #111111; }

/* ── Partnership tables ── */
[data-theme="light"] .p-table thead { background: #ffffff; }
[data-theme="light"] .p-table tr:hover { background: #f5f5f5; }
[data-theme="light"] .p-stat-card, [data-theme="light"] .p-deliverables,
[data-theme="light"] .p-contact-info, [data-theme="light"] .p-notes-field,
[data-theme="light"] .p-deal-row { background: #ffffff; border-color: #e8e8e8; border-radius: 8px; }
[data-theme="light"] .dashboard-dropdown { background: #ffffff; border-color: #e8e8e8; }

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-width: 1024px;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
a { cursor: pointer; }

/* ── Force pointer cursor on all interactive elements ── */
button, a, [role="button"],
.nav-item, .p-nav-item, .snav-item, .dash-toggle-btn,
.table-row, .p-deal-row, .p-del-left-row, .p-inv-row,
.p-activity-entry, .more-btn, .stage-badge,
.cal-pill, .pcal-pill, .link-pill, .p-link-video-btn,
.p-talent-cell, .p-del-video-cell, .studio-person-cell,
.p-notes-field-clickable, .task-item-name, .task-group-header,
.fm-custom-select-btn, .fm-custom-select-option,
.p-panel-add-row-btn, .p-add-contact-btn, .p-add-deliverable-btn,
.p-comm-pill, .p-linked-video-clickable,
.p-sub-edit-btn, .p-sub-del-btn, .p-del-delete-btn,
.p-activity-delete, .p-unlink-btn { cursor: pointer !important; }

/* ── Global hover transitions ── */
.nav-item, .p-nav-item, .snav-item, .dash-toggle-btn,
.table-row, .p-deal-row, .p-del-left-row, .p-inv-row,
.p-activity-entry, .p-sub-contact,
.btn-primary, .btn-archive, .btn-restore, .btn-delete,
.cal-pill, .pcal-pill, .link-pill,
.context-item, .more-btn, .bulk-btn,
.fm-custom-select-btn, .fm-custom-select-option,
.p-add-deliverable-btn, .p-panel-add-row-btn, .p-add-contact-btn,
.task-group-header, .task-item-name,
.p-comm-pill, .p-talent-chip, .p-talent-cell, .p-del-video-cell,
.p-notes-field-clickable, .phm-link,
.form-modal-cancel-btn, .notes-popup-close {
  transition: background 0.15s ease, color 0.12s ease,
              border-color 0.12s ease, opacity 0.12s ease,
              transform 0.12s ease;
}
input, select, textarea { font-family: inherit; }
select { cursor: pointer; }

/* ── Top Bar ────────────────────────────────────── */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  z-index: 200;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  flex-shrink: 0;
}

/* ── Workspace Rail (Slack-style, far-left) ──────── */
.workspace-rail {
  position: fixed;
  top: 52px; left: 0;
  width: var(--workspace-rail-w);
  height: calc(100vh - 52px);
  z-index: 10;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
  overflow: hidden;
  transition: width var(--transition);
}
[data-theme="light"] .workspace-rail { background: #ffffff; border-right-color: #e8e8e8; }

.workspace-rail.expanded {
  align-items: stretch;
  padding: 12px 8px;
}

.workspace-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.workspace-icon:hover:not(.workspace-icon-disabled) {
  background: var(--surface-hover);
}
.workspace-icon.active {
  background: var(--surface-hover);
}
.workspace-icon-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  color: var(--muted);
}
.workspace-icon-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.workspace-icon-label {
  display: none;
}
.workspace-rail.expanded .workspace-icon {
  width: 100%;
  justify-content: flex-start;
  padding: 0 10px;
  gap: 12px;
}
.workspace-rail.expanded .workspace-icon-label {
  display: inline;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-rail-divider {
  width: 28px;
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.workspace-rail.expanded .workspace-rail-divider {
  width: 100%;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(var(--workspace-rail-w) + var(--sidebar-w));
  min-width: calc(var(--workspace-rail-w) + var(--sidebar-w));
  padding: 0 18px;
  border-right: 1px solid var(--border);
  height: 100%;
  transition: width var(--transition), min-width var(--transition);
}

.top-bar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  flex-shrink: 0;
}

.top-bar-brand {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
}

.top-bar-my-dash-btn {
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.top-bar-my-dash-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.top-bar-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.top-bar-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.top-bar-user {
  position: relative;
  margin-left: 4px;
}
.top-bar-user .sidebar-user-avatar {
  cursor: pointer;
}
.top-bar-user .sidebar-user-menu {
  top: calc(100% + 8px);
  bottom: auto;
  right: 0;
  left: auto;
  min-width: 180px;
}

.sidebar-user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Partnership palette overrides for top bar */
#app[data-dash="partnership"] .top-bar {
  background: #1A1712;
  border-bottom-color: #36322A;
}
#app[data-dash="partnership"] .top-bar-left {
  border-right-color: #36322A;
}
[data-theme="light"] #app[data-dash="partnership"] .top-bar {
  background: #FFFFFF;
  border-bottom-color: #DCD2BC;
}
[data-theme="light"] #app[data-dash="partnership"] .top-bar-left {
  border-right-color: #DCD2BC;
}
[data-theme="light"] .top-bar {
  background: #ffffff;
  border-bottom-color: #e8e8e8;
}
[data-theme="light"] .top-bar-left {
  border-right-color: #e8e8e8;
}

/* ── Page load fade-in ──────────────────────────── */
.app {
  display: flex;
  height: calc(100vh / var(--app-zoom));
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.app.loaded { opacity: 1; }

/* ── Skeleton shimmer ───────────────────────────── */
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-row {
  height: 44px;
  border-radius: 6px;
  margin: 6px 12px;
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--border) 50%, var(--surface-hover) 75%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

.skeleton-stat {
  height: 64px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--border) 50%, var(--surface-hover) 75%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 52px);
  position: fixed;
  left: var(--workspace-rail-w); top: 52px;
  z-index: 10;
  transition: left var(--transition);
}

.sidebar-logo {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon,
.p-nav-item:hover .nav-icon,
.p-nav-item.active .nav-icon,
.snav-item:hover .nav-icon,
.snav-item.active .nav-icon { opacity: 1; }

.nav-item, .snav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-item:hover, .snav-item:hover {
  color: var(--text);
  background: var(--surface-hover);
  text-decoration: none;
}

.nav-item.active, .snav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

/* ── Edit | Updates toggle in form modal ── */
.fm-tab-toggle {
  display: flex; gap: 4px;
  background: var(--surface-hover);
  border-radius: 99px;
  padding: 3px;
}
.fm-tab {
  background: none; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 500;
  color: var(--muted); padding: 5px 14px; border-radius: 99px;
  transition: background 0.12s, color 0.12s;
}
.fm-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.fm-tab:not(.active):hover { color: var(--text); }

/* ── Deliverable updates feed ── */
.du-feed {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 14px 20px;
}
.du-empty {
  text-align: center; color: var(--muted); font-size: 13px; padding: 28px 0;
}
.du-item {
  display: flex; gap: 10px; margin-bottom: 16px;
}
.du-av-wrap { flex-shrink: 0; }
.du-av {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover; display: block;
}
.du-av-init {
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; font-family: 'Inter', sans-serif;
}
.du-body { flex: 1; min-width: 0; }
.du-meta {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px;
}
.du-author {
  font-family: 'Inter', sans-serif; font-size: 13px;
  font-weight: 600; color: var(--text);
}
.du-time {
  font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted);
}
.du-content {
  font-family: 'DM Sans', sans-serif; font-size: 13.5px;
  color: var(--text); line-height: 1.55; word-break: break-word;
}
.du-compose {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.du-compose-av { flex-shrink: 0; }
.du-compose-right { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.du-input {
  width: 100%; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 13px; padding: 9px 12px; resize: none; outline: none;
  box-sizing: border-box; transition: border-color 0.15s; line-height: 1.5;
}
.du-input:focus { border-color: var(--accent); }
.du-input::placeholder { color: var(--muted); }
.du-submit { align-self: flex-end; padding: 6px 16px; font-size: 12.5px; }
[data-theme="light"] .du-input { background: #f9f5ee; border-color: #e5dbd2; }

/* ── @Mention autocomplete ── */
.mention-dropdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
  overflow: hidden;
  padding: 6px 0;
}
.mention-label {
  padding: 6px 14px 4px;
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.mention-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; cursor: pointer;
  transition: background 0.1s;
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--text);
}
.mention-opt:hover,
.mention-opt.hovered { background: var(--surface-hover); }
.mention-opt strong { color: var(--accent); font-weight: 700; }
.mention-av {
  width: 30px; height: 30px; border-radius: 50%;
  flex-shrink: 0; object-fit: cover;
}
.mention-av-init {
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; font-family: 'Inter', sans-serif;
}

/* @mention chip in activity feed */
.activity-mention {
  color: #2563eb;
  font-weight: 600;
  background: rgba(37,99,235,0.1);
  padding: 1px 5px; border-radius: 4px;
}
#app[data-dash="partnership"] .activity-mention { color: var(--accent); background: var(--accent-dim); }

[data-theme="light"] .mention-dropdown { background: #fff; }
[data-theme="light"] .activity-mention { color: #1d4ed8; background: rgba(29,78,216,0.08); }

/* ── Notification bell ── */
.sidebar-bell-wrap {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}
.sidebar-bell-btn {
  position: relative;
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 6px 8px;
  border-radius: 6px; transition: background 0.12s, color 0.12s;
  display: flex; align-items: center; gap: 6px;
}
.sidebar-bell-btn:hover { background: var(--surface-hover); color: var(--text); }
.sidebar-bell-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; font-family: 'Inter', sans-serif;
  min-width: 16px; height: 16px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ── Notification panel ── */
.notif-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 350;
}
.notif-panel {
  position: fixed; top: 52px; right: 0; bottom: 0;
  width: 400px; max-width: 95vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.25);
  z-index: 360;
  display: flex; flex-direction: column;
  animation: notif-slide-in 0.2s ease-out;
}
@keyframes notif-slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-title {
  font-family: 'Inter', sans-serif; font-size: 17px; font-weight: 700;
  color: var(--text);
}
.notif-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 16px; padding: 4px 6px;
  border-radius: 5px;
}
.notif-close:hover { background: var(--surface-hover); }
.notif-tabs-row {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-tab {
  background: none; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 500;
  color: var(--muted); padding: 5px 12px; border-radius: 99px;
  transition: background 0.12s, color 0.12s;
}
.notif-tab:hover { background: var(--surface-hover); color: var(--text); }
.notif-tab.active { background: var(--accent); color: #fff; }
.notif-mark-read {
  padding: 6px 18px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-mark-read button {
  background: none; border: none; cursor: pointer;
  font-size: 11.5px; color: var(--accent); font-family: 'Inter', sans-serif;
}
.notif-mark-read button:hover { text-decoration: underline; }
.notif-body {
  flex: 1; overflow-y: auto; padding: 8px 0;
}
.notif-empty {
  padding: 40px 18px; text-align: center; color: var(--muted); font-size: 13px;
}
.notif-group-label {
  padding: 10px 18px 4px;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.notif-item {
  display: flex; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s;
  position: relative;
}
.notif-item:hover { background: var(--surface-hover); }
.notif-item.unread { background: var(--accent-dim); }
.notif-item.unread:hover { background: var(--surface-hover); }
.notif-item-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  flex-shrink: 0; overflow: hidden;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; font-family: 'Inter', sans-serif;
}
.notif-item-avatar img { width: 100%; height: 100%; object-fit: cover; }
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title {
  font-family: 'DM Sans', sans-serif; font-size: 13.5px;
  color: var(--text); font-weight: 500; line-height: 1.4;
}
.notif-item-body {
  font-size: 12.5px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-time {
  font-size: 11px; color: var(--muted); font-family: 'DM Mono', monospace;
  flex-shrink: 0; padding-top: 2px;
}
.notif-unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0; margin-top: 6px;
}
.notif-type-badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 99px; margin-right: 4px;
  font-family: 'Inter', sans-serif;
}
.notif-badge-studio  { background: rgba(124,111,205,0.15); color: var(--accent); }
.notif-badge-partners{ background: rgba(230,132,69,0.15);  color: #E68445; }
.notif-badge-mention { background: rgba(76,175,136,0.15);  color: var(--green); }

[data-theme="light"] .notif-panel { background: #fff; }
[data-theme="light"] .notif-item.unread { background: rgba(210,106,46,0.06); }

.sidebar-footer {
  padding: 12px 14px 12px 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
}

.sidebar-footer > span { flex: 1; }
.sidebar-footer > span span { color: var(--text); }

.theme-toggle {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface-hover);
}

/* Main wrapper */
.main-wrapper {
  margin-left: calc(var(--workspace-rail-w) + var(--sidebar-w));
  padding-top: 52px;
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
  height: calc(100vh / var(--app-zoom));
  overflow-y: auto;
  overflow-x: auto;
}

.main-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1700px;
  margin-left: auto;
  margin-right: auto;
}

/* Content header */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

/* Social header — two-row layout */
#social-header {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px 24px;
}
.social-header-row1 {
  display: flex;
  align-items: center;
  gap: 16px;
}
.social-header-row1 .search-wrap {
  flex: 1;
  max-width: 400px;
}
.social-header-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 28px;
}
/* Social calendar: sticky day/week headers sit below the taller two-row header */
#social-calendar-wrap .cal-day-hdr,
#social-calendar-wrap .cal-week-hdr,
#social-calendar-wrap .cal-month-hdr {
  top: 102px;
}

/* Partnership detail header: meta-left | brand-center | buttons-right */
#partnership-header.p-detail-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
#partnership-header.p-detail-header .header-left {
  display: contents; /* let children participate in parent grid */
}
#partnership-header.p-detail-header #p-view-title {
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  font-size: 33px; /* 22px × 1.5 */
  font-weight: 700;
  flex: none;
}
#partnership-header.p-detail-header #p-header-meta {
  grid-column: 1;
  grid-row: 1;
  justify-content: flex-start;
  margin-top: 0;
}
#partnership-header.p-detail-header .header-right {
  grid-column: 3;
  grid-row: 1;
  justify-content: flex-end;
  display: flex;
  gap: 8px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.view-title {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  min-width: 170px;
  flex-shrink: 0;
}

/* Partner detail header meta row */
.p-header-meta {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-top: 6px;
}
.phm-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.phm-label {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.phm-value {
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  color: var(--text);
  font-weight: 500;
}
.phm-link { color: var(--accent); text-decoration: none; }
.phm-link:hover { text-decoration: underline; }

.search-wrap { flex: 1; max-width: 320px; }

/* Channel filter pills */
.channel-filter-pills {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.channel-pill {
  padding: 5px 13px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.channel-pill:hover {
  border-color: var(--accent);
  color: var(--text);
}
.channel-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
[data-theme="light"] .channel-pill.active { color: #fff; }

.search-input {
  width: 100%;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 7px 12px;
  font-size: 13px;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
}

.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--accent); background: var(--surface); }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-refresh {
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 7px 14px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: opacity var(--transition), transform var(--transition);
}

.btn-refresh::before {
  content: '';
  display: inline-block;
  width: 15px;
  height: 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8'/%3E%3Cpath d='M21 3v5h-5'/%3E%3Cpath d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/%3E%3Cpath d='M8 16H3v5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  flex-shrink: 0;
}

.btn-refresh:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-refresh:active { transform: translateY(0); }
.btn-refresh:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: #e0201c;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: opacity var(--transition), transform var(--transition);
}

.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

/* ── Table ──────────────────────────────────────── */
.table-container {
  padding: 0 0 80px;
}

.videos-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  table-layout: fixed;
}

.videos-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
}

.videos-table th {
  padding: 10px 12px;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.videos-table th.sortable { cursor: pointer; }
.videos-table th.sortable:hover { color: var(--text); }
.sort-icon { font-size: 11px; color: var(--accent); }

/* column widths — percentage-based for even distribution (sums to 100%) */
.col-check    { width: 42px; }
.col-title    { width: 24%; min-width: 160px; }
.col-stage    { width: 10%; }
.col-channel  { width: 12%; }
.col-date     { width: 8%; }
.col-due      { width: 8%; }
.col-talent   { width: 8%; }
.col-editor   { width: 8%; }
.col-thumb    { width: 9%; }
.col-views    { width: 7%; text-align: right; }
.col-youtube  { width: 8%; text-align: center; }
.col-milanote { width: 6%; text-align: center; }
.col-frameio  { width: 6%; text-align: center; }
.col-script   { width: 6%; text-align: center; }
.col-shortlink{ width: 7%; text-align: center; }
.col-assets   { width: 7%; text-align: center; }
.col-notes    { width: 14%; max-width: 200px; }
.col-tags     { width: 10%; }
.col-custom   { width: 8%; }
.col-actions  { width: 44px; }

.col-channel, .col-date, .col-due { cursor: pointer; }
.col-channel:hover, .col-date:hover, .col-due:hover { background: var(--surface-hover); }

.videos-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
}

.stage-badge {
  cursor: pointer;
  transition: opacity var(--transition), filter var(--transition);
}
.stage-badge:hover { opacity: 0.82; filter: brightness(1.12); }

/* Archive month group headers */
.archive-group-header td {
  padding: 10px 12px 6px;
  background: var(--bg);
  border-bottom: 1px solid var(--accent-dim);
  border-top: 2px solid var(--border);
}

.archive-group-header:first-child td { border-top: none; }

.archive-group-label {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.archive-group-count {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-left: 10px;
}

.table-row {
  cursor: pointer;
  transition: background var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}

.table-row:hover { background: var(--surface-hover); }
.table-row.selected {
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

.table-row.archived-row .title-text { opacity: 0.55; }

.table-row .more-btn,
.p-table .more-btn {
  opacity: 0;
  transition: opacity var(--transition);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 13px;
  padding: 2px 6px;
  letter-spacing: 1px;
}

.table-row:hover .more-btn,
.p-table tr:hover .more-btn { opacity: 1; }
.table-row .more-btn:hover,
.p-table .more-btn:hover { color: var(--text); border-color: var(--accent); }

.text-muted { color: var(--muted); }
.mono { font-family: 'DM Mono', monospace; font-size: 12.5px; }
.right-align { text-align: right; }

/* Link pill badges (YouTube / Milanote columns) */
.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity var(--transition), transform var(--transition);
}
.link-pill:hover { opacity: 0.8; transform: translateY(-1px); text-decoration: none; }

.link-pill-yt {
  background: #e0201c;
  color: #ffffff;
  border: 1px solid #c01a17;
}
.link-pill-yt:hover { background: #c01a17; }

.link-pill-milanote {
  background: rgba(124, 111, 205, 0.18);
  color: #9d8fe8;
  border: 1px solid rgba(124, 111, 205, 0.3);
}
.link-pill-milanote:hover { background: rgba(124, 111, 205, 0.28); }

/* Inline stage select */
.inline-stage-select {
  appearance: none;
  background: var(--surface-hover);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 22px 3px 8px;
  width: 100%;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%237c6fcd' d='M5 7L1 2h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* Inline text/date input (release date, Milanote link) */
.inline-edit-input {
  background: var(--surface-hover);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  padding: 3px 8px;
  width: 100%;
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* Milanote edit/add button */
.milanote-edit-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  vertical-align: middle;
}
.milanote-edit-btn:hover { color: var(--text); background: var(--surface-hover); }
.milanote-edit-btn.add-link-btn {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  border: 1px dashed var(--border);
  padding: 2px 8px;
}
.milanote-edit-btn.add-link-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateZ(0);
}

/* Stage badges */
.stage-ondeck    { background: rgba(107,114,128,0.2); color: #9ca3af; }
.stage-scripting { background: rgba(217,119,6,0.2);   color: #fbbf24; }
.stage-filming   { background: rgba(59,130,246,0.2);  color: #60a5fa; }
.stage-editing   { background: rgba(124,111,205,0.2); color: #a78bfa; }
.stage-review    { background: rgba(232,149,109,0.2); color: #e8956d; }
.stage-scheduled { background: rgba(76,175,136,0.2);  color: #4caf88; }
.stage-live      { background: rgba(34,197,94,0.2);   color: #4ade80; }

/* Channel badges — dynamic color via --ch-color CSS custom property */
.channel-dynamic {
  background: color-mix(in srgb, var(--ch-color, #6b7280) 18%, transparent);
  color: var(--ch-color, #6b7280);
  border: 1px solid color-mix(in srgb, var(--ch-color, #6b7280) 35%, transparent);
}
/* Channel filter pills — active state uses --ch-color when set */
.channel-pill[style*="--ch-color"].active {
  background: var(--ch-color);
  color: #fff;
  border-color: var(--ch-color);
}
.channel-custom { background: rgba(107,114,128,0.18); color: #9ca3af; }

/* Checkbox */
.checkbox {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--accent);
  border-radius: 3px;
}

/* Row checkboxes — hidden until the row is hovered, selected, or checked */
.table-row .row-check {
  opacity: 0;
  transition: opacity var(--transition);
}
.table-row:hover .row-check,
.table-row.selected .row-check,
.table-row .row-check:checked {
  opacity: 1;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 10px;
}

.empty-icon { font-size: 40px; }
.empty-text {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  color: var(--text);
}
.empty-sub { color: var(--muted); font-size: 13px; }

/* ── Resources view ─────────────────────────────── */
.resources-wrap {
  padding: 16px 0 80px;
}

.resources-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 16px;
}

.resource-group {
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.resource-group.dragging { opacity: 0.4; }

.resource-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.resource-group-drag {
  color: var(--muted);
  font-size: 14px;
  cursor: grab;
  line-height: 1;
}
.resource-group-drag:active { cursor: grabbing; }

.resource-group-toggle { color: var(--muted); font-size: 11px; width: 12px; }
.resource-group-label {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}
.resource-group-count {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}

.resource-add-btn {
  margin-left: auto;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.resource-add-btn:hover { color: var(--accent); border-color: var(--accent); }

.resource-cat-menu-wrap { position: relative; }
.resource-cat-menu-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  padding: 3px 6px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.resource-cat-menu-btn:hover { color: var(--accent); border-color: var(--accent); }

.resource-cat-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  overflow: hidden;
}
.resource-cat-menu.open { display: block; }

.resource-cat-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background var(--transition);
}
.resource-cat-menu-item:hover { background: var(--surface-hover); }
.resource-cat-menu-item.danger { color: #e05252; }
.resource-cat-menu-item.danger:hover { background: rgba(224,82,82,0.1); }

.resource-group-empty {
  padding: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--muted);
}

.resource-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.resource-row:hover { background: var(--surface-hover); }
.resource-row:last-child { border-bottom: none; }
.resource-row.dragging { opacity: 0.4; }
.resource-row.drag-over { border-top: 2px solid var(--accent); }

.resource-row-drag {
  color: var(--muted);
  font-size: 14px;
  cursor: grab;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition);
}
.resource-row:hover .resource-row-drag { opacity: 1; }
.resource-row-drag:active { cursor: grabbing; }

.resource-title-link {
  flex: 1;
  min-width: 0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resource-title-link:hover { text-decoration: underline; }
.resource-title-plain { color: var(--text); cursor: default; }

.resource-date {
  flex-shrink: 0;
  font-family: 'DM Mono', monospace;
  font-size: 11.5px;
  color: var(--muted);
}

.resource-edit-btn, .resource-delete-btn {
  opacity: 0;
  transition: opacity var(--transition);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 13px;
  padding: 3px 7px;
  cursor: pointer;
}
.resource-row:hover .resource-edit-btn,
.resource-row:hover .resource-delete-btn { opacity: 1; }
.resource-edit-btn:hover { color: var(--text); border-color: var(--accent); }
.resource-delete-btn:hover { color: #e05252; border-color: #e05252; }

/* Inline add/edit form */
.resource-row-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-hover);
}
.resource-row-edit:last-child { border-bottom: none; }
.resource-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 6px 10px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
}
.resource-input-title { flex: 1 1 200px; }
.resource-input-link  { flex: 1 1 260px; }

.resource-row-actions { display: flex; gap: 8px; margin-left: auto; }
.resource-save-btn, .resource-cancel-btn {
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
}
.resource-save-btn { background: var(--accent); color: #fff; border-color: var(--accent); }
.resource-save-btn:hover { opacity: 0.88; }
.resource-cancel-btn { background: var(--surface); color: var(--muted); }
.resource-cancel-btn:hover { color: var(--text); border-color: var(--accent); }

/* ── Edit Panel ─────────────────────────────────── */
.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.panel-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

.edit-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.97);
  width: 580px;
  max-height: 88vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.edit-panel.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: all;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}

.panel-title {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  /* use full width minus space for the close button on each side */
  width: calc(100% - 80px);
}

.panel-title-input {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}
.panel-title-input:focus { border: none !important; outline: none !important; box-shadow: none !important; }
.panel-title-input::placeholder { color: var(--muted); font-weight: 400; opacity: 0.6; }
[data-theme="light"] .panel-title-input { color: #111; }

.panel-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  color: var(--muted);
  font-size: 16px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}
.panel-close:hover { color: var(--text); background: var(--surface-hover); }

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Fields */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-group.half { flex: 1; min-width: 0; }
.field-group.third { flex: 1; min-width: 0; }

.field-row {
  display: flex;
  gap: 12px;
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
}

.field-input,
.field-select,
.field-textarea {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 10px;
  font-size: 13.5px;
  width: 100%;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--accent);
  background: var(--bg);
}

.field-input::placeholder,
.field-textarea::placeholder { color: var(--muted); }

.field-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.field-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
}

/* Stage / Channel selects styled as colored badges, matching list view */
.field-select-badge {
  border-radius: 99px;
  font-weight: 600;
  border: 1px solid transparent;
  background-image: none;
}
.field-select-badge.stage-ondeck    { background-color: rgba(107,114,128,0.2); color: #9ca3af; }
.field-select-badge.stage-scripting { background-color: rgba(217,119,6,0.2);   color: #fbbf24; }
.field-select-badge.stage-filming   { background-color: rgba(59,130,246,0.2);  color: #60a5fa; }
.field-select-badge.stage-editing   { background-color: rgba(124,111,205,0.2); color: #a78bfa; }
.field-select-badge.stage-review    { background-color: rgba(232,149,109,0.2); color: #e8956d; }
.field-select-badge.stage-scheduled { background-color: rgba(76,175,136,0.2);  color: #4caf88; }
.field-select-badge.stage-live      { background-color: rgba(34,197,94,0.2);   color: #4ade80; }

.field-select-badge.channel-dynamic {
  background-color: color-mix(in srgb, var(--ch-color, #6b7280) 18%, transparent);
  color: var(--ch-color, #6b7280);
  border-color: color-mix(in srgb, var(--ch-color, #6b7280) 35%, transparent);
}

/* Tags field */
.tags-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tags-copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.tags-copy-btn:hover { background: var(--surface-hover); color: var(--text); }
.tags-copy-btn.copied { color: var(--accent); }
.tags-input-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  min-height: 38px;
  cursor: text;
  transition: border-color var(--transition), background var(--transition);
}
.tags-input-box:focus-within {
  border-color: var(--accent);
  background: var(--bg);
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-dim, rgba(124,111,205,0.15));
  color: var(--accent);
  padding: 3px 6px 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.tag-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.tags-text-input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  padding: 3px 0;
}
.tags-text-input::placeholder { color: var(--muted); }

/* URL field */
.url-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.url-field .field-input { flex: 1; }

.ext-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 14px;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
  text-decoration: none;
}

.ext-link:hover { background: var(--accent-dim); border-color: var(--accent); text-decoration: none; }
.ext-link.disabled { color: var(--muted); pointer-events: none; }

/* Views stat card */
.views-card {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 2px;
  font-size: 13px;
}

.views-icon { display: none; }

.views-card.no-link .views-label { color: var(--muted); font-style: italic; font-size: 13px; }
.views-card.failed .views-count  { color: var(--muted); font-size: 18px; }
.views-card.failed .views-meta   { color: var(--danger); font-size: 11px; }

.views-count {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.views-meta {
  font-size: 11px;
  color: var(--muted);
}

.views-card.loading .views-label { color: var(--muted); font-style: italic; font-size: 13px; }

/* Panel footer */
.panel-footer {
  padding: 14px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.btn-save {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: opacity var(--transition), background var(--transition);
}
.btn-save:hover { opacity: 0.88; }

.btn-archive {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  transition: color var(--transition), border-color var(--transition);
}
.btn-archive:hover { color: var(--text); border-color: var(--muted); }

.btn-restore {
  background: rgba(76,175,136,0.15);
  border: 1px solid rgba(76,175,136,0.4);
  color: var(--green);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  transition: background var(--transition), border-color var(--transition);
}
.btn-restore:hover { background: rgba(76,175,136,0.22); }

.btn-delete {
  background: var(--danger-dim);
  border: 1px solid rgba(224,82,82,0.3);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  transition: background var(--transition), border-color var(--transition);
}
.btn-delete:hover { background: rgba(224,82,82,0.22); border-color: var(--danger); }

/* ── Context Menu ───────────────────────────────── */
.context-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  min-width: 148px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: menuFadeIn 0.12s ease;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Dashboard Switcher ─────────────────────────── */
.sidebar-logo-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand-name {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.dash-toggle {
  display: flex;
  gap: 3px;
  padding: 6px 8px;
  background: var(--surface-hover);
  border-radius: var(--radius);
  margin: 10px 8px 4px;
}

.dash-toggle-btn {
  flex: 1;
  padding: 6px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.dash-toggle-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.dash-toggle-btn:not(.active):hover { color: var(--text); }

/* ── Partnership nav items ──────────────────────── */
.p-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
}

.p-nav-item:hover { color: var(--text); background: var(--surface-hover); text-decoration: none; }
.p-nav-item.active { color: var(--accent); background: var(--accent-dim); border-left-color: var(--accent); }

/* ── Partnership wrap ───────────────────────────── */
.partnership-wrap {
  padding: 0 0 60px;
}

/* ── Social Dashboard table ─────────────────────── */
.social-table { min-width: 1200px; }
.scol-title     { width: 22%; min-width: 160px; }
.scol-editor    { width: 10%; }
.scol-talent    { width: 10%; }
.scol-stage     { width: 9%; }
.scol-type      { width: 8%; }
.scol-channel   { width: 10%; }
.scol-frameio   { width: 7%; text-align: center; }
.scol-date      { width: 8%; cursor: pointer; }
.scol-date:hover { background: var(--surface-hover); }
.scol-due       { width: 8%; cursor: pointer; }
.scol-due:hover  { background: var(--surface-hover); }
/* All inline-editable social cells get pointer + hover highlight */
.scol-stage, .scol-type, .scol-platforms, .scol-collab,
.scol-talent, .scol-editor, .scol-frameio, .scol-final { cursor: pointer; }
.scol-stage:hover, .scol-type:hover, .scol-platforms:hover, .scol-collab:hover,
.scol-talent:hover, .scol-editor:hover, .scol-frameio:hover, .scol-final:hover { background: var(--surface-hover); }
.scol-final     { width: 7%; text-align: center; }
.scol-platforms { width: 12%; }
.scol-collab    { width: 10%; }
.scol-notes     { width: 15%; max-width: 200px; }
.scol-actions   { width: 44px; }

.post-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface-hover);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  letter-spacing: .02em;
}
/* Post type per-color badges */
.post-type-badge.pt-reel     { background: rgba(168,85,247,.15); color: #a855f7; border-color: rgba(168,85,247,.28); }
.post-type-badge.pt-comtab   { background: rgba(59,130,246,.15); color: #3b82f6; border-color: rgba(59,130,246,.28); }
.post-type-badge.pt-story    { background: rgba(249,115,22,.15); color: #f97316; border-color: rgba(249,115,22,.28); }
.post-type-badge.pt-carousel { background: rgba(20,184,166,.15); color: #14b8a6; border-color: rgba(20,184,166,.28); }

/* Post type select color in the panel */
.field-select-posttype.pt-reel     { color: #a855f7; border-color: rgba(168,85,247,.45); }
.field-select-posttype.pt-comtab   { color: #3b82f6; border-color: rgba(59,130,246,.45); }
.field-select-posttype.pt-story    { color: #f97316; border-color: rgba(249,115,22,.45); }
.field-select-posttype.pt-carousel { color: #14b8a6; border-color: rgba(20,184,166,.45); }

/* Type filter pills — each type gets its own color when active */
.type-pill.active { color: #fff !important; }

.filter-pill-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  align-self: center;
  margin-right: 2px;
}

.platform-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  margin: 1px 3px 1px 0;
  white-space: nowrap;
}

.social-acct-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px 2px 4px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ch-color, #888) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--ch-color, #888) 35%, transparent);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin: 1px 3px 1px 0;
  white-space: nowrap;
  cursor: default;
  vertical-align: middle;
}
.social-acct-chip .chip-remove-btn {
  position: static;
  opacity: 1;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: none;
}
.social-acct-chip .chip-remove-btn:hover { color: var(--text); }

/* ── Overview stat cards ────────────────────────── */
/* ── Year selector ──────────────────────────────────── */
.p-year-selector {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  position: relative;
  padding: 3px 8px 3px 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  user-select: none;
}
.p-year-selector:hover { background: var(--surface-hover); }

.p-year-label {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.p-year-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  min-width: 100px;
  padding: 4px;
  z-index: 50;
  animation: menuFadeIn 0.12s ease;
}
.p-year-dropdown.open { display: block; }

.p-year-option {
  padding: 8px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.p-year-option:hover { background: var(--surface-hover); }
.p-year-option.active { color: var(--accent); font-weight: 600; }

/* ── Analytics ───────────────────────────────────────── */
.analytics-toggle {
  display: flex;
  background: var(--surface-hover);
  border-radius: 99px;
  padding: 3px;
  gap: 2px;
}

.analytics-toggle-btn {
  padding: 5px 14px;
  border-radius: 99px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.analytics-toggle-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Year view */
.analytics-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.analytics-year-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.analytics-year-card:hover { background: var(--surface-hover); }
.analytics-year-active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.analytics-year-num {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.analytics-year-value {
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}
.analytics-year-bar-wrap {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}
.analytics-year-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.6s ease;
}
.analytics-year-meta {
  font-size: 11.5px;
  color: var(--muted);
}

/* Month view */
.analytics-month-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  align-items: end;
}

.analytics-month-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background var(--transition);
  cursor: default;
}
.analytics-month-card:hover { background: var(--surface-hover); }
.analytics-month-now {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.analytics-month-bar-wrap {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.analytics-month-bar {
  width: 70%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: height 0.5s ease;
}
.analytics-month-now .analytics-month-bar { background: var(--green); }

.analytics-month-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
}
.analytics-month-value {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  color: var(--text);
}
.analytics-month-count {
  font-size: 10px;
  color: var(--muted);
}

.analytics-unscheduled {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
  padding: 8px 12px;
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

[data-theme="light"] .analytics-year-card { background: #ffffff; border-color: #e8e8e8; }
[data-theme="light"] .analytics-year-active { border-color: var(--accent); background: var(--accent-dim); }
[data-theme="light"] .p-year-dropdown { background: #ffffff; border-color: #e8e8e8; box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

/* ── Partnership calendar pills ─────────────────────── */
.pcal-pill {
  border-radius: 5px;
  padding: 4px 7px;
  margin-bottom: 3px;
  cursor: pointer;
  font-size: 11px;
  transition: opacity var(--transition), transform var(--transition);
}
.pcal-pill:hover { opacity: 0.82; transform: translateY(-1px); }

.pcal-pay-unpaid   { background: rgba(224,82,82,0.2);   border-left: 3px solid #e05252; }
.pcal-pay-invoiced { background: rgba(251,191,36,0.2);  border-left: 3px solid #fbbf24; }
.pcal-pay-paid     { background: rgba(76,175,136,0.2);  border-left: 3px solid #4caf88; }

.pcal-pill-brand {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pcal-pill-desc {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pcal-pill-video {
  font-size: 10px;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* ── Overview year label ─────────────────────────────── */
.p-overview-year-label {
  padding: 20px 24px 4px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0;
  text-transform: none;
}

.p-overview-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 24px;
}

.p-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.p-stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.p-stat-value {
  font-family: 'DM Mono', monospace;
  font-size: 26px;
  font-weight: 500;
  color: var(--text);
}

.p-stat-card.paid .p-stat-value   { color: var(--green); }
.p-stat-card.pending .p-stat-value { color: #fbbf24; }

/* ── Partnership table ──────────────────────────── */
.p-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px 12px;
}

.p-section-title {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.p-list-card {
  margin: 8px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.p-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.p-table thead {
  background: var(--surface);
}

.p-table th {
  padding: 10px 16px;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}

.p-table th:hover { color: var(--text); }

.p-table th:last-child,
.p-table td:last-child {
  padding-left: 4px;
  padding-right: 8px;
}

.p-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-table tr {
  cursor: pointer;
  transition: background var(--transition);
}

.p-table tr:hover { background: var(--surface-hover); }

/* Partnership status badges */
.p-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 99px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
}

.p-badge-discussion { background: rgba(251,191,36,0.18); color: #fbbf24; }
.p-badge-active     { background: rgba(76,175,136,0.2);  color: #4caf88; }
.p-badge-completed  { background: rgba(96,165,250,0.2);  color: #60a5fa; }
.p-badge-archived   { background: rgba(107,114,128,0.2); color: #9ca3af; }

/* Payment status badges */
.pay-unpaid   { background: rgba(224,82,82,0.15);    color: #e05252; }
.pay-invoiced { background: rgba(251,191,36,0.18);   color: #fbbf24; }
.pay-paid     { background: rgba(76,175,136,0.18);   color: #4caf88; }

/* Lead status badges */
.lead-cold        { background: rgba(107,114,128,0.2); color: #9ca3af; }
.lead-warm        { background: rgba(251,191,36,0.18); color: #fbbf24; }
.lead-negotiating { background: rgba(124,111,205,0.2); color: #a78bfa; }
.lead-passed      { background: rgba(224,82,82,0.15);  color: #e05252; }
.lead-converted   { background: rgba(76,175,136,0.2);  color: #4caf88; }

/* ── Partnership detail view ────────────────────── */
.p-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.p-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.p-back-btn:hover { color: var(--text); border-color: var(--muted); }

.p-detail-brand {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.p-detail-meta {
  font-size: 12px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  margin-left: auto;
}

.p-detail-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.p-detail-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.p-detail-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.p-contact-notes-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch; /* both panels same height */
}
.p-contact-notes-row .p-notes-field {
  display: flex;
  flex-direction: column;
}

/* Notes preview (replaces textarea — click to open popup) */
.p-notes-field-clickable { cursor: pointer; }
.p-notes-field-clickable:hover { background: var(--surface-hover); }
.p-notes-preview {
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  padding: 0;
  height: 80px;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  /* Fade at the bottom to hint there's more */
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

/* Notes popup modal */
.notes-popup-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 400;
}
.notes-popup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 92vw; max-width: 1200px;
  height: 88vh; max-height: 900px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.notes-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notes-popup-title {
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 700; color: var(--text);
}
.notes-popup-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 16px; padding: 4px 6px;
  border-radius: 5px; transition: background 0.12s;
}
.notes-popup-close:hover { background: var(--surface-hover); }
.notes-popup-textarea {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 14px; line-height: 1.7;
  padding: 18px 20px; resize: none;
  box-sizing: border-box;
}
.notes-popup-textarea::placeholder { color: var(--muted); opacity: 0.5; }
[data-theme="light"] .notes-popup { background: #fff; }

.p-contact-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

/* Unified contact table */
.p-contact-table-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr 1fr 1fr 1fr 60px;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.p-contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr 1fr 1fr 1fr 60px;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background 0.12s;
}
.p-contact-row:last-of-type { border-bottom: none; }
.p-contact-row:hover { background: var(--surface-hover); }
.p-contact-row:hover .p-sub-contact-actions { opacity: 1; }
.p-primary-contact { font-weight: 500; }
.p-cr-cell { font-size: 13.5px; font-family: 'DM Sans', sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-cr-empty { color: var(--muted); opacity: 0.5; }
.p-contact-field { display: flex; flex-direction: column; gap: 2px; }

.p-sub-contact-actions {
  display: flex;
  gap: 4px;
  opacity: 0.35;
  transition: opacity var(--transition);
  justify-content: flex-end;
}
.p-contact-row:hover .p-sub-contact-actions { opacity: 1; }

.p-sub-edit-btn, .p-sub-del-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  transition: opacity var(--transition);
}
.p-sub-edit-btn { color: var(--accent); opacity: 0.6; }
.p-sub-del-btn  { color: var(--danger); opacity: 0.6; }
.p-sub-edit-btn:hover, .p-sub-del-btn:hover { opacity: 1; }

/* ── Quick Look ──────────────────────────────────── */
.p-ql-label {
  padding: 4px 24px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
}

.p-ql-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 24px 20px;
}

.p-ql-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}

.p-ql-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

.ql-today    { color: #e05252; }
.ql-tomorrow { color: #fbbf24; }
.ql-radar    { color: var(--muted); }

.ql-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}
.ql-item:hover .ql-title { text-decoration: underline; }

.ql-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.ql-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.ql-sub {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 1px;
}

.ql-empty {
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}

/* Invoice date reminders */
.invoice-overdue { color: var(--danger) !important; }
.invoice-soon    { color: #fbbf24 !important; }

.invoice-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  padding: 1px 5px;
  border-radius: 99px;
  margin-left: 5px;
  vertical-align: middle;
}
.invoice-badge.overdue { background: rgba(224,82,82,0.15); color: var(--danger); }
.invoice-badge.soon    { background: rgba(251,191,36,0.15); color: #fbbf24; }

.p-reminders {
  margin: 0 24px 16px;
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.p-reminders-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 8px;
}

.p-reminder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text);
  padding: 4px 0;
  border-bottom: 1px solid rgba(251,191,36,0.12);
  cursor: pointer;
}
.p-reminder-item:last-child { border-bottom: none; }
.p-reminder-item:hover { opacity: 0.8; }
.p-reminder-brand { font-weight: 600; }
.p-reminder-desc  { color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-reminder-date  { font-family: 'DM Mono', monospace; font-size: 11.5px; flex-shrink: 0; }
.p-reminder-dot   { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.p-whatsapp-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #25D366 !important;
  text-decoration: none;
  font-size: 13px;
}
.p-whatsapp-link:hover { opacity: 0.8; text-decoration: none; }

.p-add-contact-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 11px 18px;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface-hover);
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  margin-top: 0;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.p-add-contact-btn:hover { background: var(--border); color: var(--text); }
[data-theme="light"] .p-add-contact-btn { background: #f5f0e8; }
[data-theme="light"] .p-add-contact-btn:hover { background: #ede6d8; }

.p-add-contact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.p-contact-label { font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); font-family: 'Inter', sans-serif; font-weight: 700; }
.p-contact-value { font-size: 13.5px; color: var(--text); }

/* ── Deliverables section ───────────────────────── */
.p-deliverables {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.p-deliverables-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.p-section-header-expandable { cursor: pointer; user-select: none; }

/* Expanded section — 70% width, 80% height */
#section-expand-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 280;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.p-section-expanded {
  position: fixed;
  left: 15vw; right: 15vw;
  top: 10vh; bottom: 10vh;
  z-index: 290;
  border-radius: var(--radius);
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
}
[data-theme="light"] .p-section-expanded { background: #fff; }

.p-deliverables-title {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.p-add-deliverable-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition);
}
.p-add-deliverable-btn:hover { opacity: 0.88; }

/* + Add row at bottom of deliverable/invoice panels */
.p-panel-add-row-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 11px 18px;
  border: none;
  border-top: 1px solid var(--border);
  background: var(--surface-hover);
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.p-panel-add-row-btn:hover { background: var(--border); color: var(--text); }
[data-theme="light"] .p-panel-add-row-btn { background: #f5f0e8; }
[data-theme="light"] .p-panel-add-row-btn:hover { background: #ede6d8; }

.p-deliverable-col-headers {
  display: grid;
  grid-template-columns: 28px 1fr 120px 110px 120px 100px 110px 110px auto;
  gap: 12px;
  padding: 6px 18px;
  border-bottom: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.p-deliverable-row {
  display: grid;
  grid-template-columns: 28px 1fr 120px 110px 120px 100px 110px 110px auto;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background var(--transition);
  cursor: pointer;
}
.p-deliverable-row:last-child { border-bottom: none; }
.p-deliverable-row:hover { background: var(--surface-hover); }

.p-deliverable-num {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.p-deliverable-vid-status { display: flex; align-items: center; }

.panel-person-picker {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s;
}
.panel-person-picker:hover { border-color: var(--accent); }
.panel-person-placeholder {
  font-size: 13px;
  color: var(--muted);
  opacity: 0.6;
}

.studio-person-cell {
  cursor: pointer;
}
.studio-person-cell:hover .studio-assign-btn { opacity: 1 !important; }
.studio-assign-btn { opacity: 0.45; transition: opacity 0.15s; font-size: 11px; }

.p-talent-cell {
  display: flex;
  align-items: center;
  cursor: pointer;
}
/* Stacked avatar group — replaces name chips for multi-person assignments */
.p-talent-stack {
  display: inline-flex;
  align-items: center;
}
.p-talent-stack-item {
  position: relative;
  display: block;
  border-radius: 50%;
  transition: z-index 0s;
  transform: translateZ(0);
}
.p-talent-stack-item:not(:first-child) { margin-left: -8px; }
.p-talent-stack-item:hover { z-index: 50 !important; }
.p-talent-stack-item img,
.p-talent-stack-item > div {
  box-shadow: 0 0 0 2px var(--bg);
  transform: translateZ(0);
}
.chip-remove-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity var(--transition);
}
.p-talent-stack-item:hover .chip-remove-btn { opacity: 1; }
.p-talent-assign {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.6;
  transition: opacity 0.15s;
}
.p-talent-cell:hover .p-talent-assign { opacity: 0.8; }

.p-talent-popup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  min-width: 200px;
  padding: 4px;
  overflow: hidden;
}
.p-talent-search {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 7px 10px;
  margin-bottom: 4px;
  outline: none;
  box-sizing: border-box;
}
.p-talent-search:focus { border-color: var(--accent); }
.p-talent-options {
  max-height: 220px;
  overflow-y: auto;
}
.p-talent-empty {
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
}

.p-video-picker-popup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  width: 320px;
  overflow: hidden;
}
.p-video-picker-search-wrap {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
}
.p-video-picker-search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  box-sizing: border-box;
}
.p-video-picker-search:focus { border-color: var(--accent); }
.p-video-picker-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
}
.p-video-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}
.p-video-picker-item:hover { background: var(--surface-hover); }
.p-video-picker-title {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.p-talent-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.1s;
}
.p-talent-option:hover { background: var(--surface-hover); }
.p-talent-option-active {
  color: var(--accent);
  font-weight: 600;
}

.p-deliverable-desc { font-size: 13.5px; color: var(--text); font-weight: 500; line-height: 1.4; }

.p-linked-video {
  font-size: 11.5px;
  color: var(--accent);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  margin-top: 2px;
}

.p-linked-video-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.p-linked-video-clickable {
  cursor: pointer;
  transition: opacity var(--transition);
}
.p-linked-video-clickable:hover { opacity: 0.7; }

.p-unlink-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  padding: 0 2px;
  transition: opacity var(--transition);
  line-height: 1;
}
.p-deliverable-row:hover .p-unlink-btn { opacity: 0.6; }
.p-unlink-btn:hover { opacity: 1 !important; }

.p-link-video-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  margin-top: 2px;
  padding: 0;
  transition: color var(--transition);
  opacity: 0;
}
.p-deliverable-row:hover .p-link-video-btn { opacity: 1; }
.p-link-video-btn:hover { color: var(--accent); }

/* Brand deal card inside video edit panel */
.brand-deal-card {
  background: rgba(76,175,136,0.08);
  border: 1px solid rgba(76,175,136,0.3);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-deal-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.brand-deal-card-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.brand-deal-card-brand {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.brand-deal-card-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.brand-deal-card-status {
  margin-left: auto;
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: 99px;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
}

.brand-deal-card-link {
  background: none;
  border: none;
  color: var(--green);
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: opacity var(--transition);
}
.brand-deal-card-link:hover { opacity: 0.7; }

.brand-deal-tag {
  display: inline-block;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: var(--green);
  margin-top: 2px;
  cursor: pointer;
  transition: opacity var(--transition);
}
.brand-deal-tag:hover { opacity: 0.7; }
.p-deliverable-date { font-size: 12px; color: var(--muted); font-family: 'DM Mono', monospace; }
.p-deliverable-amount { font-size: 13px; font-family: 'DM Mono', monospace; color: var(--text); }

.p-pay-select {
  font-size: 11.5px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  border: none;
  border-radius: 99px;
  padding: 3px 10px;
  cursor: pointer;
  appearance: none;
  text-align: center;
  width: 100%;
}

/* Inline edit inputs — minimal, matches read mode feel */
.p-inline-edit-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--border);
  outline: none;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  padding: 2px 0;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.p-inline-edit-input:focus { border-bottom-color: var(--accent); }
.p-inline-edit-input::placeholder { color: var(--muted); font-weight: 400; }

/* Deliverable type / month select */
.p-del-type-select {
  font-size: 11px;
  font-family: 'DM Sans', sans-serif;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 3px 0;
  cursor: pointer;
  width: 100%;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
}

/* Deliverable stage select */
.p-del-stage-select {
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  border: none;
  background: transparent;
  padding: 4px 0;
  cursor: pointer;
  width: 100%;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
}
/* Deliverable stage colors — used on table selects (text color) and brand pill (background) */
.del-stage-neutral { color: var(--muted); }

/* Yellow — action needed from us */
.del-stage-action {
  color: #b45309;
  background: rgba(251,191,36,0.18);
  border-color: rgba(251,191,36,0.35);
}
/* Green — sent, approved, complete */
.del-stage-good {
  color: #166534;
  background: rgba(76,175,136,0.18);
  border-color: rgba(76,175,136,0.35);
}
/* Light mode adjustments */
[data-theme="light"] .del-stage-action { color: #92400e; }
[data-theme="light"] .del-stage-good   { color: #14532d; }

/* Keep old names as aliases for backward compat */
.del-stage-needs-edits { color: #e05252; }
.del-stage-approved    { color: #4caf88; }

.p-del-actions { display: flex; justify-content: flex-end; }
.p-del-delete-btn {
  color: var(--danger);
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--transition);
}
.p-del-delete-btn:hover { opacity: 1; }


/* Two-column detail layout */
.p-detail-columns {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  align-items: start;
}
.p-detail-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Split layout — deliverables left, invoices right (full width) */
.p-del-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* Left panel grid: # | Description | Deliverable | Month | Talent | Video | Stage | Video Status | Scheduled Date */
.p-del-left-grid {
  display: grid;
  grid-template-columns: 28px 1fr 9% 8% 9% 13% 12% 9% 7% 7% 28px;
  gap: 8px;
  align-items: center;
  justify-items: center;
}
/* Keep description left-aligned */
.p-del-left-grid .p-deliverable-desc,
.p-del-left-grid .p-deliverable-num { justify-self: start; }
.p-del-video-cell { width: 100%; text-align: center; }

/* Right panel grid: Invoice Date | Value | Payment | Delete */
.p-inv-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 110px 14% 20% 1fr 36px;
  gap: 8px;
  align-items: center;
  justify-items: center;
}

/* Invoice status badges */
.inv-status-ontrack  { background: rgba(76,175,136,0.15);  color: var(--green); }
.inv-status-sent     { background: rgba(251,191,36,0.15);   color: #d4a017; }
.inv-status-overdue  { background: rgba(224,82,82,0.15);    color: var(--danger); font-weight:700; }
.inv-status-paid     { background: rgba(76,175,136,0.15);   color: var(--green); }
[data-theme="light"] .inv-status-sent { color: #b8860b; }
.p-inv-grid .p-inv-desc { justify-self: start; font-size: 13px; font-family: 'DM Sans', sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sortable column headers */
.p-sort-header {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.12s;
}
.p-sort-header:hover { color: var(--text); }
.p-sort-icon { font-size: 10px; margin-left: 3px; opacity: 0.35; }
.p-sort-active { opacity: 1; color: var(--accent); }

/* ··· row action button */
.p-row-menu-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 16px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  opacity: 0.3; transition: opacity 0.15s, background 0.15s;
  letter-spacing: 1px;
}
.p-del-left-row:hover .p-row-menu-btn,
.p-inv-row:hover .p-row-menu-btn { opacity: 1; }
.p-row-menu-btn:hover { background: var(--surface-hover); opacity: 1; }

/* Row action popup menu */
.p-row-action-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  overflow: hidden;
  min-width: 140px;
}
.p-row-action-item {
  padding: 10px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
}
.p-row-action-item:hover { background: var(--surface-hover); }
.p-row-action-danger { color: var(--danger); }
.p-row-action-danger:hover { background: var(--danger-dim); }
[data-theme="light"] .p-row-action-menu { background: #fff; }

.p-del-col-headers {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.p-del-left-row {
  padding: 0 16px;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
  align-items: center;
}
.p-del-left-row:last-child { border-bottom: none; }
.p-del-left-row:hover { background: var(--surface-hover); }
.p-del-left-row:hover .p-link-video-btn { opacity: 1; }
.p-del-left-row:hover .p-unlink-btn { opacity: 0.6; }

.p-inv-row {
  padding: 0 16px;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
  align-items: center;
}
.p-inv-row:last-child { border-bottom: none; }
.p-inv-row:hover { background: var(--surface-hover); }

/* Add form contained inside its own panel */
.p-panel-add-form {
  padding: 12px 18px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-hover);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.p-panel-add-form .p-add-input { width: 100%; box-sizing: border-box; }

/* Legacy full-width form (kept for reference) */
.p-add-form-full {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-hover);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.p-add-form-full .p-add-input { flex: 1; min-width: 120px; }
.p-add-form-full .p-add-submit { flex-shrink: 0; }

/* Add deliverable form (legacy — kept for reference) */
.p-add-form {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 28px 1fr 120px 110px 120px 100px 110px 110px auto;
  gap: 10px;
  align-items: center;
  background: var(--surface-hover);
}

.p-add-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 10px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  width: 100%;
  transition: border-color var(--transition);
}
.p-add-input:focus { border-color: var(--accent); }

.p-add-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition);
}
.p-add-submit:hover { opacity: 0.88; }

/* Overview deal list */
.p-overview-deals {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Brand name links in overview panels */
.ov-brand-link:hover,
.ov-inv-brand-link:hover { text-decoration: underline; }

/* Invoice Overview — month group header */
.ov-inv-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 9px;
  border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--border);
  background: var(--surface-hover);
}
.p-inv-month-group:first-child .ov-inv-month-head {
  border-top: none;
}
.ov-inv-month-label {
  font-size: 12px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ov-inv-month-totals {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* Column headers */
.ov-inv-col-head {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 95px 1fr 110px 1fr;
  gap: 8px;
  padding: 5px 16px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
/* Invoice rows in overview */
.p-inv-ov-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 95px 1fr 110px 1fr;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  cursor: pointer;
  transition: background var(--transition);
}
.p-inv-ov-row:hover { background: var(--surface-hover); }
/* Totals footer row */
.ov-inv-totals-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 2px solid var(--border);
  background: var(--surface-hover);
  gap: 10px;
}
.ov-inv-totals-label {
  font-size: 13px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: var(--text);
}
.ov-inv-totals-breakdown {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ov-inv-stat {
  font-size: 11.5px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  padding: 2px 9px;
  border-radius: 99px;
  white-space: nowrap;
}
.ov-inv-stat-paid    { background: rgba(76,175,136,0.15);  color: var(--green); }
.ov-inv-stat-pending { background: rgba(180,120,0,0.12);   color: #a07800; }
.ov-inv-stat-overdue { background: rgba(224,82,82,0.15);   color: var(--danger); }
.ov-inv-stat-total   { background: var(--surface);         color: var(--text); border: 1px solid var(--border); font-weight: 700; }
[data-theme="dark"] .ov-inv-stat-pending { background: rgba(251,191,36,0.15); color: #fbbf24; }
/* Overdue status badge colour */
.pay-overdue { background: rgba(224,82,82,0.15) !important; color: var(--danger) !important; }

/* All Deliverables / Invoice Overview expanded popup */
.p-ov-del-expanded {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: max-content;
  min-width: 560px;
  max-width: 92vw;
  max-height: 88vh;
  z-index: 290;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 32px 100px rgba(0,0,0,0.5);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  animation: expand-in 0.18s ease-out;
}
@keyframes expand-in {
  from { opacity: 0; transform: translateX(-50%) translateY(calc(-50% + 10px)) scale(0.97); }
  to   { opacity: 1; transform: translateX(-50%) translateY(-50%)              scale(1); }
}
.p-ov-del-expanded .p-deliverables,
.p-ov-del-expanded .p-ov-panel {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
[data-theme="light"] .p-ov-del-expanded { background: #fff; }

/* Proper title bar header */
.p-ov-del-expanded #ov-del-header,
.p-ov-del-expanded #ov-inv-header {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 16px 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.p-ov-del-expanded #ov-del-header .p-deliverables-title,
.p-ov-del-expanded #ov-inv-header .p-deliverables-title {
  font-size: 18px !important;
  font-weight: 700 !important;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  letter-spacing: -0.01em;
}
[data-theme="light"] .p-ov-del-expanded #ov-del-header,
[data-theme="light"] .p-ov-del-expanded #ov-inv-header { background: #fff; }

/* Override grids to compact fixed widths inside expanded popup only */
.p-ov-del-expanded .ov-del-row,
.p-ov-del-expanded [style*="grid-template-columns"] {
  grid-template-columns: minmax(100px,170px) minmax(140px,260px) 75px 85px 105px 105px 90px 85px !important;
}
.p-ov-del-expanded .ov-inv-col-head,
.p-ov-del-expanded .p-inv-ov-row {
  grid-template-columns: minmax(100px,170px) minmax(120px,200px) 90px 90px 90px 90px 100px 90px !important;
}

/* Distinct column header row inside expanded */
.p-ov-del-expanded [style*="padding:8px 16px"][style*="font-size:11px"] {
  padding: 9px 16px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .08em !important;
  background: var(--bg) !important;
  border-top: 1px solid var(--border);
  border-bottom: 2px solid var(--border) !important;
}
/* Brand column left accent line */
.p-ov-del-expanded .ov-del-row,
.p-ov-del-expanded .ov-inv-row {
  border-left: 3px solid transparent;
  transition: border-color var(--transition), background var(--transition) !important;
}
.p-ov-del-expanded .ov-del-row:hover,
.p-ov-del-expanded .ov-inv-row:hover {
  border-left-color: var(--accent) !important;
}

/* Tighter data rows + alternating stripe */
.p-ov-del-expanded .ov-del-row,
.p-ov-del-expanded .ov-inv-row,
.p-ov-del-expanded .p-inv-ov-row {
  padding: 8px 16px !important;
}
.p-ov-del-expanded .ov-del-row:nth-child(even),
.p-ov-del-expanded .ov-inv-row:nth-child(even),
.p-ov-del-expanded .p-inv-ov-row:nth-child(even) {
  background: var(--surface-hover) !important;
}
.p-ov-del-expanded .ov-del-row:hover,
.p-ov-del-expanded .ov-inv-row:hover,
.p-ov-del-expanded .p-inv-ov-row:hover {
  background: rgba(124,111,205,0.07) !important;
}
[data-theme="light"] .p-ov-del-expanded .ov-del-row:nth-child(even),
[data-theme="light"] .p-ov-del-expanded .ov-inv-row:nth-child(even),
[data-theme="light"] .p-ov-del-expanded .p-inv-ov-row:nth-child(even) {
  background: #f9f9f9 !important;
}
[data-theme="light"] .p-ov-del-expanded .ov-del-row:hover,
[data-theme="light"] .p-ov-del-expanded .ov-inv-row:hover,
[data-theme="light"] .p-ov-del-expanded .p-inv-ov-row:hover {
  background: #f0eeff !important;
}

/* Close button in expanded panel header */
.ov-expand-close {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--surface-hover);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.ov-expand-close:hover { background: var(--danger-dim); color: var(--danger); }

/* Overview new panels — side by side */
.p-ov-split {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 8px 24px 0;
}
.p-ov-panel { margin: 0; }

/* Invoice month grouping */
.p-inv-month-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 700;
  color: var(--text);
}
.p-inv-month-total {
  font-family: 'DM Mono', monospace;
  font-size: 13px; font-weight: 600;
  color: var(--accent);
}

.p-deal-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  transition: background var(--transition);
}

.p-deal-row:hover { background: var(--surface-hover); }

.p-deal-row-rich {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
  align-items: center;
  gap: 16px;
}

.p-deal-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.p-deal-col-brand { min-width: 0; }

.p-deal-col-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
}

.p-deal-col-value {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 500;
}

.p-deal-col-value.mono { font-family: 'DM Mono', monospace; font-size: 12.5px; }

.p-deal-brand {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-deal-contact {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-deal-value {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--text);
}

.p-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.p-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.p-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  margin-top: 4px;
}

/* Notes field in detail */
.p-notes-field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.p-notes-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.p-notes-textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  min-height: 72px;
  outline: none;
}

/* Notes + Activity side by side */
.p-notes-textarea { min-height: 120px; }

/* Activity Log */
.p-activity {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.p-activity-header {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.p-activity-feed {
  padding: 8px 0;
  max-height: 420px;
  overflow-y: auto;
}
.p-activity-empty {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.p-activity-entry {
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  transition: background 0.1s;
}
.p-activity-entry:hover { background: var(--surface-hover); }
.p-activity-entry:hover .p-activity-delete { opacity: 1; }
.p-activity-body { flex: 1; min-width: 0; }
.p-activity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.p-activity-author {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.p-activity-date {
  font-size: 11.5px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
}
.p-activity-delete {
  margin-left: auto;
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--danger);
  padding: 4px;
  border-radius: 4px;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.p-activity-delete:hover { background: rgba(224,82,82,0.1); }
.p-activity-content {
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.p-activity-compose {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  align-items: flex-start;
}
.p-activity-compose-avatar { padding-top: 2px; flex-shrink: 0; }
.p-activity-compose-right { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.p-activity-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  padding: 9px 12px;
  resize: none;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.p-activity-input:focus { border-color: var(--accent); }
.p-activity-input::placeholder { color: var(--muted); }
.p-activity-submit {
  align-self: center;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.p-activity-submit:hover { opacity: 0.85; }

/* Communication type pills */
.p-activity-comm-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.p-activity-comm-label {
  font-size: 11.5px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.p-comm-pill {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.p-comm-pill:hover { border-color: var(--accent); color: var(--accent); }
.p-comm-pill-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
}

/* Communication badge on activity entries */
.p-activity-comm-badge {
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 1px 8px;
  color: var(--muted);
  white-space: nowrap;
}

[data-theme="light"] .p-activity { background: #ffffff; border-color: #e5dbd2; }
[data-theme="light"] .p-activity-input { background: #f9f5ee; border-color: #e5dbd2; }

/* ── Tasks — placeholder until redesigned ───────────────────────── */

/* ── Form Modal ─────────────────────────────────────────────────── */
.form-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 400;
}
.form-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 480px;
  max-width: 94vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  display: flex; flex-direction: column;
  overflow: hidden;
  color-scheme: light;
}
.form-modal.form-modal-wide {
  width: 740px;
}
.form-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.form-modal-title {
  font-family: 'Inter', sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--text); margin: 0;
}
.form-modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 16px; padding: 4px 6px;
  border-radius: 5px; transition: background 0.12s;
}
.form-modal-close:hover { background: var(--surface-hover); }
.form-modal-body {
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.form-modal-field { display: flex; flex-direction: column; gap: 5px; }
.form-modal-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted);
}
.form-modal-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  padding: 9px 12px;
  outline: none; width: 100%; box-sizing: border-box;
  transition: border-color 0.15s;
}
.form-modal-input:focus { border-color: var(--accent); }
.form-modal-input::placeholder { color: var(--muted); }
.form-modal-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 22px;
  border-top: 1px solid var(--border);
}
/* When no delete button, push buttons to the right */
.form-modal-footer > .form-modal-cancel-btn:first-child {
  margin-left: auto;
}
.form-modal-delete-btn {
  background: none;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.form-modal-delete-btn:hover { background: var(--danger-dim); }
.form-modal-cancel-btn {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: 'Inter', sans-serif; font-size: 13px;
  font-weight: 500; padding: 7px 16px; cursor: pointer;
  transition: background 0.15s;
}
.form-modal-cancel-btn:hover { background: var(--surface-hover); }
.form-modal-submit-btn { padding: 7px 20px; font-size: 13px; }
[data-theme="light"] .form-modal { background: #fff; }
[data-theme="light"] .form-modal-input { background: #f9f5ee; border-color: #e5dbd2; }

/* Custom select dropdown in modal */
.fm-custom-select { position: relative; }
.fm-custom-select-btn {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  padding: 9px 12px;
  cursor: pointer;
  transition: border-color 0.15s;
  user-select: none;
}
.fm-custom-select-btn:hover { border-color: var(--accent); }
.fm-custom-select-btn.open {
  border-radius: 7px 7px 0 0;
  border-bottom-color: var(--border);
}
.fm-custom-select-btn svg { flex-shrink: 0; color: var(--muted); transition: transform 0.15s; }
.fm-custom-select-btn.open svg { transform: rotate(180deg); }

.fm-custom-select-list {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0 0 7px 7px;
  overflow-y: auto;
  max-height: calc(11 * 44px); /* 11 rows × 44px each */
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.fm-custom-select-option {
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
}
.fm-custom-select-option:hover { background: var(--surface-hover); }
.fm-custom-select-option.selected { color: var(--accent); font-weight: 600; }
[data-theme="light"] .fm-custom-select-btn { background: #f9f5ee; border-color: #e5dbd2; }
[data-theme="light"] .fm-custom-select-list,
html[data-theme="light"] .fm-custom-select-list { background: #f9f5ee; border-color: #e5dbd2; }
[data-theme="light"] .fm-custom-select-option:hover,
html[data-theme="light"] .fm-custom-select-option:hover { background: #ede6d8; }

/* Video picker inside modal */
.fm-video-picker { display: flex; flex-direction: column; gap: 8px; }
.fm-video-current {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 7px;
  min-height: 40px;
}
.fm-video-linked {
  flex: 1; font-size: 13px; color: var(--text);
  font-family: 'DM Sans', sans-serif; font-weight: 500;
}
.fm-video-clear {
  background: none; border: none; cursor: pointer;
  color: var(--danger); font-size: 12px; padding: 2px 6px;
  border-radius: 4px; flex-shrink: 0; opacity: 0.7;
  transition: opacity 0.15s;
}
.fm-video-clear:hover { opacity: 1; }
.fm-video-search-btn {
  background: var(--surface-hover); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 14px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text);
  transition: background 0.15s;
}
.fm-video-search-btn:hover { background: var(--border); }

/* Empty state for partnership */
.p-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 10px;
  color: var(--muted);
}

.p-empty-icon { font-size: 36px; }
.p-empty-text { font-family: 'Inter', sans-serif; font-size: 17px; color: var(--text); }
.p-empty-sub  { font-size: 13px; }

/* Light mode partnership tweaks */
[data-theme="light"] .p-table thead { background: var(--bg); }
[data-theme="light"] .p-stat-card,
[data-theme="light"] .p-deliverables,
[data-theme="light"] .p-contact-info,
[data-theme="light"] .p-notes-field,
[data-theme="light"] .p-deal-row { background: #ffffff; border-color: #e5dbd2; }
[data-theme="light"] .p-table tr:hover { background: #fef3e8; }
[data-theme="light"] .p-nav-item:hover { background: #fde9d8; color: #1c1a2e; }
[data-theme="light"] .p-nav-item.active { background: #fde9d8; color: #c96340; border-left-color: #c96340; }
[data-theme="light"] .dash-toggle { background: #ede8e2; }
[data-theme="light"] .dash-toggle-btn.active { background: #ffffff; box-shadow: 0 1px 4px rgba(28,26,46,0.12); }

.context-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
  transition: background var(--transition), color var(--transition);
}

.context-item:hover { background: var(--surface-hover); }
.context-item.ctx-danger { color: var(--danger); }
.context-item.ctx-danger:hover { background: var(--danger-dim); }
.context-item.ctx-restore { color: var(--green); }
.context-item.ctx-restore:hover { background: rgba(76,175,136,0.12); }

/* ── Bulk Toolbar ───────────────────────────────── */
.bulk-toolbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), opacity 0.22s ease;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
}

.bulk-toolbar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.bulk-count {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}

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

.bulk-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}

.bulk-btn:hover { color: var(--text); border-color: var(--muted); }

.bulk-btn.bulk-archive:hover { border-color: var(--accent); color: var(--accent); }
.bulk-btn.bulk-delete { color: var(--danger); border-color: rgba(224,82,82,0.3); }
.bulk-btn.bulk-delete:hover { background: var(--danger-dim); border-color: var(--danger); }
.bulk-btn.bulk-restore { color: var(--green); border-color: rgba(76,175,136,0.3); }
.bulk-btn.bulk-restore:hover { background: rgba(76,175,136,0.12); border-color: var(--green); }
.bulk-btn.bulk-clear:hover { color: var(--text); }

/* ── Dialog ─────────────────────────────────────── */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: backdropFade 0.15s ease;
}

@keyframes backdropFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  animation: dialogPop 0.18s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes dialogPop {
  from { opacity: 0; transform: scale(0.93) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.dialog-message {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 20px;
}

.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

.btn-dialog-cancel {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  transition: color var(--transition), border-color var(--transition);
}
.btn-dialog-cancel:hover { color: var(--text); border-color: var(--muted); }

.btn-dialog-confirm {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: opacity var(--transition);
}
.btn-dialog-confirm:hover { opacity: 0.88; }
.btn-dialog-confirm.danger { background: var(--danger); }

/* ── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Focus styles ───────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Tooltips ───────────────────────────────────── */
/* Only non-interactive elements get default cursor on title — don't override buttons/links */
abbr[title] { cursor: help; }

/* ── Calendar ───────────────────────────────────── */
.calendar-wrap {
  display: flex;
  flex-direction: column;
}

/* Calendar view toggle (Month | 2 Week | Week) — lives in the header row */
.cal-view-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  background: var(--surface-hover);
  border-radius: var(--radius);
}
.cal-view-btn {
  padding: 5px 14px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.cal-view-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.cal-view-btn:not(.active):hover { color: var(--text); }
[data-theme="light"] .cal-view-toggle { background: #f0f0f0; }
[data-theme="light"] .cal-view-btn { color: #737373; }
[data-theme="light"] .cal-view-btn.active { background: var(--accent); color: #fff; }

.cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cal-month-label {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  min-width: 200px;
  text-align: center;
}

.cal-nav-btn {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 30px; height: 30px;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  line-height: 1;
}
.cal-nav-btn:hover { background: var(--border); border-color: var(--muted); }

.cal-today-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  padding: 5px 14px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.cal-today-btn:hover { color: var(--text); border-color: var(--accent); }

/* ── Calendar panels (On Deck + Notepad) ────────── */
.cal-panels {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  height: 420px;
}

.cal-ondeck-panel {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cal-notepad-panel {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cal-panel-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
  letter-spacing: 0.01em;
  position: relative;
}

.cal-ondeck-count { color: var(--muted); font-size: 12px; }

.cal-panel-add-btn {
  position: absolute;
  right: 12px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  padding: 5px 14px;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  letter-spacing: 0.02em;
}
.cal-panel-add-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.cal-panel-add-btn:active { transform: translateY(0); }

.cal-ondeck-zone {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: flex-start;
  gap: 5px;
  transition: background var(--transition), outline var(--transition);
  border-radius: 0 0 var(--radius) var(--radius);
}

.cal-ondeck-zone.drag-over {
  background: var(--accent-dim);
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}

.cal-ondeck-empty {
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
  padding: 4px 2px;
  font-family: 'DM Sans', sans-serif;
  grid-column: 1 / -1;
}

.cal-notepad {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  padding: 12px 16px;
  outline: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.cal-notepad:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  font-style: italic;
  pointer-events: none;
}

.notepad-link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  word-break: break-all;
}
.notepad-link:hover { color: #a78bfa; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto;
  grid-auto-rows: 146px;
  flex-shrink: 0;
  border-left: 2px solid #4a527a;
  border-top: 2px solid #4a527a;
}
.cal-week-grid {
  grid-auto-rows: minmax(200px, 1fr);
  flex: 1;
}
.cal-week-cell {
  min-height: 200px;
}

/* Studio calendar Week/2-Week grid: cells span rows of .cal-grid's existing
   146px auto-rows so the total grid height exactly matches Month view */
.cal-cell.cal-studio-week-cell {
  overflow-y: auto;
  overflow-x: hidden;
}

.cal-day-header {
  padding: 8px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text);
  border-right: 2px solid #4a527a;
  border-bottom: 2px solid #4a527a;
  background: var(--surface);
  position: sticky;
  top: var(--content-header-h);
  z-index: 2;
}

.cal-cell {
  border-right: 2px solid #4a527a;
  border-bottom: 2px solid #4a527a;
  padding: 4px 6px;
  cursor: pointer;
  transition: background var(--transition);
  vertical-align: top;
  position: relative;
  overflow: hidden;
}

.cal-cell:hover { background: var(--surface-hover); }
.cal-cell.cal-other-month { opacity: 0.5; }
.cal-cell.cal-today { background: var(--accent-dim); }

.cal-day-num {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.cal-today-num {
  background: var(--accent);
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.cal-pill {
  display: block;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  margin-bottom: 3px;
  transition: opacity var(--transition), transform var(--transition);
  max-width: 100%;
  text-align: center;
  color: #ffffff !important;
  border: none !important;
}

/* Calendar pill solid colors — override the transparent badge styles */
.cal-pill.stage-ondeck    { background: #6b7280; }
.cal-pill.stage-scripting { background: #d97706; }
.cal-pill.stage-filming   { background: #3b82f6; }
.cal-pill.stage-editing   { background: #7c6fcd; }
.cal-pill.stage-review    { background: #e8956d; }
.cal-pill.stage-scheduled { background: #4caf88; }
.cal-pill.stage-live      { background: #16a34a; }
.cal-pill:hover  { opacity: 0.8; transform: translateY(-1px); }
.cal-pill-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 3px;
}

.cal-pill-group .cal-pill { margin-bottom: 0; }

.cal-pill-brand {
  font-size: 10.5px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: var(--green);
  padding: 0 4px;
  cursor: pointer;
  transition: opacity var(--transition);
  margin-top: 1px;
}
.cal-pill-brand:hover { opacity: 0.75; }

.cal-pill[draggable="true"] { cursor: grab; }
.cal-pill[draggable="true"]:active { cursor: grabbing; }
.cal-pill.dragging { opacity: 0.3; transform: scale(0.96); }

.cal-cell.drag-over {
  background: var(--accent-dim) !important;
  outline: 2px dashed var(--accent);
  outline-offset: -3px;
}

.cal-more {
  font-size: 10px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  padding: 1px 2px;
  cursor: pointer;
}
.cal-more:hover { color: var(--accent); }

.cal-add-hint {
  position: absolute;
  bottom: 5px; right: 7px;
  font-size: 18px;
  color: var(--border);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
  line-height: 1;
}
.cal-cell:hover .cal-add-hint { opacity: 1; }

/* ── Login Gate ─────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: dialogPop 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

.login-logo {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.login-subtitle {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.login-input {
  width: 100%;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition);
  font-family: 'DM Sans', sans-serif;
}

.login-input:focus { border-color: var(--accent); }

.login-btn {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 11px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  width: 100%;
  transition: opacity var(--transition);
  cursor: pointer;
  border: none;
}

.login-btn:hover { opacity: 0.88; }

.login-error {
  font-size: 13px;
  color: var(--danger);
  text-align: center;
  min-height: 18px;
}

.login-forgot {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12.5px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  text-align: center;
  transition: color var(--transition);
  padding: 0;
  margin-top: -4px;
}
.login-forgot:hover { color: var(--accent); }

.login-success {
  font-size: 12.5px;
  color: var(--green);
  text-align: center;
  padding: 4px 0;
}

/* Sidebar user chip */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #7c6fcd;
  color: #fff;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-avatar {
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}
.sidebar-user-avatar:hover { opacity: 0.85; transform: scale(1.05); }

.sidebar-user-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  min-width: 160px;
  padding: 4px;
  display: none;
  z-index: 200;
  animation: menuFadeIn 0.12s ease;
}

.sidebar-user-menu.open { display: block; }

.sidebar-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.sidebar-user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--danger);
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background var(--transition);
  text-align: left;
}
.sidebar-user-menu-item:hover { background: var(--danger-dim); }

.sidebar-user-menu-item-neutral { color: var(--text); }
.sidebar-user-menu-item-neutral:hover { background: var(--surface-hover); }

.avatar-uploading {
  opacity: 0.6;
  cursor: wait;
}

[data-theme="light"] .sidebar-user-menu { background: #ffffff; border-color: #e8e8e8; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

/* ── Team Dashboards Dropdown ───────────────────── */
.team-dash-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
  z-index: 400;
  overflow: hidden;
}
.team-dash-header {
  padding: 10px 14px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.team-dash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 13.5px;
  color: var(--text);
}
.team-dash-item:hover { background: var(--surface-hover); }
.team-dash-av {
  width: 32px; height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.team-dash-av-img { width: 100%; height: 100%; object-fit: cover; }
.team-dash-av-init {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.team-dash-info { flex: 1; min-width: 0; }
.team-dash-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.team-dash-role { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-dash-divider { height: 1px; background: var(--border); margin: 4px 0; }
.team-dash-settings { color: var(--muted); font-size: 13px; gap: 8px; }
.team-dash-settings:hover { color: var(--text); background: var(--surface-hover); }
.team-dash-empty { padding: 14px; font-size: 13px; color: var(--muted); text-align: center; }
[data-theme="light"] .team-dash-dropdown { background: #fff; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }

/* ── Admin Settings — compact table ─────────────── */
.admin-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-table-head {
  display: grid;
  grid-template-columns: 200px 1fr 140px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
}
.admin-table-row {
  display: grid;
  grid-template-columns: 200px 1fr 140px;
  padding: 10px 14px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.admin-table-row:last-child { border-bottom: none; }
.admin-member-cell { display: flex; align-items: center; gap: 9px; }
.admin-av { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.admin-av-img { width: 100%; height: 100%; object-fit: cover; }
.admin-av-init {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.admin-member-name { font-size: 13px; font-weight: 600; color: var(--text); }
.admin-member-email { font-size: 11px; color: var(--muted); }
.admin-roles-cell { display: flex; align-items: center; }
.admin-roles-list { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.admin-role-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px 3px 9px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px; font-weight: 600;
  font-family: 'Inter', sans-serif;
}
.admin-role-remove {
  background: none; border: none; color: rgba(255,255,255,0.8);
  cursor: pointer; padding: 0; line-height: 1;
  font-size: 14px; display: flex; align-items: center;
  transition: color var(--transition);
}
.admin-role-remove:hover { color: #fff; }
.admin-add-role-btn {
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.admin-add-role-btn:hover { border-color: var(--accent); color: var(--accent); }
.admin-role-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  z-index: 500;
  min-width: 160px;
  overflow: hidden;
}
.admin-role-dd-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}
.admin-role-dd-item:hover { background: var(--surface-hover); }
.admin-perm-cell {}
.admin-perm-select {
  width: 100%;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
}
.admin-perm-select:focus { outline: none; border-color: var(--accent); }
[data-theme="light"] .admin-role-dropdown { background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

/* ── Personal Dashboard ─────────────────────────── */
.pdash-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.pdash-header-info { flex: 1; }
.pdash-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  margin-bottom: 6px;
}
.pdash-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.pdash-role-tag {
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}
.pdash-viewing-badge {
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.pdash-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.pdash-cal-section { overflow: visible; }

@keyframes pdash-page-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pdash-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 24px 40px;
  max-width: 1200px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  animation: pdash-page-in 0.3s ease both;
}
.pdash-cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.pdash-cal-grid {
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
/* This calendar is a small fixed-size widget, not a scrolling page section —
   the sticky header (meant to stick below the Studio content-header while
   scrolling) has no scroll context here and just misplaces the row. */
.pdash-cal-grid .cal-day-header {
  position: static;
}
.pdash-section-title {
  padding: 14px 18px 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pdash-count {
  background: var(--surface-hover);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--muted);
}
.pdash-table-head {
  display: grid;
  padding: 8px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.pdash-table-row {
  display: grid;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 13px;
  color: var(--text);
}
.pdash-table-row:last-child { border-bottom: none; }
.pdash-table-row:hover { background: var(--surface-hover); }
.pdash-video-title { font-weight: 500; }
.pdash-section-title .pdash-col-gear {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.pdash-section-title .pdash-col-gear:hover { background: var(--surface-hover); color: var(--text); }

.pdash-col-popover {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  padding: 6px 0 8px;
  min-width: 200px;
  z-index: 1200;
}
.pdash-pop-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 14px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.pdash-pop-group {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 14px 2px;
}
.pdash-pop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
}
.pdash-pop-item:hover { background: var(--surface-hover); }
.pdash-pop-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.pdash-social-cal-pill {
  border-left: 3px solid #7c5cfc;
  background: color-mix(in srgb, var(--surface-hover) 80%, transparent);
  color: var(--text);
  font-weight: 500;
}
.pdash-empty {
  padding: 24px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ── Partners dashboard — modal + dropdown theming ── */
/* Dark mode */
#app[data-dash="partnership"] .form-modal {
  background: #1C1814;
  border-color: #36322A;
  color: #F4ECD6;
}
#app[data-dash="partnership"] .form-modal-header {
  border-bottom-color: #36322A;
}
#app[data-dash="partnership"] .form-modal-title,
#app[data-dash="partnership"] .form-modal-label { color: #F4ECD6; }
#app[data-dash="partnership"] .form-modal-close {
  color: #9A8A76;
}
#app[data-dash="partnership"] .form-modal-close:hover {
  background: #2C2820; color: #F4ECD6;
}
#app[data-dash="partnership"] .form-modal-footer {
  border-top-color: #36322A;
  background: #1C1814;
}
#app[data-dash="partnership"] .form-modal-input {
  background: #111009;
  border-color: #36322A;
  color: #F4ECD6;
}
#app[data-dash="partnership"] .form-modal-input:focus { border-color: #E68445; }
#app[data-dash="partnership"] .form-modal-input::placeholder { color: #6B5E4E; }
#app[data-dash="partnership"] .form-modal-cancel-btn {
  background: transparent;
  border-color: #36322A;
  color: #9A8A76;
}
#app[data-dash="partnership"] .form-modal-cancel-btn:hover {
  background: #2C2820;
}
#app[data-dash="partnership"] .btn-primary.form-modal-submit-btn {
  background: #F4ECD6;
  color: #2A2622;
}
#app[data-dash="partnership"] .btn-primary.form-modal-submit-btn:hover {
  background: #e8dfc8;
}
/* Custom select dropdown */
#app[data-dash="partnership"] .fm-custom-select-btn {
  background: #111009;
  border-color: #36322A;
  color: #F4ECD6;
}
#app[data-dash="partnership"] .fm-custom-select-btn:hover,
#app[data-dash="partnership"] .fm-custom-select-btn.open { border-color: #E68445; }
#app[data-dash="partnership"] .fm-custom-select-list {
  background: #1C1814;
  border-color: #36322A;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
#app[data-dash="partnership"] .fm-custom-select-option { color: #F4ECD6; }
#app[data-dash="partnership"] .fm-custom-select-option:hover { background: #2C2820; }
#app[data-dash="partnership"] .fm-custom-select-option.selected {
  color: #E68445; font-weight: 600;
}
/* Video picker */
#app[data-dash="partnership"] .fm-video-current {
  background: #111009; border-color: #36322A; color: #F4ECD6;
}
/* Tab toggle (Item Card / Updates) */
#app[data-dash="partnership"] .fm-tab-toggle {
  background: #111009;
  border-color: #36322A;
}
#app[data-dash="partnership"] .fm-tab { color: #9A8A76; }
#app[data-dash="partnership"] .fm-tab.active {
  background: #2C2820; color: #F4ECD6;
}

/* Light mode overrides */
[data-theme="light"] #app[data-dash="partnership"] .form-modal {
  background: #FFFFFF;
  border-color: #DCD2BC;
  color: #2A2622;
}
[data-theme="light"] #app[data-dash="partnership"] .form-modal-header { border-bottom-color: #DCD2BC; }
[data-theme="light"] #app[data-dash="partnership"] .form-modal-title,
[data-theme="light"] #app[data-dash="partnership"] .form-modal-label { color: #2A2622; }
[data-theme="light"] #app[data-dash="partnership"] .form-modal-close { color: #9A8A76; }
[data-theme="light"] #app[data-dash="partnership"] .form-modal-close:hover { background: #F0E8D8; }
[data-theme="light"] #app[data-dash="partnership"] .form-modal-footer { border-top-color: #DCD2BC; background: #FDFAF5; }
[data-theme="light"] #app[data-dash="partnership"] .form-modal-input { background: #F9F5EE; border-color: #DCD2BC; color: #2A2622; }
[data-theme="light"] #app[data-dash="partnership"] .form-modal-input:focus { border-color: #D26A2E; }
[data-theme="light"] #app[data-dash="partnership"] .form-modal-input::placeholder { color: #B8A898; }
[data-theme="light"] #app[data-dash="partnership"] .form-modal-cancel-btn { border-color: #DCD2BC; color: #7A6A5A; }
[data-theme="light"] #app[data-dash="partnership"] .form-modal-cancel-btn:hover { background: #F0E8D8; }
[data-theme="light"] #app[data-dash="partnership"] .btn-primary.form-modal-submit-btn { background: #2A2622; color: #F9F5EE; }
[data-theme="light"] #app[data-dash="partnership"] .btn-primary.form-modal-submit-btn:hover { background: #3D3530; }
[data-theme="light"] #app[data-dash="partnership"] .fm-custom-select-btn { background: #F9F5EE; border-color: #DCD2BC; color: #2A2622; }
[data-theme="light"] #app[data-dash="partnership"] .fm-custom-select-btn:hover,
[data-theme="light"] #app[data-dash="partnership"] .fm-custom-select-btn.open { border-color: #D26A2E; }
[data-theme="light"] #app[data-dash="partnership"] .fm-custom-select-list { background: #FFFFFF; border-color: #DCD2BC; }
[data-theme="light"] #app[data-dash="partnership"] .fm-custom-select-option { color: #2A2622; }
[data-theme="light"] #app[data-dash="partnership"] .fm-custom-select-option:hover { background: #F0E8D8; }
[data-theme="light"] #app[data-dash="partnership"] .fm-custom-select-option.selected { color: #D26A2E; }
[data-theme="light"] #app[data-dash="partnership"] .fm-video-current { background: #F9F5EE; border-color: #DCD2BC; color: #2A2622; }
[data-theme="light"] #app[data-dash="partnership"] .fm-tab-toggle { background: #F0E8D8; border-color: #DCD2BC; }
[data-theme="light"] #app[data-dash="partnership"] .fm-tab { color: #9A8A76; }
[data-theme="light"] #app[data-dash="partnership"] .fm-tab.active { background: #FFFFFF; color: #2A2622; }

/* ── Google Calendar Connect buttons ───────────── */
.gcal-connect-btn {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.gcal-connect-btn:hover { background: var(--accent); color: #fff; }
.gcal-disconnect-btn {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}
.gcal-disconnect-btn:hover { border-color: var(--danger); color: var(--danger); }

/* ── Google Calendar event list (Today view) ───── */
.gcal-event-list { padding: 8px 0; }
.gcal-event-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.gcal-event-item:last-child { border-bottom: none; }
.gcal-event-item:hover { background: var(--surface-hover); }
.gcal-event-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #4285f4;
  flex-shrink: 0;
}
.gcal-event-info { flex: 1; min-width: 0; }
.gcal-event-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gcal-event-time {
  font-size: 12px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  margin-top: 2px;
}
.gcal-join-btn {
  padding: 4px 12px;
  border-radius: 99px;
  background: #4285f4;
  color: #fff;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.gcal-join-btn:hover { opacity: 0.85; }
.gcal-loading, .gcal-empty {
  padding: 20px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* GCal skeleton shimmer — shown while events load on cached-connected dashboards */
@keyframes pdash-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.gcal-skeleton-body {
  padding: 14px 18px 18px;
}
.gcal-sk-bar {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--border) 50%, var(--surface-hover) 75%);
  background-size: 800px 100%;
  animation: pdash-shimmer 1.4s infinite linear;
}
.gcal-sk-w40 { width: 40%; }
.gcal-sk-timeline {
  position: relative;
  height: 36px;
  border-radius: 6px;
  background: var(--surface-hover);
  overflow: hidden;
}
.gcal-sk-block {
  position: absolute;
  top: 6px;
  height: 24px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--border) 25%, color-mix(in srgb, var(--border) 60%, transparent) 50%, var(--border) 75%);
  background-size: 800px 100%;
  animation: pdash-shimmer 1.4s infinite linear;
}

/* ── Google Calendar week popup ─────────────────── */
.gcal-week-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gcal-week-popup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gcal-week-popup-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}
.gcal-week-popup-header .gcal-week-nav { justify-self: center; }
.gcal-week-popup-header .gcal-week-popup-close { justify-self: end; }
.gcal-week-popup-week-label {
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--text);
}
.gcal-week-popup-title {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  color: var(--text);
}
.gcal-week-popup-close {
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 18px; padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.gcal-week-popup-close:hover { background: var(--surface-hover); color: var(--text); }
.gcal-week-popup-body {
  overflow-y: auto;
  flex: 1;
}
[data-theme="light"] .gcal-week-popup { background: #fff; }

/* ── Google Calendar Day Timeline ────────────────── */
.gcal-htl-label {
  padding: 10px 18px 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
}
.gcal-htl-allday {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 4px 18px 8px;
}
.gcal-htl-allday-chip {
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(66,133,244,0.12);
  color: #4285f4;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}
.gcal-day-timeline {
  padding: 0 18px 20px;
  overflow-x: auto;
  min-height: 110px;
}
/* Hour axis */
.gcal-day-axis {
  position: relative;
  height: 36px;
  margin-bottom: 0;
}
.gcal-day-rule {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border);
  border-radius: 99px;
}
.gcal-day-hour {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.gcal-day-hour-label {
  font-size: 10.5px;
  font-family: 'DM Mono', monospace;
  color: var(--muted);
  white-space: nowrap;
}
.gcal-day-hour-tick {
  width: 1px;
  height: 8px;
  background: var(--border);
}
/* 30-minute tick marks */
.gcal-day-half {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 5px;
  background: var(--border);
  opacity: 0.5;
  transform: translateX(-50%);
}
/* Now indicator — inside .gcal-day-axis, extends down via large height */
.gcal-day-now-line {
  position: absolute;
  top: 0;
  width: 1.5px;
  height: calc(100% + 200px); /* extend below axis into events area */
  background: var(--danger);
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
  opacity: 0.6;
  border-radius: 1px;
}
/* Event area */
.gcal-day-events {
  position: relative;
  margin-top: 8px;
}
.gcal-day-block {
  position: absolute;
  background: rgba(66,133,244,0.12);
  border: 1.5px solid #4285f4;
  border-radius: var(--radius-sm);
  padding: 5px 8px 5px;
  overflow: hidden;
  box-sizing: border-box;
  transition: background 0.15s, box-shadow 0.15s;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Small link-type badges in bottom-right corner of event block */
.gcal-block-badges {
  display: flex;
  gap: 3px;
  margin-top: auto;
  padding-top: 2px;
}
.gcal-block-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  color: #fff;
  flex-shrink: 0;
}
.gcal-block-badge-zoom { background: #2D8CFF; }
.gcal-block-badge-doc  { background: #0F9D58; }
.gcal-day-block:hover {
  background: rgba(66,133,244,0.22);
  box-shadow: 0 2px 10px rgba(66,133,244,0.2);
  z-index: 3;
}
.gcal-day-block-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #4285f4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.gcal-day-block-time {
  font-size: 10.5px;
  font-family: 'DM Mono', monospace;
  color: #4285f4;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.gcal-day-past {
  background: rgba(128,128,128,0.08);
  border-color: var(--border);
}
.gcal-day-past .gcal-day-block-title,
.gcal-day-past .gcal-day-block-time { color: var(--muted); }
.gcal-day-current {
  background: rgba(66,133,244,0.18);
  border-color: #4285f4;
  box-shadow: 0 0 0 2px rgba(66,133,244,0.15);
}
.gcal-zoom-btn       { background: #2D8CFF !important; }
.gcal-zoom-btn:hover { background: #1a7ae8 !important; }
.gcal-gcal-btn       { background: #EA4335 !important; }
.gcal-gcal-btn:hover { background: #c5352a !important; }
.gcal-doc-btn        { background: #0F9D58 !important; }
.gcal-doc-btn:hover  { background: #0b7a44 !important; }

.gcal-htl-join {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 99px;
  background: #4285f4;
  color: #fff;
  font-size: 10.5px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
}
[data-theme="light"] .gcal-day-block { background: rgba(66,133,244,0.08); }

/* ── Google Calendar Week Grid ───────────────────── */
.gcal-week-popup {
  max-width: 96vw;
  width: 1200px;
  height: 88vh; /* fixed height — popup opens full size immediately */
  display: flex;
  flex-direction: column;
}
.gcal-week-popup-body {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.gcw-root { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

/* All-day row */
.gcw-allday-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 28px;
  align-items: center;
}
.gcw-allday-cell {
  flex: 1;
  padding: 3px 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  border-left: 1px solid var(--border);
}
.gcw-allday-chip {
  font-size: 11px;
  background: rgba(66,133,244,0.15);
  color: #4285f4;
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Day headers */
.gcw-header {
  display: flex;
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}
.gcw-day-head {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px 6px;
  border-left: 1px solid var(--border);
  gap: 2px;
}
.gcw-day-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
}
.gcw-day-num {
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.gcw-today-num {
  background: #4285f4;
  color: #fff;
  font-weight: 600;
}
.gcw-today-head .gcw-day-label { color: #4285f4; }

/* Time gutter shared style */
.gcw-time-gutter { width: 52px; flex-shrink: 0; }

/* Scrollable grid */
.gcw-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.gcw-grid {
  display: flex;
  position: relative;
}
.gcw-time-col {
  position: relative;
  flex-shrink: 0;
}
.gcw-hour-label {
  position: absolute;
  right: 8px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: var(--muted);
  transform: translateY(-50%);
  white-space: nowrap;
  user-select: none;
}

/* Day columns */
.gcw-day-col {
  flex: 1;
  position: relative;
  border-left: 1px solid var(--border);
}
.gcw-today-col { background: rgba(66,133,244,0.02); }
.gcw-hour-cell {
  position: absolute;
  left: 0; right: 0;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}

/* Events */
.gcw-event {
  position: absolute;
  background: #4285f4;
  border-radius: 4px;
  padding: 3px 5px;
  overflow: hidden;
  cursor: pointer;
  box-sizing: border-box;
  transition: opacity 0.15s;
  z-index: 1;
}
.gcw-event:hover { opacity: 0.85; z-index: 2; }
.gcw-event-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.gcw-event-time {
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  font-family: 'DM Mono', monospace;
}
.gcw-event-past { background: var(--border); }
.gcw-event-past .gcw-event-title,
.gcw-event-past .gcw-event-time { color: var(--muted); }

/* Now line */
.gcw-now-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--danger);
  z-index: 3;
}
.gcw-now-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--danger);
  position: absolute;
  left: -5px;
  top: -4px;
}

[data-theme="light"] .gcw-today-col { background: rgba(66,133,244,0.03); }

/* ── Google Calendar day navigation ─────────────── */
.gcal-day-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 18px 8px;
  border-bottom: 1px solid var(--border);
}
.gcal-nav-arrow {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}
.gcal-nav-arrow:hover { background: var(--surface-hover); color: var(--text); border-color: var(--accent); }
.gcal-day-nav-label {
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  min-width: 140px;
  text-align: center;
}
/* Week popup nav */
.gcal-week-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Google Calendar Event Detail Popup ─────────── */
.gcal-event-popup {
  position: fixed;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  z-index: 9999;
  overflow: hidden;
  font-family: 'DM Sans', sans-serif;
}
.gcal-event-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  background: #4285f4;
}
.gcal-event-popup-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  font-family: 'Inter', sans-serif;
  line-height: 1.3;
  flex: 1;
}
.gcal-event-popup-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
}
.gcal-event-popup-close:hover { color: #fff; }
.gcal-event-popup-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
}
.gcal-event-popup-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}
.gcal-event-popup-icon { flex-shrink: 0; font-size: 14px; }
.gcal-event-popup-desc {
  color: var(--muted);
  font-size: 12px;
}
.gcal-event-popup-attendees {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.gcal-event-popup-attendees-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.gcal-event-popup-attendee {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text);
}
.gcal-attendee-status {
  font-size: 12px;
  font-weight: 700;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}
.gcal-attendee-self { font-weight: 600; }
.gcal-event-popup-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
[data-theme="light"] .gcal-event-popup { background: #fff; }

/* ── Zoom step buttons in avatar dropdown ───────── */
.zoom-step-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  padding: 0;
}
.zoom-step-btn:hover { background: var(--border); }

/* ── Video thumbnail preview in table row ────────── */
.video-thumb-preview {
  width: 64px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  display: block;
  transform: translateZ(0);
}

/* ── Thumbnail slots in edit panel ──────────────── */
.thumb-slots {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.thumb-slot {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.thumb-slot-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
}
.thumb-slot-preview { position: relative; }
.thumb-slot-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
}
.thumb-slot-del {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.thumb-slot-preview:hover .thumb-slot-del { opacity: 1; }
.thumb-slot-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16/9;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  gap: 4px;
  transition: border-color var(--transition), background var(--transition);
}
.thumb-slot-upload:hover { border-color: var(--accent); background: var(--surface-hover); }
.thumb-slot-plus { font-size: 24px; color: var(--muted); line-height: 1; }
.thumb-loading { font-size: 12px; color: var(--muted); }
.thumb-comments { display: flex; flex-direction: column; gap: 4px; max-height: 100px; overflow-y: auto; }
.thumb-comment {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 12px;
}
.thumb-comment-av {
  width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.thumb-comment-av-init {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; flex-shrink: 0;
}
.thumb-comment-body { flex: 1; min-width: 0; }
.thumb-comment-name { font-weight: 600; color: var(--text); margin-right: 4px; }
.thumb-comment-text { color: var(--muted); }
.thumb-comment-compose { display: flex; flex-direction: column; gap: 4px; }
.thumb-comment-input {
  width: 100%; padding: 5px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: 12px; font-family: 'DM Sans', sans-serif;
  resize: none; box-sizing: border-box;
}
.thumb-comment-input:focus { outline: none; border-color: var(--accent); }
.thumb-comment-submit {
  align-self: flex-end;
  padding: 3px 10px; border-radius: 99px;
  background: var(--accent); color: #fff;
  border: none; font-size: 11.5px; font-family: 'Inter', sans-serif;
  font-weight: 600; cursor: pointer;
}

/* ── YouTube-style thumbnail card in calendar ───── */
.cal-yt-card {
  margin: 3px 4px 6px;
  cursor: pointer;
  transition: transform 0.15s;
  background: transparent;
}
.cal-yt-card:hover { transform: scale(1.015); }
.cal-yt-card:hover .cal-yt-thumb { box-shadow: 0 4px 14px rgba(0,0,0,0.2); }
.cal-yt-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  transition: box-shadow 0.15s;
}
.cal-yt-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.35;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cal-yt-brand {
  font-size: 11.5px;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme="light"] .cal-yt-title { color: #0f0f0f; }
[data-theme="light"] .cal-yt-brand  { color: #606060; }

/* ── All Videos: Grid (YouTube-homepage-style) view ───── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px 20px;
  padding: 16px 0 40px;
}
.vgrid-card {
  cursor: pointer;
  transition: transform 0.15s;
}
.vgrid-card:hover { transform: scale(1.015); }
.vgrid-card:hover .vgrid-thumb { box-shadow: 0 4px 14px rgba(0,0,0,0.2); }
.vgrid-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: var(--surface-hover);
  transition: box-shadow 0.15s;
}
.vgrid-thumb-na {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.vgrid-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.35;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vgrid-meta {
  font-size: 12.5px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  margin-top: 4px;
}
[data-theme="light"] .vgrid-title { color: #0f0f0f; }

@media (max-width: 1600px) { .video-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1280px) { .video-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .video-grid { grid-template-columns: repeat(1, 1fr); } }

/* ── Tighter rows inside expanded overview panels ── */
.p-ov-del-expanded [style*="padding:10px 16px"] {
  padding: 8px 16px !important;
}
.p-ov-del-expanded .p-inv-month-group + .p-inv-month-group {
  border-top: 2px solid var(--border);
}

/* ── Google Calendar inline reconnect prompt ─────── */
.gcal-reconnect {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 20px;
  text-align: center;
}
.gcal-reconnect-icon { font-size: 28px; }
.gcal-reconnect-msg {
  font-size: 13px;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
}
.gcal-reconnect-btn {
  padding: 8px 18px;
  border-radius: 99px;
  background: #4285f4;
  color: #fff;
  border: none;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.gcal-reconnect-btn:hover { opacity: 0.85; }

/* ── Settings Page ──────────────────────────────────────────────── */
.settings-wrap {
  height: calc(100vh - 52px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* Two-panel layout */
.settings-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 28px 32px 0;
  box-sizing: border-box;
}
.settings-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.settings-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  font-family: 'Inter', sans-serif;
}
.settings-panels {
  display: flex;
  flex: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 24px;
}

/* Sidebar */
.settings-sidebar {
  width: 196px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.settings-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.12s;
}
.settings-sidebar-item:hover:not(:disabled) { background: var(--surface-hover); }
.settings-sidebar-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.settings-sidebar-item:disabled { opacity: 0.45; cursor: default; }
.settings-sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}
.settings-soon-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface-hover);
  color: var(--muted);
  border-radius: 99px;
  padding: 2px 7px;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
}

/* Content area */
.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
}
.settings-content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.settings-section-title {
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  margin: 0 0 3px;
}
.settings-section-desc {
  font-size: 12px;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  margin: 0;
}

/* Read-only member cards */
.settings-member-cards { display: flex; flex-direction: column; gap: 2px; }
.settings-member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: background 0.12s;
}
.settings-member-card:hover { background: var(--surface-hover); }
.settings-member-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.settings-member-av-img { width: 100%; height: 100%; object-fit: cover; }
.settings-member-av-init {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.settings-member-info { flex: 1; min-width: 0; }
.settings-member-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.settings-member-role { font-size: 12px; color: var(--muted); margin-top: 1px; }
.settings-member-email { font-size: 11px; color: var(--muted); margin-top: 1px; }
.settings-perm-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
}
.settings-perm-admin        { background: rgba(99,102,241,0.15); color: #818cf8; }
.settings-perm-standard     { background: var(--surface-hover); color: var(--muted); }
.settings-perm-guest-collaborator { background: rgba(76,175,136,0.15); color: #4caf88; }
.settings-perm-guest-brand  { background: rgba(240,136,62,0.15); color: #f0883e; }

/* Legacy — kept for backward compat */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.settings-channel-list {
  display: flex;
  flex-direction: column;
}

.settings-channel-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.settings-channel-row:last-child { border-bottom: none; }
.settings-channel-row:hover { background: var(--row-hover); }

.settings-ch-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.15);
}

.settings-ch-name {
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}

/* Card Template settings */
.card-template-list {
  display: flex;
  flex-direction: column;
}

.card-template-row {
  display: grid;
  grid-template-columns: 28px 1fr 90px 110px 110px 28px;
  align-items: center;
  gap: 14px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s, opacity 0.12s;
}
.card-template-row:last-child { border-bottom: none; }
.card-template-row:hover { background: var(--row-hover); }
.card-template-row.ct-row-hidden { opacity: 0.5; }
.card-template-row.ct-dragging { opacity: 0.35; }
.card-template-row.ct-drop-above { box-shadow: inset 0 2px 0 0 var(--accent); }
.card-template-row.ct-drop-below { box-shadow: inset 0 -2px 0 0 var(--accent); }

.ct-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--muted);
  cursor: grab;
  transition: background 0.12s, color 0.12s;
}
.ct-drag-handle:hover { background: var(--surface-hover); color: var(--text); }
.ct-drag-handle:active { cursor: grabbing; }

.ct-delete-field-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}
.ct-delete-field-btn:hover { background: var(--surface-hover); color: #e05252; }

.ct-label-input, .ct-label {
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}
.ct-label-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  padding: 6px 8px;
  width: 100%;
  transition: border-color 0.12s, background 0.12s;
}
.ct-label-input:hover { border-color: var(--border); }
.ct-label-input:focus { border-color: var(--accent); background: var(--surface-hover); outline: none; }
.ct-label-input[data-locked-label="1"] { color: var(--text); }

.ct-type-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-hover);
  border-radius: 99px;
  padding: 4px 10px;
  text-align: center;
  white-space: nowrap;
  justify-self: start;
}

.ct-visible-state {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

/* YouTube Card Template — checkbox + Card only pill */
.ct-yt-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.ct-card-only-btn {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.ct-card-only-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ct-card-only-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.ct-card-only-btn:not(.active):not(:disabled):hover { background: var(--surface-hover); }
.ct-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.ct-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.yt-card-template .card-template-row {
  grid-template-columns: 28px 1fr 90px 110px 110px;
}

/* Stage options editor (inside form modal) */
.ct-stage-editor-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.ct-stage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ct-stage-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ct-stage-input {
  flex: 1;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}
.ct-stage-input:disabled { opacity: 0.7; cursor: not-allowed; }
.ct-stage-input:focus { border-color: var(--accent); outline: none; }
.ct-stage-lock {
  font-size: 14px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.ct-stage-remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.ct-stage-remove:hover { background: var(--surface-hover); color: #e05252; }
.ct-stage-add-btn { width: 100%; }

/* Color picker in modals */
.settings-color-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.settings-color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.1s, border-color 0.1s;
}

.settings-color-dot:hover { transform: scale(1.15); }
.settings-color-dot.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5), 0 0 0 3px var(--accent);
  transform: scale(1.15);
}

/* ── Deliverable channel mismatch ─────────────────────────────── */
.p-del-channel-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

.p-del-channel-mismatch .badge {
  background: rgba(240,136,62,0.2);
  border-color: rgba(240,136,62,0.5);
  color: #f0883e;
}

.del-ch-warn {
  font-size: 12px;
  color: #f0883e;
  cursor: help;
}


/* ── Admin table — role free-text + pending invites ───────────── */
.admin-table-head-3 {
  display: grid;
  grid-template-columns: 220px 1fr 180px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
}
.admin-table-row-3 {
  display: grid;
  grid-template-columns: 220px 1fr 180px;
  padding: 10px 14px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.admin-table-row-3:last-child { border-bottom: none; }

.admin-table-head-4 {
  display: grid;
  grid-template-columns: 220px 1fr 170px 110px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
}
.admin-table-row-4 {
  display: grid;
  grid-template-columns: 220px 1fr 170px 110px;
  padding: 10px 14px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.admin-table-row-4:last-child { border-bottom: none; }
.admin-access-cell { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.admin-access-btn {
  padding: 5px 14px;
  border-radius: 99px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.admin-access-btn:hover {
  opacity: 0.85;
}
.admin-view-only-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--surface-hover);
  color: var(--muted);
  border: 1px solid var(--border);
}

.admin-role-title-cell { display: flex; align-items: center; }
.admin-role-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.admin-role-input:hover {
  border-color: var(--border);
  background: var(--surface-hover);
}
.admin-role-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-hover);
}
.admin-role-input::placeholder { color: var(--muted); font-style: italic; }

.admin-pending-header {
  padding: 8px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-hover);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.admin-pending-row { opacity: 0.85; }
.admin-pending-badge {
  display: inline-block;
  background: rgba(240,136,62,0.2);
  color: #f0883e;
  border-radius: 99px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 5px;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.04em;
}
.admin-av-pending {
  background: var(--surface-hover);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── My Profile section ─────────────────────────────────────────── */
.profile-av-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.profile-av-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}
.profile-av-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-av-init {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
}
.profile-av-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: 50%;
}
.profile-av-wrap:hover .profile-av-overlay { opacity: 1; }

.profile-form { display: flex; flex-direction: column; gap: 16px; }
.profile-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-field { display: flex; flex-direction: column; gap: 5px; }
.profile-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
}
.profile-input {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13.5px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.profile-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

/* Clickable avatar in team list */
.admin-av-clickable {
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  border-radius: 50%;
}
.admin-av-clickable:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--accent);
}

/* ── Thumbnails Tab ──────────────────────────────────────────────── */
.panel-thumbs {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  flex-direction: column;
  min-height: 0;
}
/* Three thumbnails side by side at the top */
.thumb-tab-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.thumb-tab-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Unified comment area below thumbnails */
.thumb-comments-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.thumb-tab-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
}
.thumb-tab-preview {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16/9;
  background: var(--surface-hover);
  max-width: 100%;
}
.thumb-tab-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.thumb-tab-preview:hover .thumb-tab-img { transform: scale(1.02); }
.thumb-tab-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
.thumb-tab-preview:hover .thumb-tab-actions { opacity: 1; }
.thumb-tab-del, .thumb-tab-dl {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(6px);
}
.thumb-tab-del {
  background: rgba(220,38,38,0.85);
  color: #fff;
  border: none;
}
.thumb-tab-dl {
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-weight: 700;
}
.thumb-tab-del:hover { background: rgba(220,38,38,1); }
.thumb-tab-dl:hover  { background: rgba(0,0,0,0.85); }

.thumb-tab-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16/9;
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  gap: 6px;
  color: var(--muted);
}
.thumb-tab-upload:hover { border-color: var(--accent); background: var(--accent-dim); }

/* Comment delete button */
.thumb-comment { position: relative; }
.thumb-comment-del {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.12s;
  padding: 4px;
  color: var(--muted);
}
.thumb-comment:hover .thumb-comment-del { opacity: 1; }
.thumb-comment-del:hover { color: var(--danger); }

/* ── Thumbnail Lightbox ──────────────────────────────────────────── */
.thumb-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
.thumb-lb-img-wrap {
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb-lb-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.thumb-lb-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 10000;
}
.thumb-lb-close:hover { background: rgba(255,255,255,0.3); }
.thumb-lb-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 32px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 10000;
}
.thumb-lb-arrow:hover { background: rgba(255,255,255,0.25); }
.thumb-lb-prev { left: 20px; }
.thumb-lb-next { right: 20px; }
.thumb-lb-download {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 99px;
  transition: all 0.15s;
}
.thumb-lb-download:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

/* ── Brand Tab ──────────────────────────────────────────────────── */
.panel-brand {
  flex: 1;
  overflow-y: auto;
  flex-direction: column;
  min-height: 0;
  padding: 20px 28px;
}

/* Small brand reference badge in Item Card */
.brand-ref-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
}
.brand-ref-icon { font-size: 14px; }
.brand-ref-name { font-weight: 600; color: var(--text); }
.brand-ref-status {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  font-family: 'Inter', sans-serif;
}

/* Brand tab empty state */
.brand-tab-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  text-align: center;
  flex: 1;
}
.brand-tab-empty-icon { font-size: 36px; }
.brand-tab-empty-title { font-size: 15px; font-weight: 700; font-family: 'Inter', sans-serif; }
.brand-tab-empty-desc { font-size: 13px; color: var(--muted); max-width: 280px; line-height: 1.5; }

/* Brand tab content */
.brand-tab-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}
.brand-tab-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.brand-tab-brand-name {
  font-size: 17px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}
.brand-tab-deal-status {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.brand-tab-action-btn { font-size: 12px !important; padding: 4px 10px !important; }

/* Deliverable fields grid */
.brand-tab-fields {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}
.brand-field-row {
  display: contents; /* each child becomes a direct row in the parent */
}
/* Each field is a horizontal label + value row */
.brand-field {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  min-height: 38px;
}
.brand-field:last-child { border-bottom: none; }
.brand-field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  flex-shrink: 0;
}
.brand-field-value {
  font-size: 13.5px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}
.brand-field-select {
  font-size: 13px !important;
  padding: 5px 8px !important;
  width: 100%;
}
.brand-field-mismatch .brand-field-value {
  background: rgba(240,136,62,0.08);
  border-radius: 6px;
  padding: 4px 6px;
}
/* Invoice section divider row */
.brand-field-section-row {
  padding: 10px 0 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.brand-field-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
}

/* ── Brand tab colored elements ─────────────────────────────────── */
.brand-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  background: rgba(91,142,240,0.15);
  color: #5b8ef0;
  border: 1px solid rgba(91,142,240,0.3);
}

.brand-talent-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12.5px;
  font-family: 'DM Sans', sans-serif;
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
}

.brand-amount-value {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #4caf76 !important;
  font-family: 'Inter', sans-serif !important;
}

/* Clickable colored pill that IS the select — no duplicate badge */
.brand-stage-pill {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 99px;
  font-size: 11.5px;
  padding: 4px 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  border: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='currentColor' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  transition: opacity 0.12s;
}
.brand-stage-pill:hover { opacity: 0.85; }
.brand-stage-pill:focus { outline: 2px solid rgba(255,255,255,0.4); outline-offset: 1px; }

/* ── View-only mode — hide create/edit/delete affordances ────────── */
#app[data-view-only="true"] #add-video-btn,
#app[data-view-only="true"] #p-add-btn,
#app[data-view-only="true"] #add-resource-cat-btn,
#app[data-view-only="true"] .resource-add-btn,
#app[data-view-only="true"] .resource-edit-btn,
#app[data-view-only="true"] .resource-delete-btn,
#app[data-view-only="true"] .resource-save-btn,
#app[data-view-only="true"] .resource-cat-menu-btn,
#app[data-view-only="true"] #p-add-contact-btn,
#app[data-view-only="true"] #settings-add-channel-btn,
#app[data-view-only="true"] #settings-add-resource-cat-btn,
#app[data-view-only="true"] #settings-add-field-btn,
#app[data-view-only="true"] #cal-add-ondeck,
#app[data-view-only="true"] #p-add-lead-btn,
#app[data-view-only="true"] #show-add-form,
#app[data-view-only="true"] #show-add-form-inv,
#app[data-view-only="true"] #btn-save,
#app[data-view-only="true"] #btn-archive,
#app[data-view-only="true"] #btn-delete,
#app[data-view-only="true"] #btn-restore,
#app[data-view-only="true"] #fp-save,
#app[data-view-only="true"] #fp-archive,
#app[data-view-only="true"] #fp-delete,
#app[data-view-only="true"] #p-activate-btn,
#app[data-view-only="true"] #p-complete-btn {
  display: none !important;
}

#app[data-view-only="true"] .stage-badge,
#app[data-view-only="true"] .col-channel,
#app[data-view-only="true"] .col-date,
#app[data-view-only="true"] .milanote-edit-btn,
#app[data-view-only="true"] .studio-person-cell,
#app[data-view-only="true"] .p-talent-cell,
#app[data-view-only="true"] .p-del-type-select,
#app[data-view-only="true"] .p-del-stage-select,
#app[data-view-only="true"] .p-pay-select,
#app[data-view-only="true"] .p-link-video-btn,
#app[data-view-only="true"] .p-row-menu-btn,
#app[data-view-only="true"] .chip-remove-btn {
  pointer-events: none !important;
  cursor: default !important;
  opacity: 0.7;
}
.brand-stage-pill { width: fit-content; }
