:root {
  --bg: #071b1d;
  --panel: #0d292c;
  --panel-2: #123438;
  --panel-3: #173e42;
  --text: #effcf8;
  --muted: #9dbbb5;
  --line: #245156;
  --primary: #31c7a2;
  --primary-dark: #159273;
  --gold: #e0b24d;
  --danger: #ff756d;
  --warning: #f6c65b;
  --success: #45d483;
  --shadow: 0 20px 45px rgba(0, 0, 0, .26);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 8% 0%, #124248 0, var(--bg) 33rem); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
}
.login-hero { padding: clamp(3rem, 7vw, 8rem); display: flex; flex-direction: column; justify-content: center; }
.brand-line { display: flex; gap: .85rem; align-items: center; }
.brand-mark { width: 44px; height: 44px; border: 2px solid var(--gold); border-radius: 15px 15px 20px 20px; display: grid; place-items: center; color: var(--gold); font-weight: 900; }
.brand-name { font-size: 1.15rem; letter-spacing: .02em; font-weight: 800; }
.login-hero h1 { font-size: clamp(2.6rem, 6vw, 5.6rem); line-height: .98; max-width: 900px; margin: 2rem 0 1.3rem; }
.login-hero h1 span { color: var(--primary); }
.login-hero p { color: var(--muted); font-size: 1.12rem; max-width: 720px; line-height: 1.65; }
.feature-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.feature-pill { border: 1px solid var(--line); padding: .7rem 1rem; border-radius: 999px; color: #cce5df; background: rgba(13,41,44,.75); }
.login-panel { display: grid; place-items: center; padding: 2rem; background: rgba(1, 12, 14, .55); border-left: 1px solid rgba(255,255,255,.05); }
.login-card { width: min(440px, 100%); padding: 2rem; border: 1px solid var(--line); background: rgba(13,41,44,.94); border-radius: 24px; box-shadow: var(--shadow); }
.login-card h2 { margin: 0 0 .5rem; font-size: 1.7rem; }
.login-card .hint { color: var(--muted); margin: 0 0 1.5rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); padding: 1.25rem; background: rgba(6, 26, 29, .94); backdrop-filter: blur(20px); display: flex; flex-direction: column; }
.sidebar .brand-line { margin-bottom: 2rem; }
.nav { display: grid; gap: .45rem; }
.nav-button { display: flex; align-items: center; gap: .85rem; border: 0; background: transparent; color: var(--muted); padding: .9rem 1rem; border-radius: 12px; text-align: left; }
.nav-button:hover, .nav-button.active { background: var(--panel-3); color: var(--text); }
.nav-icon { width: 22px; text-align: center; }
.sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.user-name { font-weight: 750; }
.user-role { color: var(--muted); font-size: .85rem; text-transform: capitalize; margin-top: .2rem; }
.logout-button { margin-top: .8rem; width: 100%; }

