/* LinkUp Organizer Portal — light theme, matching the iOS app's design
   philosophy: brand-blue gradient (#2455F0 → #1636B0), white rounded cards on a
   soft grouped background, the LinkUp logo, monday.com-style grouped boards. */

:root {
  --bg: #eef1f7;
  --bg-2: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f1f4fa;
  --surface-3: #e7ecf5;
  --border: #e6e9f1;
  --border-2: #d4dae6;
  --text: #0f1422;
  --text-2: #5a6678;
  --text-3: #8a93a6;
  --blue: #2455f0;
  --blue-dark: #1636b0;
  --blue-2: #1636b0;
  --blue-dim: rgba(36, 85, 240, .10);
  --grad: linear-gradient(135deg, #2455f0, #1636b0);
  --green: #0f9d58;
  --orange: #e8920a;
  --red: #e0533d;
  --purple: #7a5bf0;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(20, 30, 60, .10);
  --shadow-lg: 0 18px 50px rgba(20, 30, 60, .16);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; font-size: 14px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--text-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  cursor: pointer; padding: 9px 15px; border-radius: 10px; border: 1px solid transparent;
  transition: filter .15s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; padding: 12px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(36, 85, 240, .28); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: #fff; color: #d8412a; border-color: rgba(224, 83, 61, .35); }
.btn-danger:hover { background: rgba(224, 83, 61, .07); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-google { background: #fff; color: var(--text); border: 1px solid var(--border-2); }
.btn-google:hover { background: var(--surface-2); }
.btn-google img { width: 18px; height: 18px; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); cursor: pointer; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

/* ---------- inputs ---------- */
.input, .field input, .field select, .field textarea { width: 100%; font: inherit; color: var(--text);
  background: #eef2f8; border: 1.5px solid #c2cbd9; border-radius: 10px; padding: 11px 13px; outline: none; }
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: #98a2b4; }
.field textarea { resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px var(--blue-dim); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: #3b4658; font-weight: 700; }
.field small { font-size: 11.5px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inline { display: flex; gap: 8px; }
.search { min-width: 200px; }
.form-error { background: rgba(224, 83, 61, .1); color: #c23a25; padding: 9px 12px; border-radius: 9px; font-size: 13px; }
.form-notice { background: var(--blue-dim); color: var(--blue-dark); padding: 9px 12px; border-radius: 9px; font-size: 13px; }

/* ---------- auth ---------- */
.auth-screen { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1100px 560px at 50% -10%, rgba(36, 85, 240, .14), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); margin-bottom: 20px; }
.auth-logo:hover { text-decoration: none; }
.logo-img { width: 34px; height: 34px; }
.logo-tag { font-size: 12px; color: var(--text-3); font-weight: 600; }
.auth-card h1 { font-size: 23px; }
.auth-sub { color: var(--text-2); margin: 4px 0 18px; }
.oauth-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 4px 0 14px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-switch { margin-top: 16px; text-align: center; color: var(--text-2); font-size: 13px; }
.auth-fine { margin-top: 18px; color: var(--text-3); font-size: 11.5px; text-align: center; line-height: 1.6; }

/* ---------- app shell ---------- */
.app-shell { display: grid; grid-template-columns: 236px 1fr; height: 100vh; }
.app-shell.nav-collapsed { grid-template-columns: 66px 1fr; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 14px 12px; gap: 6px; }
.side-org { display: flex; align-items: center; gap: 10px; padding: 4px 6px 13px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.org-avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.org-meta { min-width: 0; flex: 1; }
.org-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-kind { font-size: 11px; color: var(--text-3); }
.nav-collapsed .org-meta, .nav-collapsed .ni-l, .nav-collapsed .side-foot, .nav-collapsed #sidebarToggle { display: none; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 10px; background: none; border: none;
  color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; text-align: left; width: 100%; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--blue-dim); color: var(--blue); }
.ni-ic { width: 20px; text-align: center; font-size: 16px; flex: none; }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.side-link { font-size: 12.5px; color: var(--text-3); }
.side-logo { width: 20px; height: 20px; opacity: .9; }

.main { overflow: auto; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 13px 24px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 18px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.acct { position: relative; }
.acct-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.acct-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--grad); }
.acct-menu { position: absolute; right: 0; top: 42px; width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; flex-direction: column; }
.acct-menu.open { display: flex; }
.acct-menu a, .acct-signout { padding: 9px 11px; border-radius: 8px; color: var(--text); background: none; border: none; text-align: left; font: inherit; cursor: pointer; }
.acct-menu a:hover, .acct-signout:hover { background: var(--surface-2); text-decoration: none; }
.acct-signout { color: #d8412a; }
.acct-name { padding: 8px 11px; font-size: 12px; color: var(--text-3); border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- tabs ---------- */
.tab { display: none; padding: 22px 24px 60px; }
.tab.active { display: block; }
.tab-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.tab-head h2 { font-size: 21px; }
.tab-sub { color: var(--text-2); margin: 3px 0 0; font-size: 13px; }
.tab-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; padding: 3px; }
.seg button { background: none; border: none; color: var(--text-2); padding: 6px 12px; border-radius: 7px; font: inherit; font-weight: 600; cursor: pointer; }
.seg button.active { background: var(--grad); color: #fff; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h3 { font-size: 14.5px; margin-bottom: 12px; }
.empty-card { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 42px; margin-bottom: 10px; }
.empty-card h2 { font-size: 18px; margin-bottom: 6px; }
.empty-card p { color: var(--text-2); max-width: 460px; margin: 0 auto 16px; line-height: 1.6; }
.loading-row { color: var(--text-2); padding: 28px; text-align: center; }

/* ---------- dashboard ---------- */
.dash-grid { display: flex; flex-direction: column; gap: 16px; }
.kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--c, var(--blue)); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); }
.kpi-v { font-size: 24px; font-weight: 800; }
.kpi-l { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.dash-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-box { height: 230px; position: relative; }
.chart-box.donuts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash-skel { height: 90px; border-radius: var(--radius); background: linear-gradient(90deg, #eef1f7, #f6f8fc, #eef1f7); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.track-list { display: flex; flex-direction: column; }
.track-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.track-row:last-child { border-bottom: none; }
.rank { width: 24px; height: 24px; border-radius: 50%; background: var(--blue-dim); color: var(--blue); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.track-main { flex: 1; min-width: 0; }
.track-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-sub { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-end { text-align: right; } .track-end b { font-size: 15px; }
.track-rev { display: block; font-size: 11px; color: var(--green); }
.track-time { font-size: 11.5px; color: var(--text-3); }

.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--blue-dim); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.pill-in { background: rgba(15, 157, 88, .12); color: #0c7a45; }
.pill-out { background: var(--surface-3); color: var(--text-2); }
.pill-warn { background: rgba(232, 146, 10, .14); color: #b9740a; }

/* ---------- CRM board (monday-style) ---------- */
.crm-board { display: flex; flex-direction: column; gap: 30px; }
.board-skel { height: 130px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.crm-empty { text-align: center; padding: 60px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.crm-empty-icon { font-size: 46px; color: var(--blue); }
.crm-empty h2 { font-size: 20px; margin: 12px 0 6px; }
.crm-empty p { color: var(--text-2); max-width: 520px; margin: 0 auto 18px; line-height: 1.6; }
.crm-empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.crm-group { border-radius: 8px; }
.crm-group.drop-target .crm-table-wrap { box-shadow: 0 0 0 2px var(--g) inset; }
.crm-group-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 8px; }
.crm-collapse { background: none; border: none; color: var(--g); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.crm-group-name { font-weight: 700; color: var(--g); font-size: 15px; outline: none; padding: 2px 6px; border-radius: 6px; }
.crm-group-name[contenteditable="true"] { background: var(--surface-2); box-shadow: 0 0 0 1px var(--g); }
.crm-group-count { color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.crm-group-spacer { flex: 1; }
.crm-group-menu { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 18px; padding: 0 6px; border-radius: 6px; }
.crm-group-menu:hover { background: var(--surface-2); color: var(--text); }

.crm-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-left: 3px solid var(--g); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.crm-table { border-collapse: collapse; width: 100%; min-width: 900px; font-size: 13.5px; }
.crm-table th, .crm-table td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 0; text-align: left; }
.crm-table th { background: var(--bg-2); color: var(--text-2); font-weight: 600; font-size: 12.5px; padding: 12px 14px; position: sticky; top: 0; }
.crm-table th.num, .crm-table td.num { text-align: right; }
.crm-colrow th:first-child, .crm-grip { width: 34px; }
.crm-grip { color: var(--text-3); text-align: center; cursor: grab; user-select: none; font-size: 11px; }
.crm-row:hover td { background: #f8fafd; }
.crm-row.dragging { opacity: .4; }
.crm-cell { padding: 13px 14px; cursor: text; max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-cell.primary { font-weight: 600; color: var(--text); }
.crm-cell.editing { padding: 0; }
.crm-cell:hover { box-shadow: 0 0 0 1px var(--border-2) inset; }
.cell-empty { color: var(--text-3); }
.cell-input { width: 100%; border: none; background: #fff; color: var(--text); font: inherit; padding: 13px 13px; outline: 2px solid var(--blue); }
.cell-link { color: var(--blue); }
.label-cell { cursor: pointer; }
.chip { display: inline-block; background: var(--c); color: #fff; font-weight: 600; font-size: 11.5px; padding: 3px 10px; border-radius: 20px; }
.crm-sumrow td { background: var(--bg-2); padding: 10px 14px; color: var(--text-2); font-size: 12.5px; }
.crm-add-row { display: block; width: 100%; text-align: left; background: var(--surface); border: none; border-top: 1px solid var(--border); color: var(--text-3); padding: 12px 16px; cursor: pointer; font: inherit; border-radius: 0 0 8px 8px; }
.crm-add-row:hover { color: var(--blue); background: var(--surface-2); }
/* live event groups + read-only rows */
.crm-section-label { margin: 8px 2px -8px; font-weight: 700; font-size: 13px; color: var(--text-2); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-top: 8px; border-top: 1px dashed var(--border-2); }
.crm-section-label span { font-weight: 500; font-size: 12px; color: var(--text-3); }
.crm-live { font-size: 10.5px; font-weight: 700; color: var(--green); background: rgba(15, 157, 88, .12); padding: 2px 7px; border-radius: 20px; }
.crm-group.is-event .crm-table-wrap { background: var(--bg-2); }
.crm-row.ro .crm-grip { cursor: default; }
.crm-cell.ro { cursor: default; }
.crm-cell.ro:hover { box-shadow: none; }
.crm-promote { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--surface); color: var(--blue); font-size: 15px; font-weight: 700; line-height: 1; cursor: pointer; }
.crm-promote:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
/* event-specific attendee board cells */
.att-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.att-name span { overflow: hidden; text-overflow: ellipsis; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.crm-cell.att-actions { overflow: visible; }
.att-actions-inner { display: flex; gap: 6px; }

/* popover menus */
.popover { position: fixed; z-index: 200; background: var(--surface); border: 1px solid var(--border-2); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 5px; min-width: 150px; max-height: 320px; overflow: auto; }
.pop-item { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text); padding: 8px 11px; border-radius: 7px; cursor: pointer; font: inherit; }
.pop-item:hover { background: var(--surface-2); }
.pop-item.danger { color: #d8412a; }
.pop-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ---------- events ---------- */
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ev-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.ev-banner { aspect-ratio: 2 / 1; background: var(--grad); background-size: cover; background-position: center; position: relative; }
.ev-cat, .ev-vis { position: absolute; top: 10px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: rgba(0, 0, 0, .5); color: #fff; }
.ev-cat { left: 10px; } .ev-vis { right: 10px; }
.ev-body { padding: 13px; flex: 1; }
.ev-title { font-weight: 700; font-size: 15px; margin-bottom: 7px; }
.ev-meta { display: flex; flex-direction: column; gap: 3px; color: var(--text-2); font-size: 12.5px; }
.ev-stats { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.ev-actions { display: flex; gap: 6px; padding: 11px 13px; border-top: 1px solid var(--border); }
.ev-actions .btn { flex: 1; }

.cal-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.cal-bar { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 14px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-wd { text-align: center; color: var(--text-3); font-size: 11px; font-weight: 700; padding-bottom: 4px; }
.cal-cell { min-height: 78px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 5px; }
.cal-empty { background: none; border: none; }
.cal-today { box-shadow: 0 0 0 1.5px var(--blue) inset; }
.cal-daynum { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.cal-chip { display: block; width: 100%; text-align: left; background: var(--blue-dim); color: var(--blue); border: none; border-radius: 6px; padding: 3px 6px; font-size: 11px; margin-bottom: 3px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* people / stats (manage modal, team) */
.people { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.people-head { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.person { display: flex; align-items: center; gap: 11px; padding: 9px 11px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; }
.person-info { flex: 1; min-width: 0; }
.person-info .n { font-weight: 600; }
.person-info .s { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-actions { display: flex; gap: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-tile { background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; padding: 12px; text-align: center; }
.stat-tile .v { font-size: 19px; font-weight: 800; }
.stat-tile .l { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.team-list { display: flex; flex-direction: column; gap: 8px; }
.team-pending { margin-top: 16px; }
.team-pending-h { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.settings-card { max-width: 600px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 14px; }
.kv { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 12px; }
.kv span { color: var(--text-2); }
.link-row { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center;
  background: rgba(15, 22, 40, .42); backdrop-filter: blur(3px); padding: 28px 24px; overflow: auto; }
.modal.open { display: flex; }
.modal-card { width: 100%; max-width: 540px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); }
.modal-card.wide { max-width: 760px; }

/* Manage-attendees opens as a near-fullscreen sheet — lots of room for the roster. */
#manageModal .modal-card { max-width: none; width: 100%; min-height: calc(100vh - 56px);
  display: flex; flex-direction: column; }
#manageModal .modal-body { flex: 1; padding: 24px 28px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.modal-x { background: none; border: none; color: var(--text-2); font-size: 17px; cursor: pointer; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-sub { color: var(--text-2); font-size: 13px; line-height: 1.6; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.banner-drop { border: 1.5px dashed var(--border-2); border-radius: 11px; min-height: 90px; display: grid; place-items: center; cursor: pointer; color: var(--text-3); overflow: hidden; text-align: center; padding: 10px; }
.banner-preview { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 8px; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-wrap { overflow: auto; max-height: 60vh; border: 1px solid var(--border); border-radius: 11px; }
table.sheet { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.sheet th, table.sheet td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
table.sheet th { background: var(--bg-2); position: sticky; top: 0; }
table.sheet td.empty-cell { color: var(--text-3); } table.sheet td.wrap { white-space: normal; min-width: 160px; }

/* import flow */
.src-list { display: flex; flex-direction: column; gap: 10px; }
.src-card { text-align: left; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; }
.src-card:hover { border-color: var(--blue); background: #fff; box-shadow: var(--shadow); }
.src-name { font-weight: 700; margin-bottom: 3px; }
.src-detail { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
#importUrlRow { display: flex; gap: 8px; align-items: flex-end; }
#importUrlRow .field { flex: 1; }
.import-error { background: rgba(224, 83, 61, .1); color: #c23a25; padding: 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.map-row { display: flex; flex-direction: column; gap: 5px; }
.map-row span { font-size: 12px; color: var(--text-2); font-weight: 600; }
.map-row select { padding: 7px 9px; }
.map-preview-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px; max-height: 230px; }
.map-preview { border-collapse: collapse; width: 100%; font-size: 12px; }
.map-preview th, .map-preview td { border-bottom: 1px solid var(--border); padding: 6px 9px; text-align: left; white-space: nowrap; }
.map-preview th { background: var(--bg-2); color: var(--text-2); position: sticky; top: 0; }
.invite-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-height: 50vh; overflow: auto; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #11151f; color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 600; transition: opacity .2s, transform .2s; z-index: 300; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: #0c7a45; }
.toast.err { background: #c23a25; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .dash-2col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; height: 100vh; width: 236px; transform: translateX(-100%); transition: transform .2s; }
  .app-shell.nav-open .sidebar { transform: none; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .grid2, .map-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Profile tab ===== */
.pf-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .pf-grid { grid-template-columns: 1fr; } }
.pf-editor.pf-loading { opacity: .55; pointer-events: none; }
.pf-editor .field { margin-top: 12px; }
.pf-photo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.pf-avatar { width: 64px; height: 64px; flex: 0 0 64px; }
.pf-avatar .pf-avatar-img, .pf-avatar > div { width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff;
  background: var(--grad); font-size: 22px; }
.pf-hint { margin: 6px 0 0; font-size: 11.5px; }

.pf-posts { display: flex; flex-direction: column; gap: 16px; }
.pf-composer textarea { width: 100%; font: inherit; color: var(--text); resize: vertical;
  border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.pf-composer textarea:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px var(--blue-dim); outline: none; }
.pf-post-preview { display: block; max-height: 220px; border-radius: 10px; margin-top: 10px; object-fit: cover; }
.pf-composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.pf-composer-tools { display: flex; gap: 8px; }

.pf-feed { display: flex; flex-direction: column; gap: 12px; }
.pf-skel { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2));
  background-size: 200% 100%; animation: pf-shimmer 1.4s infinite; }
@keyframes pf-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.pf-empty { text-align: center; padding: 36px 20px; color: var(--text-2); background: var(--surface);
  border: 1px dashed var(--border-2); border-radius: var(--radius); font-size: 13.5px; }

.pf-post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; }
.pf-repost-tag { font-size: 12px; font-weight: 700; color: var(--blue); margin-bottom: 6px; }
.pf-post-text { white-space: pre-wrap; line-height: 1.55; font-size: 14px; }
.pf-post-img { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin-top: 10px; }
.pf-post-tagged { font-size: 12px; color: var(--text-2); margin-top: 8px; }
.pf-post-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.pf-post-time { font-size: 12px; color: var(--text-2); }

/* org profile photo in sidebar + topbar avatars */
.org-avatar.has-photo { background: none; overflow: hidden; }
.org-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.acct-btn img.acct-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
