* { box-sizing: border-box; margin: 0; }
:root {
  --bg: #0a0a0b; --bg-elev: #141417; --card: #141417;
  --navy: #ffffff; /* heading color — kept name for minimal diff, now light-on-dark */
  --ink: #ffffff; --text: #f4f4f6; --muted: #9a9aa4; --muted-dim: #6c6c76;
  --border: rgba(255,255,255,.12); --line-strong: rgba(255,255,255,.24);
  --mint: #e50914; --mint-dark: #b20710;
  --blue: #5976f0; --green: #34d399; --red: #ff5c56; --amber: #ffb300;
  --radius: 16px; --radius-sm: 8px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --glass-bg: linear-gradient(155deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  --glass-shadow: 0 8px 28px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.08);
}
:root[data-theme="light"] {
  --bg: #f2f3f6; --bg-elev: #ffffff; --card: #ffffff;
  --navy: #14151a;
  --ink: #14151a; --text: #20222b; --muted: #6b6f7b; --muted-dim: #9298a6;
  --border: rgba(10,10,20,.10); --line-strong: rgba(10,10,20,.22);
  --mint: #e50914; --mint-dark: #b20710;
  --blue: #3b5bdb; --green: #15803d; --red: #dc2626; --amber: #b45309;
  --glass-bg: linear-gradient(155deg, rgba(255,255,255,.92), rgba(255,255,255,.72));
  --glass-shadow: 0 8px 28px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.6);
}
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; transition: background .15s ease, color .15s ease; }
.hidden { display: none !important; }

/* Any plain <a> without its own color (e.g. inside block/note content) would otherwise fall
   back to the browser's default blue/purple — both low-contrast on this app's near-black
   dark background, and the default :visited purple especially so. Give unstyled links a
   theme-aware color instead; more specific rules elsewhere (.btn, #sidebar a, etc.) still win. */
a { color: var(--blue); }
a:visited { color: var(--blue); }
a:hover { filter: brightness(1.15); }

/* Login */
#login-screen {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background:
    radial-gradient(60% 55% at 82% 8%, rgba(89,118,240,.16), transparent 60%),
    radial-gradient(55% 50% at 12% 92%, rgba(229,9,20,.14), transparent 60%),
    var(--bg);
}
.login-card {
  background: var(--glass-bg); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border); box-shadow: var(--glass-shadow);
  padding: 44px; border-radius: var(--radius); width: 360px; text-align: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; text-transform: uppercase; letter-spacing: 2.5px;
  font-size: 12px; font-weight: 700; color: var(--mint); margin: 0 0 16px;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
#login-logo { width: 240px; margin: 0 auto 28px; }
.login-card input { width: 100%; margin-bottom: 12px; }
.login-card .btn { display: inline-block; width: 100%; box-sizing: border-box; text-decoration: none; margin-bottom: 12px; }

/* Layout */
#app { display: flex; min-height: 100vh; }
#sidebar { width: 240px; background: var(--bg-elev); color: #fff; display: flex; flex-direction: column; padding: 24px 0; position: fixed; top: 0; bottom: 0; border-right: 1px solid var(--border); }
#sidebar .brand { padding: 0 22px 24px; }
.brand-logo { display: block; height: auto; }
#sidebar-logo { width: 100%; }
#sidebar a { color: var(--muted); text-decoration: none; padding: 9px 22px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; border-left: 3px solid transparent; transition: color .15s ease, background .15s ease, border-color .15s ease; display: flex; align-items: center; gap: 9px; }
.nav-icon { width: 15px; height: 15px; flex-shrink: 0; }
#sidebar a:hover { background: rgba(255,255,255,.06); color: var(--ink); }
#sidebar a.active { background: rgba(229,9,20,.12); color: var(--ink); border-left-color: var(--mint); }
#sidebar .spacer { flex: 1; }
#main { flex: 1; margin-left: 240px; padding: 28px 32px; max-width: 1280px; }

/* Elements */
h2.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: var(--navy); margin-bottom: 18px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
input, select, textarea {
  padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 14px;
  font-family: inherit; background: rgba(255,255,255,.04); color: var(--ink);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--mint); outline-offset: -1px; }
textarea { width: 100%; resize: vertical; }
.btn {
  padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: rgba(255,255,255,.05);
  cursor: pointer; font-size: 13.5px; font-weight: 700; letter-spacing: .2px; color: var(--ink);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  text-decoration: none; display: inline-block;
}
.btn:hover { background: rgba(255,255,255,.11); border-color: #fff; transform: translateY(-1px); }
.btn.primary { background: var(--mint); color: #fff; border-color: var(--mint); }
.btn.primary:hover { background: var(--mint-dark); border-color: var(--mint-dark); }
.btn.danger { color: var(--red); }
.btn.small { padding: 5px 10px; font-size: 13px; }

.voice-search-btn { padding: 9px 12px; line-height: 1; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
/* !important: a light-mode :hover rule elsewhere is more specific than this and was masking the
   red "listening" state with hover-gray for as long as the mouse sat on the button post-click —
   which is exactly when this state most needs to be visible. */
.voice-search-btn.listening { background: var(--red) !important; border-color: var(--red) !important; color: #fff !important; animation: voice-pulse 1.2s ease-in-out infinite; }
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.45); }
  50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
}

.ask-ai-box {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--glass-bg); border: 1px solid var(--mint); box-shadow: var(--glass-shadow);
}
.ask-ai-icon { font-size: 16px; flex-shrink: 0; }
.ask-ai-box input { flex: 1; }
.ask-ai-box .btn.primary { flex-shrink: 0; }
.ask-ai-box .btn.primary:disabled { opacity: .6; cursor: default; transform: none; }
.ask-answer {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin: -6px 0 16px; padding: 10px 16px; border-radius: var(--radius-sm);
  background: rgba(229,9,20,.08); border: 1px solid rgba(229,9,20,.3); color: var(--ink); font-size: 13.5px; line-height: 1.5;
}
.ask-answer-clear { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 2px; flex-shrink: 0; }
.ask-answer-clear:hover { color: var(--ink); }

.card {
  background: var(--glass-bg); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--border); box-shadow: var(--glass-shadow); border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card h3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--navy); margin-bottom: 12px; }