.main { min-width: 0; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 1rem clamp(1rem, 3vw, 2.5rem); border-bottom: 1px solid var(--line); background: rgba(7,27,29,.8); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 4; }
.topbar h1 { font-size: 1.35rem; margin: 0; }
.topbar-meta { color: var(--muted); font-size: .9rem; }
.content { padding: clamp(1rem, 3vw, 2.5rem); max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.page-head h2 { margin: 0 0 .35rem; font-size: 1.75rem; }
.page-head p { margin: 0; color: var(--muted); }

.grid { display: grid; gap: 1rem; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-col { grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); }
.card { background: linear-gradient(145deg, rgba(18,52,56,.96), rgba(10,37,40,.96)); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 25px rgba(0,0,0,.12); }
.card-pad { padding: 1.15rem; }
.metric { padding: 1.2rem; min-height: 126px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-label { color: var(--muted); font-size: .9rem; }
.metric-value { font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 850; letter-spacing: -.03em; }
.metric-note { color: var(--primary); font-size: .82rem; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-title h3 { margin: 0; font-size: 1.05rem; }
.section-title span { color: var(--muted); font-size: .82rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; }
table { width: 100%; border-collapse: collapse; min-width: 740px; }
th, td { padding: .85rem .9rem; text-align: left; border-bottom: 1px solid rgba(36,81,86,.7); vertical-align: middle; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; background: rgba(7,27,29,.55); }
tbody tr:hover { background: rgba(49,199,162,.05); }
tbody tr:last-child td { border-bottom: 0; }
.cell-main { font-weight: 700; }
.cell-sub { color: var(--muted); font-size: .82rem; margin-top: .15rem; }
.empty { color: var(--muted); padding: 2rem; text-align: center; }

.badge { display: inline-flex; align-items: center; padding: .35rem .58rem; border-radius: 999px; font-size: .76rem; font-weight: 750; background: rgba(157,187,181,.12); color: #c9e2dc; text-transform: capitalize; white-space: nowrap; }
.badge.new, .badge.draft { background: rgba(109,186,255,.12); color: #9bcfff; }
.badge.active, .badge.approved, .badge.published, .badge.patient_active, .badge.deposit_paid { background: rgba(69,212,131,.13); color: #7aefa8; }
.badge.paused, .badge.in_review, .badge.quote_sent { background: rgba(246,198,91,.13); color: #ffd878; }
.badge.lost, .badge.rejected, .badge.failed { background: rgba(255,117,109,.13); color: #ff9a94; }

.funnel-list { display: grid; gap: .6rem; }
.funnel-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 42px; align-items: center; gap: .7rem; }
.funnel-label { color: #cde2de; font-size: .86rem; text-transform: capitalize; }
.funnel-progress { width: 100%; height: 9px; border: 0; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.07); appearance: none; }
.funnel-progress::-webkit-progress-bar { background: rgba(255,255,255,.07); border-radius: 999px; }
.funnel-progress::-webkit-progress-value { background: linear-gradient(90deg, var(--primary-dark), var(--primary)); border-radius: 999px; }
.funnel-progress::-moz-progress-bar { background: linear-gradient(90deg, var(--primary-dark), var(--primary)); border-radius: 999px; }
.funnel-value { text-align: right; font-weight: 800; }

.toolbar { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }

button, .button { border: 1px solid var(--line); background: var(--panel-3); color: var(--text); border-radius: 10px; padding: .68rem .95rem; font-weight: 700; }
button:hover, .button:hover { filter: brightness(1.08); }
.button-primary { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); border-color: transparent; color: #021c15; }
.button-danger { color: #ffb6b1; border-color: rgba(255,117,109,.35); background: rgba(255,117,109,.08); }
.button-small { padding: .42rem .65rem; font-size: .8rem; }
.button-ghost { background: transparent; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-field { display: grid; gap: .42rem; }
.form-field.full { grid-column: 1 / -1; }
label { color: #cde2de; font-size: .86rem; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: #092326; color: var(--text); border-radius: 10px; padding: .72rem .8rem; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(49,199,162,.11); }
textarea { min-height: 120px; resize: vertical; }
.check-row { display: flex; align-items: center; gap: .55rem; }
.check-row input { width: auto; }
.form-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1.2rem; }
.help { color: var(--muted); font-size: .78rem; line-height: 1.5; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,7,8,.72); display: grid; place-items: center; padding: 1rem; z-index: 20; }
.modal { width: min(760px, 100%); max-height: calc(100vh - 2rem); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.3rem; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 1.3rem; }
.icon-button { width: 35px; height: 35px; padding: 0; border-radius: 50%; }

.toast { position: fixed; right: 1rem; bottom: 1rem; max-width: 420px; padding: .9rem 1rem; border-radius: 12px; background: #173e42; border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 40; }
.toast.error { border-color: rgba(255,117,109,.6); }
.toast.success { border-color: rgba(69,212,131,.6); }

.integration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.integration-card { padding: 1rem; }
.integration-card h3 { margin: 0 0 .4rem; }
.integration-card p { color: var(--muted); min-height: 42px; line-height: 1.45; }
.integration-state { display: flex; align-items: center; justify-content: space-between; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px rgba(255,117,109,.08); }
.status-dot.on { background: var(--success); box-shadow: 0 0 0 4px rgba(69,212,131,.08); }
.code-box { border: 1px solid var(--line); background: #061b1d; color: #a9e6d8; padding: .8rem; border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; font-size: .82rem; }
.journey-list { display: grid; gap: 0; margin-top: .65rem; }
.journey-item { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: .65rem; padding: .25rem 0 1rem; }
.journey-item:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 12px; bottom: -2px; width: 2px; background: var(--line); }
.journey-dot { width: 12px; height: 12px; margin-top: .2rem; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px rgba(49,199,162,.12); z-index: 1; }
.journey-url { max-width: 620px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mt-1 { margin-top: 1rem; }

.mobile-nav { display: none; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-panel { min-height: 100vh; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { padding: .9rem 1rem; }
  .content { padding: 1rem; padding-bottom: 6rem; }
  .metric-grid, .integration-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .funnel-row { grid-template-columns: 130px minmax(0, 1fr) 35px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: .6rem; right: .6rem; bottom: .6rem; z-index: 10; border: 1px solid var(--line); border-radius: 16px; background: rgba(7,27,29,.96); backdrop-filter: blur(18px); padding: .35rem; }
  .mobile-nav button { border: 0; background: transparent; font-size: .7rem; display: grid; gap: .2rem; place-items: center; padding: .5rem .2rem; color: var(--muted); }
  .mobile-nav button.active { color: var(--primary); }
  .page-head { align-items: stretch; flex-direction: column; }
}


/* Executive cross-platform dashboard */
.executive-metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; }
.metric-accent { position: relative; overflow: hidden; }
.metric-accent::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.metric-accent.green { --accent: #45d483; } .metric-accent.gold { --accent: #f6c65b; }
.metric-accent.blue { --accent: #4d8dff; } .metric-accent.pink { --accent: #e857a6; }
.metric-accent.purple { --accent: #9d7dff; } .metric-accent.cyan { --accent: #35d6d2; }
.executive-chart-grid { grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr); }
.donut-layout { display: grid; grid-template-columns: 190px 1fr; gap: 1.4rem; align-items: center; }
.donut-chart { width: 180px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 28px rgba(0,0,0,.2); }
.donut-chart > div { width: 108px; aspect-ratio: 1; border-radius: 50%; background: var(--panel); display: grid; place-content: center; text-align: center; box-shadow: 0 0 0 1px var(--line); }
.donut-chart strong { font-size: 1.35rem; } .donut-chart span { color: var(--muted); font-size: .78rem; }
.share-legend { display: grid; gap: .7rem; }
.share-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: .6rem; text-transform: capitalize; }
.platform-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--platform-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--platform-color) 15%, transparent); }
.money-bars { display: grid; gap: 1.25rem; padding: .5rem 0 1.2rem; }
.money-bar-row > div:first-child { display: flex; justify-content: space-between; margin-bottom: .48rem; }
.money-bar-row span { color: var(--muted); } .money-track { height: 14px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.money-fill { display: block; height: 100%; min-width: 3px; border-radius: inherit; }
.money-fill.spend { background: linear-gradient(90deg, #c28725, #f6c65b); }
.money-fill.revenue { background: linear-gradient(90deg, #159273, #45d483); }
.mini-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.mini-summary div { display: grid; gap: .25rem; } .mini-summary span { color: var(--muted); font-size: .78rem; } .mini-summary strong { font-size: 1.1rem; }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; }
.platform-card { border: 1px solid var(--line); border-top: 3px solid var(--platform-color); background: rgba(7,27,29,.45); border-radius: 14px; padding: .9rem; }
.platform-card-head { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: .55rem; text-transform: capitalize; margin-bottom: .75rem; }
.platform-card-head > span:last-child { color: var(--platform-color); font-weight: 800; }
.platform-stat { display: flex; justify-content: space-between; gap: .6rem; padding: .35rem 0; font-size: .84rem; border-bottom: 1px solid rgba(36,81,86,.45); }
.platform-stat span { color: var(--muted); } .platform-stat:last-of-type { border-bottom: 0; }
.platform-unavailable { color: var(--warning); font-size: .72rem; margin-top: .55rem; }
.empty-state-chart { grid-column: 1 / -1; min-height: 150px; display: grid; place-items: center; align-content: center; gap: .6rem; color: var(--muted); text-align: center; }
.empty-state-chart strong { color: var(--text); }
@media (max-width: 1350px) { .executive-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .executive-chart-grid { grid-template-columns: 1fr; } }
@media (max-width: 650px) { .executive-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .donut-layout { grid-template-columns: 1fr; justify-items: center; width: 100%; } .share-legend { width: 100%; } .mini-summary { grid-template-columns: 1fr; } }

/* Premium executive command center */
:root {
  --bg: #061315;
  --panel: #0b2022;
  --panel-2: #10282a;
  --panel-3: #153235;
  --text: #f4fbf8;
  --muted: #86a8a3;
  --line: rgba(116, 169, 160, .2);
  --primary: #3ad7b6;
  --primary-dark: #168c75;
  --gold: #e3bb68;
  --gold-soft: #f2d89d;
  --shadow: 0 18px 50px rgba(0, 0, 0, .34);
}

body {
  background:
    radial-gradient(circle at 70% -10%, rgba(212, 170, 82, .16), transparent 30rem),
    radial-gradient(circle at 5% 30%, rgba(35, 150, 133, .12), transparent 28rem),
    linear-gradient(145deg, #071719 0%, #051113 64%, #061315 100%);
}

.app-shell { grid-template-columns: 226px minmax(0, 1fr); }
.sidebar {
  padding: 1.2rem .8rem .9rem;
  background: linear-gradient(180deg, rgba(5, 22, 24, .98), rgba(5, 17, 19, .98));
  border-right-color: rgba(227, 187, 104, .14);
  box-shadow: 14px 0 40px rgba(0, 0, 0, .17);
}
.sidebar .brand-line { margin: 0 .45rem 1.8rem; gap: .7rem; }
.brand-mark {
  position: relative;
  width: 44px;
  height: 48px;
  border: 1px solid rgba(227, 187, 104, .8);
  border-radius: 50% 50% 46% 46% / 38% 38% 62% 62%;
  background: linear-gradient(150deg, rgba(227, 187, 104, .16), rgba(227, 187, 104, .02));
  box-shadow: inset 0 0 18px rgba(227, 187, 104, .08), 0 0 24px rgba(227, 187, 104, .08);
  font-size: .68rem;
  letter-spacing: -.03em;
}
.brand-mark::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 16px;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  background: var(--bg);
  border-radius: 8px 8px 0 0;
}
.brand-mark span { position: relative; z-index: 1; }
.brand-name { font-size: 1.05rem; letter-spacing: -.02em; }
.brand-kicker, .nav-label {
  color: var(--gold);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.nav-label { padding: 0 .85rem .65rem; color: #587975; }
.nav { gap: .22rem; }
.nav-button {
  position: relative;
  min-height: 43px;
  padding: .72rem .82rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .84rem;
  font-weight: 650;
}
.nav-button:hover { background: rgba(58, 215, 182, .06); border-color: rgba(58, 215, 182, .08); }
.nav-button.active {
  color: #fff9e9;
  border-color: rgba(227, 187, 104, .3);
  background: linear-gradient(90deg, rgba(227, 187, 104, .18), rgba(58, 215, 182, .07));
  box-shadow: inset 3px 0 0 var(--gold), 0 8px 22px rgba(0, 0, 0, .13);
}
.nav-icon { color: var(--gold-soft); font-size: 1rem; }
.sidebar-promo {
  margin: auto .05rem 1rem;
  padding: 1rem;
  min-height: 176px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid rgba(227, 187, 104, .22);
  border-radius: 15px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 30, 32, .18), rgba(6, 24, 26, .96)),
    radial-gradient(circle at 70% 0%, rgba(227, 187, 104, .28), transparent 58%);
}
.sidebar-promo strong { margin-top: .3rem; font-size: 1rem; line-height: 1.18; color: #fff8e6; }
.sidebar-promo p { color: var(--muted); font-size: .71rem; line-height: 1.45; margin: .55rem 0 .75rem; }
.sidebar-promo button { display: flex; justify-content: space-between; align-items: center; font-size: .74rem; }
.eyebrow, .panel-kicker {
  color: var(--gold);
  font-size: .65rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.sidebar-footer {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
  padding: .85rem .35rem 0;
}
.profile-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(227, 187, 104, .35);
  border-radius: 50%;
  color: var(--gold-soft);
  background: rgba(227, 187, 104, .1);
  font-weight: 850;
  font-size: .75rem;
}
.profile-copy { min-width: 0; }
.profile-copy .user-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .76rem; }
.profile-copy .user-role { font-size: .64rem; }
.logout-button { width: auto; margin: 0; padding: .4rem; font-size: 0; }
.logout-button::after { content: "↪"; font-size: .9rem; color: var(--muted); }

.topbar {
  min-height: 72px;
  padding: .8rem 1.25rem;
  background: rgba(5, 18, 20, .84);
  border-bottom-color: rgba(227, 187, 104, .12);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .13);
}
.topbar-heading h1 { margin: .12rem 0 0; font-size: 1.15rem; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: .65rem; }
.period-control {
  min-width: 195px;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .78rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 40, 42, .66);
}
.period-control > span { color: var(--gold); }
.period-control div { display: grid; }
.period-control strong { font-size: .76rem; }
.period-control small { color: var(--muted); font-size: .62rem; }
.notification-button {
  position: relative;
  width: 39px;
  height: 39px;
  padding: 0;
  border-radius: 50%;
  color: var(--gold-soft);
  background: rgba(14, 39, 41, .74);
}
.notification-button span {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--gold);
  color: #10211f;
  font-size: .58rem;
  font-weight: 900;
}
.content { max-width: 1900px; padding: 1rem 1.25rem 2rem; }

.executive-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: .9rem;
}
.executive-intro h2 { margin: .15rem 0 .2rem; font-size: 1.55rem; letter-spacing: -.035em; }
.executive-intro p { margin: 0; color: var(--muted); font-size: .82rem; }
.executive-status {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .55rem .5rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 31, 33, .72);
}
.executive-status > div { display: grid; min-width: 125px; }
.executive-status strong { font-size: .72rem; }
.executive-status small { color: var(--muted); font-size: .62rem; }
.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(69, 212, 131, .09), 0 0 16px rgba(69, 212, 131, .6);
}

.premium-kpi-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(115px, 1fr));
  gap: .55rem;
  margin-bottom: .65rem;
}
.premium-kpi {
  position: relative;
  min-height: 91px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: .55rem;
  padding: .78rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(19, 49, 51, .9), rgba(8, 29, 31, .94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 7px 20px rgba(0, 0, 0, .13);
}
.premium-kpi::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -35px;
  width: 75px;
  height: 75px;
  border-radius: 50%;
  background: rgba(58, 215, 182, .035);
}
.premium-kpi.highlight {
  border-color: rgba(58, 215, 182, .46);
  background: linear-gradient(145deg, rgba(19, 87, 78, .92), rgba(7, 45, 43, .96));
  box-shadow: 0 0 26px rgba(58, 215, 182, .08), inset 0 1px 0 rgba(255,255,255,.05);
}
.kpi-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(227, 187, 104, .25);
  border-radius: 50%;
  color: var(--gold-soft);
  background: rgba(227, 187, 104, .08);
  font-size: .78rem;
}
.premium-kpi > div { display: grid; min-width: 0; }
.premium-kpi small { color: #abc2be; font-size: .63rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.premium-kpi strong { margin: .16rem 0; font-size: 1.18rem; letter-spacing: -.035em; color: #fff; }
.premium-kpi em { color: #58dfa8; font-size: .6rem; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card {
  border-color: rgba(116, 169, 160, .2);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(15, 43, 45, .96), rgba(7, 27, 29, .97));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), 0 10px 30px rgba(0, 0, 0, .16);
}
.premium-dashboard-grid { display: grid; gap: .65rem; margin-bottom: .65rem; }
.primary-row { grid-template-columns: minmax(430px, 1.3fr) minmax(300px, .8fr) minmax(300px, .8fr); }
.operations-row { grid-template-columns: minmax(560px, 1.15fr) minmax(480px, .85fr); }
.intelligence-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.premium-panel { padding: .8rem .9rem; overflow: hidden; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .8rem;
  margin-bottom: .72rem;
}
.panel-head h3 { margin: .08rem 0 0; font-size: .91rem; letter-spacing: -.015em; }
.panel-total { display: grid; text-align: right; }
.panel-total strong { font-size: 1.02rem; color: #fff; }
.panel-total small { color: var(--muted); font-size: .62rem; }
.text-action {
  border: 0;
  padding: .2rem 0;
  background: transparent;
  color: var(--gold-soft);
  font-size: .66rem;
}

.revenue-chart { position: relative; min-height: 205px; padding-left: 44px; }
.revenue-chart svg { width: 100%; height: 175px; overflow: visible; }
.revenue-chart line { stroke: rgba(116, 169, 160, .14); stroke-width: 1; }
.chart-axis {
  position: absolute;
  inset: 2px auto 31px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #668985;
  font-size: .58rem;
}
.chart-caption { display: flex; justify-content: space-between; color: var(--muted); font-size: .6rem; }

.premium-donut-layout { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: center; gap: .9rem; min-height: 205px; }
.premium-donut { width: 126px; }
.premium-donut > div { width: 75px; background: #0a2426; }
.premium-donut strong { font-size: 1.08rem; }
.source-list { display: grid; gap: .38rem; }
.source-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto 38px;
  align-items: center;
  gap: .45rem;
  padding-bottom: .33rem;
  border-bottom: 1px solid rgba(116, 169, 160, .1);
  font-size: .65rem;
  text-transform: capitalize;
}
.source-row small { color: var(--muted); text-align: right; }
.premium-empty { color: var(--muted); font-size: .72rem; line-height: 1.5; }

.premium-funnel { display: grid; gap: .45rem; min-height: 205px; }
.premium-funnel-row { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: .35rem .55rem; align-items: center; }
.premium-funnel-row > div:first-child { display: flex; justify-content: space-between; grid-column: 1 / -1; font-size: .62rem; }
.premium-funnel-row > div:first-child span { color: #b4ccc7; }
.premium-funnel-row small { color: var(--muted); text-align: right; font-size: .58rem; }
.premium-funnel-bar {
  width: var(--funnel-width);
  height: 9px;
  justify-self: center;
  border-radius: 3px;
  background: linear-gradient(90deg, hsl(calc(168 - var(--funnel-index) * 9) 67% 40%), hsl(calc(168 - var(--funnel-index) * 9) 72% 64%));
  box-shadow: 0 0 14px rgba(58, 215, 182, .08);
}

.premium-table { border: 0; border-radius: 0; }
.premium-table table { min-width: 680px; }
.premium-table th {
  padding: .45rem .55rem;
  color: #789b96;
  background: rgba(4, 18, 20, .38);
  font-size: .58rem;
  letter-spacing: .05em;
}
.premium-table td { padding: .52rem .55rem; font-size: .66rem; }
.premium-table .cell-main { font-size: .69rem; }
.premium-table .cell-sub { font-size: .58rem; }
.premium-table .badge { padding: .25rem .42rem; font-size: .57rem; }
.positive { color: #61e7ab; }
.muted-value { color: var(--muted); }
.lead-identity { display: flex; align-items: center; gap: .5rem; }
.lead-identity > span {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(227, 187, 104, .25);
  border-radius: 50%;
  background: rgba(227, 187, 104, .08);
  color: var(--gold-soft);
  font-weight: 800;
}

.compact-panel { min-height: 137px; }
.compact-stat-grid, .approval-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.compact-stat-grid > div, .approval-summary > div {
  display: grid;
  gap: .16rem;
  padding: .62rem;
  border: 1px solid rgba(116, 169, 160, .12);
  border-radius: 8px;
  background: rgba(4, 18, 20, .25);
}
.compact-stat-grid small, .approval-summary small { color: var(--muted); font-size: .6rem; }
.compact-stat-grid strong, .approval-summary strong { font-size: 1.02rem; }
.approval-summary > div { grid-template-columns: 8px auto; }
.approval-summary small { grid-column: 1 / -1; }
.approval-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: .35rem; }
.approval-dot.review { background: var(--gold); }
.approval-dot.ready { background: var(--success); }
.approval-dot.draft { background: #a786ff; }
.focus-message { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem .7rem; border: 1px solid rgba(227, 187, 104, .15); border-radius: 9px; background: linear-gradient(100deg, rgba(227, 187, 104, .08), rgba(58, 215, 182, .04)); }
.focus-message > span { color: var(--gold); }
.focus-message strong { font-size: .74rem; }
.focus-message p { margin: .28rem 0 0; color: var(--muted); font-size: .64rem; line-height: 1.4; }

.integration-strip { margin-top: 0; }
.integration-chip-row { display: flex; gap: .55rem; overflow-x: auto; padding-bottom: .1rem; }
.integration-chip {
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .58rem .66rem;
  text-align: left;
  background: rgba(6, 25, 27, .58);
}
.integration-chip > span:last-child { display: grid; }
.integration-chip strong { font-size: .65rem; }
.integration-chip small { display: flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .57rem; }
.integration-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.integration-chip i.on { background: var(--success); box-shadow: 0 0 7px rgba(69, 212, 131, .55); }
.integration-glyph { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--gold-soft); background: rgba(227, 187, 104, .09); font-size: .72rem; font-weight: 900; }

button, .button { transition: transform .16s ease, filter .16s ease, border-color .16s ease; }
button:hover, .button:hover { transform: translateY(-1px); }
.button-primary {
  background: linear-gradient(135deg, #d1a751, #f0d28b);
  color: #11221f;
  box-shadow: 0 5px 16px rgba(227, 187, 104, .12);
}

.oauth-connect-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  margin-bottom: 1rem;
  padding: 1.15rem 1.25rem;
  border-color: rgba(64, 205, 177, .25);
  background: linear-gradient(110deg, rgba(16, 67, 66, .76), rgba(5, 28, 31, .92));
  box-shadow: inset 3px 0 0 #38d0b1, 0 16px 35px rgba(0, 0, 0, .16);
}
.oauth-connect-banner h3 { margin: .2rem 0 .35rem; }
.oauth-connect-banner p { max-width: 780px; margin: 0; color: var(--muted); line-height: 1.5; }
.oauth-connect-banner > button { flex: 0 0 auto; }
.oauth-connect-banner .code-box { margin-top: .7rem; user-select: all; }
.oauth-not-ready { border-color: rgba(227, 187, 104, .22); box-shadow: inset 3px 0 0 var(--gold), 0 16px 35px rgba(0, 0, 0, .16); }
.oauth-permission-list { display: grid; gap: .35rem; padding: .8rem; border: 1px solid rgba(116, 169, 160, .16); border-radius: 9px; background: rgba(4, 18, 20, .3); }
.oauth-permission-list span { color: var(--muted); font-size: .74rem; line-height: 1.5; overflow-wrap: anywhere; }
.meta-import-options { border: 1px solid rgba(116, 169, 160, .2); border-radius: 12px; padding: 1rem; display: grid; gap: .8rem; background: rgba(4, 18, 20, .28); }
.meta-import-options legend { padding: 0 .4rem; font-weight: 800; color: var(--text); }
.meta-import-group { display: grid; gap: .45rem; padding: .75rem; border-radius: 9px; background: rgba(255,255,255,.025); }
.meta-import-group label { display: flex; align-items: flex-start; gap: .55rem; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.meta-import-group input { margin-top: .1rem; accent-color: var(--accent); }
.meta-import-heading { display: flex; gap: 1rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.privacy-note { margin: 0; padding: .65rem .8rem; border-left: 3px solid var(--gold); color: var(--muted); font-size: .78rem; background: rgba(206,166,74,.06); }
.social-history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .85rem; }
.social-history-card { border: 1px solid rgba(116,169,160,.18); border-radius: 12px; overflow: hidden; background: rgba(4,18,20,.32); min-width: 0; }
.social-history-card > img, .social-history-placeholder { width: 100%; height: 180px; object-fit: cover; background: linear-gradient(135deg, rgba(20,81,80,.7), rgba(7,25,29,.8)); display: grid; place-items: center; font-size: 3rem; font-weight: 900; color: var(--accent); }
.social-history-body { padding: .9rem; display: grid; gap: .55rem; }
.social-history-body p { margin: 0; line-height: 1.45; color: var(--text); }
.social-history-body small { color: var(--muted); }
.social-history-body a { color: var(--accent); font-weight: 700; font-size: .8rem; }
.social-history-title { display: flex; justify-content: space-between; gap: .5rem; align-items: center; text-transform: capitalize; }
.social-history-metrics { display: flex; flex-wrap: wrap; gap: .45rem .8rem; color: var(--muted); font-size: .72rem; }
.oauth-warning { margin: 0; padding: .75rem; border: 1px solid rgba(244, 177, 74, .32); border-radius: 8px; color: #f0d28b; background: rgba(135, 83, 13, .14); }
.danger-button { color: #ffb0a8; border-color: rgba(255, 116, 103, .3); }
button:disabled { cursor: not-allowed; opacity: .48; transform: none !important; }
.table-actions { display: flex; flex-wrap: wrap; gap: .4rem; min-width: 150px; }

@media (max-width: 1550px) {
  .premium-kpi-grid { grid-template-columns: repeat(5, minmax(120px, 1fr)); }
  .primary-row { grid-template-columns: minmax(420px, 1.2fr) minmax(280px, .8fr); }
  .funnel-panel { grid-column: 1 / -1; }
  .premium-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 0; gap: .65rem 1.2rem; }
}

@media (max-width: 1180px) {
  .premium-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .primary-row, .operations-row { grid-template-columns: 1fr; }
  .intelligence-row { grid-template-columns: 1fr 1fr; }
  .focus-message { min-height: 76px; }
}

@media (max-width: 760px) {
  .oauth-connect-banner { align-items: stretch; flex-direction: column; }
  .oauth-connect-banner > button { align-self: flex-start; }
  .topbar-heading .eyebrow, .period-control, .desktop-quick-lead { display: none; }
  .topbar { min-height: 60px; }
  .topbar-heading h1 { font-size: 1rem; }
  .content { padding: .85rem .75rem 5.5rem; }
  .executive-intro { align-items: stretch; flex-direction: column; }
  .executive-status { align-self: stretch; }
  .executive-status button { margin-left: auto; }
  .premium-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .premium-kpi { min-height: 86px; }
  .primary-row, .operations-row, .intelligence-row { grid-template-columns: 1fr; }
  .funnel-panel { grid-column: auto; }
  .premium-funnel { grid-template-columns: 1fr; }
  .premium-donut-layout { grid-template-columns: 105px minmax(0, 1fr); }
  .premium-donut { width: 102px; }
  .premium-donut > div { width: 62px; }
  .mobile-nav { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 430px) {
  .premium-kpi-grid { grid-template-columns: 1fr 1fr; gap: .45rem; }
  .premium-kpi { grid-template-columns: 24px minmax(0, 1fr); padding: .65rem; }
  .premium-kpi strong { font-size: 1.02rem; }
  .executive-intro h2 { font-size: 1.27rem; }
  .premium-donut-layout { grid-template-columns: 1fr; justify-items: center; }
  .source-list { width: 100%; }
  .compact-stat-grid, .approval-summary { grid-template-columns: 1fr 1fr 1fr; }
}

/* Executive Suite v0.4 — visibly versioned premium command center */
.release-line { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.release-badge {
  display: inline-flex; align-items: center; min-height: 22px; padding: .18rem .52rem;
  border: 1px solid rgba(239, 197, 108, .48); border-radius: 999px; color: #ffe8ae;
  background: linear-gradient(135deg, rgba(239, 197, 108, .18), rgba(239, 197, 108, .05));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 18px rgba(239,197,108,.08);
  font-size: .56rem; font-weight: 900; letter-spacing: .13em;
}
.command-search {
  width: clamp(220px, 25vw, 420px); height: 40px; display: flex; align-items: center; gap: .55rem;
  padding: 0 .8rem; border: 1px solid rgba(116, 169, 160, .24); border-radius: 11px;
  background: linear-gradient(145deg, rgba(16, 43, 46, .84), rgba(7, 27, 29, .9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.command-search span { color: var(--gold); font-size: 1rem; }
.command-search input { width: 100%; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: .72rem; }
.command-search input::placeholder { color: #6f918d; }
.executive-intro {
  padding: .9rem 1rem; border: 1px solid rgba(227, 187, 104, .15); border-radius: 13px;
  background: radial-gradient(circle at 78% -50%, rgba(227,187,104,.2), transparent 38%), linear-gradient(120deg, rgba(15,50,52,.82), rgba(7,27,29,.72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 12px 32px rgba(0,0,0,.15);
}
.executive-intro h2 { font-size: 1.75rem; }
.premium-kpi { border-top-color: rgba(227,187,104,.28); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.premium-kpi:hover { transform: translateY(-2px); border-color: rgba(227,187,104,.42); box-shadow: 0 15px 34px rgba(0,0,0,.22), 0 0 22px rgba(58,215,182,.05); }
.premium-panel { border-top-color: rgba(227,187,104,.22); }
.panel-head { padding-bottom: .55rem; border-bottom: 1px solid rgba(116,169,160,.1); }
.integration-strip { background: radial-gradient(circle at 10% 0%, rgba(227,187,104,.09), transparent 34%), linear-gradient(145deg, rgba(15,43,45,.97), rgba(7,27,29,.98)); }
@media (max-width: 1180px) { .command-search { display: none; } }


.two-col{grid-template-columns:repeat(2,minmax(0,1fr))}
.readiness-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;margin:1rem 0}
.readiness-item{display:flex;gap:.75rem;align-items:center;padding:.8rem 1rem;border:1px solid rgba(245,190,78,.22);border-radius:12px;background:rgba(13,29,31,.58)}
.readiness-item>span{min-width:42px;text-align:center;font-size:.68rem;font-weight:800;color:#f1c46b}
.readiness-item.ready{border-color:rgba(35,204,151,.34);background:rgba(18,88,70,.22)}
.readiness-item.ready>span{color:#47daa9}
.readiness-item strong,.readiness-item small{display:block}
.readiness-item small{color:var(--muted);margin-top:.18rem}
.deployment-row{display:grid;grid-template-columns:auto minmax(130px,1fr) 2fr;gap:.7rem;align-items:center;padding:.65rem 0;border-bottom:1px solid rgba(255,255,255,.08)}
.deployment-row code{color:#85e5cc;overflow-wrap:anywhere}
.success-panel{padding:.5rem}
button:disabled{opacity:.42;cursor:not-allowed}
@media(max-width:900px){.two-col,.readiness-grid{grid-template-columns:1fr}.deployment-row{grid-template-columns:1fr}}

/* Visual Command Center v2.0 — presentation only */
.dashboard-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.7rem;margin:.75rem 0}
.dashboard-action{min-height:72px;display:grid;grid-template-columns:36px minmax(0,1fr) 22px;gap:.65rem;align-items:center;padding:.75rem .85rem;text-align:left;color:var(--text);border:1px solid rgba(108,235,213,.18);border-radius:13px;background:linear-gradient(145deg,rgba(17,53,55,.96),rgba(7,27,29,.98));box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 10px 24px rgba(0,0,0,.15)}
.dashboard-action:hover{transform:translateY(-2px);border-color:rgba(108,235,213,.48);box-shadow:0 15px 34px rgba(0,0,0,.24),0 0 24px rgba(45,212,191,.08)}
.dashboard-action>span{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:rgba(45,212,191,.12);color:#7af0dc;font-size:1.05rem}
.dashboard-action strong{display:block;font-size:.78rem}.dashboard-action small{display:block;margin-top:.2rem;color:var(--muted);font-size:.61rem;line-height:1.25}
.dashboard-action b{color:var(--gold);font-size:1rem;text-align:right}.dashboard-action.campaign{border-top-color:rgba(231,183,92,.48)}
.dashboard-action.lead{border-top-color:rgba(60,140,255,.48)}.dashboard-action.content-action{border-top-color:rgba(217,108,216,.48)}.dashboard-action.connect{border-top-color:rgba(86,217,154,.48)}
.social-kpi{background:radial-gradient(circle at 100% 0,rgba(60,140,255,.13),transparent 50%),linear-gradient(145deg,rgba(14,46,49,.98),rgba(7,27,29,.98))}
.channel-board{margin-bottom:.7rem;background:radial-gradient(circle at 75% 0,rgba(60,140,255,.08),transparent 34%),linear-gradient(145deg,rgba(15,43,45,.98),rgba(7,27,29,.99))}
.channel-board .panel-head p{margin:.22rem 0 0;color:var(--muted);font-size:.64rem}.channel-name{display:flex;align-items:center;gap:.5rem;text-transform:capitalize}
.metric-scale{width:88px;height:6px;display:inline-block;margin-right:.45rem;overflow:hidden;vertical-align:middle;border-radius:99px;background:rgba(255,255,255,.08)}
.metric-scale span{height:100%;display:block;border-radius:inherit;background:linear-gradient(90deg,#2dd4bf,#e7b75c);box-shadow:0 0 10px rgba(45,212,191,.35)}
.channel-board td:last-child{white-space:nowrap}.channel-board td:last-child small{color:#b7d4d0}
@media(max-width:1100px){.dashboard-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.premium-kpi-grid{grid-template-columns:repeat(4,minmax(120px,1fr))}}
@media(max-width:760px){.dashboard-actions{grid-template-columns:1fr 1fr}.dashboard-action{grid-template-columns:30px minmax(0,1fr);min-height:66px}.dashboard-action>b{display:none}}
@media(max-width:520px){.dashboard-actions{grid-template-columns:1fr}.dashboard-action{min-height:60px}}

/* Unified multichannel inbox */
.message-channel-bar{display:grid;grid-template-columns:repeat(7,minmax(110px,1fr));gap:10px;margin-top:16px}
.message-channel{display:grid;grid-template-columns:32px 1fr auto;align-items:center;gap:9px;padding:11px 12px;border:1px solid var(--border);border-radius:14px;background:var(--panel);color:var(--text);text-align:left;box-shadow:none}
.message-channel span{display:grid;place-items:center;width:30px;height:30px;border-radius:10px;background:color-mix(in srgb,var(--accent) 12%,transparent);font-size:11px;font-weight:800}
.message-channel strong{font-size:12px}.message-channel b{min-width:23px;padding:3px 6px;border-radius:999px;background:var(--panel-soft);text-align:center;font-size:11px}
.message-channel:hover,.message-channel.active{border-color:var(--accent);transform:translateY(-1px)}
.message-channel.active{background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 16%,var(--panel)),var(--panel))}
.message-note{margin-top:10px;padding:10px 13px;border:1px solid color-mix(in srgb,var(--accent) 28%,var(--border));border-radius:12px;background:color-mix(in srgb,var(--accent) 7%,var(--panel));font-size:12px;color:var(--muted)}
.message-workspace{display:grid;grid-template-columns:minmax(320px,390px) minmax(480px,1fr);min-height:690px;overflow:hidden}
.conversation-list,.conversation-thread{min-width:0;border-radius:16px}.conversation-list{border-top-right-radius:0;border-bottom-right-radius:0}
.conversation-thread{display:grid;grid-template-rows:auto minmax(0,1fr) auto;border-top-left-radius:0;border-bottom-left-radius:0;border-left:0}
.conversation-list .panel-head{padding:18px 18px 10px}.conversation-list .panel-head h3,.conversation-list .panel-head p{margin:0}.conversation-list .panel-head p{margin-top:3px;color:var(--muted);font-size:12px}
.conversation-search{display:grid;grid-template-columns:1fr auto auto;gap:7px;padding:0 14px 12px}.conversation-search input{min-width:0}
.conversation-scroll{max-height:600px;overflow:auto;border-top:1px solid var(--border)}
.conversation-row{width:100%;display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:10px;align-items:start;padding:13px 14px;border:0;border-bottom:1px solid var(--border);border-radius:0;background:transparent;color:var(--text);text-align:left}
.conversation-row:hover,.conversation-row.active{background:color-mix(in srgb,var(--accent) 9%,var(--panel))}
.conversation-row.active{box-shadow:inset 3px 0 var(--accent)}
.conversation-avatar{display:grid;place-items:center;width:40px;height:40px;border-radius:13px;background:#334155;color:#fff;font-size:11px;font-weight:850;letter-spacing:.04em}
.channel-whatsapp{background:#20a66a}.channel-facebook{background:#1877f2}.channel-instagram{background:linear-gradient(135deg,#833ab4,#e1306c,#fcb045)}.channel-email{background:#7357d8}.channel-sms{background:#168a9f}.channel-internal{background:#64748b}
.conversation-copy{min-width:0}.conversation-title{display:flex;align-items:center;gap:7px}.conversation-title strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.conversation-title em{font-style:normal;color:var(--muted);font-size:10px}
.conversation-copy small,.conversation-copy p{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-copy small{margin-top:3px;color:var(--muted);font-size:10px}.conversation-copy p{margin:5px 0 0;font-size:12px;color:var(--text-soft)}
.conversation-side{display:flex;flex-direction:column;align-items:flex-end;gap:7px}.conversation-side time{font-size:9px;color:var(--muted);white-space:nowrap}.conversation-side b{display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:var(--accent);color:#fff;font-size:10px}
.thread-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid var(--border)}.thread-contact{display:flex;align-items:center;gap:10px}.thread-contact strong,.thread-contact small{display:block}.thread-contact small{margin-top:3px;color:var(--muted);font-size:11px}
.thread-placeholder{grid-row:1/4;display:grid;place-items:center;align-content:center;gap:7px;min-height:520px;color:var(--muted);text-align:center}.thread-placeholder span{display:grid;place-items:center;width:62px;height:62px;border-radius:21px;background:color-mix(in srgb,var(--accent) 12%,var(--panel-soft));color:var(--accent);font-weight:900}.thread-placeholder h3,.thread-placeholder p{margin:0}
.thread-messages{min-height:0;max-height:570px;overflow:auto;padding:22px;background:color-mix(in srgb,var(--panel-soft) 55%,var(--panel))}
.message-bubble{width:max-content;max-width:min(74%,620px);margin:0 0 12px;padding:10px 13px;border:1px solid var(--border);border-radius:14px 14px 14px 4px;background:var(--panel);box-shadow:0 4px 14px rgba(0,0,0,.05)}
.message-bubble.outbound{margin-left:auto;border-radius:14px 14px 4px 14px;background:color-mix(in srgb,var(--accent) 14%,var(--panel));border-color:color-mix(in srgb,var(--accent) 30%,var(--border))}.message-bubble.internal{margin-left:auto;margin-right:auto;background:color-mix(in srgb,#f5b942 13%,var(--panel));border-style:dashed}
.message-bubble small,.message-bubble time{display:block;color:var(--muted);font-size:9px}.message-bubble p{margin:5px 0 7px;white-space:pre-wrap;font-size:13px;line-height:1.45}
.message-compose{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:14px 16px;border-top:1px solid var(--border);align-items:center}.message-compose textarea{grid-column:1/3;min-height:72px;resize:vertical}.message-compose label{font-size:11px;color:var(--muted)}
@media(max-width:1120px){.message-channel-bar{grid-template-columns:repeat(4,1fr)}.message-workspace{grid-template-columns:320px 1fr}}
@media(max-width:780px){.message-channel-bar{grid-template-columns:repeat(2,1fr)}.message-workspace{grid-template-columns:1fr}.conversation-thread{border-left:1px solid var(--border);border-top:0}.conversation-scroll{max-height:360px}.thread-messages{max-height:480px}.message-bubble{max-width:88%}}


.lead-view-tabs { display:flex; gap:.65rem; margin:0 0 1rem; flex-wrap:wrap; }
.lead-view-tab { display:flex; align-items:center; gap:.55rem; border:1px solid var(--line); background:var(--card); color:var(--muted); border-radius:999px; padding:.65rem 1rem; font-weight:700; cursor:pointer; }
.lead-view-tab span { min-width:1.7rem; padding:.1rem .4rem; border-radius:999px; background:rgba(255,255,255,.08); color:inherit; text-align:center; }
.lead-view-tab.active { background:var(--accent); color:#032f2c; border-color:var(--accent); }
.lead-pagination { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:1rem .2rem 0; color:var(--muted); }
.lead-pagination > div { display:flex; align-items:center; gap:.75rem; }
.lead-pagination strong { color:var(--text); font-size:.9rem; }
.crm-connection-strip { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:0 0 1rem; border-color:color-mix(in srgb,var(--accent) 45%,var(--line)); background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 9%,var(--card)),var(--card)); }
.crm-connection-strip h3,.crm-connection-strip p { margin:.15rem 0 0; }
.crm-connection-strip.warning { border-color:color-mix(in srgb,var(--gold) 45%,var(--line)); }
.status-badge { display:inline-flex; align-items:center; width:max-content; padding:.25rem .55rem; border:1px solid var(--line); border-radius:999px; font-size:.68rem; font-weight:800; white-space:nowrap; }
.status-badge.connected { border-color:rgba(86,217,154,.45); background:rgba(86,217,154,.12); color:#7be7ac; }
.status-badge.pending { border-color:rgba(231,183,92,.45); background:rgba(231,183,92,.12); color:var(--gold); }
.status-badge.muted { color:var(--muted); background:rgba(255,255,255,.04); }
.row-actions { display:flex; align-items:center; gap:.4rem; white-space:nowrap; }
@media (max-width: 720px) { .lead-pagination { align-items:flex-start; flex-direction:column; } }
