/* Partners — visual language mirrors speakers.html (same tokens, masthead,
   filter bar, table pane, pills, modal) so the two tabs read as one product. */
:root {
  --blue: #003366;
  --blue-mid: #005EB8;
  --blue-soft: #EBF2FC;
  --red: #FF3B30;
  --red-soft: #FFF0EF;
  --green: #34C759;
  --green-soft: #E8F9ED;
  --amber: #FF9500;
  --amber-soft: #FFF4E0;
  --ink: #1C1C1E;
  --ink-soft: #48484A;
  --ink-muted: #8E8E93;
  --surface: #FFFFFF;
  --surface-2: #F2F2F7;
  --surface-3: #E5E5EA;
  --border: rgba(0,0,0,0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: -apple-system, 'Figtree', 'SF Pro Display', sans-serif; background: var(--surface-2); color: var(--ink); min-height: 100vh; }
.nav { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 60px; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.nav-brand { font-size: 18px; font-weight: 700; color: var(--blue); letter-spacing: -0.4px; text-decoration: none; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; }
.nav-brand:hover { background: var(--blue-soft); }
.home-icon { font-size: 14px; color: var(--blue-mid); }
.brand-tail { color: var(--ink-muted); font-weight: 600; }
.nav-brand-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; }
.nav-right { display: flex; align-items: center; gap: 4px; }
.nav-link { font-size: 14px; font-weight: 500; color: var(--ink-soft); text-decoration: none; padding: 7px 14px; border-radius: var(--radius-sm); transition: background 0.15s, color 0.15s; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { color: var(--blue); font-weight: 600; background: var(--blue-soft); }

.page { max-width: 1600px; margin: 0 auto; padding: 32px 32px; }
.btn-sm { padding: 8px 16px; font-size: 13px; font-weight: 600; border-radius: 8px; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.btn-primary { background: var(--blue); color: white; border: none; }
.btn-primary:hover { background: #002244; }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-secondary { background: white; color: var(--ink-soft); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--surface-2); }

/* PAGE HEADER — dark masthead strip matching Speakers and the dashboard */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; padding: 20px 24px; border-radius: var(--radius); color: #fff; background: linear-gradient(135deg, rgba(7,20,38,.98) 0%, rgba(11,46,74,.96) 48%, rgba(14,124,123,.90) 100%); box-shadow: 0 14px 36px rgba(7,20,38,.16); }
.page-title { font-size: 24px; font-weight: 700; color: #fff; letter-spacing: -0.3px; }
.page-count { font-size: 13px; color: rgba(255,255,255,.68); margin-top: 3px; }
.header-stats { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.stat-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 12px; font-weight: 600; color: rgba(255,255,255,.9); cursor: pointer; transition: background 0.15s, border-color 0.15s; font-family: inherit; }
.stat-chip:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); }
.stat-chip.active { background: rgba(255,255,255,.92); color: var(--ink); }
.stat-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.stat-dot-all { background: #61DAD3; }
.stat-dot-invited { background: #5AA9FF; }
.stat-dot-accepted { background: #C084FC; }
.stat-dot-live { background: #34C759; }
.stat-dot-due { background: #FFB020; }
.stat-dot-unset { background: rgba(255,255,255,.45); }
.stat-chip.active .stat-dot-unset { background: rgba(0,0,0,.3); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-add { padding: 10px 20px; font-size: 14px; font-weight: 600; background: rgba(255,255,255,.94); color: var(--blue); border: none; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 8px; transition: background 0.15s, box-shadow 0.15s; }
.btn-add:hover { background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.25); }

/* FILTER BAR */
.filter-bar { background: var(--surface); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tab { padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--border); background: white; color: var(--ink-muted); transition: all 0.15s; font-family: inherit; }
.filter-tab.active { background: var(--blue); color: white; border-color: var(--blue); }
.filter-tab:hover:not(.active) { background: var(--surface-2); color: var(--ink); }
.filter-tab .filter-count { margin-left: 5px; opacity: .7; font-weight: 600; }
.org-filter { padding: 8px 14px; border: 1.5px solid var(--surface-3); border-radius: 20px; font-size: 13px; font-weight: 600; font-family: inherit; color: var(--ink); background: white; cursor: pointer; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.org-filter:first-of-type { margin-left: auto; }
.org-filter:focus { border-color: var(--blue); }
.filter-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; padding: 6px 10px; border-radius: 20px; border: 1.5px solid var(--surface-3); background: white; }
.filter-check input { accent-color: var(--blue); }
.search-input { padding: 8px 14px; border: 1.5px solid var(--surface-3); border-radius: 20px; font-size: 13px; font-family: inherit; width: 240px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.search-input:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(0,94,184,0.1); }

/* TABLE — spreadsheet pane: sticky header + frozen name column */
.table-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: auto; max-height: calc(100vh - 300px); min-height: 320px; }
table { width: 100%; min-width: 1480px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
thead th { padding: 12px 16px; font-size: 11px; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.6px; text-align: left; background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; white-space: nowrap; }
tbody tr { transition: background 0.12s, box-shadow 0.12s; }
tbody tr:nth-child(even) { background: #FAFAFA; }
tbody tr:hover { background: var(--blue-soft); box-shadow: inset 0 0 0 1px rgba(0,94,184,0.16), inset 3px 0 0 var(--blue-mid); }
tbody td { padding: 11px 16px; font-size: 13px; color: var(--ink-soft); border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
.name-col { position: sticky; left: 0; z-index: 1; background: var(--surface); border-right: 1px solid var(--border); }
tbody tr:nth-child(even) .name-col { background: #FAFAFA; }
tbody tr:hover .name-col { background: var(--blue-soft); }
thead th.name-col { background: var(--surface-2); z-index: 3; }

.partner-name-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.partner-name-text { min-width: 0; flex: 1; }
.td-name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.td-name:hover { color: var(--blue-mid); text-decoration: underline; }
.td-org { font-size: 12px; color: var(--ink-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-org.editable-inline { cursor: pointer; border-radius: 6px; }
.td-org.editable-inline:hover { background: rgba(0,94,184,0.06); color: var(--ink-soft); }

/* Logo tile — the partner's "avatar". Real logo on a white tile, monogram otherwise. */
.partner-logo { width: 40px; height: 40px; border-radius: 10px; flex: 0 0 40px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; border: 1px solid var(--border); padding: 4px; }
.partner-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.partner-logo.logo-dark { background: #0B2E4A; border-color: #0B2E4A; }
.partner-monogram { padding: 0; border: none; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.2px; background: var(--blue); }
.partner-monogram.cat-kp { background: #003366; }
.partner-monogram.cat-ap { background: #6B21A8; }
.partner-monogram.cat-sp { background: #1A7A3C; }
.partner-monogram.cat-ip { background: #B05000; }
.partner-monogram.cat-others, .partner-monogram.cat-none { background: #6E6E73; }
/* Status ring — readable at a glance while scrolling, as on Speakers */
.partner-logo.ring-live-on-website { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--green); }
.partner-logo.ring-accepted, .partner-logo.ring-partner-kit-shared { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #A855F7; }
.partner-logo.ring-invited { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue-mid); }
.partner-logo.ring-declined { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--red); }
.partner-logo.ring-on-hold { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--amber); }
.partner-logo.ring-not-invited, .partner-logo.ring-unset { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--surface-3); }

/* Contacts — stacked list, up to two visible, click to manage all in the dialog */
.contact-list { display: flex; flex-direction: column; gap: 6px; cursor: pointer; border-radius: 8px; padding: 2px 4px; margin: -2px -4px; }
.contact-list:hover { background: rgba(0,94,184,0.06); }
.contact-row { min-width: 0; line-height: 1.3; }
.contact-name { font-weight: 600; color: var(--ink); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-name .contact-designation { font-weight: 500; color: var(--ink-muted); }
.contact-email { font-size: 12px; color: var(--blue-mid); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-more { font-size: 11px; color: var(--ink-muted); font-weight: 600; }
.contact-empty { color: var(--ink-muted); font-size: 12px; }

/* Editable cells */
.editable-cell { cursor: pointer; position: relative; border-radius: 8px; }
.editable-cell:hover { background: rgba(0,94,184,0.06); }
.editable-cell::after { content: '✎'; opacity: 0; color: var(--ink-muted); font-size: 11px; margin-left: 6px; transition: opacity 0.15s; }
.editable-cell:hover::after { opacity: 1; }
.editable-cell[data-editing]::after { display: none; }
.inline-input, .inline-textarea, .inline-select { width: 100%; border: 1.5px solid var(--blue-mid); border-radius: 8px; padding: 6px 8px; font: inherit; color: var(--ink); background: white; outline: none; }
.inline-textarea { min-height: 54px; resize: vertical; }
.remarks-cell { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remarks-empty { color: var(--ink-muted); }
.td-date { white-space: nowrap; }
.td-date.overdue { color: #B05000; font-weight: 600; }
.td-date.overdue::before { content: '⚑ '; }
.owner-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.owner-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); color: var(--ink-soft); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 24px; overflow: hidden; }
.owner-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.owner-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.website-link { font-size: 12px; font-weight: 600; color: var(--blue-mid); text-decoration: none; white-space: nowrap; }
.website-link:hover { color: var(--blue); text-decoration: underline; }

/* BADGES + STATUS PILLS */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-kp { background: #EBF2FC; color: #003366; }
.badge-ap { background: #F3E8FF; color: #6B21A8; }
.badge-sp { background: #E8F9ED; color: #1A7A3C; }
.badge-ip { background: #FFF4E0; color: #B05000; }
.badge-others { background: var(--surface-2); color: var(--ink-soft); }
.badge-none { background: transparent; color: var(--ink-muted); border: 1.5px dashed var(--surface-3); }
.badge-not-invited { background: var(--surface-2); color: var(--ink-muted); }
.badge-invited { background: var(--blue-soft); color: var(--blue-mid); }
.badge-accepted { background: #F3E8FF; color: #6B21A8; }
.badge-partner-kit-shared { background: #E0F2FE; color: #0369A1; }
.badge-live-on-website { background: var(--green-soft); color: #1A7A3C; }
.badge-on-hold { background: var(--amber-soft); color: #B05000; }
.badge-declined { background: var(--red-soft); color: var(--red); }
.badge-unset { background: transparent; color: var(--ink-muted); border: 1.5px dashed var(--surface-3); }
.status-pill, .category-pill { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; transition: box-shadow 0.14s, transform 0.1s; }
.status-pill::after, .category-pill::after { content: '▾'; font-size: 9px; opacity: 0.45; }
.status-pill:hover, .category-pill:hover { box-shadow: 0 0 0 2px rgba(0,94,184,0.18); }
.status-pill:active, .category-pill:active { transform: scale(0.97); }
.read-only .status-pill, .read-only .category-pill { cursor: default; }
.read-only .status-pill::after, .read-only .category-pill::after, .read-only .editable-cell::after { display: none; }
.read-only .editable-cell, .read-only .contact-list, .read-only .td-org.editable-inline { cursor: default; background: none; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 64px 24px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.empty-desc { font-size: 14px; color: var(--ink-muted); margin-bottom: 24px; }
.skeleton-block { height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: white; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; transform: scale(0.96) translateY(10px); transition: transform 0.2s; }
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header { padding: 22px 24px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.modal-close { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: none; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; color: var(--ink-muted); }
.modal-close:hover { background: var(--surface-3); }
.modal-body { padding: 22px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.modal-footer .form-error { margin-right: auto; color: var(--red); font-size: 13px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.modal label { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.4px; }
.modal input[type="text"], .modal input[type="email"], .modal input[type="url"], .modal input[type="date"], .modal select, .modal textarea { padding: 10px 12px; border: 1.5px solid var(--surface-3); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; color: var(--ink); background: white; outline: none; transition: border-color 0.15s, box-shadow 0.15s; width: 100%; }
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(0,94,184,0.1); }
.modal textarea { resize: vertical; min-height: 80px; }
.modal-logo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.modal-logo { width: 64px; height: 64px; border-radius: 14px; flex: 0 0 64px; font-size: 16px; }
.modal-logo-row .form-field { flex: 1; gap: 0; }
.modal-logo-row input { font-weight: 600; font-size: 15px; }
.form-section { margin-bottom: 22px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.form-section-title .btn-xs { margin-left: auto; }
.hint { font-size: 12px; color: var(--ink-muted); margin-top: 8px; line-height: 1.5; }
.btn-xs { padding: 5px 12px; font-size: 12px; font-weight: 600; border-radius: 7px; cursor: pointer; font-family: inherit; transition: all 0.15s; text-transform: none; letter-spacing: 0; }

/* Contacts editor — one row per person: name, designation, email, remove */
.contact-editor { display: flex; flex-direction: column; gap: 10px; }
.contact-editor-row { display: grid; grid-template-columns: 1.1fr 1fr 1.3fr 32px; gap: 8px; align-items: center; padding: 10px; border: 1.5px dashed var(--surface-3); border-radius: var(--radius-sm); }
.contact-editor-row input { padding: 8px 10px; font-size: 13px; }
.contact-editor-row .icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--border); background: white; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; color: var(--ink-muted); }
.contact-editor-row .icon-btn:hover { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.contact-editor-empty { font-size: 13px; color: var(--ink-muted); padding: 6px 0; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); }
.history-item .badge { flex: 0 0 auto; }
.history-meta { color: var(--ink-muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.history-empty { font-size: 13px; color: var(--ink-muted); }
.modal fieldset { border: 0; min-width: 0; }
.modal fieldset:disabled input, .modal fieldset:disabled select, .modal fieldset:disabled textarea { background: var(--surface-2); color: var(--ink-soft); }

/* TOAST */
.toast { position: fixed; bottom: 28px; right: 28px; background: var(--ink); color: white; padding: 12px 20px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-md); z-index: 9999; transform: translateY(100px); opacity: 0; transition: all 0.25s; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.undo-btn { margin-left: 8px; border: none; background: rgba(255,255,255,0.18); color: #fff; border-radius: 6px; padding: 2px 8px; cursor: pointer; font: inherit; font-weight: 700; }

@media (max-width: 720px) {
  .page { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .contact-editor-row { grid-template-columns: 1fr 1fr; }
  .contact-editor-row input[data-contact="email"] { grid-column: 1 / 2; }
  .search-input { width: 100%; }
}