/* Stats row */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--glass-bg); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--border); box-shadow: var(--glass-shadow); border-radius: var(--radius); padding: 16px 20px;
}
.stat .num { font-size: 28px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.stat .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-top: 4px; }
.stat.clickable { cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.stat.clickable:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.stat.active { border-color: var(--mint); box-shadow: 0 0 0 1px var(--mint); }

.stat-changes { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.change-badge { font-size: 11px; font-weight: 700; white-space: nowrap; }
.change-badge.up { color: var(--green); }
.change-badge.down { color: var(--red); }
.change-badge.flat { color: var(--muted); }
.change-label { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.chart-title-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.chart-title-row .stat-changes { margin-top: 0; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--bg-elev); border-radius: var(--radius); overflow: hidden; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.03); }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: rgba(255,255,255,.05); }
tr.lead-alert { background: rgba(255,92,86,.08); box-shadow: inset 3px 0 0 0 var(--red); }
tr.lead-alert:hover { background: rgba(255,92,86,.14); }
[data-theme="light"] tr.lead-alert { background: rgba(220,38,38,.06); }
[data-theme="light"] tr.lead-alert:hover { background: rgba(220,38,38,.1); }
tr.stale-alert { background: rgba(255,179,0,.08); box-shadow: inset 3px 0 0 0 var(--amber); }
tr.stale-alert:hover { background: rgba(255,179,0,.14); }
[data-theme="light"] tr.stale-alert { background: rgba(180,83,9,.07); }
[data-theme="light"] tr.stale-alert:hover { background: rgba(180,83,9,.12); }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; background: var(--bg-elev); }
.pagination { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.pagination .btn.small { min-width: 34px; text-align: center; }

/* Badges */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.09); color: var(--text); }
.badge.blue { background: rgba(89,118,240,.18); color: #a9b8ff; }
.badge.green { background: rgba(52,211,153,.16); color: #6be8b3; }
.badge.red { background: rgba(255,92,86,.16); color: #ff9c98; }
.badge.amber { background: rgba(255,179,0,.16); color: #ffd166; }
.badge.purple { background: rgba(168,85,247,.18); color: #d3a4ff; }
.badge.navy { background: var(--mint); color: #000; }
.badge.stale { background: transparent; color: var(--muted); border: 1px solid var(--line-strong); font-weight: 600; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(var(--stage-count, 6), minmax(0, 1fr)); gap: 10px; align-items: start; }
.kanban-col { min-width: 0; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.kanban-col h4 { font-size: 13px; font-weight: 700; color: var(--ink); padding: 4px 4px 10px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: space-between; }
.kanban-col h4 .sum { color: var(--muted); font-weight: 500; }
.deal-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 8px; cursor: grab; transition: border-color .15s ease; }
.deal-card:hover { border-color: var(--line-strong); }
.deal-card:active { cursor: grabbing; }
.deal-card .deal-name { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.deal-card .deal-meta { font-size: 12px; color: var(--muted); line-height: 1.5; }
.deal-card .deal-value { font-weight: 700; color: var(--green); font-size: 13px; margin-top: 4px; }
.kanban-col.drag-over { outline: 2px dashed var(--mint); }

/* Activity feed */
.feed-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: none; }
.feed-item.clickable { cursor: pointer; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--mint); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; object-fit: cover; }
.avatar.anon { background: rgba(255,255,255,.16); color: var(--muted); }
.feed-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.feed-body .who { font-weight: 700; color: var(--ink); }
.feed-body .what { color: var(--muted); font-size: 13px; }
.feed-time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* Traffic trend chart */
.chart-legend { display: flex; gap: 18px; justify-content: center; margin-top: 8px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* Newsletter editor */
.editor-layout { display: grid; grid-template-columns: 1fr 420px; gap: 20px; align-items: start; }
.design-colors { display: flex; flex-wrap: wrap; gap: 14px 20px; }
.design-colors label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.audience-checks { margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; max-height: 180px; overflow-y: auto; }
#modal .audience-checks label, .audience-checks label {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; color: var(--text); margin: 6px 0;
}
#modal .audience-checks input[type="checkbox"] { width: auto; flex: 0 0 auto; }
.product-cat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 2px; }
.product-cat-label:first-child { margin-top: 0; }
.cat-actions { display: flex; gap: 14px; margin: 0 0 8px; }
.cat-actions a { font-size: 12px; color: var(--muted); text-decoration: none; }
.cat-actions a:hover { text-decoration: underline; }
.cat-actions a.danger { color: var(--red); }
.block { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: var(--bg-elev); transition: border-color .15s ease, opacity .15s ease; }
.block.dragging { opacity: .4; }
.block.drag-over { border-color: var(--mint); border-style: dashed; }
.block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.block-head .drag-handle { cursor: grab; color: var(--muted-dim); font-size: 15px; letter-spacing: -1px; }
.block-head .drag-handle:active { cursor: grabbing; }
.block-head .type { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.block-head .block-actions { margin-left: auto; display: flex; gap: 2px; }
.block-head .block-actions button { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.block-head .block-actions button:hover { background: rgba(255,255,255,.08); color: var(--ink); }
.block input, .block textarea { width: 100%; margin-bottom: 6px; }
.add-block-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.preview-frame { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }

/* Block style toolbar (align, color, size controls) */
.block-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.align-group { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.align-group button { background: var(--bg); border: none; color: var(--muted); font-size: 13px; padding: 4px 8px; cursor: pointer; border-right: 1px solid var(--border); }
.align-group button:last-child { border-right: none; }
.align-group button.active { background: var(--mint); color: #fff; }
.block-toolbar select { padding: 4px 6px; font-size: 12.5px; }
.color-swatch { width: 28px; height: 26px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); cursor: pointer; }
.rt-toolbar { display: flex; gap: 2px; margin-bottom: 6px; }
.rt-toolbar button { background: var(--bg); border: 1px solid var(--border); color: var(--text); font-size: 13px; width: 28px; height: 26px; border-radius: 5px; cursor: pointer; }
.rt-toolbar button:hover { border-color: var(--line-strong); }
.rt-editable {
  width: 100%; min-height: 70px; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px;
  font-size: 14px; line-height: 1.6; color: var(--text); background: var(--bg); margin-bottom: 6px;
}
.rt-editable:focus { outline: none; border-color: var(--mint); }
.social-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.social-row .platform-label { width: 70px; font-size: 12.5px; color: var(--muted); font-weight: 600; flex-shrink: 0; }

/* Modal */
#modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
#lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 40px; cursor: zoom-out; }
#lightbox-img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); cursor: default; }
#lightbox-close {
  position: absolute; top: 18px; right: 24px; background: none; border: none; color: #fff;
  font-size: 34px; line-height: 1; cursor: pointer; opacity: .8;
}
#lightbox-close:hover { opacity: 1; }
#modal {
  background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--glass-shadow);
  border-radius: var(--radius); padding: 26px; width: 480px; max-width: 100%; max-height: 88vh; overflow: auto; color: var(--text);
}
#modal h3 { color: var(--ink); margin-bottom: 16px; }
#modal label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
#modal input, #modal select, #modal textarea { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow: auto; }
.modal-list li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.modal-list li:last-child { border-bottom: none; }
.notes-lists-link { color: var(--mint); text-decoration: underline; cursor: pointer; }
.extra-row { display: flex; gap: 6px; margin-bottom: 6px; }
.extra-row input { width: auto; }
.extra-row .extra-value { flex: 2; }
.extra-row .extra-label { flex: 1; }
.extra-row .extra-remove { flex: 0 0 auto; padding: 0 10px; }

/* Toast */
#toast { position: fixed; bottom: 24px; right: 24px; background: var(--bg-elev); border: 1px solid var(--border); border-left: 3px solid var(--mint); color: var(--ink); padding: 12px 20px; border-radius: var(--radius-sm); z-index: 100; box-shadow: var(--glass-shadow); }
#toast.error { background: var(--mint-dark); border-left-color: var(--red); color: #fff; }
.error { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 18px; }

.detail-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }

/* Card-per-category grids (e.g. Products) where each card's height varies a lot — a plain
   grid stretches every card in a row to match its tallest neighbor, leaving big blank gaps
   under the shorter ones. Columns let each card size to its own content and pack tightly. */
.masonry-grid { column-count: 2; column-gap: 20px; }
.masonry-grid .card { break-inside: avoid; -webkit-column-break-inside: avoid; display: inline-block; width: 100%; vertical-align: top; }
.kv { margin-bottom: 10px; }
.kv .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.kv .v { font-size: 14px; color: var(--text); }
.notes-feed { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.notes-item { font-size: 14px; color: var(--text); line-height: 1.4; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.notes-item:last-child { padding-bottom: 0; border-bottom: none; }
.notes-item .notes-time { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.back-link { color: var(--muted); text-decoration: none; font-size: 13px; display: inline-block; margin-bottom: 12px; }
.back-link:hover { color: var(--ink); }
.muted { color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: none; padding: 9px 14px; cursor: pointer; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 700; white-space: nowrap; flex-shrink: 0; transition: color .15s ease, border-color .15s ease; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--mint); }

@media (max-width: 900px) {
  #sidebar { width: 60px; }
  #sidebar .brand { display: none; }
  #main { margin-left: 60px; padding: 16px; }
  .editor-layout, .detail-grid { grid-template-columns: 1fr; }
  .masonry-grid { column-count: 1; }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .kanban { grid-template-columns: 1fr; }
}

/* Light theme overrides (non-variable colors) */
[data-theme="light"] #login-screen {
  background:
    radial-gradient(60% 55% at 82% 8%, rgba(89,118,240,.12), transparent 60%),
    radial-gradient(55% 50% at 12% 92%, rgba(229,9,20,.10), transparent 60%),
    var(--bg);
}
[data-theme="light"] #sidebar a.active { background: rgba(229,9,20,.08); }
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea { background: #fff; }
[data-theme="light"] .btn:not(.primary) { background: #fff; }
[data-theme="light"] .btn:not(.primary):hover { background: #f2f3f6; border-color: #14151a; }
[data-theme="light"] th { background: rgba(10,10,20,.03); }
[data-theme="light"] tr.clickable:hover { background: rgba(10,10,20,.035); }
[data-theme="light"] .badge { background: rgba(10,10,20,.07); }
[data-theme="light"] .badge.blue { background: rgba(59,91,219,.12); color: #2c46b8; }
[data-theme="light"] .badge.green { background: rgba(21,128,61,.12); color: #15803d; }
[data-theme="light"] .badge.red { background: rgba(220,38,38,.12); color: #b91c1c; }
[data-theme="light"] .badge.amber { background: rgba(180,83,9,.14); color: #92400e; }
[data-theme="light"] .badge.purple { background: rgba(126,34,206,.12); color: #7e22ce; }
[data-theme="light"] .kanban-col { background: rgba(10,10,20,.03); }
[data-theme="light"] .avatar.anon { background: rgba(10,10,20,.12); }
[data-theme="light"] #modal-overlay { background: rgba(15,23,42,.45); }
[data-theme="light"] #toast.error { background: #fde8e7; color: #7a1210; }

/* Theme toggle switch */
.theme-toggle {
  margin: 0 22px 12px; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(255,255,255,.05); color: var(--muted);
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  cursor: pointer; text-align: center;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }

/* Notifications bell */
#notif-wrap { position: fixed; top: 20px; right: 32px; z-index: 60; }
#notif-bell {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: var(--glass-bg); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--border); box-shadow: var(--glass-shadow); color: var(--ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
#notif-bell:hover { border-color: var(--line-strong); }
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 10px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
#notif-panel {
  position: absolute; top: 48px; right: 0; width: 380px; max-height: 480px; overflow: auto;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--glass-shadow); padding: 8px;
}
.notif-panel-header { display: flex; align-items: center; gap: 8px; padding: 6px 8px 10px; }
.notif-panel-header h4 { margin: 0; font-size: 14px; font-weight: 800; color: var(--navy); }
.notif-item { display: flex; gap: 10px; padding: 10px 8px; border-radius: var(--radius-sm); cursor: pointer; align-items: flex-start; }
.notif-item:hover { background: rgba(255,255,255,.06); }
.notif-item.unread { background: rgba(89,118,240,.08); }
.notif-icon { flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.notif-icon.church_move { background: rgba(89,118,240,.18); }
.notif-icon.deceased { background: rgba(255,255,255,.09); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.notif-detail { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--muted); margin-top: 4px; }
.notif-dismiss { flex: none; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 4px; }
.notif-dismiss:hover { color: var(--ink); }
.notif-empty { padding: 30px 10px; text-align: center; color: var(--muted); font-size: 13px; }
[data-theme="light"] .notif-item.unread { background: rgba(89,118,240,.06); }

/* ---- social / marketing ---- */
#sidebar .nav-label { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; cursor: pointer; display: flex; align-items: center; justify-content: space-between; text-align: left; font-family: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted-dim); padding: 14px 22px 4px; margin-top: 4px; border-top: 1px solid var(--border); }
.banner { border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; font-size: 13.5px; line-height: 1.5; }
.banner.warn { background: rgba(255,179,0,.14); color: var(--amber); border: 1px solid rgba(255,179,0,.3); }
.banner a, .banner a:visited { color: inherit; text-decoration: underline; font-weight: 700; }
.platform-badge { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 800; line-height: 1; flex-shrink: 0; vertical-align: middle; }
.account-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.account-avatar.glyph { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; }
.account-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.account-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.account-lines { font-size: 12.5px; line-height: 1.7; }
.account-error { color: var(--red); overflow-wrap: anywhere; }
.account-actions { display: flex; gap: 8px; margin-top: 12px; }
.card.disconnected { opacity: .55; }
.btn:disabled, .btn:disabled:hover { opacity: .5; cursor: not-allowed; transform: none; background: rgba(255,255,255,.05); border-color: var(--line-strong); }
.btn.primary:disabled, .btn.primary:disabled:hover { background: var(--mint); border-color: var(--mint); }
.empty-state {
  background: var(--glass-bg); border: 1px solid var(--border); box-shadow: var(--glass-shadow); border-radius: var(--radius);
  text-align: center; color: var(--muted); padding: 40px; margin-bottom: 16px; line-height: 1.6;
}
.empty-state h3 { color: var(--navy); font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.cal-month-title { font-weight: 700; color: var(--ink); min-width: 150px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-weekday { text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day { min-height: 96px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; background: var(--card); transition: background .15s ease, border-color .15s ease; }
.cal-day:hover { border-color: var(--line-strong); }
.cal-day.out-month { opacity: .45; }
.cal-day.today { border-color: var(--mint); background: rgba(229,9,20,.06); }
.cal-day .day-num { font-weight: 700; font-size: 12px; color: var(--ink); }
.cal-day.today .day-num { color: var(--mint); }
.cal-chips { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.cal-chip { font-size: 11px; padding: 2px 6px; border-radius: 4px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; transition: transform .1s ease, filter .1s ease; }
.cal-chip:hover { filter: brightness(1.12); transform: translateY(-1px); }
.cal-chip-more { font-size: 10.5px; color: var(--muted); padding: 1px 2px; }

/* ---- social composer ---- */
.social-post-group { margin-bottom: 24px; }
.social-group-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; letter-spacing: -.01em; color: var(--navy); margin-bottom: 10px; }
.group-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.post-card { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.08); }
.post-card-badges { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.post-thumb { display: block; max-width: 100%; max-height: 140px; border-radius: var(--radius-sm); object-fit: cover; margin-bottom: 8px; }
video.post-thumb { object-fit: contain; background: #000; }
.media-purged-note { font-size: 12px; color: var(--muted); background: rgba(255,255,255,.04); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px; }
.media-thumb-wrap { position: relative; display: inline-block; }
.media-thumb-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); pointer-events: none; }
.media-thumb-play svg { width: 32px; height: 32px; color: #fff; filter: drop-shadow(0 1px 4px rgba(0,0,0,.6)); }
.post-body-preview { font-size: 13.5px; color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
.post-meta { font-size: 12px; margin-top: 6px; }
.post-target-lines { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 8px; }

.comment-card { cursor: default; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.comment-head .who { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.comment-time { margin-left: auto; font-size: 11.5px; flex-shrink: 0; }
.comment-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; margin-top: 8px; }
.comment-reply { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text); }
.comment-reply-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-dim); margin-bottom: 3px; }

.podcast-meta { font-size: 12px; margin: 2px 0 8px; }
.podcast-analytics-toggle { font-size: 12px; }
.podcast-analytics { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.podcast-analytics-total { font-size: 13px; font-weight: 700; color: var(--ink); }

.account-picker { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 10px; margin-top: 4px; background: rgba(255,255,255,.02); }
.account-picker-row { display: flex; align-items: center; gap: 12px; font-size: 13.5px; font-weight: 500; color: var(--text); padding: 9px 2px; border-radius: var(--radius-sm); transition: background .15s ease; }
.account-picker-row + .account-picker-row { border-top: 1px solid var(--border); }
.account-picker-row:hover { background: rgba(255,255,255,.05); }
.account-avatar-ring { display: block; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; }
.account-picker-row .account-avatar { width: 100%; height: 100%; }
.account-picker-row .account-avatar.glyph { font-size: 10px; }
.account-picker-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-picker-platform { flex-shrink: 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.account-picker-row.disabled { color: var(--muted); }
.account-picker-row.disabled:hover { background: transparent; }
#modal .schedule-row input, #modal .account-picker-row input[type="checkbox"] { width: auto; }
.toggle-switch { position: relative; display: inline-block; width: 30px; height: 17px; flex-shrink: 0; }
.toggle-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle-switch input:disabled { cursor: not-allowed; }
.toggle-track { position: absolute; inset: 0; background: rgba(127,127,140,.38); border-radius: 999px; transition: background .15s ease; }
.toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: transform .15s ease; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle-switch input:checked + .toggle-track { background: var(--mint); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(13px); }
.toggle-switch input:disabled + .toggle-track { opacity: .4; }
.composer-warning, .composer-note { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; line-height: 1.4; padding: 8px 10px; border-radius: var(--radius-sm); margin-top: 8px; }
.composer-warning { color: var(--amber); background: rgba(255,179,0,.1); }
.composer-note { color: var(--muted); background: rgba(255,255,255,.04); }
.link-toggle { background: none; border: none; padding: 10px 0 0; margin: 0; color: var(--blue); font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.link-toggle:hover { text-decoration: underline; }
.link-toggle-caret { font-size: 9px; }
.composer-overrides { margin-top: 8px; }
.composer-overrides label { margin-top: 12px; }
.composer-overrides label:first-child { margin-top: 4px; }
.composer-section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
#modal.modal-composer { width: 980px; max-width: calc(100vw - 40px); }
.composer-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.composer-form { min-width: 0; }
@media (max-width: 860px) {
  #modal.modal-composer { width: 100%; }
  .composer-layout { grid-template-columns: 1fr; }
}

.composer-preview-panel { position: sticky; top: 0; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.preview-panel-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-dim); margin-bottom: 12px; }
.preview-empty { font-size: 13px; color: var(--muted); line-height: 1.5; }
.preview-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.preview-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.preview-header .account-avatar { width: 32px; height: 32px; }
.preview-header .account-avatar.glyph { font-size: 12px; }
.preview-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.preview-meta { font-size: 11.5px; color: var(--muted); }
.preview-caption { font-size: 13px; color: var(--text); line-height: 1.45; margin-bottom: 8px; overflow-wrap: anywhere; }
.preview-more { color: var(--muted); font-weight: 600; }
.preview-media { position: relative; margin: 0 -12px 8px; overflow: hidden; }
.preview-media img { display: block; width: 100%; object-fit: cover; }
/* A video is shown whole, never cropped: a vertical (9:16) clip keeps its shape and sits centered on
   black like it does in the feed, instead of being sliced to a thin band across the middle. */
.preview-media.is-video { background: #000; }
.preview-media.is-video video { display: block; width: auto; max-width: 100%; max-height: 380px; margin: 0 auto; object-fit: contain; }
.preview-media-count { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.preview-media-empty { font-size: 12px; color: var(--muted); background: rgba(255,255,255,.04); border-radius: var(--radius-sm); padding: 24px 10px; text-align: center; margin-bottom: 8px; }
.preview-link-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; background: rgba(255,255,255,.03); }
.preview-link-domain { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.preview-actions { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.preview-actions.ig-actions { display: flex; justify-content: space-between; border-top: none; padding-top: 0; margin: 8px 0; font-size: 16px; }
.preview-reel-note { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.preview-more-note { font-size: 11.5px; color: var(--muted); margin: -6px 0 12px; }
.preview-disclaimer { font-size: 11px; color: var(--muted-dim); margin-top: 4px; }
.post-media-preview { position: relative; display: inline-block; margin-top: 4px; }
.post-media-preview img { display: block; max-width: 100%; max-height: 140px; border-radius: var(--radius-sm); object-fit: cover; }
.post-media-preview video { display: block; max-width: 100%; max-height: 320px; border-radius: var(--radius-sm); background: #000; }
.post-media-preview #pc-remove-image { position: absolute; top: -8px; right: -8px; border-radius: 50%; padding: 0 7px; line-height: 1.8; }
.post-media-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.post-media-tile { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.post-media-tile img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.post-media-tile .media-remove-btn { position: absolute; top: -8px; right: -8px; border-radius: 50%; padding: 0 7px; line-height: 1.8; }
.post-media-add-tile { width: 96px; height: 96px; flex-shrink: 0; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s ease; }
.post-media-add-tile:hover { background: rgba(255,255,255,.05); }
.media-thumb-count { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 999px; pointer-events: none; }
.schedule-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.schedule-row input { width: auto; }
.tag-row-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-dim); margin-bottom: 6px; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 600; background: rgba(255,255,255,.09); color: var(--text); }
.tag-chip-remove { background: none; border: none; color: inherit; opacity: .6; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.tag-chip-remove:hover { opacity: 1; }
#modal .tag-input-row { display: flex; gap: 8px; }
#modal .tag-input-row input { flex: 1; width: auto; }

/* ---- social manager (merged accounts rail + queue/calendar tabs) ---- */
.social-manager-layout { display: block; }
.accounts-panel { max-width: 460px; position: static; }
.social-rail {
  background: var(--glass-bg); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--border); box-shadow: var(--glass-shadow); border-radius: var(--radius); padding: 18px; position: sticky; top: 28px;
}
.social-rail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.social-rail-head h4 { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-dim); }
.social-rail-head .btn { flex-shrink: 0; white-space: nowrap; }
.social-rail-list { display: flex; flex-direction: column; gap: 2px; }
.rail-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: var(--radius-sm); transition: background .15s ease; }
.rail-item:hover { background: rgba(255,255,255,.05); }
.rail-item:hover .rail-item-actions { opacity: 1; }
.rail-item.disconnected { opacity: .5; }
.rail-avatar-wrap { position: relative; flex-shrink: 0; line-height: 0; }
.rail-item .account-avatar { width: 32px; height: 32px; }
.rail-item .account-avatar.glyph { font-size: 12px; }
.rail-dot { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg-elev); box-shadow: 0 0 0 1px var(--border); }
.rail-dot.ok { background: var(--green); }
.rail-dot.warn { background: var(--amber); }
.rail-dot.off { background: var(--muted-dim); }
.rail-item-body { flex: 1; min-width: 0; }
.rail-item-body .who { font-size: 13.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-item-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.rail-item-actions { display: flex; gap: 2px; flex-shrink: 0; opacity: 0; transition: opacity .15s ease; }
.icon-btn {
  width: 26px; height: 26px; padding: 0; border: none; border-radius: 50%; background: transparent; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease;
}
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn:hover { background: rgba(255,255,255,.1); color: var(--ink); }
.icon-btn.danger:hover { background: rgba(255,92,86,.14); color: var(--red); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--blue); }
.btn.ghost:hover { background: rgba(89,118,240,.1); border-color: transparent; transform: none; }
.social-rail-connect { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.social-rail-connect-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-dim); margin-bottom: 2px; }
.social-rail-connect .btn { text-align: center; }
.sm-tabs { display: flex; gap: 2px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.sm-tab {
  padding: 10px 18px; font-size: 13.5px; font-weight: 700; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; transition: color .15s ease, background .15s ease;
}
.sm-tab:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.sm-tab.active { color: var(--mint); border-bottom-color: var(--mint); }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.cal-toolbar-nav { display: flex; align-items: center; gap: 4px; }
.analytics-accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 20px; }
.analytics-account-card { display: flex; align-items: center; gap: 12px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.analytics-account-card .account-avatar-ring { width: 38px; height: 38px; }
.analytics-account-card .account-avatar { width: 38px; height: 38px; }
.analytics-account-info { flex: 1; min-width: 0; }
.analytics-account-name { font-size: 13.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-account-platform { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.analytics-account-followers { text-align: right; flex-shrink: 0; }
.analytics-account-followers .num { font-size: 20px; font-weight: 800; color: var(--ink); }
.analytics-account-followers .label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.analytics-posts { display: flex; flex-direction: column; gap: 10px; }
.analytics-post-row { display: flex; align-items: center; gap: 14px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.analytics-post-thumb, .analytics-post-thumb-empty { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; background: rgba(255,255,255,.05); }
.analytics-post-body { flex: 1; min-width: 0; }
.analytics-post-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 4px; }
.analytics-post-meta .platform-badge { width: 18px; height: 18px; font-size: 10px; }
.analytics-post-account { font-weight: 700; color: var(--text); }
.analytics-post-stats { display: flex; gap: 18px; flex-shrink: 0; }
.analytics-stat { text-align: center; }
.analytics-stat .num { font-size: 16px; font-weight: 800; color: var(--ink); }
.analytics-stat .label { color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.analytics-no-data { font-size: 12px; }
@media (max-width: 700px) {
  .analytics-post-row { flex-wrap: wrap; }
  .analytics-post-stats { width: 100%; justify-content: space-between; }
}
@media (max-width: 900px) {
  .social-manager-layout { grid-template-columns: 1fr; }
  .social-rail { position: static; }
  .rail-item-actions { opacity: 1; }
}

.post-detail-body { font-size: 14px; line-height: 1.6; color: var(--text); margin: 12px 0; overflow-wrap: anywhere; }
.post-detail-media { display: block; max-width: 100%; max-height: 220px; border-radius: var(--radius-sm); object-fit: cover; margin-bottom: 12px; }
.post-detail-targets { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.post-detail-target { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.post-detail-target:last-child { margin-bottom: 0; }

/* ============ Projects (Monday-style boards) ============ */
.pm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.pm-dot.big { width: 14px; height: 14px; }
.small { font-size: 12px; }
.pm-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.pm-inline input { width: auto; }
.pm-bell { position: relative; }
.pm-bell-badge { position: static; margin-left: 4px; }
#pm-nav-badge { position: static; margin-left: auto; }
.pm-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pm-board-card { display: block; text-decoration: none; color: var(--text); background: var(--bg-elev); border: 1px solid var(--border); border-top: 4px solid var(--bc); border-radius: var(--radius); padding: 16px; transition: transform .12s ease, border-color .12s ease; }
.pm-board-card:hover { transform: translateY(-2px); border-color: var(--line-strong); border-top-color: var(--bc); }
.pm-board-card-top { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 6px; color: var(--ink); }
.pm-board-card p { margin: 0 0 12px; min-height: 18px; }
.pm-progress { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.pm-progress span { display: block; height: 100%; background: #00c875; }
.pm-tpl-list { display: grid; gap: 8px; max-height: 300px; overflow: auto; }
#modal label.pm-tpl { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; margin: 0; font-weight: 400; }
#modal label.pm-tpl b { color: var(--ink); font-size: 14px; }
#modal label.pm-tpl.sel { border-color: var(--mint); background: rgba(229,9,20,.08); }
.pm-team-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pm-team-row .grow { flex: 1; min-width: 0; }
#modal .pm-team-row label { margin: 0; display: inline-flex; font-weight: 400; }

.pm-head { gap: 12px; }
.pm-board-title { cursor: text; padding: 2px 6px; border-radius: 6px; }
.pm-board-title:hover { background: rgba(255,255,255,.07); }
.pm-desc { margin: -6px 0 12px; }
.pm-viewbar { padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.pm-tabs { display: flex; gap: 2px; }
.pm-tab { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 700; padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.pm-tab:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.pm-tab.on { color: var(--ink); background: rgba(255,255,255,.1); }
.pm-search { width: 190px; }
.pm-person-filter { width: auto; }

.pm-scroll { overflow-x: auto; padding-bottom: 12px; }
.pm-table { min-width: max-content; }
.pm-group { margin-bottom: 26px; }
.pm-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--gc); position: sticky; left: 0; }
.pm-group-name { font-size: 17px; font-weight: 700; cursor: text; padding: 1px 6px; border-radius: 6px; }
.pm-group-name:hover { background: rgba(255,255,255,.07); }
.pm-caret, .pm-gmenu { background: none; border: 0; color: var(--gc); font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.pm-gmenu { color: var(--muted); opacity: 0; }
.pm-group-head:hover .pm-gmenu { opacity: 1; }
.pm-row { display: grid; grid-template-columns: var(--tpl); border-bottom: 1px solid var(--border); background: var(--bg-elev); align-items: stretch; position: relative; }
.pm-row > .pm-cell { border-left: 1px solid var(--border); padding: 0 8px; display: flex; align-items: center; min-height: 38px; min-width: 0; }
.pm-row > .pm-namecell { border-left: 5px solid var(--gc); gap: 6px; position: sticky; left: 0; background: var(--bg-elev); z-index: 1; }
.pm-row.is-done .pm-itemname { color: var(--muted); text-decoration: line-through; }
.pm-head-row { background: transparent; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--line-strong); }
.pm-head-row > .pm-cell { justify-content: center; min-height: 32px; }
.pm-head-row > .pm-namecell { justify-content: flex-start; background: var(--bg); }
.pm-colhead { gap: 4px; }
.pm-colmenu, .pm-addcol { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 4px; opacity: .5; }
.pm-colhead:hover .pm-colmenu, .pm-addcol { opacity: 1; }
.pm-addcol { font-size: 18px; }
.pm-colmenu:hover, .pm-addcol:hover { background: rgba(255,255,255,.1); color: var(--ink); }
.pm-row[data-item]:hover { background: rgba(255,255,255,.04); }
.pm-row[data-item]:hover > .pm-namecell { background: color-mix(in srgb, var(--bg-elev) 92%, #fff); }
.pm-grip { color: var(--muted-dim); cursor: grab; font-size: 11px; letter-spacing: -2px; opacity: 0; user-select: none; }
.pm-row:hover .pm-grip { opacity: 1; }
.pm-itemname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; color: var(--ink); }
.pm-itemname:hover { text-decoration: underline; }
.pm-chat { background: none; border: 0; cursor: pointer; font-size: 13px; color: var(--muted-dim); padding: 2px 4px; border-radius: 6px; }
.pm-chat.has { color: var(--blue); }
.pm-chat:hover { background: rgba(255,255,255,.1); }
.pm-subcount, .pm-linkcount { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pm-val { cursor: pointer; justify-content: center; }
.pm-val:hover { background: rgba(255,255,255,.05); }
.pm-pill { display: inline-block; width: 100%; text-align: center; color: #fff; font-size: 13px; font-weight: 600; padding: 6px 8px; border-radius: 4px; border: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-pill.empty { background: rgba(255,255,255,.08); }
button.pm-pill.pick { cursor: pointer; margin-bottom: 6px; }
.pm-avatars { display: inline-flex; }
.pm-avatars .pm-avatar + .pm-avatar { margin-left: -6px; }
.pm-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; border: 2px solid var(--bg-elev); flex: 0 0 auto; }
.pm-avatar.more { background: var(--muted-dim); width: 26px; height: 26px; font-size: 10px; }
.pm-empty-person { color: var(--muted-dim); font-size: 18px; }
.pm-overdue { color: var(--red); font-weight: 600; }
.pm-range { font-size: 13px; }
.pm-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-check { width: 20px; height: 20px; border: 2px solid var(--line-strong); border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; background: none; color: #fff; cursor: pointer; padding: 0; }
.pm-check.on { background: #00c875; border-color: #00c875; }
.pm-inline-edit { width: 100%; padding: 5px 7px; }
.pm-additem { width: 100%; background: transparent; border: 0; padding: 8px 4px; color: var(--muted); }
.pm-additem:focus { color: var(--text); outline: 0; background: rgba(255,255,255,.05); }
.pm-addrow { background: transparent; opacity: .85; }
.pm-summary { background: transparent; border-bottom: 0; }
.pm-summary > .pm-cell { border-left: 0; min-height: 24px; }
.pm-bar { display: flex; width: 100%; height: 10px; border-radius: 3px; overflow: hidden; background: var(--border); }
.pm-bar span { display: block; height: 100%; }
.pm-addgroup { margin-top: 4px; }
.pm-row.dragging { opacity: .35; }
.pm-row.drop-above { box-shadow: 0 -2px 0 0 var(--mint); }
.pm-row.drop-below { box-shadow: 0 2px 0 0 var(--mint); }
.pm-row.drop-end { box-shadow: 0 -2px 0 0 var(--mint); }

.pm-popover { position: fixed; z-index: 80; background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.45); max-height: 70vh; overflow: auto; padding: 6px; }
.pm-popover hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.pm-popover input, .pm-popover select, .pm-popover textarea { width: 100%; }
.pm-menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: inherit; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.pm-menu-item:hover { background: rgba(255,255,255,.08); }
.pm-menu-item.danger { color: var(--red); }
.pm-labelpick { padding: 4px; }
.pm-people-pick { padding: 2px; }
.pm-person-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.pm-person-opt:hover { background: rgba(255,255,255,.07); }
.pm-person-opt input { width: auto; }
.pm-pop-actions { display: flex; gap: 8px; margin-top: 10px; }
.pm-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.pm-sw.on { border-color: var(--ink); }
.pm-labels-edit { display: grid; gap: 8px; margin-bottom: 12px; }
.pm-label-row { display: flex; gap: 8px; align-items: center; }
.pm-label-row input { flex: 1; }
.pm-link-results { max-height: 220px; overflow: auto; margin-top: 6px; }
.pm-notif-head { display: flex; justify-content: space-between; padding: 8px 10px; }
.pm-notif-list { max-height: 360px; overflow: auto; }
.pm-notif { display: block; padding: 9px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 13px; }
.pm-notif.unread { background: rgba(89,118,240,.14); }
.pm-notif:hover { background: rgba(255,255,255,.08); }
.pm-mw-group { margin-bottom: 22px; }
.pm-mw-group h4 { margin-bottom: 8px; }

#pm-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 100vw; background: var(--bg-elev); border-left: 1px solid var(--line-strong); box-shadow: -16px 0 50px rgba(0,0,0,.4); z-index: 60; overflow-y: auto; padding: 18px 22px 40px; }
.pm-drawer-head { display: flex; gap: 10px; align-items: center; }
.pm-drawer-title { flex: 1; font-size: 20px; font-weight: 700; background: transparent; border: 1px solid transparent; padding: 6px 8px; }
.pm-drawer-title:hover, .pm-drawer-title:focus { border-color: var(--border); }
.pm-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px 6px; border-radius: 6px; }
.pm-x:hover { color: var(--ink); background: rgba(255,255,255,.1); }
.pm-drawer-sub { margin: 2px 8px 14px; display: flex; align-items: center; gap: 6px; }
.pm-drawer-sub select { width: auto; padding: 2px 6px; font-size: 12px; }
.pm-field { display: grid; grid-template-columns: 120px 1fr; align-items: center; border-bottom: 1px solid var(--border); min-height: 42px; }
.pm-field-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.pm-field-val { justify-content: flex-start; padding: 4px 6px; min-height: 36px; display: flex; align-items: center; border-radius: 6px; }
.pm-section { margin-top: 20px; }
.pm-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pm-linkchip { display: inline-flex; align-items: center; gap: 4px; background: rgba(89,118,240,.15); border-radius: 20px; padding: 3px 4px 3px 10px; margin: 0 6px 6px 0; font-size: 13px; }
.pm-linkchip a { color: var(--text); text-decoration: none; }
.pm-sub { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.pm-sub.is-done .pm-sub-name { text-decoration: line-through; color: var(--muted); }
.pm-sub-name { flex: 1; cursor: pointer; }
.pm-drawer-tabs { margin-top: 22px; border-bottom: 1px solid var(--border); }
.pm-compose { position: relative; margin: 14px 0; }
.pm-mention-list { position: absolute; left: 0; right: 0; top: 70px; background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 8px; z-index: 5; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.pm-mention-list button { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; color: var(--text); padding: 8px 10px; cursor: pointer; font: inherit; }
.pm-mention-list button:hover { background: rgba(255,255,255,.08); }
.pm-update { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pm-update .grow { flex: 1; min-width: 0; }
.pm-update-body { margin-top: 4px; line-height: 1.45; overflow-wrap: anywhere; }
.pm-mention { color: var(--blue); font-weight: 600; }
.pm-act { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }

[data-theme="light"] .pm-tab:hover, [data-theme="light"] .pm-board-title:hover, [data-theme="light"] .pm-group-name:hover,
[data-theme="light"] .pm-val:hover, [data-theme="light"] .pm-menu-item:hover, [data-theme="light"] .pm-person-opt:hover { background: rgba(10,10,20,.06); }
[data-theme="light"] .pm-tab.on { background: rgba(10,10,20,.09); }
[data-theme="light"] .pm-pill.empty { background: rgba(10,10,20,.07); }
[data-theme="light"] .pm-row[data-item]:hover { background: rgba(10,10,20,.03); }
[data-theme="light"] .pm-popover { box-shadow: 0 12px 40px rgba(15,23,42,.18); }
@media (max-width: 720px) { #pm-drawer { width: 100vw; } .pm-search { width: 130px; } }

/* Projects: kanban, calendar, timeline */
.pmk-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; }
.pmk-lane { flex: 0 0 270px; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 12px; padding: 8px; }
.pmk-lane.drag-over { outline: 2px dashed var(--mint); }
.pmk-lane-head { color: #fff; font-weight: 700; padding: 8px 10px; border-radius: 6px; display: flex; justify-content: space-between; margin-bottom: 8px; }
.pmk-lane-head span { opacity: .8; }
.pmk-cards { display: grid; gap: 8px; min-height: 8px; }
.pmk-card { background: var(--bg-elev); border: 1px solid var(--border); border-left: 4px solid; border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.pmk-card:hover { border-color: var(--line-strong); }
.pmk-card.dragging { opacity: .4; }
.pmk-card-name { color: var(--ink); font-weight: 600; margin-bottom: 8px; overflow-wrap: anywhere; }
.pmk-card-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.pmk-card-meta .grow { flex: 1; }
.pmk-add { margin-top: 8px; }

.pmc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.pmc-dow { padding: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-elev); }
.pmc-day { min-height: 118px; padding: 4px 0 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-elev); min-width: 0; }
.pmc-day.other { opacity: .5; }
.pmc-day.today { box-shadow: inset 0 0 0 2px var(--blue); }
.pmc-day.drag-over { background: rgba(89,118,240,.14); }
.pmc-daynum { display: flex; justify-content: space-between; align-items: center; padding: 0 6px 3px; font-size: 12px; color: var(--muted); }
.pmc-add { background: none; border: 0; color: var(--muted); cursor: pointer; opacity: 0; font-size: 15px; }
.pmc-day:hover .pmc-add { opacity: 1; }
.pmc-chip { color: #fff; font-size: 12px; font-weight: 600; padding: 3px 7px; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.pmc-chip.first { border-radius: 4px 0 0 4px; margin-left: 4px; }
.pmc-chip.last { border-radius: 0 4px 4px 0; margin-right: 4px; }
.pmc-chip.first.last { border-radius: 4px; }
.pmc-chip.is-done { opacity: .55; text-decoration: line-through; }
.pmc-more { font-size: 11px; color: var(--muted); padding: 2px 8px; }

.pmt-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev); position: relative; }
.pmt { position: relative; }
.pmt-head, .pmt-row { display: flex; }
.pmt-label { flex: 0 0 240px; padding: 8px 12px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: sticky; left: 0; background: var(--bg-elev); z-index: 3; cursor: pointer; font-size: 13px; }
.pmt-label.head { font-weight: 700; color: var(--muted); cursor: default; }
.pmt-track { position: relative; height: 38px; border-bottom: 1px solid var(--border); background-image: linear-gradient(to right, var(--border) 1px, transparent 1px); }
.pmt-track.head { height: 52px; background-image: none; }
.pmt-months span, .pmt-ticks span { position: absolute; white-space: nowrap; }
.pmt-months span { top: 4px; font-size: 12px; font-weight: 700; color: var(--ink); padding-left: 4px; }
.pmt-ticks span { top: 28px; font-size: 11px; color: var(--muted); padding-left: 2px; }
.pmt-ticks span.we { opacity: .5; }
.pmt-group { padding: 8px 12px; font-weight: 700; font-size: 13px; background: rgba(255,255,255,.03); border-bottom: 1px solid var(--border); position: sticky; left: 0; }
.pmt-bar { position: absolute; top: 7px; height: 24px; border-radius: 6px; color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; cursor: grab; user-select: none; overflow: hidden; }
.pmt-bar.is-done { opacity: .55; }
.pmt-name { padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; pointer-events: none; }
.pmt-h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.pmt-h.l { left: 0; } .pmt-h.r { right: 0; }
.pmt-h:hover { background: rgba(255,255,255,.35); }
.pmt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); opacity: .7; pointer-events: none; z-index: 2; }
.pmt-undated { padding: 12px; border-top: 1px solid var(--border); }
.pmt-undated .pm-linkchip { cursor: pointer; border: 0; color: var(--text); font: inherit; }
[data-theme="light"] .pmk-lane, [data-theme="light"] .pmt-group { background: rgba(10,10,20,.03); }
.pm-auto-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pm-auto-row .grow { flex: 1; }
#modal .pm-auto-row label, #modal label.pm-inline { margin: 0; display: inline-flex; font-weight: 400; }

.pm-files { display: grid; gap: 6px; border: 1px dashed transparent; border-radius: 8px; padding: 4px; }
.pm-files.over { border-color: var(--mint); background: rgba(229,9,20,.06); }
.pm-file { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.pm-file a { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: var(--text); text-decoration: none; }
.pm-file img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; }
.pm-file-ico { font-size: 24px; width: 34px; text-align: center; }
.pm-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#modal label.pm-tpl { position: relative; }
.pm-tpl-del { position: absolute; top: 6px; right: 6px; }

/* Sidebar sections collapse so the nav stays short */
#sidebar .nav-label:hover { color: var(--ink); }
#sidebar .nav-caret { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -3px; transition: transform .15s ease; }
#sidebar .nav-group.collapsed .nav-caret { transform: rotate(-45deg); margin-top: 0; }
#sidebar .nav-group.collapsed .nav-items { display: none; }
#sidebar .nav-group.collapsed.has-active .nav-label { color: var(--ink); }
#sidebar { overflow-y: auto; }
.pm-bell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Nav hierarchy: section headings stay loud, the links under them read as sub-items */
#sidebar .nav-label { color: var(--ink); font-size: 11px; letter-spacing: 1.4px; padding-top: 16px; padding-bottom: 6px; }
#sidebar .nav-items a { padding-left: 38px; font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: .1px; }
#sidebar .nav-items a.active { font-weight: 700; }

/* Sub-items: icon + rounded pill so they read as real links, not a plain list */
#sidebar .nav-items { padding: 2px 10px 6px; display: flex; flex-direction: column; gap: 1px; }
#sidebar .nav-items a { padding: 8px 12px; gap: 11px; border-left: 0; border-radius: 9px; color: var(--text); }
#sidebar .nav-items a .nav-icon { width: 17px; height: 17px; color: var(--muted-dim); transition: color .15s ease; }
#sidebar .nav-items a:hover { background: rgba(255,255,255,.07); }
#sidebar .nav-items a:hover .nav-icon { color: var(--ink); }
#sidebar .nav-items a.active { background: rgba(229,9,20,.14); color: var(--ink); }
#sidebar .nav-items a.active .nav-icon { color: var(--mint); }
[data-theme="light"] #sidebar .nav-items a:hover { background: rgba(10,10,20,.06); }

/* Dashboard link matches the sub-item links below it */
#sidebar > a.nav-link { margin: 0 10px 4px; padding: 8px 12px; gap: 11px; border-left: 0; border-radius: 9px; font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: .1px; color: var(--text); }
#sidebar > a.nav-link .nav-icon { width: 17px; height: 17px; color: var(--muted-dim); transition: color .15s ease; }
#sidebar > a.nav-link:hover { background: rgba(255,255,255,.07); }
#sidebar > a.nav-link:hover .nav-icon { color: var(--ink); }
#sidebar > a.nav-link.active { background: rgba(229,9,20,.14); color: var(--ink); font-weight: 700; }
#sidebar > a.nav-link.active .nav-icon { color: var(--mint); }
[data-theme="light"] #sidebar > a.nav-link:hover { background: rgba(10,10,20,.06); }

h2.page-title .title-count { font-weight: 500; color: var(--muted); font-size: .8em; margin-left: 4px; }

#sidebar .nav-count { color: var(--red); font-weight: 400; margin-left: -8px; }

.post-list-row { cursor: pointer; transition: border-color .12s; }
.post-list-row:hover { border-color: var(--muted-dim); }
.post-list-status { flex-shrink: 0; }
.post-list-row .post-body-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.analytics-account-followers.editable { cursor: pointer; border-radius: var(--radius-sm); padding: 2px 8px; margin: -2px -8px; }
.analytics-account-followers.editable:hover { background: rgba(120,120,140,.12); }
