:root {
  color-scheme: dark;
  --bg: #090c14;
  --bg-deep: #070910;
  --panel: #111725;
  --panel-2: #171e2e;
  --panel-3: #1d2639;
  --line: #29354b;
  --line-soft: rgba(111, 132, 171, .18);
  --muted: #8d99af;
  --text: #f3f6ff;
  --text-soft: #c0c9da;
  --accent: #9b8cff;
  --accent-2: #5f8dff;
  --accent-3: #65d7e9;
  --danger: #ff718b;
  --warning: #f5cb75;
  --success: #71e0b2;
  --shadow: 0 22px 60px rgba(0, 0, 0, .28);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; max-width: 100%; overflow-x: hidden; background: var(--bg-deep); color: var(--text); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 85% -12%, rgba(95, 141, 255, .17), transparent 62%),
    radial-gradient(620px 420px at 35% 0%, rgba(155, 140, 255, .10), transparent 66%),
    linear-gradient(180deg, #0b0f1a 0%, var(--bg-deep) 72%);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 26px 18px;
  border-right: 1px solid var(--line-soft);
  background: rgba(10, 14, 24, .82);
  backdrop-filter: blur(22px);
}
.brand { display: flex; align-items: center; gap: 12px; margin: 2px 9px 34px; }
.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 14px;
  color: #0b1020;
  font-weight: 900;
  letter-spacing: -.04em;
  background: linear-gradient(135deg, #c3bbff 0%, #7d9cff 55%, #6ee0ed 100%);
  box-shadow: 0 12px 30px rgba(95, 141, 255, .28);
}
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .01em; font-size: 15px; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 11px; }
nav { display: grid; gap: 6px; }
.nav-item {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.nav-item span, .nav-item small { display: block; }
.nav-item span { color: inherit; font-weight: 700; }
.nav-item small { margin-top: 3px; opacity: .52; font-size: 10px; letter-spacing: .14em; }
.nav-item:hover { color: var(--text); border-color: var(--line-soft); background: rgba(118, 139, 190, .08); transform: translateX(2px); }
.nav-item.active {
  color: #cfcaff;
  border-color: rgba(155, 140, 255, .36);
  background: linear-gradient(100deg, rgba(155, 140, 255, .20), rgba(95, 141, 255, .07));
  box-shadow: inset 3px 0 0 var(--accent), 0 9px 28px rgba(86, 78, 169, .12);
}
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 12px; color: var(--muted); font-size: 12px; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--warning); box-shadow: 0 0 12px currentColor; }
.status-dot.live { color: var(--success); background: var(--success); }
.status-dot.error { color: var(--danger); background: var(--danger); }

