:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --surface-3: #eceff4;
  --text: #090b12;
  --muted: #8c94a7;
  --muted-2: #b2b8c6;
  --line: #e4e7ed;
  --line-strong: #d6dae3;
  --sidebar: #0e1016;
  --sidebar-surface: #161920;
  --sidebar-text: #808aa4;
  --sidebar-active: #222543;
  --primary: #5248ed;
  --primary-2: #7b78f6;
  --primary-soft: #edecff;
  --success: #10a463;
  --success-soft: #dcf8e9;
  --warning: #f59e0b;
  --warning-soft: #fff1c9;
  --danger: #ef4444;
  --danger-soft: #fee5e5;
  --info: #3b82f6;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 12px 40px rgba(21, 24, 38, .08);
  --sidebar-width: 242px;
  --content-max: 1320px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #11131a;
  --surface: #181b24;
  --surface-2: #20242f;
  --surface-3: #282d3a;
  --text: #f8fafc;
  --muted: #9aa3b6;
  --muted-2: #737d91;
  --line: #2b303d;
  --line-strong: #3a4050;
  --primary-soft: #29254d;
  --success-soft: #123c2c;
  --warning-soft: #443413;
  --danger-soft: #471e23;
  --shadow: 0 15px 48px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--sidebar-width);
  color: #fff;
  background: var(--sidebar);
  border-right: 1px solid #20232c;
  display: flex;
  flex-direction: column;
  transition: width .22s ease, transform .22s ease;
  overflow: hidden;
}
.brand-row { height: 68px; display: flex; align-items: center; padding: 0 14px 0 24px; border-bottom: 1px solid #20232c; }
.brand { min-width: 165px; display: flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 800; }
.brand-mark { width: 41px; height: 41px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #716cf6, #5a50e9); box-shadow: 0 8px 22px rgba(89, 80, 237, .32); }
.brand-mark svg { width: 21px; height: 21px; }
.brand-name { white-space: nowrap; }
.icon-button { border: 0; background: transparent; padding: 0; width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; cursor: pointer; }
.icon-button:hover { background: var(--surface-2); }
.icon-button svg { width: 17px; height: 17px; }
.sidebar-pin { margin-left: auto; color: #fff; background: var(--primary); width: 24px; height: 24px; border-radius: 50%; }
.sidebar-pin:hover { background: var(--primary-2); }
.sidebar-pin svg { width: 15px; }
.workspace-card { margin: 12px 13px 10px; height: 54px; padding: 10px 11px; border: 1px solid #2b2e37; border-radius: 10px; background: var(--sidebar-surface); display: flex; align-items: center; gap: 10px; }
.workspace-avatar { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: #9d99ff; background: #26294c; font-size: 11px; font-weight: 700; }
.workspace-card > span:nth-child(2) { min-width: 0; flex: 1; }
.workspace-card b, .workspace-card small { display: block; white-space: nowrap; }
.workspace-card b { font-size: 13px; }
.workspace-card small { color: #65708b; font-size: 11px; }
.workspace-card > svg { width: 13px; color: #747d91; }
.side-nav { padding: 2px 9px; overflow-y: auto; scrollbar-width: thin; }
.nav-label { margin: 15px 11px 7px; color: #7182a8; font-size: 10px; letter-spacing: .12em; font-weight: 700; }
.side-nav a, .sidebar-bottom > a, .sidebar-bottom > button {
  position: relative;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: var(--sidebar-text);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
}
.side-nav a:hover, .sidebar-bottom > a:hover, .sidebar-bottom > button:hover { color: #fff; background: #161924; }
.side-nav a.active, .sidebar-bottom > a.active { color: #fff; background: var(--sidebar-active); font-weight: 650; }
.side-nav a.active::before { content: ""; position: absolute; left: -9px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #7772ff; }
.side-nav svg, .sidebar-bottom > a svg, .sidebar-bottom > button svg { flex: 0 0 auto; width: 19px; height: 19px; }
.side-nav em { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 12px; background: var(--primary); color: #fff; font-size: 10px; font-style: normal; font-weight: 800; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #20232c; padding: 7px 9px 10px; }
.user-card { margin-top: 7px; padding: 10px; border-top: 1px solid #20232c; display: flex; align-items: center; gap: 10px; min-width: 220px; }
.user-card > span:nth-child(2) { flex: 1; min-width: 0; }
.user-card b, .user-card small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card b { font-size: 13px; }
.user-card small { color: #7182a8; font-size: 10px; }
.user-card .icon-button { color: #798398; }
.avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; background: #e6e8ee; color: #4c5568; font-size: 11px; font-weight: 750; }
.avatar-sm { width: 29px; height: 29px; font-size: 10px; }
.avatar-lg { width: 68px; height: 68px; font-size: 22px; }
.avatar-violet { color: #fff; background: linear-gradient(145deg, #736eff, #5146e9); }
.avatar-green { color: #287a3a; background: #dff5d7; }
.avatar-pink { color: #a33b61; background: #f5d8e3; }
.avatar-blue { color: #4355a8; background: #d9defb; }
.avatar-gold { color: #8a6a24; background: #f4e8c8; }

.app-main { min-height: 100vh; margin-left: var(--sidebar-width); transition: margin-left .22s ease; }
.page { width: min(100%, var(--content-max)); margin: 0 auto; padding: 40px 28px 56px; }
.page-wide { max-width: none; }
.page-bleed { width: 100%; padding: 0; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.page-header h1, .section-title { margin: 0; font-weight: 780; letter-spacing: -.04em; }
.page-header h1 { font-size: clamp(28px, 3vw, 36px); line-height: 1.05; }
.page-header p { margin: 7px 0 0; color: var(--muted); }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.eyebrow { display: inline-block; margin-bottom: 10px; color: var(--primary); font: 700 10px/1.2 var(--mono); letter-spacing: .18em; }
.eyebrow.light { color: #aaa7ff; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

.button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 650;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover { border-color: var(--line-strong); background: var(--surface-2); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .5; cursor: wait; }
.button svg { width: 16px; height: 16px; }
.button.primary { color: #fff; border-color: #090b12; background: #090b12; }
[data-theme="dark"] .button.primary { color: #0a0c12; border-color: #fff; background: #fff; }
.button.violet { color: #fff; border-color: var(--primary); background: var(--primary); }
.button.success { color: #087347; border-color: #a4ebcb; background: var(--success-soft); }
.button.danger { color: var(--danger); border-color: #f8b9b9; background: var(--danger-soft); }
.button.ghost { border-color: transparent; background: transparent; }
.button.small { min-height: 34px; padding: 0 11px; font-size: 12px; }
.button.wide { width: 100%; }
.segmented { padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); display: flex; gap: 3px; }
.segmented a, .segmented button { min-height: 35px; padding: 0 13px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; display: grid; place-items: center; cursor: pointer; }
.segmented .active { color: #fff; background: #090b12; font-weight: 700; }
[data-theme="dark"] .segmented .active { color: #090b12; background: #fff; }

.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { min-height: 150px; padding: 26px; }
.stat-label { color: var(--muted); font: 700 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.stat-value { margin: 12px 0 14px; font-size: 38px; line-height: 1; font-weight: 800; letter-spacing: -.04em; }
.stat-value.violet { color: var(--primary); }
.stat-value.green { color: var(--success); }
.stat-value.blue { color: #2c54f4; }
.stat-foot { padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font: 11px var(--mono); }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 23px; padding: 0 9px; border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { color: #0a9d5c; background: var(--success-soft); }
.badge.warning { color: #bb7a00; background: var(--warning-soft); }
.badge.danger { color: #dc3030; background: var(--danger-soft); }
.badge.violet { color: var(--primary); background: var(--primary-soft); }
.badge.gray { color: #7f899d; background: var(--surface-2); }
.count-pill { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 12px; }
.count-pill b { color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 98px;
  padding: 11px 12px;
  resize: vertical;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(82, 72, 237, .12);
}

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

/* INPUT FILE */
input[type="file"] {
  width: 100%;
  min-height: 46px;
  padding: 5px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: var(--surface-2);
  cursor: pointer;
  font-size: 12px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

input[type="file"]:hover {
  color: var(--text);
  border-color: var(--primary);
  background: var(--primary-soft);
}

input[type="file"]:focus,
input[type="file"]:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(82, 72, 237, .12);
}

input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 10px;
  padding: 0 14px;
  color: #fff;
  border: 0;
  border-radius: 7px;
  background: var(--primary);
  cursor: pointer;
  font: 650 12px/1 var(--font);
  transition: background .15s ease, transform .15s ease;
}

input[type="file"]::file-selector-button:hover {
  background: var(--primary-2);
}

input[type="file"]::file-selector-button:active {
  transform: translateY(1px);
}

/* CHECKBOX */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
  background-color: var(--surface);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  cursor: pointer;
  vertical-align: middle;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

input[type="checkbox"]:hover { border-color: var(--primary); }

input[type="checkbox"]:checked {
  border-color: var(--primary);
  background-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.3' d='m3 8.5 3.1 3L13 4.8'/%3E%3C/svg%3E");
}

input[type="checkbox"]:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(82, 72, 237, .16);
}

input[type="checkbox"]:active { transform: scale(.94); }

input[type="checkbox"]:disabled,
input[type="file"]:disabled {
  opacity: .55;
  cursor: not-allowed;
}

label { display: grid; gap: 7px; color: var(--text); font-size: 12px; font-weight: 650; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-grid .full { grid-column: 1 / -1; }
.check-row { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.check-row input[type="checkbox"] { width: 18px; height: 18px; }

.search-box { position: relative; }
.search-box svg { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.search-box input { padding-left: 40px; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.toolbar .search-box { flex: 1; }
.filter-chips { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.chip { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); display: inline-flex; align-items: center; gap: 7px; font-size: 12px; cursor: pointer; }
.chip.active { color: #fff; border-color: var(--primary); background: var(--primary); }
.chip.danger { color: var(--danger); border-color: #f6b8b8; }
.chip .dot { width: 7px; height: 7px; }

.table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 44px; color: var(--muted); background: var(--surface-2); font-size: 10px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table th, .data-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.data-table tbody tr { cursor: pointer; transition: background .12s ease; }
.data-table tbody tr:hover, .data-table tbody tr.selected { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.lead-cell { display: flex; align-items: center; gap: 11px; font-weight: 650; }
.lead-phone { font-family: var(--mono); color: #687287; font-size: 12px; }
.channel-icon { width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; color: #fff; background: #11a753; font-size: 9px; font-weight: 800; }
.pagination { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.pagination a, .pagination span { min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; background: var(--surface); }
.pagination .active { color: #fff; border-color: var(--primary); background: var(--primary); }

.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 200; display: grid; gap: 9px; }
.toast { min-width: 290px; max-width: 430px; padding: 13px 15px; border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; animation: toast-in .2s ease; }
.toast span { flex: 1; }
.toast button { border: 0; color: var(--muted); background: transparent; font-size: 19px; cursor: pointer; }
.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-danger { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.modal-root { position: fixed; inset: 0; z-index: 150; visibility: hidden; opacity: 0; transition: opacity .16s ease, visibility .16s; }
.modal-root.open { visibility: visible; opacity: 1; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 18, .62); backdrop-filter: blur(3px); }
.modal-card { position: relative; width: min(720px, calc(100vw - 28px)); max-height: calc(100vh - 40px); margin: 20px auto; padding: 28px; overflow-y: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 30px 90px rgba(0, 0, 0, .28); transform: translateY(12px); transition: transform .18s ease; }
.modal-root.open .modal-card { transform: none; }
.modal-card.wide { width: min(1120px, calc(100vw - 28px)); }
.modal-close { position: absolute; right: 14px; top: 14px; z-index: 2; color: var(--muted); font-size: 24px; }
.modal-title { margin: 0 0 5px; font-size: 24px; letter-spacing: -.03em; }
.modal-subtitle { margin: 0 0 24px; color: var(--muted); }
.modal-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.template { display: none !important; }

.dashboard-grid { margin-top: 16px; display: grid; grid-template-columns: 1.55fr .8fr; gap: 16px; }
.activity-card { min-height: 310px; position: relative; overflow: hidden; }
.activity-chart { height: 180px; margin-top: 25px; display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line); }
.activity-bar { flex: 1; min-height: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--primary-2), var(--primary)); opacity: .86; }
.distribution-list, .alert-list, .connection-list, .ranking-list { display: grid; gap: 0; }
.distribution-row { min-height: 37px; display: grid; grid-template-columns: minmax(110px, 1fr) 1.2fr auto; align-items: center; gap: 12px; }
.progress { height: 6px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.progress > span { height: 100%; display: block; border-radius: inherit; background: var(--primary-2); }
.alert-row { padding: 14px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 12px; }
.alert-row:last-child, .ranking-row:last-child { border-bottom: 0; }
.alert-symbol { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; color: #bd7900; background: var(--warning-soft); }
.alert-row b, .alert-row small { display: block; }
.alert-row small { margin-top: 3px; color: var(--muted); font: 10px var(--mono); }
.ranking-row { min-height: 71px; padding: 10px 0; border-bottom: 1px dashed var(--line); display: grid; grid-template-columns: 30px 40px 1fr auto; align-items: center; gap: 8px; }
.rank-number { color: #9ba2b2; font-size: 16px; font-weight: 800; }
.rank-main b, .rank-main small { display: block; }
.rank-main small { margin-top: 4px; color: var(--muted); font: 10px var(--mono); }
.rank-score { text-align: right; font: 11px var(--mono); }
.rank-score b { display: block; color: var(--success); font: 700 16px var(--font); }
.podium-card { position: relative; overflow: hidden; background: radial-gradient(circle at 50% 0, rgba(117,105,255,.14), transparent 42%), var(--surface); }
.podium-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, rgba(255,255,255,.08), transparent 42%); }
.podium-card .card-head { position: relative; z-index: 1; }
.podium-trophy { width: 46px; height: 46px; border: 1px solid rgba(245,190,69,.35); border-radius: 14px; color: #d89b24; background: linear-gradient(145deg, #fff7da, #f5d58f); display: grid; place-items: center; font-size: 23px; box-shadow: 0 12px 28px rgba(218,157,38,.17); }
.podium { position: relative; min-height: 315px; padding: 18px 5px 0; display: flex; align-items: flex-end; justify-content: center; gap: 8px; }
.podium-place { width: 31%; min-width: 0; display: grid; align-content: end; text-align: center; }
.podium-person { position: relative; min-height: 128px; padding: 0 4px 14px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.podium-person .avatar { width: 52px; height: 52px; margin-bottom: 8px; color: #302a7c; background: linear-gradient(145deg, #eeecff, #c6c1ff); box-shadow: 0 0 0 5px var(--surface), 0 8px 24px rgba(82,72,237,.22); font-size: 15px; }
.podium-person b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.podium-person small { margin-top: 4px; color: var(--success); font: 700 10px var(--mono); }
.podium-person .crown { position: absolute; top: -8px; color: #e9af37; font-size: 25px; filter: drop-shadow(0 5px 7px rgba(218,157,38,.24)); }
.podium-step { position: relative; min-height: 108px; padding: 18px 6px; border: 1px solid rgba(82,72,237,.17); border-bottom: 0; border-radius: 14px 14px 0 0; background: linear-gradient(180deg, rgba(110,98,255,.2), rgba(82,72,237,.08)); display: grid; place-content: start center; overflow: hidden; }
.podium-step::after { content: ""; position: absolute; left: -25%; right: -25%; top: -30px; height: 55px; border-radius: 50%; background: rgba(255,255,255,.14); }
.podium-step span { font-size: 29px; font-weight: 850; letter-spacing: -.05em; }
.podium-step small { color: var(--muted); font: 700 8px var(--mono); letter-spacing: .16em; }
.podium-place.place-1 { order: 2; }
.podium-place.place-2 { order: 1; }
.podium-place.place-3 { order: 3; }
.podium-place.place-1 .podium-person { min-height: 152px; }
.podium-place.place-1 .podium-person .avatar { width: 62px; height: 62px; color: #745317; background: linear-gradient(145deg, #fff8d6, #f1c866); }
.podium-place.place-1 .podium-step { min-height: 154px; border-color: rgba(229,170,43,.28); background: linear-gradient(180deg, rgba(255,215,120,.48), rgba(208,146,31,.13)); }
.podium-place.place-2 .podium-step { min-height: 112px; background: linear-gradient(180deg, rgba(199,205,219,.4), rgba(142,151,172,.1)); }
.podium-place.place-3 .podium-step { min-height: 86px; background: linear-gradient(180deg, rgba(210,142,90,.33), rgba(167,100,55,.08)); }
.ranking-rest { position: relative; z-index: 1; margin-top: 14px; padding-top: 4px; border-top: 1px solid var(--line); }
.podium-empty { min-height: 290px; display: grid; place-content: center; justify-items: center; }
.podium-empty > span { color: #d89b24; font-size: 46px; }
.connection-row { padding: 8px 0; display: flex; align-items: center; gap: 9px; }
.connection-row > span:last-child { margin-left: auto; color: var(--muted); font: 10px var(--mono); }

.split-layout { height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.split-layout.chat-open { grid-template-columns: minmax(650px, 1fr) minmax(420px, 500px); }
.split-content { min-width: 0; overflow-y: auto; padding: 28px 30px; }
.chat-panel { min-width: 0; border-left: 1px solid var(--line); background: var(--surface); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
.split-layout:not(.chat-open) > .chat-panel { display: none; }
.chat-head { min-height: 98px; padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.chat-head .lead-meta { flex: 1; min-width: 0; }
.chat-head h3 { margin: 1px 0 2px; font-size: 14px; }
.chat-head p { margin: 0; color: var(--muted); font-size: 11px; }
.chat-tools { display: flex; color: var(--muted); }
.chat-tools .active { color: var(--primary); background: var(--primary-soft); }
.desktop-chat-close { margin-left: 3px; font-size: 21px; line-height: 1; }
.chat-stage { margin-top: 8px; width: max-content; min-height: 28px; padding: 0 11px; border: 0; border-radius: 99px; background: var(--surface-2); font-size: 11px; }
.chat-messages { padding: 30px 18px; overflow-y: auto; background: var(--surface-2); }
.date-divider { margin: 0 auto 26px; width: max-content; padding: 6px 11px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: var(--surface); font-size: 10px; }
.message-group { margin: 0 0 12px; display: flex; flex-direction: column; }
.message-group.outbound { align-items: flex-end; }
.message-author { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.message-bubble { max-width: 82%; padding: 12px 14px 9px; border: 1px solid var(--line); border-radius: 14px 14px 14px 3px; background: var(--surface); box-shadow: 0 4px 12px rgba(27, 31, 47, .04); }
.message-group.outbound .message-bubble { color: #fff; border: 0; border-radius: 14px 14px 3px 14px; background: linear-gradient(135deg, #584af0, #4436d7); }
.message-time { margin-top: 6px; color: var(--muted); font: 9px var(--mono); text-align: right; }
.message-group.outbound .message-time { color: rgba(255,255,255,.68); }
.chat-compose { padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.compose-top { margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.compose-top select { height: 34px; flex: 1; font-size: 11px; }
.compose-box { min-height: 74px; padding: 10px 10px 8px 14px; border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: 1fr auto; align-items: end; }
.compose-box textarea { min-height: 44px; max-height: 120px; padding: 4px 0; border: 0; box-shadow: none; resize: none; }
.compose-actions { display: flex; align-items: center; gap: 3px; color: var(--muted); }
.compose-actions .send { color: #fff; background: var(--primary); }
.chat-empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--muted); }

.lead-layout.details-open { grid-template-columns: minmax(530px, 1fr) minmax(400px, 470px) 350px; }
.lead-details { position: relative; min-width: 0; border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.details-close { position: absolute; z-index: 3; right: 10px; top: 10px; color: var(--muted); font-size: 21px; }
.details-hero { padding: 20px; text-align: center; border-bottom: 1px solid var(--line); }
.details-hero .avatar { margin: 0 auto 10px; }
.details-hero h3 { margin: 0 0 4px; font-size: 19px; }
.details-hero p { margin: 0; color: var(--muted); font-family: var(--mono); }
.details-actions { margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.details-actions .button { min-height: 58px; display: grid; place-items: center; gap: 2px; font-size: 10px; }
.detail-section { padding: 17px 20px; border-bottom: 1px solid var(--line); }
.detail-section-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font: 700 10px var(--mono); letter-spacing: .1em; }
.detail-value { margin-top: 10px; display: flex; gap: 9px; align-items: center; }
.financial-box { margin-top: 10px; padding: 16px; border-radius: 10px; background: linear-gradient(135deg, var(--surface-2), rgba(16,164,99,.08)); }
.financial-box b { display: block; font-size: 29px; }

.conversation-layout { height: 100vh; display: grid; grid-template-columns: 345px minmax(0, 1fr); overflow: hidden; }
.conversation-layout.details-open { grid-template-columns: 345px minmax(480px, 1fr) 350px; }
.conversation-list { border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.conversation-list-head { position: sticky; top: 0; z-index: 2; padding: 20px 16px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.conversation-list-head h1 { margin: 0 0 14px; font-size: 25px; }
.conversation-filter { margin: 11px 0 0; display: flex; gap: 5px; }
.conversation-filter a { flex: 1; padding: 7px; border-radius: 8px; color: var(--muted); text-align: center; font-size: 10px; }
.conversation-filter a.active { color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.conversation-item { min-height: 77px; padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 10px; }
.conversation-item:hover, .conversation-item.active { background: var(--surface-2); }
.conversation-item h4 { margin: 0 0 3px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-item p { margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-side { color: var(--muted); font: 9px var(--mono); text-align: right; }
.unread-count { margin-top: 8px; margin-left: auto; width: 19px; height: 19px; border-radius: 50%; color: #fff; background: var(--primary); display: grid; place-items: center; font: 8px var(--font); }
.conversation-chat { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; }

.kanban-layout { height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.kanban-layout.chat-open { grid-template-columns: minmax(620px, 1fr) minmax(420px, 490px); }
.kanban-layout.details-open { grid-template-columns: minmax(520px, 1fr) minmax(400px, 470px) 350px; }
.kanban-layout:not(.chat-open) > .chat-panel { display: none; }
.kanban-page { height: 100vh; padding: 0; overflow: hidden; display: grid; grid-template-rows: auto auto auto 1fr; }
.kanban-head { padding: 24px 30px 15px; border-bottom: 1px solid var(--line); background: var(--surface); display: flex; align-items: flex-end; justify-content: space-between; }
.kanban-head h1 { margin: 0; font-size: 32px; letter-spacing: -.04em; }
.kanban-toolbar { margin: 9px 0 0; padding: 8px 18px; border-bottom: 1px solid var(--line); background: var(--surface); display: flex; gap: 8px; }
.kanban-toolbar .search-box { flex: 1; }
.kanban-metrics { display: grid; grid-template-columns: repeat(4,1fr); border-bottom: 1px solid var(--line); background: var(--surface); }
.kanban-metric { padding: 17px 30px; border-right: 1px solid var(--line); }
.kanban-metric:last-child { border-right: 0; }
.kanban-metric small { display: block; color: var(--muted); font: 9px var(--mono); letter-spacing: .1em; }
.kanban-metric b { display: block; margin-top: 6px; font-size: 23px; }
.kanban-board { padding: 16px 18px 22px; overflow: auto; display: flex; align-items: stretch; gap: 12px; }
.kanban-column { flex: 0 0 305px; min-height: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; }
.kanban-column.drag-over { outline: 2px solid var(--primary); outline-offset: -2px; }
.kanban-column-head { position: sticky; top: 0; z-index: 2; padding: 13px; border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; background: var(--surface); }
.kanban-column-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.kanban-column-title .count-pill { margin-left: auto; padding: 4px 8px; border: 0; background: var(--surface-2); }
.kanban-column-head .progress { margin-top: 12px; }
.kanban-cards { padding: 10px; display: grid; align-content: start; gap: 9px; }
.kanban-card { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: grab; box-shadow: 0 2px 8px rgba(25, 29, 45, .03); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .38; }
.kanban-card-head { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; }
.kanban-card h4 { margin: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-card .lead-phone { margin-top: 2px; font-size: 10px; }
.kanban-preview { margin: 10px 0; min-height: 33px; color: var(--muted); font-size: 11px; line-height: 1.4; overflow: hidden; }
.kanban-card-foot { padding-top: 9px; border-top: 1px solid var(--line); display: flex; align-items: center; color: var(--muted); font-size: 10px; }
.kanban-card-foot .age { margin-left: auto; padding: 3px 7px; border-radius: 99px; color: #e74646; background: var(--danger-soft); font: 9px var(--mono); }
.drawer-loading { height: 100%; min-height: 180px; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.drawer-loading span { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: drawer-spin .7s linear infinite; }
.drawer-loading b { font-size: 12px; }
@keyframes drawer-spin { to { transform: rotate(360deg); } }

.campaign-empty { min-height: 430px; display: grid; place-items: center; text-align: center; }
.empty-icon { width: 74px; height: 74px; margin: 0 auto 18px; border-radius: 22px; color: var(--primary); background: var(--primary-soft); display: grid; place-items: center; }
.empty-icon svg { width: 34px; height: 34px; }
.campaign-list { display: grid; gap: 12px; }
.campaign-card { padding: 20px; display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(95px,.6fr)) auto; align-items: center; gap: 18px; }
.campaign-title h3 { margin: 0 0 7px; font-size: 16px; }
.campaign-title p { margin: 0; color: var(--muted); font-size: 11px; }
.metric-mini small, .metric-mini b { display: block; }
.metric-mini small { color: var(--muted); font: 9px var(--mono); text-transform: uppercase; }
.metric-mini b { margin-top: 5px; font-size: 17px; }
.campaign-actions { display: flex; gap: 5px; }
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 0; min-height: 630px; margin: -28px; }
.wizard-main { padding: 28px 28px 20px; border-right: 1px solid var(--line); }
.wizard-preview { padding: 28px; background: var(--surface-2); }
.wizard-steps { margin: 0 0 26px; display: grid; grid-template-columns: repeat(4, 1fr); }
.wizard-step { position: relative; color: var(--muted); display: flex; align-items: center; gap: 8px; font-size: 11px; }
.wizard-step::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.wizard-step:last-child::after { display: none; }
.wizard-step span { width: 27px; height: 27px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }
.wizard-step.active { color: var(--text); font-weight: 700; }
.wizard-step.active span { color: #fff; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; }
.wizard-panel h3 { margin: 0 0 5px; font-size: 24px; letter-spacing: -.04em; }
.wizard-panel > p { margin: 0 0 24px; color: var(--muted); }
.choice-group { margin-bottom: 21px; }
.choice-label { margin-bottom: 9px; color: var(--muted); font: 700 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.choice-list { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-list label { display: block; }
.choice-list input { position: absolute; opacity: 0; pointer-events: none; }
.choice-list span { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: var(--surface); display: inline-flex; align-items: center; cursor: pointer; font-size: 11px; font-weight: 500; }
.choice-list input:checked + span { color: #fff; border-color: var(--primary); background: var(--primary); }
.audience-result { margin-top: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.audience-result b { display: block; font-size: 28px; }
.phone-preview { width: 228px; height: 450px; margin: 20px auto 0; padding: 12px 9px; border: 9px solid #11151b; border-radius: 31px; background: #07141a; box-shadow: 0 18px 36px rgba(0,0,0,.2); }
.phone-head { height: 49px; margin: -2px -1px 0; padding: 9px; border-radius: 18px 18px 0 0; color: #fff; background: #20323b; display: flex; align-items: center; gap: 8px; font-size: 10px; }
.phone-message { max-width: 85%; margin: 315px 0 0 auto; padding: 8px; border-radius: 8px 8px 1px 8px; color: #d4f1e8; background: #00725e; font-size: 9px; }
.wizard-footer { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }

.settings-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; }
.settings-nav { position: sticky; top: 20px; padding: 10px; align-self: start; }
.settings-nav a { min-height: 43px; padding: 0 12px; border-radius: 8px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.settings-nav a:hover, .settings-nav a.active { color: var(--text); background: var(--surface-2); font-weight: 650; }
.settings-content { min-width: 0; }
.list-card { overflow: hidden; }
.list-row { min-height: 70px; padding: 13px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.list-row:last-child { border-bottom: 0; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-main b, .list-row-main small { display: block; }
.list-row-main small { margin-top: 4px; color: var(--muted); }
.list-row-actions { display: flex; gap: 5px; }
.connection-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.connection-card { padding: 18px; }
.connection-card-head { display: flex; gap: 11px; align-items: center; }
.connection-card-head > div { flex: 1; min-width: 0; }
.connection-card-head h3 { margin: 0 0 3px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.connection-card-head p { margin: 0; color: var(--muted); font-size: 10px; }
.connection-meta { margin: 17px 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.connection-meta div { padding: 8px; border-radius: 8px; background: var(--surface-2); }
.connection-meta small, .connection-meta b { display: block; }
.connection-meta small { color: var(--muted); font: 8px var(--mono); }
.connection-meta b { margin-top: 4px; font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.connection-actions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 7px; }
.connection-actions .icon-button { margin-left: auto; }
.quality-banner { margin: 10px 0; padding: 10px; border-radius: 8px; color: #b73535; background: var(--danger-soft); font-size: 10px; }
.meta-button { color: #fff !important; border-color: #1769e0 !important; background: #1769e0 !important; }
.meta-logo { width: 22px; height: 22px; border-radius: 50%; color: #1769e0; background: #fff; display: inline-grid; place-items: center; font: 800 16px/1 Arial, sans-serif; }
.meta-logo.large { width: 46px; height: 46px; color: #fff; background: #1769e0; font-size: 30px; box-shadow: 0 8px 20px rgba(23,105,224,.24); }
.integration-status { margin-bottom: 18px; padding: 16px 18px; display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 13px; }
.integration-status div b, .integration-status div small { display: block; }
.integration-status div small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.integration-sync { padding-left: 18px; border-left: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: right; }
.integration-sync b { color: var(--text); font-size: 11px; }
.integration-modal-head { margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.integration-modal-head .modal-title, .integration-modal-head .modal-subtitle { margin-bottom: 0; }
.how-to-card { margin-bottom: 18px; padding: 16px 18px; border: 1px solid #cbdcff; border-radius: 11px; background: #f4f8ff; color: #263756; font-size: 11px; }
[data-theme="dark"] .how-to-card { border-color: #29436b; background: #17243a; color: #dce8ff; }
.how-to-card ol { margin: 10px 0 0; padding-left: 19px; }
.how-to-card li { margin: 5px 0; }
.field-help { display: block; margin-top: 6px; color: var(--muted); }
.security-note { margin-top: 16px; padding: 11px 13px; border-radius: 9px; color: #087347; background: var(--success-soft); font-size: 11px; }
.provider-grid { display: grid; gap: 10px; }
.provider-card { min-height: 90px; padding: 16px 18px; display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 13px; }
.provider-icon { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px; color: #0a985b; background: var(--success-soft); display: inline-grid; place-items: center; font-size: 19px; font-weight: 850; }
.provider-icon.official { color: #fff; background: #1769e0; }
.provider-main h3, .provider-main p { margin: 0; }
.provider-main h3 { font-size: 14px; }
.provider-main p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.provider-main small { display: block; margin-top: 4px; color: var(--muted); font: 9px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch-field { min-height: 65px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; grid-template-columns: 1fr auto; align-items: center; }
.switch-field span b, .switch-field span small { display: block; }
.switch-field span small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.switch-field input[type="checkbox"] { appearance: none; width: 38px; height: 22px; padding: 0; border: 0; border-radius: 99px; background: var(--line-strong); background-image: none; cursor: pointer; transition: background .15s ease; }
.switch-field input[type="checkbox"]::after { content: ""; display: block; width: 18px; height: 18px; margin: 2px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .15s ease; }
.switch-field input[type="checkbox"]:checked { background: var(--primary); background-image: none; }
.switch-field input[type="checkbox"]:checked::after { transform: translateX(16px); }
.policy-owner { padding: 14px; border: 1px solid rgba(82,72,237,.25); border-radius: 12px; background: var(--primary-soft); }
.policy-owner > b, .policy-owner > small { display: block; }
.policy-owner > small { margin: 3px 0 12px; color: var(--muted); font-size: 10px; }
.policy-owner .switch-field { margin-top: 9px; background: var(--surface); }
.policy-users { max-height: 265px; padding-right: 4px; overflow-y: auto; display: grid; gap: 7px; }
.policy-users > label { min-height: 55px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; grid-template-columns: auto auto minmax(0,1fr); align-items: center; cursor: pointer; }
.policy-users input { width: 17px; height: 17px; padding: 0; }
.policy-users b, .policy-users small { display: block; }
.policy-users small { color: var(--muted); font-size: 9px; font-weight: 400; }
.qr-help { margin-top: 16px; padding: 12px 14px; border: 1px dashed var(--primary); border-radius: 10px; color: var(--muted); background: var(--primary-soft); font-size: 11px; }
.qr-help b, .qr-help span { display: block; }
.qr-help span { margin-top: 4px; }
.qr-live { text-align: center; }
.qr-frame { width: 250px; min-height: 250px; margin: 18px auto 12px; padding: 10px; border: 2px solid var(--primary); border-radius: 15px; background: #fff; display: grid; place-items: center; }
.qr-frame img { width: 100%; height: auto; image-rendering: pixelated; }
#live-qr-code { max-width: 100%; color: #111; font: 11px/1.4 var(--mono); word-break: break-all; }
.qr-expiry > div { height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.qr-expiry > div span { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #f59e0b, #ef6b6b); transition: width 1s linear; }
.qr-expiry small { display: block; margin-top: 6px; color: var(--muted); font: 10px var(--mono); }
.meta-wait { min-height: 390px; display: grid; align-content: center; justify-items: center; text-align: center; }
.meta-wait > p { max-width: 310px; color: var(--muted); }
.agent-card { padding: 20px; }
.agent-card h3 { margin: 12px 0 5px; }
.agent-card p { min-height: 40px; margin: 0 0 15px; color: var(--muted); font-size: 11px; }
.agent-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.agent-stats div { padding: 9px; border-radius: 8px; background: var(--surface-2); }
.agent-stats small, .agent-stats b { display: block; }
.agent-stats small { color: var(--muted); font: 8px var(--mono); }
.agent-stats b { margin-top: 4px; }

.auth-main { min-height: 100vh; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.12fr .88fr; }
.login-visual { padding: 52px clamp(35px, 7vw, 105px); color: #fff; background: radial-gradient(circle at 70% 20%, rgba(109,98,255,.35), transparent 30%), linear-gradient(145deg, #0e1018, #16132a); display: flex; flex-direction: column; justify-content: space-between; }
.login-logo { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 800; }
.login-visual h1 { max-width: 620px; margin: 12px 0 18px; font-size: clamp(42px, 5vw, 78px); line-height: .98; letter-spacing: -.06em; }
.login-visual p { max-width: 540px; margin: 0; color: #a6acc2; font-size: 17px; }
.login-proof { width: max-content; max-width: 100%; padding: 12px 15px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; color: #b7bed0; background: rgba(255,255,255,.05); }
.login-proof span { color: #64df9b; }
.login-form-wrap { padding: 35px; display: grid; place-items: center; background: var(--surface); }
.login-form { width: min(100%, 400px); }
.login-form h2 { margin: 0 0 8px; font-size: 34px; letter-spacing: -.04em; }
.login-form > p { margin: 0 0 30px; color: var(--muted); }
.login-form label { margin-bottom: 17px; }
.login-form input:not([type="checkbox"]) { height: 48px; }
.login-form .button { margin-top: 8px; height: 49px; }
.login-form > small { display: block; margin-top: 18px; color: var(--muted); text-align: center; line-height: 1.5; }
.mobile-menu { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .connection-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-layout.details-open { grid-template-columns: minmax(470px, 1fr) 430px; }
  .lead-layout.details-open .lead-details,
  .conversation-layout.details-open .lead-details,
  .kanban-layout.details-open .lead-details { position: fixed; right: 0; top: 0; bottom: 0; z-index: 110; width: 360px; box-shadow: var(--shadow); }
  .conversation-layout.details-open { grid-template-columns: 345px minmax(0, 1fr); }
  .kanban-layout.details-open { grid-template-columns: minmax(620px, 1fr) minmax(410px, 470px); }
  .campaign-card { grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(90px,.5fr)) auto; }
  .campaign-card .metric-mini:nth-of-type(n+3) { display: none; }
}

body.sidebar-collapsed .sidebar { width: 70px; }
body.sidebar-collapsed .app-main { margin-left: 70px; }
body.sidebar-collapsed .brand-row { padding-left: 14px; }
body.sidebar-collapsed .brand { min-width: 42px; }
body.sidebar-collapsed .brand-name,
body.sidebar-collapsed .workspace-card > span:nth-child(2),
body.sidebar-collapsed .workspace-card > svg,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .side-nav a span,
body.sidebar-collapsed .side-nav a em,
body.sidebar-collapsed .sidebar-bottom > a span,
body.sidebar-collapsed .sidebar-bottom > button span,
body.sidebar-collapsed .user-card > span:nth-child(2),
body.sidebar-collapsed .user-card form,
body.sidebar-collapsed .sidebar-pin { display: none; }
body.sidebar-collapsed .workspace-card { padding: 10px; justify-content: center; }
body.sidebar-collapsed .side-nav a, body.sidebar-collapsed .sidebar-bottom > a, body.sidebar-collapsed .sidebar-bottom > button { justify-content: center; padding: 0; }
body.sidebar-collapsed .user-card { min-width: 0; justify-content: center; padding: 10px 0; }

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); width: min(86vw, 300px); }
  .app-main { margin-left: 0; }
  .mobile-menu { position: fixed; left: 12px; top: 12px; z-index: 55; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow); }
  .mobile-menu svg { width: 20px; height: 20px; }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { position: fixed; inset: 0; z-index: 58; display: block; background: rgba(0,0,0,.45); }
  .page { padding: 72px 16px 35px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .grid-2, .grid-3, .grid-4, .field-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar select, .toolbar .button { width: 100%; }
  .table-card { overflow-x: auto; }
  .data-table { min-width: 780px; }
  .split-layout, .split-layout.chat-open, .split-layout.details-open { height: auto; min-height: 100vh; grid-template-columns: 1fr; overflow: visible; }
  .split-content { padding: 72px 16px 30px; overflow: visible; }
  .chat-panel { position: fixed; inset: 0; z-index: 100; display: none; }
  .split-layout.chat-open .chat-panel { display: grid; }
  .lead-layout.details-open { grid-template-columns: 1fr; }
  .conversation-layout { height: 100vh; grid-template-columns: 1fr; }
  .conversation-chat { position: fixed; inset: 0; z-index: 100; background: var(--surface); display: none; }
  .conversation-layout.chat-open .conversation-chat { display: grid; }
  .conversation-layout .lead-details,
  .lead-layout .lead-details,
  .kanban-layout .lead-details { width: min(92vw, 380px); }
  .kanban-layout, .kanban-layout.chat-open, .kanban-layout.details-open { grid-template-columns: 1fr; }
  .kanban-layout > .chat-panel { position: fixed; inset: 0; z-index: 100; display: none; }
  .kanban-layout.chat-open > .chat-panel { display: grid; }
  .kanban-head { padding: 70px 16px 15px; align-items: flex-start; flex-direction: column; gap: 12px; }
  .kanban-toolbar { padding: 9px; overflow-x: auto; }
  .kanban-toolbar .search-box { flex: 0 0 260px; }
  .kanban-metrics { grid-template-columns: repeat(2,1fr); }
  .kanban-metric { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .kanban-column { flex-basis: 280px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; overflow-x: auto; display: flex; }
  .settings-nav a { flex: 0 0 auto; }
  .connection-card-grid { grid-template-columns: 1fr; }
  .integration-status { grid-template-columns: auto minmax(0,1fr) auto; }
  .integration-sync { grid-column: 1 / -1; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); text-align: left; }
  .provider-card { grid-template-columns: auto minmax(0,1fr) auto; }
  .provider-card > .button { grid-column: 1 / -1; width: 100%; }
  .wizard { margin: -28px; grid-template-columns: 1fr; }
  .wizard-preview { display: none; }
  .wizard-main { border-right: 0; }
  .campaign-card { grid-template-columns: 1fr auto; }
  .campaign-card .metric-mini { display: none; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 300px; padding: 30px; }
  .login-visual h1 { font-size: 46px; }
  .login-proof { display: none; }
}

@media (max-width: 520px) {
  .stat-card { min-height: 128px; padding: 20px; }
  .stat-value { font-size: 31px; }
  .segmented { width: 100%; overflow-x: auto; }
  .segmented a, .segmented button { flex: 1 0 auto; }
  .modal-card { padding: 22px 17px; }
  .details-actions { grid-template-columns: repeat(2,1fr); }
  .podium { min-height: 275px; gap: 4px; }
  .podium-person { min-height: 115px; }
  .podium-place.place-1 .podium-person { min-height: 135px; }
  .podium-person .avatar { width: 43px; height: 43px; }
  .podium-place.place-1 .podium-person .avatar { width: 52px; height: 52px; }
  .podium-person b { font-size: 10px; }
  .podium-person small { font-size: 8px; }
  .provider-card { grid-template-columns: auto 1fr; }
  .provider-card > .badge { justify-self: start; }
  .provider-card > .button { grid-column: 1 / -1; }
  .qr-frame { width: min(100%, 240px); min-height: 220px; }
  .toast-stack { left: 10px; right: 10px; top: 10px; }
  .toast { min-width: 0; width: 100%; }
  .login-form-wrap { padding: 40px 20px; }
}