:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #f8f9fd;
  --surface-muted: #eef1f8;
  --text: #171a2d;
  --text-strong: #0d1020;
  --muted: #6f768b;
  --muted-2: #969caf;
  --border: #e3e7f0;
  --border-strong: #d5dae7;
  --tenant-primary: #0969f5;
  --primary: var(--tenant-primary);
  --primary-dark: color-mix(in srgb, var(--primary) 82%, #000);
  --primary-soft: color-mix(in srgb, var(--primary) 12%, #fff);
  --secondary: #0ea5a8;
  --success: #16834f;
  --success-soft: #e8f8ef;
  --danger: #b42338;
  --danger-soft: #feedef;
  --warning: #a86400;
  --warning-soft: #fff4d8;
  --info: #1769aa;
  --info-soft: #eaf4ff;
  --shadow-sm: 0 4px 14px rgba(34, 39, 67, .06);
  --shadow: 0 16px 42px rgba(35, 38, 59, .09);
  --shadow-lg: 0 28px 80px rgba(35, 38, 59, .14);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --sidebar-width: 268px;
  --topbar-height: 88px;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f121b;
  --surface: #171b27;
  --surface-raised: #1c2130;
  --surface-soft: #202637;
  --surface-muted: #272e42;
  --text: #edf0fb;
  --text-strong: #ffffff;
  --muted: #a5adc1;
  --muted-2: #7e879e;
  --border: #2d3549;
  --border-strong: #3a435a;
  --primary-soft: #2b2851;
  --success-soft: #153526;
  --danger-soft: #40212a;
  --warning-soft: #3c301b;
  --info-soft: #182f47;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .18);
  --shadow: 0 16px 42px rgba(0, 0, 0, .28);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); line-height: 1.55; }