main { min-width: 0; padding: 34px clamp(22px, 4vw, 60px) 76px; }
.topbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 3vw, 42px); letter-spacing: -.05em; line-height: 1.08; }
h2 { font-size: 18px; letter-spacing: -.025em; }
h3 { font-size: 14px; }
.eyebrow { margin-bottom: 8px; color: var(--accent-3); font-size: 10px; font-weight: 850; letter-spacing: .18em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.admin-session {
  display: flex;
  min-width: 178px;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  margin-right: 4px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(13, 20, 34, .7);
}
.admin-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(155, 140, 255, .35);
  border-radius: 9px;
  color: #e8e5ff;
  background: linear-gradient(145deg, rgba(155, 140, 255, .3), rgba(95, 141, 255, .18));
  font-size: 11px;
  font-weight: 900;
}
.admin-identity { min-width: 0; }
.admin-identity small, .admin-identity strong { display: block; }
.admin-identity small { color: var(--muted); font-size: 9px; letter-spacing: .05em; }
.admin-identity strong { margin-top: 3px; overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { color: #ffbdc9; }

.button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-weight: 750;
  background: linear-gradient(180deg, #202a3e, #182133);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.button:hover { border-color: rgba(155, 140, 255, .72); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0, 0, 0, .18); }
.button:disabled { cursor: wait; opacity: .55; transform: none; box-shadow: none; }
.button.primary { color: #0c1020; border-color: #a79aff; background: linear-gradient(135deg, #b2a7ff, #789bff); box-shadow: 0 9px 24px rgba(106, 126, 255, .22); }
.button.primary:hover { border-color: #c5beff; box-shadow: 0 12px 28px rgba(106, 126, 255, .32); }
.button.ghost { color: var(--muted); background: rgba(20, 27, 42, .45); }
.button.danger { color: #ffadba; border-color: rgba(255, 113, 139, .36); background: rgba(93, 27, 45, .34); }
.button.danger:hover { border-color: rgba(255, 113, 139, .72); background: rgba(112, 31, 52, .48); box-shadow: 0 10px 26px rgba(104, 24, 47, .22); }
.button.small { min-height: 31px; padding: 0 10px; font-size: 12px; }
.view { display: none; animation: reveal .2s ease; }
.view.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.grid { display: grid; gap: 18px; }
.grid > *, .stack, .panel { min-width: 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.form-layout { grid-template-columns: minmax(280px, .76fr) minmax(0, 1.8fr); align-items: start; }
.stack { display: grid; gap: 18px; }

.panel {
  padding: 21px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(22, 29, 45, .94), rgba(14, 19, 31, .96));
  box-shadow: var(--shadow);
}
.panel + .panel, .stat-grid + .grid { margin-top: 18px; }
.sticky-panel { position: sticky; top: 26px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 36px; margin-bottom: 18px; }
.panel-mark { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.badge { display: inline-grid; min-width: 28px; height: 28px; padding: 0 8px; place-items: center; border: 1px solid rgba(155, 140, 255, .34); border-radius: 99px; color: #cfcaff; background: rgba(113, 97, 221, .14); font-size: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card {
  position: relative;
  min-height: 138px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(25, 34, 53, .96), rgba(15, 21, 35, .98));
}
.stat-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(125deg, transparent 55%, rgba(155, 140, 255, .07)); pointer-events: none; }
.stat-card::after { content: ''; position: absolute; right: -42px; bottom: -55px; width: 130px; height: 130px; border: 1px solid rgba(117, 139, 255, .14); border-radius: 50%; box-shadow: 0 0 0 12px rgba(117, 139, 255, .03), 0 0 0 24px rgba(117, 139, 255, .025); }
.stat-card small { color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; margin-top: 16px; font-size: 36px; letter-spacing: -.06em; }
.stat-card .eyebrow { position: relative; z-index: 1; margin-top: 9px; color: var(--accent-3); }

.state-list { display: grid; gap: 10px; }
.state-row { display: grid; grid-template-columns: minmax(120px, 1fr) 3fr auto; gap: 12px; align-items: center; font-size: 13px; }
.state-bar { height: 7px; overflow: hidden; border-radius: 99px; background: #252e42; }
.state-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent-3)); }

.stack-form, .form-section { display: grid; gap: 14px; }
.section-heading h3 { color: var(--text); font-size: 14px; }
.section-heading p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.58; }
.form-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0; color: var(--muted); font-size: 10px; }
.form-divider::before, .form-divider::after { content: ''; height: 1px; flex: 1; background: var(--line-soft); }
.form-divider span { white-space: nowrap; }
label { color: var(--muted); font-size: 12px; }
input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 11px;
  outline: none;
  border: 1px solid #344159;
  border-radius: 9px;
  color: var(--text);
  background: #0c1220;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #52627f; }
input[type="file"] { min-width: 0; max-width: 100%; padding: 7px; overflow: hidden; color: var(--muted); }
input[type="file"]::file-selector-button { min-height: 32px; margin-right: 10px; padding: 0 11px; border: 1px solid #455574; border-radius: 7px; color: var(--text); background: #202b42; cursor: pointer; }
textarea { resize: vertical; line-height: 1.5; }
select[multiple] { min-height: 100px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(95, 141, 255, .14); background: #0f1728; }
.field-row { display: grid; grid-template-columns: 1.5fr .75fr; gap: 10px; }
.form-note { color: var(--muted); font-size: 11px; line-height: 1.55; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.account-group-manager {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid rgba(101, 215, 233, .18);
  border-radius: 12px;
  background: rgba(7, 14, 25, .44);
}
.account-group-manager-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.account-group-manager-head h3 { color: var(--text); font-size: 13px; }
.account-group-manager-head p { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.account-group-create-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: end; }
.account-group-create-form input { margin-top: 0; min-height: 34px; padding: 8px 9px; }
.account-group-create-form .button { min-height: 34px; }
.account-group-list { display: grid; gap: 6px; max-height: 205px; overflow-y: auto; }
.account-group-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: 42px; padding: 7px 8px; border: 1px solid var(--line-soft); border-radius: 9px; background: rgba(15, 23, 39, .58); }
.account-group-row.is-system { border-color: rgba(245, 203, 117, .2); background: rgba(137, 104, 35, .08); }
.account-group-symbol { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 6px; color: var(--accent-3); background: rgba(101, 215, 233, .11); font-size: 9px; }
.account-group-row.is-system .account-group-symbol { color: var(--warning); background: rgba(245, 203, 117, .12); }
.account-group-copy, .account-group-copy strong, .account-group-copy small { display: block; min-width: 0; }
.account-group-copy strong { overflow: hidden; color: var(--text-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-group-copy small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.account-group-actions { display: flex; gap: 5px; }
.account-group-actions .button { min-height: 27px; padding: 0 7px; font-size: 10px; }
.account-group-actions .button[aria-disabled="true"] { opacity: .56; }
.account-list-tools { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: -4px 0 12px; padding: 10px 11px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(10, 16, 28, .4); }
.account-list-tools label { display: flex; min-width: min(260px, 100%); align-items: center; gap: 8px; color: var(--text-soft); font-size: 11px; font-weight: 700; }
.account-list-tools select { min-width: 168px; margin-top: 0; padding: 8px 9px; }
.account-list-tools small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.account-bulk-move { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.account-bulk-move select { min-width: 145px; margin-top: 0; padding: 7px 8px; }
.account-group-pill { display: inline-flex; max-width: 150px; align-items: center; padding: 4px 8px; overflow: hidden; border: 1px solid rgba(101, 215, 233, .23); border-radius: 99px; color: #b5edf4; background: rgba(101, 215, 233, .09); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.subaccount-layout { grid-template-columns: minmax(300px, .72fr) minmax(0, 1.8fr); }
.subaccount-create-panel {
  overflow: hidden;
  border-color: rgba(101, 215, 233, .22);
  background:
    radial-gradient(440px 230px at 100% 0%, rgba(101, 215, 233, .09), transparent 66%),
    linear-gradient(145deg, rgba(22, 31, 48, .97), rgba(13, 19, 31, .98));
}
.subaccount-create-form { margin-top: 18px; }
.subaccount-create-access { border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(7, 12, 22, .3); }
.subaccount-create-access > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
}
.subaccount-create-access > summary::-webkit-details-marker { display: none; }
.subaccount-create-access > summary::before { content: '+'; width: 14px; color: var(--accent-3); font-size: 15px; }
.subaccount-create-access[open] > summary::before { content: '−'; }
.subaccount-create-access > summary span { margin-right: auto; }
.subaccount-create-access > summary small { color: var(--muted); font-size: 8px; font-weight: 500; }
.subaccount-create-access-body { display: grid; gap: 15px; padding: 13px; border-top: 1px solid var(--line-soft); }
.create-permission-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.create-number-option-grid { grid-template-columns: 1fr; max-height: 210px; }
.inline-feedback { min-height: 16px; margin-top: 12px; color: var(--success); font-size: 11px; line-height: 1.5; }
.inline-feedback:empty { display: none; }
.inline-feedback.error { color: #ffadba; }
.panel-description { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.5; }
.subaccount-list { display: grid; gap: 14px; }
.subaccount-card {
  position: relative;
  padding: 17px;
  overflow: hidden;
  border: 1px solid rgba(111, 132, 171, .2);
  border-radius: 14px;
  background:
    linear-gradient(115deg, rgba(28, 37, 58, .92), rgba(12, 18, 30, .96));
  transition: border-color .18s ease, opacity .18s ease;
}
.subaccount-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-3), transparent 75%);
  opacity: .65;
}
.subaccount-card.is-disabled { border-color: rgba(255, 113, 139, .2); }
.subaccount-card.is-disabled::before { background: linear-gradient(90deg, var(--danger), rgba(255, 113, 139, .1), transparent); }
.subaccount-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.subaccount-identity { display: flex; min-width: 0; align-items: center; gap: 11px; }
.subaccount-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(101, 215, 233, .3);
  border-radius: 11px;
  color: #dffbff;
  background: linear-gradient(145deg, rgba(95, 141, 255, .3), rgba(101, 215, 233, .14));
  font-size: 12px;
  font-weight: 900;
}
.subaccount-identity > div { min-width: 0; }
.subaccount-identity h3 { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.subaccount-identity p { margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.subaccount-status-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.subaccount-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 17px; }
.subaccount-metrics > span {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(7, 12, 22, .38);
}
.subaccount-metrics small, .subaccount-metrics strong { display: block; }
.subaccount-metrics small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.subaccount-metrics strong { margin-top: 5px; font-size: 16px; letter-spacing: -.03em; }
.quota-track { height: 4px; margin: 10px 2px 0; overflow: hidden; border-radius: 99px; background: rgba(92, 108, 143, .18); }
.quota-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent-3)); }
.permission-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.permission-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid rgba(113, 224, 178, .2);
  border-radius: 99px;
  color: var(--success);
  background: rgba(54, 139, 111, .09);
  font-size: 9px;
  font-weight: 750;
}
.permission-chip.denied { border-color: var(--line-soft); color: #78859b; background: rgba(71, 82, 105, .08); }
.assigned-number-summary { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.assigned-number-summary > small { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; letter-spacing: .05em; }
.assigned-number-summary > div { display: flex; flex-wrap: wrap; gap: 6px; }
.number-chip { max-width: 100%; padding: 5px 8px; overflow: hidden; border-radius: 7px; color: var(--text-soft); background: rgba(95, 141, 255, .1); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.empty-assignment { color: var(--muted); font-size: 10px; }
.subaccount-editor-wrap { margin: 14px -17px -17px; border-top: 1px solid var(--line-soft); }
.subaccount-editor-wrap > summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 17px;
  color: var(--text-soft);
  background: rgba(8, 13, 23, .28);
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 750;
}
.subaccount-editor-wrap > summary::-webkit-details-marker { display: none; }
.subaccount-editor-wrap > summary::before { content: '+'; width: 18px; color: var(--accent-3); font-size: 16px; }
.subaccount-editor-wrap[open] > summary::before { content: '−'; }
.subaccount-editor-wrap > summary span { margin-right: auto; }
.subaccount-editor-wrap > summary small { color: var(--muted); font-size: 9px; font-weight: 500; }
.subaccount-editor { display: grid; gap: 16px; padding: 17px; border-top: 1px solid var(--line-soft); background: rgba(6, 10, 18, .34); }
.subaccount-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.subaccount-fieldset legend { margin-bottom: 9px; padding: 0; color: var(--text-soft); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.subaccount-fieldset > p { margin: -3px 0 10px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.permission-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.permission-option, .number-option {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  color: var(--text);
  background: rgba(15, 23, 39, .64);
  cursor: pointer;
}
.permission-option input, .number-option input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--accent-2);
}
.number-option.is-conflict { border-color: rgba(255, 113, 139, .32); background: rgba(93, 27, 45, .16); opacity: .72; cursor: not-allowed; }
.number-option.is-conflict strong { color: #ffbdc9; }
.number-option input:disabled { cursor: not-allowed; }
.permission-option span, .number-option span { min-width: 0; }
.permission-option strong, .permission-option small, .number-option strong, .number-option small { display: block; }
.permission-option strong, .number-option strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.permission-option small, .number-option small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.subaccount-editor-section { display: grid; gap: 16px; padding-bottom: 17px; border-bottom: 1px solid var(--line-soft); }
.subaccount-edit-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.subaccount-disabled-option {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  align-self: end;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(15, 23, 39, .64);
  cursor: pointer;
}
.subaccount-disabled-option input { width: 16px; height: 16px; margin: 0; padding: 0; flex: 0 0 auto; accent-color: var(--danger); }
.subaccount-disabled-option span, .subaccount-disabled-option strong, .subaccount-disabled-option small { display: block; }
.subaccount-disabled-option span { min-width: 0; }
.subaccount-disabled-option strong { color: var(--text); font-size: 10px; }
.subaccount-disabled-option small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.number-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 235px; padding-right: 3px; overflow-y: auto; }
.account-assignment-group { display: grid; grid-column: 1 / -1; gap: 7px; padding: 8px; border: 1px solid var(--line-soft); border-radius: 9px; background: rgba(11, 18, 31, .4); }
.account-assignment-group > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line-soft); }
.account-assignment-group > header strong { color: var(--text-soft); font-size: 10px; }
.account-assignment-group > header small { color: var(--muted); font-size: 9px; }
.account-assignment-group-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.number-option.is-offline { opacity: .58; }
.assignment-empty { grid-column: 1 / -1; padding: 12px; border: 1px dashed var(--line-soft); border-radius: 9px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.subaccount-editor-actions { display: flex; min-height: 40px; align-items: center; justify-content: flex-end; gap: 12px; }
.editor-feedback { margin-right: auto; color: var(--success); font-size: 10px; line-height: 1.4; }
.editor-feedback.error { color: #ffadba; }
.password-reset-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.password-reset-row .button { min-width: 104px; }
.subaccount-password-form > .editor-feedback:empty { display: none; }
.subaccount-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.subaccount-danger-zone strong, .subaccount-danger-zone small { display: block; }
.subaccount-danger-zone strong { color: #ffbdc9; font-size: 10px; }
.subaccount-danger-zone small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.4; }

#view-campaigns .grid.form-layout { grid-template-columns: minmax(410px, 1fr) minmax(0, 1.42fr); }
.campaigns-layout { display: grid; gap: 14px; }
.campaign-task-panel { min-width: 0; }
.campaign-task-head { align-items: flex-start; }
.campaign-task-head-actions { display: flex; align-items: center; gap: 9px; }
.campaign-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(105px, 1fr)); gap: 9px; margin: 0 0 14px; }
.campaign-summary-card { min-width: 0; padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 11px; background: rgba(10, 16, 28, .55); }
.campaign-summary-card strong { display: block; color: var(--text); font-size: 19px; line-height: 1; }
.campaign-summary-card span { display: block; margin-top: 7px; color: var(--text-soft); font-size: 11px; font-weight: 700; }
.campaign-summary-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.campaign-bulk-toolbar { margin-top: 0; }
.campaign-table-wrap { border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(7, 12, 22, .32); }
.campaign-table { width: 100%; min-width: 0; table-layout: fixed; }
.campaign-table th, .campaign-table td { vertical-align: middle; }
.campaign-table th { position: sticky; top: 0; z-index: 1; background: #111a2a; }
.campaign-table td { max-width: 190px; }
.campaign-table .table-actions { min-width: 165px; white-space: normal; }
.campaign-empty-cell { padding: 42px 18px; text-align: center; }
.success-number { color: var(--success); font-weight: 700; }
.danger-number { color: var(--danger); font-weight: 700; }
.campaign-task-panel .panel-description { margin-top: 5px; color: var(--muted); font-size: 11px; }
.campaign-create-panel {
  position: sticky;
  overflow: hidden;
  border-color: rgba(128, 143, 255, .28);
  background:
    radial-gradient(520px 250px at 90% -10%, rgba(101, 215, 233, .11), transparent 62%),
    radial-gradient(420px 260px at -8% 20%, rgba(155, 140, 255, .14), transparent 66%),
    linear-gradient(145deg, rgba(23, 31, 50, .98), rgba(13, 18, 31, .98));
}
.campaign-create-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, #000, transparent 74%);
}
.campaign-create-panel > * { position: relative; z-index: 1; }
.campaign-lead { margin: -3px 0 18px; color: #aeb9cc; font-size: 12px; line-height: 1.7; }
.campaign-import-form { gap: 17px; }
.campaign-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.file-upload-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 188px;
  padding: 16px;
  overflow: hidden;
  flex-direction: column;
  border: 1px dashed rgba(133, 151, 207, .46);
  border-radius: 14px;
  color: var(--text);
  background: linear-gradient(150deg, rgba(27, 37, 59, .84), rgba(13, 20, 35, .76));
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.file-upload-card::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -34px;
  width: 96px;
  height: 96px;
  border: 1px solid rgba(117, 156, 255, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 11px rgba(117, 156, 255, .025);
}
.file-upload-card:hover {
  z-index: 2;
  border-color: rgba(155, 140, 255, .82);
  background: linear-gradient(150deg, rgba(38, 48, 79, .9), rgba(17, 25, 43, .88));
  box-shadow: 0 14px 32px rgba(4, 8, 18, .24);
  transform: translateY(-2px);
}
.file-step {
  display: grid;
  width: 28px;
  height: 28px;
  margin-bottom: 16px;
  place-items: center;
  border: 1px solid rgba(159, 148, 255, .46);
  border-radius: 9px;
  color: #d8d2ff;
  background: rgba(119, 102, 225, .16);
  font-size: 10px;
  font-weight: 900;
}
.file-upload-card strong { font-size: 15px; letter-spacing: -.02em; }
.file-upload-card small { min-height: 47px; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.file-upload-card input[type="file"] { position: relative; z-index: 2; margin-top: auto; background: rgba(7, 12, 22, .66); }
.file-upload-card input[type="file"]::file-selector-button { color: #d9d5ff; border-color: rgba(151, 139, 255, .38); background: rgba(104, 86, 210, .18); }
.campaign-flow { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 11px; background: rgba(8, 14, 25, .54); }
.campaign-flow span { display: inline-flex; align-items: center; gap: 6px; color: #b6c0d2; font-size: 10px; white-space: nowrap; }
.campaign-flow b { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #0a1020; background: linear-gradient(135deg, var(--accent), var(--accent-3)); font-size: 9px; }
.campaign-flow i { height: 1px; min-width: 10px; flex: 1; background: linear-gradient(90deg, rgba(155, 140, 255, .2), rgba(101, 215, 233, .7), rgba(155, 140, 255, .2)); }
.campaign-submit { width: 100%; min-height: 48px; font-size: 13px; }
.campaign-status-panel { min-height: 330px; }
.campaign-card { transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.campaign-card:hover { border-color: rgba(135, 149, 209, .34); background: rgba(16, 24, 41, .88); transform: translateY(-1px); }
.campaign-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.campaign-metrics span { padding: 9px; border: 1px solid var(--line-soft); border-radius: 9px; color: var(--muted); background: rgba(7, 12, 22, .45); font-size: 9px; }
.campaign-metrics b { display: block; margin-bottom: 3px; color: var(--text); font-size: 13px; }
.campaign-uncertain { margin: 11px 0 0; padding: 9px 10px; border: 1px solid rgba(246, 189, 96, .32); border-radius: 9px; color: #f5ce8c; background: rgba(123, 80, 18, .16); font-size: 11px; line-height: 1.5; }
.campaign-uncertain strong { color: #ffe1a9; }
.campaign-safety { margin: 11px 0 0; padding: 9px 10px; border: 1px solid rgba(101, 215, 233, .2); border-radius: 9px; color: #b9dce5; background: rgba(31, 88, 103, .12); font-size: 10px; line-height: 1.55; }
.campaign-preview-panel {
  margin-top: 18px;
  overflow: hidden;
  border-color: rgba(128, 143, 255, .24);
  background:
    radial-gradient(720px 260px at 8% -20%, rgba(155, 140, 255, .1), transparent 62%),
    linear-gradient(145deg, rgba(20, 28, 46, .98), rgba(12, 18, 31, .98));
}
.campaign-preview-panel[hidden] { display: none; }
.campaign-preview-head { align-items: flex-start; }
.campaign-preview-head h2 { margin-bottom: 5px; }
.campaign-preview-head p:not(.eyebrow) { color: var(--muted); font-size: 11px; }
.campaign-preview-grid { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(420px, 1.22fr); gap: 14px; }
.campaign-preview-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(7, 12, 22, .48);
}
.campaign-preview-card > header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(29, 39, 62, .42);
}
.campaign-preview-card h3 { color: var(--text); font-size: 13px; }
.campaign-preview-card header p { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.campaign-preview-list {
  max-height: 480px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-color: #384765 transparent;
}
.campaign-preview-list.empty { padding: 18px 14px; }
.campaign-preview-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line-soft);
}
.campaign-preview-item:last-child { border-bottom: 0; }
.campaign-preview-item:hover { background: rgba(117, 131, 199, .055); }
.preview-position {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(126, 144, 201, .24);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(29, 39, 62, .54);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.preview-main { min-width: 0; }
.preview-main strong { display: block; overflow-wrap: anywhere; color: var(--text); font-size: 11px; line-height: 1.55; }
.preview-main small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.recipient-preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line-soft);
}
.recipient-preview-stats:empty { display: none; }
.recipient-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(17, 25, 42, .72);
  font-size: 9px;
}
.recipient-stat b { color: var(--text); font-size: 10px; }
.recipient-stat.sent b { color: var(--success); }
.recipient-stat.queued b { color: var(--warning); }
.recipient-stat.uncertain b { color: #ffb86b; }
.recipient-stat.failed b, .recipient-stat.invalid b { color: var(--danger); }
.recipient-preview-item { grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; }
.recipient-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(133, 151, 207, .22);
  border-radius: 99px;
  color: var(--text-soft);
  background: rgba(30, 39, 61, .7);
  font-size: 9px;
  white-space: nowrap;
}
.recipient-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #8390a9; box-shadow: 0 0 0 3px rgba(131, 144, 169, .1); }
.recipient-status.sent { color: var(--success); border-color: rgba(113, 224, 178, .24); background: rgba(54, 139, 111, .11); }
.recipient-status.sent::before { background: var(--success); box-shadow: 0 0 0 3px rgba(113, 224, 178, .1); }
.recipient-status.queued { color: var(--warning); border-color: rgba(245, 203, 117, .24); background: rgba(137, 104, 35, .11); }
.recipient-status.queued::before { background: var(--warning); box-shadow: 0 0 0 3px rgba(245, 203, 117, .1); }
.recipient-status.uncertain { color: #ffbd75; border-color: rgba(255, 170, 82, .34); background: rgba(150, 79, 25, .16); }
.recipient-status.uncertain::before { background: #ff9f43; box-shadow: 0 0 0 3px rgba(255, 159, 67, .12); }
.recipient-status.failed, .recipient-status.invalid { color: var(--danger); border-color: rgba(255, 113, 139, .25); background: rgba(135, 40, 64, .12); }
.recipient-status.failed::before, .recipient-status.invalid::before { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 113, 139, .1); }

.table-wrap { width: 100%; max-width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line-soft); }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
td { max-width: 270px; overflow: hidden; text-overflow: ellipsis; }
tr:hover td { background: rgba(104, 126, 177, .05); }
.diagnostic-cell { max-width: 260px; }
.table-actions { display: flex; align-items: center; gap: 7px; }
.bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: -2px 0 14px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(10, 16, 28, .54);
}
.bulk-select-all { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.bulk-select-all input,
input.row-select {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  border-radius: 4px;
  accent-color: var(--accent-2);
}
.selection-cell { width: 38px; max-width: none; text-align: center; }
.bulk-selection-count { color: var(--muted); font-size: 11px; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-left: auto; }
.bulk-feedback { flex-basis: 100%; min-height: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.bulk-feedback:empty { display: none; }
.bulk-feedback.error { color: #ffadba; }
.bulk-toolbar .button:disabled { cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid rgba(113, 224, 178, .23); border-radius: 99px; color: var(--success); background: rgba(54, 139, 111, .13); font-size: 10px; }
.pill.warn { color: var(--warning); border-color: rgba(245, 203, 117, .23); background: rgba(137, 104, 35, .13); }
.pill.bad { color: var(--danger); border-color: rgba(255, 113, 139, .25); background: rgba(135, 40, 64, .14); }
.empty { color: var(--muted); font-size: 13px; }

.import-result { overflow: hidden; border: 1px solid rgba(113, 224, 178, .25); border-radius: 12px; background: rgba(21, 57, 53, .26); }
.import-result.error { border-color: rgba(255, 113, 139, .35); background: rgba(93, 27, 45, .24); }
.result-summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 13px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.result-summary strong { color: var(--text); font-size: 12px; }
.result-summary span { text-align: right; }
.result-list { display: grid; gap: 0; max-height: 310px; margin: 0; padding: 0; overflow-y: auto; list-style: none; border-top: 1px solid var(--line-soft); counter-reset: result-row; }
.result-item { display: grid; grid-template-columns: minmax(0, .9fr) minmax(150px, 1.2fr); gap: 12px; align-items: center; padding: 11px 13px; border-bottom: 1px solid var(--line-soft); counter-increment: result-row; }
.result-item:last-child { border-bottom: 0; }
.result-item > div { min-width: 0; }
.result-item strong, .result-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-item strong { color: var(--success); font-size: 12px; }
.result-item.failure strong { color: var(--danger); }
.result-item span, .result-item p { color: var(--muted); font-size: 10px; line-height: 1.45; }
.result-item span { margin-top: 4px; }
.result-item p { margin: 0; overflow-wrap: anywhere; }
.import-progress { position: relative; display: flex; align-items: center; gap: 10px; min-height: 45px; padding: 12px 13px; overflow: hidden; color: var(--text); font-size: 11px; }
.import-progress i { width: 16px; height: 16px; flex: 0 0 auto; border: 2px solid rgba(155, 140, 255, .24); border-top-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; }
.import-progress::after { content: ''; position: absolute; inset: auto 0 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent-2), transparent); animation: scan 1.4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.card-list { display: grid; gap: 11px; }
.item-card { padding: 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(12, 18, 31, .72); }
.item-card-head { display: flex; justify-content: space-between; gap: 12px; }
.item-card h3 { margin: 0 0 5px; font-size: 14px; }
.item-card p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.item-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.compact-form { margin-bottom: 18px; }
.inline-form { display: flex; align-items: end; gap: 10px; }
.inline-form label { min-width: 180px; }
.inline-form .grow { flex: 1; }

.inbox-layout { display: grid; height: calc(100dvh - 135px); min-height: 740px; grid-template-columns: 430px minmax(0, 1fr); padding: 0; overflow: hidden; }
.conversation-rail { display: flex; min-height: 0; flex-direction: column; padding: 20px 0; overflow: hidden; border-right: 1px solid var(--line-soft); background: linear-gradient(180deg, rgba(117, 131, 199, .035), transparent 38%); }
.conversation-rail .panel-head { padding: 0 18px 16px; }
.conversation-rail .panel-head > div > p:not(.eyebrow) { margin-top: 5px; font-size: 14px; }
.conversation-rail h2, .thread-head h2 { font-size: 20px; }
.conversation-clear-toolbar { display: flex; flex: 0 0 auto; gap: 8px; padding: 0 18px 14px; }
.conversation-clear-toolbar .button { min-width: 0; flex: 1 1 0; justify-content: center; }
.conversation-list { display: grid; min-height: 0; grid-auto-rows: clamp(78px, calc(10dvh - 30px), 112px); align-content: start; flex: 1 1 auto; overflow-y: auto; scrollbar-width: thin; }
.conversation-item { display: grid; min-height: 78px; grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "avatar primary route" "avatar preview preview" "avatar counts counts"; column-gap: 12px; row-gap: 4px; padding: 10px 18px 10px 15px; border: 0; border-top: 1px solid var(--line-soft); border-left: 3px solid transparent; color: var(--text); text-align: left; background: transparent; transition: border-color .16s ease, background .16s ease; }
.conversation-item:hover, .conversation-item.active { border-left-color: var(--accent-2); background: linear-gradient(90deg, rgba(117, 131, 199, .18), rgba(117, 131, 199, .08)); }
.conversation-item strong, .conversation-item span { display: block; }
.conversation-item span { margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-avatar { display: grid !important; width: 46px; height: 46px; grid-area: avatar; align-self: start; place-items: center; margin-top: 1px !important; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; color: #fff; box-shadow: 0 8px 18px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .22); }
.conversation-avatar-icon { width: 27px; height: 27px; display: block; }
.conversation-avatar-tone-0 { background: linear-gradient(145deg, #7c8cff, #4b5fd0); }
.conversation-avatar-tone-1 { background: linear-gradient(145deg, #35c6b1, #167f86); }
.conversation-avatar-tone-2 { background: linear-gradient(145deg, #ed9b72, #a65363); }
.conversation-avatar-tone-3 { background: linear-gradient(145deg, #b889f4, #6953b9); }
.conversation-avatar-tone-4 { background: linear-gradient(145deg, #5fa9e9, #3966ac); }
.conversation-avatar-tone-5 { background: linear-gradient(145deg, #e0b45e, #a46b35); }
.conversation-item .conversation-primary { display: flex; grid-area: primary; align-items: center; justify-content: space-between; gap: 10px; margin: 0; color: var(--text); font-size: 14px; }
.conversation-primary strong { overflow: hidden; text-overflow: ellipsis; }
.conversation-primary .badge { flex: 0 0 auto; }
.conversation-item .conversation-route { grid-area: route; align-self: center; margin-top: 0; color: var(--accent); font-weight: 700; letter-spacing: .02em; text-align: right; }
.conversation-item .conversation-preview { grid-area: preview; margin-top: 0; color: var(--text-soft); }
.conversation-item .conversation-counts { grid-area: counts; margin-top: 0; font-size: 10px; letter-spacing: .02em; }
.conversation-pagination { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 10px; margin-top: 0; padding: 13px 18px 0; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }
.conversation-pagination .button { padding: 7px 11px; }
.thread { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.thread-head { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.2fr); gap: 18px; padding: 19px 22px; border-bottom: 1px solid var(--line-soft); }
.thread-title h2 { margin-bottom: 12px; }
.thread-route { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; }
.thread-route span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.thread-route b { color: var(--accent); font-size: 15px; }
.thread-route small { color: var(--muted); font-size: 10px; }
.first-contact-card { min-width: 0; padding: 12px 14px; border: 1px solid rgba(113, 224, 178, .22); border-radius: 12px; background: rgba(30, 74, 75, .22); }
.first-contact-card > span, .first-contact-card > strong, .first-contact-card > small, .first-contact-card > code { display: block; }
.first-contact-card > span { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.first-contact-card > strong { margin-top: 7px; overflow: hidden; font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.first-contact-card > small { margin-top: 6px; color: var(--muted); font-size: 9px; }
.first-contact-card > code { margin-top: 6px; overflow: hidden; color: var(--text-soft); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.thread-messages { display: flex; min-height: 0; flex-direction: column; gap: 11px; padding: 20px 22px; overflow-y: auto; background: radial-gradient(circle at 52% 36%, rgba(117, 131, 199, .055), transparent 46%), linear-gradient(180deg, rgba(8, 14, 26, .08), transparent 28%); }
.thread-messages.empty { align-items: center; justify-content: center; color: var(--muted); font-size: 15px; text-align: center; }
.load-earlier-messages { align-self: center; margin: 0 auto 6px; color: var(--text-soft); background: rgba(117, 131, 199, .1); }
.bubble { max-width: min(76%, 760px); padding: 13px 15px; border: 1px solid var(--line-soft); border-radius: 14px 14px 14px 5px; background: #1a2233; }
.bubble.out { align-self: flex-end; border-color: rgba(122, 144, 255, .35); border-radius: 14px 14px 4px 14px; background: rgba(71, 87, 170, .34); }
.bubble.first-outbound { box-shadow: 0 0 0 1px rgba(113, 224, 178, .45), 0 10px 25px rgba(0, 0, 0, .12); }
.bubble-route { margin-bottom: 7px; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .03em; }
.reply-reference { margin-bottom: 8px; padding: 7px 9px; overflow: hidden; border-left: 2px solid var(--accent-2); border-radius: 4px; color: var(--text-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; background: rgba(117, 131, 199, .1); }
.reply-reference span { margin-right: 7px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.bubble p { white-space: pre-wrap; line-height: 1.55; font-size: 14px; }
.bubble small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.reply-form { display: grid; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line-soft); }
.reply-composer { display: grid; min-width: 0; gap: 9px; }
.reply-form textarea { min-height: 76px; margin: 0; resize: vertical; }
.reply-actions { display: flex; min-width: 0; align-items: center; gap: 10px; }
.reply-actions .button { display: inline-flex; box-sizing: border-box; flex: 0 0 auto; min-width: 104px; min-height: 44px; align-items: center; justify-content: center; font-size: 14px; line-height: 1; white-space: nowrap; }
.reply-actions button[type="submit"].primary { margin-left: auto; }
.visually-hidden-file { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.reply-image-button { cursor: pointer; }
.reply-image-button[aria-disabled="true"] { pointer-events: none; cursor: not-allowed; opacity: .5; }
.reply-image-preview { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(124, 143, 255, .08); }
.reply-image-preview[hidden] { display: none; }
.reply-image-preview img { width: 56px; height: 56px; border-radius: 9px; object-fit: cover; }
.reply-image-copy { display: grid; min-width: 0; gap: 3px; }
.reply-image-copy strong, .reply-image-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-image-copy small { color: var(--muted); }
.reply-image-remove { border: 0; background: transparent; color: var(--danger, #ef6b73); cursor: pointer; }
.reply-image-status { min-width: 0; color: var(--muted); font-size: 12px; }
.reply-image-status.error { color: var(--danger, #ef6b73); }
.conversation-image { display: block; max-width: min(360px, 100%); padding: 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; background: transparent; cursor: zoom-in; }
.conversation-image img { display: block; width: 100%; max-height: 360px; object-fit: contain; }
.conversation-image-state { padding: 18px; border: 1px dashed var(--line-soft); border-radius: 10px; color: var(--muted); font-size: 12px; }
.conversation-image-state.error { color: var(--danger, #ef6b73); }
.image-viewer { width: min(94vw, 1100px); max-width: none; max-height: 92vh; padding: 0; overflow: visible; border: 0; border-radius: 16px; background: #0b0f18; box-shadow: 0 30px 90px rgba(0, 0, 0, .55); }
.image-viewer::backdrop { background: rgba(3, 6, 12, .78); backdrop-filter: blur(5px); }
.image-viewer img { display: block; width: 100%; max-height: 88vh; border-radius: 16px; object-fit: contain; }
.image-viewer-close { position: absolute; z-index: 2; top: -14px; right: -14px; width: 38px; height: 38px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 50%; background: #20283a; color: #fff; font-size: 24px; cursor: pointer; }
.event-list { display: grid; gap: 9px; max-height: 650px; overflow: auto; }
.event { padding: 11px; border-left: 2px solid var(--accent-2); background: rgba(12, 18, 31, .72); }
.event strong, .event small { display: block; }
.event strong { font-size: 12px; }
.event small { margin-top: 5px; color: var(--muted); }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  background: #26324a;
  transform: translateY(-150%);
  transition: transform .15s ease;
}
.skip-link:focus { transform: none; }
.login-page {
  min-height: 100vh;
  background:
    radial-gradient(850px 520px at 14% 10%, rgba(95, 141, 255, .18), transparent 62%),
    radial-gradient(720px 520px at 92% 90%, rgba(155, 140, 255, .13), transparent 64%),
    linear-gradient(145deg, #090d17, #070910 72%);
}
.login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(135deg, #000, transparent 76%);
}
.login-shell {
  display: grid;
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 72px);
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, .72fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
}
.login-stage { position: relative; display: flex; min-height: 590px; flex-direction: column; justify-content: space-between; padding: 18px 0; }
.login-stage::before, .login-stage::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(119, 151, 255, .14);
  border-radius: 50%;
}
.login-stage::before { top: 18%; right: 5%; width: 280px; height: 280px; box-shadow: 0 0 0 34px rgba(95, 141, 255, .025), 0 0 0 68px rgba(95, 141, 255, .018); }
.login-stage::after { top: 32%; right: 24%; width: 110px; height: 110px; border-color: rgba(101, 215, 233, .18); }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 16px; }
.login-brand small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.login-stage-copy { position: relative; z-index: 1; max-width: 590px; }
.login-stage-copy h1 { max-width: 560px; font-size: clamp(42px, 5vw, 67px); line-height: 1.06; }
.login-stage-copy > p:last-child { max-width: 520px; margin-top: 24px; color: #aab5c9; font-size: 13px; line-height: 1.85; }
.login-route { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; max-width: 560px; }
.login-route span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; letter-spacing: .09em; white-space: nowrap; }
.login-route b { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid rgba(155, 140, 255, .35); border-radius: 8px; color: #d9d4ff; background: rgba(119, 102, 225, .13); font-size: 8px; }
.login-route i { height: 1px; flex: 1; background: linear-gradient(90deg, rgba(155, 140, 255, .16), rgba(101, 215, 233, .62), rgba(155, 140, 255, .16)); }
.login-card {
  position: relative;
  padding: clamp(27px, 4vw, 42px);
  overflow: hidden;
  border: 1px solid rgba(128, 143, 255, .3);
  border-radius: 20px;
  background:
    radial-gradient(420px 210px at 100% 0%, rgba(101, 215, 233, .09), transparent 65%),
    linear-gradient(145deg, rgba(24, 32, 52, .97), rgba(12, 18, 31, .98));
  box-shadow: 0 34px 90px rgba(0, 0, 0, .34);
}
.login-card::before {
  content: '';
  position: absolute;
  right: -72px;
  bottom: -84px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(155, 140, 255, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 20px rgba(155, 140, 255, .018), 0 0 0 40px rgba(155, 140, 255, .012);
}
.login-card > * { position: relative; z-index: 1; }
.login-card-mark { position: absolute; top: 20px; right: 22px; color: rgba(155, 140, 255, .34); font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.login-card h2 { font-size: clamp(25px, 3vw, 34px); }
.login-intro { margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.login-form { display: grid; gap: 17px; margin-top: 28px; }
.login-form label { color: #bec7d8; font-size: 11px; font-weight: 700; }
.login-form input { min-height: 48px; margin-top: 8px; padding: 12px 13px; border-radius: 11px; background: rgba(7, 12, 22, .72); }
.login-form input[aria-invalid="true"] { border-color: rgba(255, 113, 139, .68); box-shadow: 0 0 0 3px rgba(255, 113, 139, .11); }
.login-error { padding: 10px 12px; border: 1px solid rgba(255, 113, 139, .28); border-radius: 10px; color: #ffc0cb; background: rgba(103, 31, 51, .25); font-size: 11px; line-height: 1.55; }
.login-error[hidden] { display: none; }
.login-submit { width: 100%; min-height: 50px; margin-top: 2px; }
.login-security-note { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line-soft); }
.login-security-note p, .login-security-note strong, .login-security-note small { display: block; }
.login-security-note strong { color: var(--text-soft); font-size: 10px; }
.login-security-note small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: 390px; padding: 13px 16px; border: 1px solid rgba(113, 224, 178, .32); border-radius: 12px; color: var(--text); background: #18263b; box-shadow: var(--shadow); transform: translateY(120px); opacity: 0; transition: .22s ease; }
.toast.show { transform: none; opacity: 1; }
.toast.error { border-color: rgba(255, 113, 139, .45); color: #ffc4ce; background: #351a29; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 88px minmax(0, 1fr); }
  .sidebar { padding: 23px 12px; }
  .brand { margin: 0 auto 28px; }
  .brand > div, .nav-item small, .sidebar-foot span:last-child { display: none; }
  .nav-item { padding: 12px 5px; text-align: center; font-size: 11px; }
  .sidebar-foot { justify-content: center; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.form-layout { grid-template-columns: minmax(250px, .75fr) minmax(0, 1.4fr); }
  .grid.form-layout.subaccount-layout { grid-template-columns: minmax(270px, .68fr) minmax(0, 1.45fr); }
  #view-campaigns .grid.form-layout { grid-template-columns: minmax(360px, .92fr) minmax(0, 1.08fr); }
  .permission-options { grid-template-columns: 1fr; }
  .campaign-preview-grid { grid-template-columns: minmax(240px, .78fr) minmax(390px, 1.22fr); }
  .campaign-upload-grid { grid-template-columns: 1fr; }
  .campaign-summary-grid { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .file-upload-card { min-height: 166px; }
  .login-shell { grid-template-columns: minmax(0, .9fr) minmax(360px, .75fr); gap: 45px; }
  .login-stage-copy h1 { font-size: clamp(38px, 5.2vw, 54px); }
  .login-route { align-items: stretch; flex-direction: column; }
  .login-route i { width: 1px; height: 8px; margin-left: 11px; flex: none; }
}

@media (max-width: 760px) {
  .reply-actions { flex-wrap: wrap; }
  .reply-actions .button.primary { width: 100%; margin-left: 0; }
  .reply-image-status { flex: 1 1 140px; }
  .conversation-image { max-width: 100%; }
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0; width: auto; height: 67px; padding: 7px; border: 1px solid var(--line-soft); border-radius: 18px 18px 0 0; }
  .brand, .sidebar-foot { display: none; }
  nav { grid-template-columns: repeat(8, 1fr); gap: 2px; }
  .nav-item { min-width: 0; padding: 11px 2px; font-size: 9px; }
  .nav-item.active { box-shadow: inset 0 2px 0 var(--accent), 0 -8px 24px rgba(86, 78, 169, .12); }
  main { padding: 24px 14px 96px; }
  .topbar { align-items: start; flex-direction: column; }
  .top-actions { width: 100%; flex-wrap: wrap; }
  .admin-session { min-width: 0; flex: 1 1 170px; }
  .grid.two, .grid.form-layout, .inbox-layout { grid-template-columns: 1fr; }
  .inbox-layout { height: auto; min-height: 0; }
  .grid.form-layout.subaccount-layout { grid-template-columns: 1fr; }
  #view-campaigns .grid.form-layout { grid-template-columns: 1fr; }
  .campaign-preview-grid { grid-template-columns: 1fr; }
  .campaign-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .campaign-task-head { align-items: stretch; flex-direction: column; }
  .campaign-task-head-actions { justify-content: space-between; }
  .sticky-panel { position: static; }
  .conversation-rail { max-height: 300px; overflow: hidden; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .thread-head { grid-template-columns: 1fr; }
  .thread { min-height: 520px; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .inline-form label { min-width: 0; }
  .panel { padding: 16px; }
  .result-item { grid-template-columns: 1fr; }
  .result-summary { display: flex; flex-direction: column; align-items: stretch; }
  .result-summary span { text-align: left; }
  .result-item strong, .result-item span { overflow-wrap: anywhere; white-space: normal; }
  .table-actions { flex-direction: column; align-items: stretch; }
  .bulk-actions { width: 100%; margin-left: 0; }
  .bulk-actions .button { flex: 1 1 92px; }
  .account-list-tools { align-items: stretch; flex-direction: column; }
  .account-list-tools label { min-width: 0; align-items: stretch; flex-direction: column; gap: 5px; }
  .account-list-tools select { min-width: 0; }
  .account-list-tools small { white-space: normal; }
  .account-bulk-move { width: 100%; margin-left: 0; }
  .account-bulk-move select, .account-bulk-move .button { flex: 1 1 0; min-width: 0; }
  .subaccount-card-head { align-items: flex-start; }
  .subaccount-status-actions { align-items: flex-end; flex-direction: column; }
  .subaccount-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .permission-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .number-option-grid, .account-assignment-group-grid { grid-template-columns: 1fr; }
  .toast { right: 14px; bottom: 82px; left: 14px; max-width: none; }
  .login-shell { display: block; min-height: 100vh; padding: 28px 20px 42px; }
  .login-stage { min-height: auto; padding: 0; }
  .login-stage::before, .login-stage::after, .login-route { display: none; }
  .login-stage-copy { margin-top: 42px; }
  .login-stage-copy h1 { max-width: 430px; font-size: clamp(34px, 10vw, 48px); }
  .login-stage-copy > p:last-child { margin-top: 16px; font-size: 12px; }
  .login-card { max-width: 520px; margin: 40px auto 0; }
}

@media (max-width: 430px) {
  h1 { font-size: 30px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { min-height: 116px; padding: 14px; }
  .stat-card strong { margin-top: 12px; font-size: 29px; }
  .stat-card .eyebrow { font-size: 8px; letter-spacing: .12em; }
  .panel-head { margin-bottom: 14px; }
  .campaign-upload-grid { grid-template-columns: 1fr; }
  .campaign-flow { align-items: stretch; flex-direction: column; }
  .campaign-flow i { width: 1px; height: 9px; min-width: 0; margin-left: 9px; flex: none; }
  .campaign-metrics { grid-template-columns: 1fr; }
  .permission-options, .subaccount-edit-fields { grid-template-columns: 1fr; }
  .subaccount-card-head { align-items: stretch; flex-direction: column; }
  .subaccount-status-actions { align-items: center; justify-content: space-between; flex-direction: row; }
  .subaccount-editor-actions { align-items: stretch; flex-direction: column; }
  .subaccount-editor-actions .button { width: 100%; }
  .password-reset-row { grid-template-columns: 1fr; }
  .password-reset-row .button { width: 100%; }
  .subaccount-danger-zone { align-items: stretch; flex-direction: column; }
  .subaccount-danger-zone .button { width: 100%; }
  .recipient-preview-item { grid-template-columns: 28px minmax(0, 1fr); }
  .recipient-preview-item .recipient-status { grid-column: 2; justify-self: start; }
  .login-shell { padding: 22px 14px 34px; }
  .login-stage-copy { margin-top: 32px; }
  .login-stage-copy h1 { font-size: 33px; }
  .login-stage-copy > p:last-child { line-height: 1.7; }
  .login-card { margin-top: 30px; padding: 27px 20px; border-radius: 17px; }
  table { font-size: 11px; }
}