body.modal-open, body.sidebar-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Shell */
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 40;
  display: flex; flex-direction: column; overflow: hidden;
  padding: 18px 14px 14px;
  background: linear-gradient(180deg, #171a2d 0%, #121525 100%);
  color: #fff; box-shadow: 10px 0 30px rgba(18, 21, 37, .08);
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 4px 8px 16px; }
.brand-mark {
  flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 15px; background: linear-gradient(135deg, #8d82ff, #5b4ee9 65%, #3d35ba);
  color: white; font-size: 21px; font-weight: 850; box-shadow: 0 12px 30px rgba(101,88,245,.35);
}
.brand-logo { overflow: hidden; background: #fff; padding: 0; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: 17px; letter-spacing: .3px; }
.brand-copy small { color: #aeb5cc; font-size: 11px; margin-top: 1px; }
.workspace-chip {
  display: flex; align-items: center; gap: 10px; margin: 4px 3px 14px; padding: 10px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: rgba(255,255,255,.055);
}
.workspace-avatar, .user-avatar {
  display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; font-weight: 750;
  background: linear-gradient(135deg, #7367f0, #4f46e5); color: #fff;
}
.workspace-avatar { width: 34px; height: 34px; font-size: 13px; }
.workspace-chip span:last-child { min-width: 0; }
.workspace-chip small, .workspace-chip strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-chip small { color: #a8afc5; font-size: 10px; }
.workspace-chip strong { font-size: 12px; margin-top: 1px; }
.main-nav { display: flex; flex: 1; flex-direction: column; gap: 3px; overflow: auto; scrollbar-width: thin; scrollbar-color: #343950 transparent; padding: 2px 0 12px; }
.main-nav a {
  position: relative; display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 10px 12px;
  border-radius: 12px; color: #d8dcee; font-size: 13px; transition: .18s ease;
}
.main-nav a:hover { background: rgba(255,255,255,.075); color: #fff; transform: translateX(-2px); }
.main-nav a.active { background: linear-gradient(135deg, rgba(115,103,240,.34), rgba(80,67,222,.22)); color: #fff; box-shadow: inset 0 0 0 1px rgba(145,136,255,.16); }
.main-nav a.active::before { content: ""; position: absolute; right: -14px; width: 4px; height: 24px; border-radius: 4px 0 0 4px; background: #8e84ff; }
.nav-icon { display: grid; place-items: center; width: 23px; font-size: 17px; opacity: .95; }
.nav-label { padding: 17px 12px 5px; color: #79819b; font-size: 10px; font-weight: 700; letter-spacing: .7px; }
.nav-count { margin-inline-start: auto; min-width: 19px; height: 19px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 999px; background: #ee4564; color: #fff; font-size: 10px; }
.nav-status { margin-inline-start: auto; width: 8px; height: 8px; border-radius: 50%; background: #7e879e; }
.nav-status.online { background: #27c17e; box-shadow: 0 0 0 4px rgba(39,193,126,.12); }
.sidebar-footer { margin-top: auto; padding: 14px 5px 0; border-top: 1px solid rgba(255,255,255,.08); }
.user-mini { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 2px 4px 10px; }
.user-avatar { width: 36px; height: 36px; font-size: 12px; }
.user-mini > span:last-child { min-width: 0; }
.user-mini strong, .user-mini small { display: block; max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-mini strong { color: #fff; font-size: 11px; }
.user-mini small { color: #9ba3bb; font-size: 10px; }
.sidebar .btn-ghost { border-color: rgba(255,255,255,.12); color: #cbd0e0; }
.sidebar-backdrop { display: none; }

.main-content { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; min-height: var(--topbar-height); padding: 17px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(15px);
}
.topbar-start, .top-actions, .profile-button, .page-heading { display: flex; align-items: center; }
.topbar-start { gap: 12px; min-width: 0; }
.page-heading { display: block; min-width: 0; }
.page-heading h1 { margin: 0; color: var(--text-strong); font-size: clamp(19px, 2vw, 25px); line-height: 1.25; }
.page-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { gap: 8px; }
.profile-button { gap: 9px; padding: 5px 9px 5px 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
.profile-button strong, .profile-button small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-button strong { font-size: 11px; }
.profile-button small { color: var(--muted); font-size: 9px; }
.page-content { width: 100%; max-width: 1640px; margin: 0 auto; padding: 26px 28px 70px; }
.mobile-bottom-nav { display: none; }

/* Core components */
.grid { display: grid; gap: 18px; }
.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)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.card-elevated { box-shadow: var(--shadow); }
.card-flat { box-shadow: none; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.card-header h2, .card-header h3, .card h2, .card h3 { margin: 0; color: var(--text-strong); }
.card-header h2, .card h2 { font-size: 17px; }
.card-header h3, .card h3 { font-size: 15px; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin: 4px 0 17px; }
.section-title h2 { margin: 0; font-size: 18px; }
.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.stat-card { position: relative; overflow: hidden; min-height: 132px; }
.stat-card::after { content: ""; position: absolute; width: 95px; height: 95px; border-radius: 50%; left: -25px; bottom: -42px; background: var(--accent-soft, var(--primary-soft)); opacity: .65; }
.stat { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.stat strong { display: block; font-size: clamp(25px, 3vw, 34px); line-height: 1.1; letter-spacing: -.6px; }
.stat small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.stat-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; background: var(--accent-soft, var(--primary-soft)); color: var(--accent, var(--primary)); font-size: 21px; }
.stat-trend { display: inline-flex; align-items: center; gap: 4px; margin-top: 11px; padding: 4px 8px; border-radius: 999px; font-size: 10px; }
.stat-trend.up { background: var(--success-soft); color: var(--success); }
.stat-trend.down { background: var(--danger-soft); color: var(--danger); }
.hero-card { position: relative; overflow: hidden; background: linear-gradient(135deg, #5d50ed, #776cf5 58%, #9d95ff); color: #fff; border: 0; box-shadow: 0 20px 50px rgba(91,79,233,.24); }
.hero-card::before, .hero-card::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.1); }
.hero-card::before { width: 220px; height: 220px; left: -85px; top: -95px; }
.hero-card::after { width: 140px; height: 140px; right: 26%; bottom: -85px; }
.hero-card h2, .hero-card h3, .hero-card p { color: inherit; position: relative; z-index: 1; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; position: relative; z-index: 1; margin-top: 18px; }
.hero-card .btn-primary { background: #fff; color: #5043de; }
.hero-card .btn-ghost { color: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 17px; }
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn {
  min-height: 40px; padding: 9px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 650; font-size: 12px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(101,88,245,.22); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface-soft); border-color: var(--border); color: var(--text); }
.btn-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 18%, transparent); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 17%, transparent); }
.btn-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 18%, transparent); }
.btn-info { background: var(--info-soft); color: var(--info); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-link { background: transparent; color: var(--primary); padding-inline: 5px; }
.btn-sm { min-height: 32px; padding: 6px 10px; border-radius: 9px; font-size: 10px; }
.btn-lg { min-height: 48px; padding: 12px 20px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-button {
  position: relative; width: 41px; height: 41px; display: inline-grid; place-items: center;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); cursor: pointer; transition: .16s;
}
.icon-button:hover { border-color: var(--border-strong); background: var(--surface-muted); transform: translateY(-1px); }
.notification-button span, .icon-button [data-notification-count] { position: absolute; top: -5px; left: -5px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center; border-radius: 999px; background: #e83e5d; color: #fff; font-size: 9px; border: 2px solid var(--surface); }
.actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-group { margin-bottom: 15px; }
.form-grid .form-group { margin: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 7px; color: var(--text-strong); font-size: 12px; font-weight: 700; }
.form-control, .form-select {
  width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 11px; background: var(--surface); color: var(--text); outline: none; transition: .16s;
}
.form-control:hover, .form-select:hover { border-color: var(--border-strong); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.form-control::placeholder { color: var(--muted-2); }
textarea.form-control { min-height: 120px; resize: vertical; }
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: 0 11px 11px 0; }
.input-group .btn, .input-addon { border-radius: 11px 0 0 11px; }
.input-addon { min-width: 43px; display: grid; place-items: center; border: 1px solid var(--border); border-right: 0; background: var(--surface-soft); color: var(--muted); }
.search-control { position: relative; min-width: 250px; }
.search-control .form-control { padding-inline-start: 38px; }
.search-control::before { content: "⌕"; position: absolute; right: 13px; top: 50%; transform: translateY(-52%); color: var(--muted); z-index: 1; }
.help, .form-hint { margin-top: 5px; color: var(--muted); font-size: 10px; }
.validation-summary-errors, .field-validation-error { color: var(--danger); font-size: 11px; }
.checkbox, .switch-row { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.checkbox input { margin-top: 4px; accent-color: var(--primary); }
.switch { position: relative; width: 43px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-muted); border: 1px solid var(--border-strong); transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; top: 2px; right: 2px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.16); transition: .2s; }
.switch input:checked + span { background: var(--primary); border-color: var(--primary); }
.switch input:checked + span::after { transform: translateX(-19px); }
.switch-copy strong, .switch-copy small { display: block; }
.switch-copy strong { font-size: 12px; }
.switch-copy small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.radio-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.radio-card { position: relative; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card-content { height: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); transition: .18s; }
.radio-card input:checked + .radio-card-content { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 11%, transparent); }
.radio-card-content strong, .radio-card-content small { display: block; }
.radio-card-content small { color: var(--muted); margin-top: 3px; font-size: 10px; }

/* Tables and cards */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.table { width: 100%; min-width: 800px; border-collapse: collapse; }
.table th, .table td { padding: 13px 14px; text-align: right; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table th { position: sticky; top: 0; z-index: 1; background: var(--surface-soft); color: var(--muted); font-size: 10px; letter-spacing: .1px; font-weight: 750; }
.table td { font-size: 12px; }
.table tbody tr { transition: .15s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--primary-soft) 48%, transparent); }
.table tr:last-child td { border-bottom: 0; }
.table-mobile-cards .mobile-card { display: none; }
.contact-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.contact-cell-copy { min-width: 0; }
.contact-cell strong, .contact-cell small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-cell small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.avatar { width: 39px; height: 39px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; background: var(--surface-muted); }
.avatar-sm { width: 30px; height: 30px; }
.avatar-lg { width: 66px; height: 66px; }
.badge { display: inline-flex; align-items: center; gap: 4px; min-height: 23px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 9px; font-weight: 700; white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 20%, transparent); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 18%, transparent); }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 20%, transparent); }
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); border-color: color-mix(in srgb, var(--primary) 18%, transparent); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 18%, transparent); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag { display: inline-flex; margin: 2px; padding: 3px 8px; border-radius: 999px; color: #fff; font-size: 9px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 18px; }
.pagination a, .pagination span { min-width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); font-size: 11px; }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Progress, charts, states */
.progress { height: 9px; overflow: hidden; border-radius: 999px; background: var(--surface-muted); }
.progress > span { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #8a7fff); transition: width .35s ease; }
.progress-success > span { background: linear-gradient(90deg, #1d9d61, #43c485); }
.progress-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 10px; }
.metric-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 10px 0; font-size: 12px; }
.metric-line span { color: var(--muted); }
.mini-chart { display: flex; align-items: flex-end; gap: 4px; height: 72px; padding-top: 8px; }
.mini-chart span { flex: 1; min-width: 4px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #8a7fff, #0969f5); opacity: .9; }
.donut { --value: 50; width: 108px; height: 108px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--value) * 1%), var(--surface-muted) 0); position: relative; }
.donut::after { content: ""; position: absolute; width: 76px; height: 76px; border-radius: 50%; background: var(--surface); }
.donut strong { position: relative; z-index: 1; font-size: 19px; }
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-soft); }
.activity-copy strong, .activity-copy small { display: block; }
.activity-copy strong { font-size: 11px; }
.activity-copy small, .activity-time { color: var(--muted); font-size: 9px; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty-icon { width: 62px; height: 62px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 20px; background: var(--surface-soft); font-size: 26px; }
.empty h3 { color: var(--text); margin: 0 0 5px; }
.empty p { margin: 0 0 14px; font-size: 11px; }

/* Alerts / toast / modal */
.alert { position: relative; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 15px; padding: 12px 14px; border: 1px solid transparent; border-radius: 13px; font-size: 11px; }
.alert > div { flex: 1; }
.alert > button { border: 0; background: transparent; cursor: pointer; color: inherit; font-size: 18px; line-height: 1; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 15%, transparent); }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 15%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 18%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 16%, transparent); }
.toast-stack { position: fixed; left: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 30px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-raised); box-shadow: var(--shadow-lg); animation: toast-in .22s ease; }
.toast strong, .toast small { display: block; }
.toast small { color: var(--muted); font-size: 10px; margin-top: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(11,14,26,.52); backdrop-filter: blur(4px); }
.modal { width: min(650px, 100%); max-height: min(85vh, 780px); overflow: auto; padding: 21px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.modal-header h3 { margin: 0; }

/* Layout utilities */
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }
.split-equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sticky-panel { position: sticky; top: calc(var(--topbar-height) + 18px); align-self: start; }
.tabs { display: flex; gap: 4px; overflow: auto; padding: 4px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
.tabs a, .tabs button { flex: 0 0 auto; min-height: 36px; padding: 8px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.tabs .active, .tabs a:hover, .tabs button:hover { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.code-box { direction: ltr; text-align: left; overflow: auto; padding: 13px; border-radius: 11px; background: #10131e; color: #dfe3f5; font-family: Consolas, monospace; font-size: 11px; }
.divider { height: 1px; margin: 18px 0; background: var(--border); }
.muted { color: var(--muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.nowrap { white-space: nowrap; }
.text-center { text-align: center; }
.text-end { text-align: left; }
.w-100 { width: 100%; }
.mt-0 { margin-top: 0; }.mt-1 { margin-top: 8px; }.mt-2 { margin-top: 14px; }.mt-3 { margin-top: 22px; }
.mb-0 { margin-bottom: 0; }.mb-1 { margin-bottom: 8px; }.mb-2 { margin-bottom: 14px; }.mb-3 { margin-bottom: 22px; }
.desktop-only { display: initial; }
.mobile-only { display: none; }

/* Wizard */
.wizard-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; }
.wizard-nav { position: sticky; top: calc(var(--topbar-height) + 18px); align-self: start; }
.wizard-steps { display: flex; flex-direction: column; gap: 5px; }
.wizard-step-link { display: grid; grid-template-columns: 33px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px; border-radius: 12px; color: var(--muted); }
.wizard-step-link.active { color: var(--primary-dark); background: var(--primary-soft); }
.wizard-step-link.done { color: var(--success); }
.wizard-step-number { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); font-size: 11px; font-weight: 750; }
.wizard-step-link.active .wizard-step-number { border-color: var(--primary); background: var(--primary); color: #fff; }
.wizard-step-link.done .wizard-step-number { border-color: var(--success); background: var(--success-soft); }
.wizard-step-link strong, .wizard-step-link small { display: block; }
.wizard-step-link strong { font-size: 11px; }
.wizard-step-link small { margin-top: 2px; font-size: 9px; }
.wizard-pane { display: none; }
.wizard-pane.active { display: block; animation: pane-in .2s ease; }
@keyframes pane-in { from { opacity: 0; transform: translateY(5px); } }
.wizard-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.health-score { display: grid; grid-template-columns: 90px minmax(0,1fr); align-items: center; gap: 15px; }
.health-ring { --score: 80; width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--success) calc(var(--score) * 1%), var(--surface-muted) 0); position: relative; }
.health-ring::after { content: ""; position: absolute; width: 64px; height: 64px; border-radius: 50%; background: var(--surface); }
.health-ring strong { position: relative; z-index: 1; }
.recipient-picker { max-height: 350px; overflow: auto; padding: 6px; border: 1px solid var(--border); border-radius: 13px; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.check-item { display: flex; align-items: center; gap: 7px; padding: 9px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-soft); font-size: 10px; cursor: pointer; }
.check-item:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.check-item input { accent-color: var(--primary); }
.message-preview { min-height: 180px; padding: 17px; border-radius: 17px; background: linear-gradient(180deg, #eef5fb, #e4edf6); direction: rtl; }
:root[data-theme="dark"] .message-preview { background: linear-gradient(180deg, #1b2a39, #17232f); }
.chat-bubble { max-width: 88%; margin-inline-start: auto; padding: 11px 13px; border-radius: 16px 16px 4px 16px; background: #1689f8; color: #fff; white-space: pre-wrap; font-size: 12px; box-shadow: 0 5px 14px rgba(22,137,248,.2); }

/* CRM */
.crm-layout { display: grid; grid-template-columns: 270px minmax(0,1fr); gap: 17px; }
.filter-panel { align-self: start; }
.filter-panel .form-group:last-child { margin-bottom: 0; }
.contact-profile-header { display: flex; align-items: center; gap: 15px; }
.contact-profile-copy { flex: 1; min-width: 0; }
.contact-profile-copy h2 { margin: 0; }
.contact-profile-copy p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.timeline { position: relative; padding-right: 18px; }
.timeline::before { content: ""; position: absolute; right: 5px; top: 5px; bottom: 5px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding: 0 14px 17px 0; }
.timeline-item::before { content: ""; position: absolute; right: -17px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item small { color: var(--muted); font-size: 9px; margin-top: 2px; }

/* Billing */
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.plan-card { position: relative; padding: 22px; border: 1px solid var(--border); border-radius: 19px; background: var(--surface); }
.plan-card.featured { border-color: var(--primary); box-shadow: 0 18px 45px rgba(101,88,245,.15); }
.plan-ribbon { position: absolute; top: 13px; left: 13px; padding: 4px 8px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 9px; }
.plan-price { margin: 15px 0; font-size: 31px; font-weight: 850; }
.plan-price small { color: var(--muted); font-size: 11px; font-weight: 500; }
.feature-list { display: flex; flex-direction: column; gap: 8px; margin: 15px 0; padding: 0; list-style: none; }
.feature-list li { color: var(--muted); font-size: 11px; }
.feature-list li::before { content: "✓"; margin-left: 7px; color: var(--success); font-weight: 800; }
.usage-card { padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
.usage-card + .usage-card { margin-top: 9px; }
.usage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 10px; }

/* Onboarding */
.onboarding-shell { max-width: 980px; margin: 0 auto; }
.onboarding-header { text-align: center; margin-bottom: 24px; }
.onboarding-header .brand-mark { margin: 0 auto 12px; }
.onboarding-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 19px; }
.onboarding-step { padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.onboarding-step.done { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); background: var(--success-soft); }
.onboarding-step strong, .onboarding-step small { display: block; }
.onboarding-step small { color: var(--muted); font-size: 9px; margin-top: 3px; }

/* Authentication */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 85% 5%, #e8e5ff 0, transparent 38%), radial-gradient(circle at 5% 95%, #dff7f4 0, transparent 34%), var(--bg); }
:root[data-theme="dark"] .auth-shell { background: radial-gradient(circle at 85% 5%, #28234f 0, transparent 38%), radial-gradient(circle at 5% 95%, #153635 0, transparent 34%), var(--bg); }
.auth-card { width: min(450px, 100%); padding: 30px; border: 1px solid var(--border); border-radius: 24px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-lg); backdrop-filter: blur(12px); }
.auth-logo { text-align: center; margin-bottom: 23px; }
.auth-logo .brand-mark { margin: auto; }
.auth-logo h1 { margin: 11px 0 3px; }
.auth-logo p { margin: 0; color: var(--muted); font-size: 11px; }

/* Responsive */
@media (max-width: 1250px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .plan-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 1050px) {
  :root { --sidebar-width: 235px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .split, .crm-layout { grid-template-columns: 1fr; }
  .filter-panel, .sticky-panel { position: static; }
  .wizard-shell { grid-template-columns: 1fr; }
  .wizard-nav { position: static; }
  .wizard-steps { flex-direction: row; overflow: auto; }
  .wizard-step-link { flex: 0 0 190px; }
  .check-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .onboarding-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 820px) {
  :root { --topbar-height: 72px; }
  .app-shell { display: block; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sidebar { position: fixed; right: -286px; top: 0; width: 272px; transition: right .23s ease; box-shadow: var(--shadow-lg); }
  .sidebar-open .sidebar { right: 0; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; display: block; pointer-events: none; opacity: 0; background: rgba(9,12,23,.52); backdrop-filter: blur(3px); transition: .2s; }
  .sidebar-open .sidebar-backdrop { pointer-events: auto; opacity: 1; }
  .topbar { min-height: var(--topbar-height); padding: 12px 14px; }
  .page-heading h1 { font-size: 18px; }
  .page-heading p { max-width: 58vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions { gap: 5px; }
  .top-actions > .icon-button:nth-of-type(1), .top-actions > .icon-button:nth-of-type(2) { display: none; }
  .profile-button { padding: 3px; border: 0; background: transparent; }
  .page-content { padding: 15px 12px 35px; }
  .mobile-only { display: inline-grid; }
  .desktop-only { display: none !important; }
  .mobile-bottom-nav {
    position: fixed; right: 0; left: 0; bottom: 0; z-index: 34; display: grid; grid-template-columns: repeat(5, 1fr);
    min-height: calc(62px + env(safe-area-inset-bottom)); padding: 5px 7px calc(5px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px); box-shadow: 0 -10px 30px rgba(34,39,67,.08);
  }
  .mobile-bottom-nav a, .mobile-bottom-nav button { border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 18px; }
  .mobile-bottom-nav small { font-size: 9px; }
  .mobile-bottom-nav .active { color: var(--primary); }
  .mobile-bottom-nav .mobile-fab { position: relative; transform: translateY(-14px); }
  .mobile-bottom-nav .mobile-fab span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 17px; background: var(--primary); color: #fff; box-shadow: 0 10px 26px rgba(101,88,245,.33); }
  .mobile-bottom-nav .mobile-fab small { color: var(--primary); font-weight: 700; }
  .grid-2, .grid-3, .grid-4, .grid-5, .plan-grid, .split-equal { grid-template-columns: 1fr; }
  .span-2, .plan-card:last-child { grid-column: auto; }
  .card { padding: 15px; border-radius: 17px; }
  .hero-card { padding: 19px; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }
  .toolbar { align-items: stretch; }
  .toolbar > *, .toolbar-group { width: 100%; }
  .toolbar-group .btn { flex: 1; }
  .search-control { width: 100%; min-width: 0; }
  .check-grid, .radio-card-grid { grid-template-columns: 1fr; }
  .wizard-step-link { flex-basis: 155px; padding: 7px; }
  .wizard-step-link small { display: none; }
  .wizard-footer { position: sticky; bottom: 72px; z-index: 4; margin: 14px -15px -15px; padding: 11px 15px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); }
  .onboarding-grid { grid-template-columns: 1fr; }
  .toast-stack { right: 12px; left: 12px; bottom: 78px; width: auto; }
}

@media (max-width: 640px) {
  .table-mobile-cards .table { display: none; }
  .table-mobile-cards .mobile-card { display: block; padding: 13px; border-bottom: 1px solid var(--border); }
  .table-mobile-cards .mobile-card:last-child { border-bottom: 0; }
  .mobile-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
  .mobile-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .mobile-card-field { padding: 8px; border-radius: 9px; background: var(--surface-soft); }
  .mobile-card-field small, .mobile-card-field strong { display: block; }
  .mobile-card-field small { color: var(--muted); font-size: 8px; }
  .mobile-card-field strong { margin-top: 2px; font-size: 10px; }
  .topbar .icon-button { width: 37px; height: 37px; }
  .page-heading p { display: none; }
  .stat-card { min-height: auto; }
  .stat strong { font-size: 27px; }
  .card-header { flex-direction: column; align-items: stretch; }
  .health-score { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .auth-card { padding: 22px 18px; border-radius: 19px; }
}

@media print {
  .sidebar, .topbar, .mobile-bottom-nav, .toolbar, .no-print { display: none !important; }
  .app-shell { display: block; }
  .page-content { max-width: none; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; color: #000; }
}

/* V4 account, legal and administration refinements */
.d-block{display:block}.mt-3{margin-top:1.25rem}.narrow-card{max-width:760px;margin-inline:auto}.legal-page{max-width:920px;margin:32px auto;line-height:1.9}.legal-page h1{margin-top:0}.legal-page h2{margin-top:28px;font-size:1.18rem}.code-input{font-size:1.6rem;letter-spacing:.45rem;text-align:center;font-weight:800}.setting-card{border:1px solid var(--border);border-radius:var(--radius-md);padding:18px;background:var(--surface-soft)}.steps-list{display:grid;gap:10px}.steps-list>div{display:flex;align-items:center;gap:12px}.steps-list span{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--primary-soft);color:var(--primary);font-weight:800}.steps-list p{margin:0}.sticky-tabs{position:sticky;top:76px;z-index:12;background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(14px);padding-block:8px;margin-bottom:16px}.btn-danger-soft{background:rgba(239,68,68,.1);color:#dc2626}.btn-success-soft{background:rgba(34,197,94,.1);color:#15803d}.form-select-sm{min-height:34px;padding:5px 9px;font-size:.82rem}.inline-form{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.inline-form .form-select{width:auto;min-width:105px}.text-truncate{max-width:360px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:720px){.sticky-tabs{top:64px;overflow-x:auto;flex-wrap:nowrap}.legal-page{margin:12px}.inline-form{width:100%;margin-top:8px}.inline-form .form-select{flex:1;min-width:0}.code-input{letter-spacing:.25rem}}


/* V4 accessibility, mobile and PWA polish */
body { font-size: 15px; }
.workspace-logo { overflow: hidden; background: #fff; }
.workspace-logo img { width: 100%; height: 100%; object-fit: cover; }
.main-nav a { min-height: 46px; font-size: 14px; }
.nav-label { font-size: 11px; }
.workspace-chip strong, .user-mini strong, .profile-button strong { font-size: 13px; }
.workspace-chip small, .user-mini small, .profile-button small, .brand-copy small { font-size: 11px; }
.page-heading p, .card-subtitle, .help-text, .form-help { font-size: 13px; }
.table th { font-size: 12px; letter-spacing: .1px; }
.table td { font-size: 14px; }
.badge, .status-badge, .chip { font-size: 12px; }
.btn { min-height: 42px; }
.btn-sm { min-height: 34px; }
.form-control, .form-select, textarea { min-height: 44px; font-size: 15px; }
textarea.form-control { min-height: 112px; }

.connection-banner {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 120;
  width: min(520px, calc(100vw - 28px)); transform: translateX(-50%);
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px 10px;
  padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--warning) 34%, var(--border));
  border-radius: 15px; background: color-mix(in srgb, var(--warning-soft) 94%, var(--surface));
  color: var(--text); box-shadow: var(--shadow-lg);
}
.connection-banner > span { color: var(--warning); animation: connection-pulse 1.4s infinite; }
.connection-banner strong { white-space: nowrap; }
.connection-banner small { color: var(--muted); }
.is-offline .nav-status.online { background: var(--warning); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 18%, transparent); }
.toast-persistent { pointer-events: auto; }
.toast-action { margin-top: 9px; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 55%, #fff);
  outline-offset: 3px;
}
@keyframes connection-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 820px) {
  body { font-size: 15px; }
  .page-content { padding-inline: 14px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 68px; padding: 10px 14px; }
  .page-heading h1 { font-size: 20px; }
  .card { padding: 16px; border-radius: 18px; }
  .btn:not(.icon-button), .form-control, .form-select { min-height: 48px; }
  .mobile-bottom-nav a, .mobile-bottom-nav button { min-height: 62px; }
  .table-responsive .table.mobile-cards td { font-size: 14px; }
  .connection-banner { bottom: calc(78px + env(safe-area-inset-bottom)); grid-template-columns: auto 1fr; }
  .connection-banner small { grid-column: 2; }
}

/* V4.1 campaign templates, manual recipients and attachment preview */
.manual-recipient-card {
  border: 1px dashed var(--border, #d9deea);
  border-radius: 16px;
  padding: 16px;
  background: color-mix(in srgb, var(--surface, #fff) 92%, var(--primary, #5b4fe9) 8%);
}
.card-header.compact { margin-bottom: 10px; }
.card-header.compact h3 { margin: 0 0 4px; }
[data-manual-recipients] { min-height: 132px; direction: ltr; text-align: left; }
.attachment-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: rgba(91,79,233,.08);
  border: 1px solid rgba(91,79,233,.14);
}
.attachment-preview[hidden] { display: none !important; }
.attachment-preview img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
}
.attachment-preview small { display: block; color: var(--muted, #6b7280); margin-top: 3px; }
.attachment-file-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 24px;
  background: #fff;
}
.chat-bubble.is-empty { opacity: .78; font-style: italic; }
@media (max-width: 720px) {
  .manual-recipient-card { padding: 12px; }
  .attachment-preview img { width: 58px; height: 58px; }
}

/* Selected plan shown on the registration page when the visitor arrives from pricing. */
.selected-plan-chip {
  background: #eaf5ff;
  border: 1px solid #dcd8ff;
  color: #5045d5;
  border-radius: 12px;
  padding: 10px 13px;
  margin-bottom: 15px;
  font-size: 13px;
}

/* Snap Inbox official brand assets */
.brand-logo { overflow: hidden; background: #fff; padding: 3px; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.auth-logo .brand-logo, .onboarding-header .brand-logo { width: 72px; height: 72px; border-radius: 22px; box-shadow: 0 18px 38px rgba(22, 104, 238, .2); }

/* V4.3.0 — durable Agent command lifecycle */
.scan-command-status {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 14px;
  padding: 8px 10px;
  border-radius: 11px;
  font-size: 13px;
  line-height: 1.55;
}
.scan-command-status:empty { display: none; }
.scan-command-status-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
}
.scan-command-status-info { background: rgba(31, 115, 255, .08); color: var(--primary, #1f73ff); }
.scan-command-status-info .scan-command-status-icon { background: rgba(31, 115, 255, .14); }
.scan-command-status-success { background: rgba(20, 160, 92, .10); color: #087545; }
.scan-command-status-success .scan-command-status-icon { background: rgba(20, 160, 92, .16); }
.scan-command-status-warning { background: rgba(217, 142, 0, .10); color: #8b5c00; }
.scan-command-status-warning .scan-command-status-icon { background: rgba(217, 142, 0, .16); }
.scan-command-status-danger { background: rgba(211, 47, 47, .10); color: #a51e1e; }
.scan-command-status-danger .scan-command-status-icon { background: rgba(211, 47, 47, .16); }

/* V4.3.6 — campaign drafts and alternating message variants */
.wizard-quick-save {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e7edf5);
  text-align: center;
}
.wizard-quick-save small { color: var(--muted, #6f7d91); }
.campaign-audience-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.campaign-audience-summary span {
  padding: 7px 10px;
  border: 1px solid var(--border, #e3eaf4);
  border-radius: 999px;
  background: var(--surface-soft, #f7faff);
  font-size: 12px;
}
.message-rotation-card {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(31, 115, 255, .18);
  border-radius: 16px;
  background: rgba(31, 115, 255, .035);
}
.message-rotation-card [hidden] { display: none !important; }
.variant-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.variant-toolbar .form-group { min-width: 130px; margin: 0; }
.message-variant-list { display: grid; gap: 12px; }
.message-variant-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border, #e3eaf4);
  border-radius: 14px;
  background: var(--surface, #fff);
}
.message-variant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.message-variant-item textarea { min-height: 105px; }
.existing-attachment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-soft, #f7faff);
}
.campaign-submit-actions .actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 720px) {
  .variant-toolbar, .existing-attachment, .campaign-submit-actions { align-items: stretch; flex-direction: column; }
  .variant-toolbar .form-group { width: 100%; }
  .campaign-submit-actions .actions { width: 100%; display: grid; }
}
.message-variant-details { display: grid; gap: 8px; }
.message-variant-details details { border: 1px solid var(--border, #e3eaf4); border-radius: 12px; overflow: hidden; }
.message-variant-details summary { cursor: pointer; padding: 10px 12px; font-weight: 700; background: var(--surface-soft, #f7faff); }
.message-variant-details .message-preview { padding: 10px; }

/* Authenticator QR setup */
.authenticator-setup-card{max-width:900px}
.authenticator-setup-grid{display:grid;grid-template-columns:minmax(260px,320px) 1fr;gap:24px;align-items:center;margin-top:18px}
.authenticator-qr-panel{display:flex;flex-direction:column;align-items:center;gap:10px}
.authenticator-qr-frame{width:min(100%,292px);aspect-ratio:1;background:#fff;border:1px solid var(--border,#dfe6ef);border-radius:20px;padding:16px;display:flex;align-items:center;justify-content:center;box-shadow:0 14px 34px rgba(15,23,42,.08)}
.authenticator-qr-frame img{display:block;width:100%;height:auto;image-rendering:pixelated}
.authenticator-instructions{min-width:0}
.manual-authenticator-setup{border:1px solid var(--border,#dfe6ef);border-radius:14px;padding:12px 14px;background:var(--surface-soft,#f8fafc)}
.manual-authenticator-setup summary{cursor:pointer;font-weight:700}
.authenticator-confirm-form{max-width:420px;margin-inline:auto}
.validation-summary:empty{display:none}
@media (max-width:760px){.authenticator-setup-grid{grid-template-columns:1fr}.authenticator-qr-frame{width:min(100%,270px)}.authenticator-confirm-form{max-width:none}}

.platform-global-notice{position:relative;z-index:5000;padding:10px 16px;text-align:center;background:#fff3cd;color:#6b4f00;border-bottom:1px solid #ffe69c;font-weight:700;font-size:.92rem}
