:root {
  --ink: #17181c; --ink-2: #3d3f47; --muted: #5b5d66; --muted-2: #8a8c94;
  --line: #e6e5e0; --line-2: #eeede8; --line-3: #f2f1ed; --input-line: #dcdbd5;
  --bg: #f6f6f3; --surface: #fff; --surface-2: #fafaf8; --hover: #f3f3f0; --hover-2: #efeee9;
  --accent: #2f4fd8; --accent-hover: #2742b8; --accent-soft: #eef1fd; --accent-line: #d6ddfa; --accent-ring: rgba(47,79,216,.12);
  --ok: #1d7a50; --ok-soft: #e7f3ec; --ok-line: #c7e3d3;
  --bad: #b3392a; --bad-soft: #fbebe8; --bad-line: #f1cfc8;
  --warn: #97650f; --warn-soft: #fbf2e1; --warn-line: #efdcb6;
  --shadow-pop: 0 12px 32px rgba(20,20,30,.12);
  --bs-body-font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --bs-body-font-size: 14.5px; --bs-body-color: var(--ink); --bs-body-bg: var(--bg);
  --bs-border-color: var(--line); --bs-border-radius: 8px;
  --bs-primary: #2f4fd8; --bs-primary-rgb: 47,79,216;
  --bs-link-color: #2f4fd8; --bs-link-color-rgb: 47,79,216; --bs-link-hover-color: #2742b8; --bs-link-hover-color-rgb: 39,66,184;
  --bs-emphasis-color: var(--ink); --bs-secondary-color: var(--muted);
}
[data-bs-theme=dark] {
  --ink: #ececef; --ink-2: #c9cad0; --muted: #a3a5ad; --muted-2: #7d7f88;
  --line: #2c2e35; --line-2: #26282e; --line-3: #222429; --input-line: #383a42;
  --bg: #111215; --surface: #18191d; --surface-2: #1d1e23; --hover: #22242a; --hover-2: #2a2c33;
  --accent: #6f86f0; --accent-hover: #8396f2; --accent-soft: #1f2440; --accent-line: #2e3666; --accent-ring: rgba(111,134,240,.2);
  --ok: #5fc795; --ok-soft: #15291f; --ok-line: #1f4030;
  --bad: #f08a7a; --bad-soft: #2e1a17; --bad-line: #4a2620;
  --warn: #e0b25c; --warn-soft: #2c2414; --warn-line: #4a3a1c;
  --shadow-pop: 0 12px 32px rgba(0,0,0,.45);
  --bs-body-color: var(--ink); --bs-body-bg: var(--bg); --bs-border-color: var(--line);
  --bs-emphasis-color: var(--ink); --bs-secondary-color: var(--muted);
  --bs-link-color: #8396f2; --bs-link-hover-color: #a3b1f5;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
.mono, .mono-label { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.mono-label { font-size: 12px; letter-spacing: .06em; color: var(--muted-2); }
.text-ok { color: var(--ok) !important; } .text-bad { color: var(--bad) !important; } .text-warn { color: var(--warn) !important; }
.text-muted-x { color: var(--muted) !important; } .text-faint { color: var(--muted-2) !important; }
.tnum { font-variant-numeric: tabular-nums; }
.pretty { text-wrap: pretty; }

/* Buttons */
.btn { --bs-btn-font-weight: 600; --bs-btn-font-size: 14px; --bs-btn-padding-x: 15px; --bs-btn-border-radius: 8px; height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn-sm { height: 32px; --bs-btn-font-size: 13px; --bs-btn-padding-x: 12px; --bs-btn-border-radius: 7px; }
.btn-lg-x { height: 44px; font-size: 15px; }
.btn-primary { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: var(--accent-hover); --bs-btn-hover-border-color: var(--accent-hover); --bs-btn-active-bg: var(--accent-hover); --bs-btn-active-border-color: var(--accent-hover); --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent); --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-disabled-opacity: .45; }
[data-bs-theme=dark] .btn-primary { --bs-btn-bg: #4a63e0; --bs-btn-border-color: #4a63e0; --bs-btn-hover-bg: #5b72e6; --bs-btn-hover-border-color: #5b72e6; --bs-btn-disabled-bg: #4a63e0; --bs-btn-disabled-border-color: #4a63e0; }
.btn-default { --bs-btn-bg: var(--surface); --bs-btn-color: var(--ink); --bs-btn-border-color: var(--input-line); --bs-btn-hover-bg: var(--hover); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--input-line); --bs-btn-active-bg: var(--hover-2); --bs-btn-active-color: var(--ink); --bs-btn-disabled-opacity: .45; --bs-btn-disabled-color: var(--ink); --bs-btn-disabled-bg: var(--surface); --bs-btn-disabled-border-color: var(--input-line); }
.btn-dark-x { --bs-btn-bg: var(--ink); --bs-btn-color: var(--surface); --bs-btn-border-color: var(--ink); --bs-btn-hover-bg: var(--ink-2); --bs-btn-hover-color: var(--surface); --bs-btn-hover-border-color: var(--ink-2); }
.btn-danger { --bs-btn-bg: #c8402f; --bs-btn-border-color: #c8402f; --bs-btn-hover-bg: #ad3527; --bs-btn-hover-border-color: #ad3527; }
.btn-danger-ghost { --bs-btn-bg: var(--surface); --bs-btn-color: var(--bad); --bs-btn-border-color: var(--input-line); --bs-btn-hover-bg: var(--bad-soft); --bs-btn-hover-color: var(--bad); --bs-btn-hover-border-color: var(--bad-line); }
.btn-ghost { --bs-btn-bg: transparent; --bs-btn-color: var(--muted); --bs-btn-border-color: transparent; --bs-btn-hover-bg: var(--hover-2); --bs-btn-hover-color: var(--ink); }
.btn-link-x { border: 0; background: none; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent); cursor: pointer; }
.btn-link-x:hover { color: var(--accent-hover); }
.icon-btn { width: 36px; height: 36px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; transition: background .12s; }
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.sm { width: 32px; height: 32px; font-size: 14px; border-radius: 7px; }
.icon-btn.flat { border-color: transparent; background: transparent; color: var(--muted); }
.icon-btn.flat:hover:not(:disabled) { background: var(--hover-2); }
.icon-btn.danger { color: var(--bad); }
.icon-btn.danger:hover:not(:disabled) { background: var(--bad-soft); color: var(--bad); }
.link-strong { font-weight: 600; font-size: 13.5px; }
.link-muted { color: var(--muted); font-weight: 600; font-size: 13.5px; display: inline-flex; gap: 6px; align-items: center; }
.link-muted:hover { color: var(--ink); text-decoration: none; }

/* Forms */
.form-label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form-control, .form-select { height: 38px; border-color: var(--input-line); border-radius: 7px; font-size: 14px; background-color: var(--surface); color: var(--ink); }
textarea.form-control { height: auto; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); background-color: var(--surface); color: var(--ink); }
.form-control[readonly] { background: var(--bg); color: var(--muted); border-color: var(--line); }
.form-control.is-invalid, .form-select.is-invalid { border-color: #d9796b; background-image: none; padding-right: .75rem; }
.invalid-feedback { font-size: 12.5px; color: var(--bad); }
.form-text { font-size: 12.5px; color: var(--muted-2); margin-top: 5px; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--accent-ring); border-color: var(--accent); }
.form-check-label { font-size: 13.5px; color: var(--ink-2); }
.form-switch .form-check-input { width: 2.4em; height: 1.35em; cursor: pointer; }
.input-wrap { position: relative; }
.input-icon-btn { position: absolute; right: 4px; top: 2px; width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); border-radius: 6px; font-size: 16px; }
.input-icon-btn:hover { background: var(--hover); }
.input-search { position: relative; } .input-search i { position: absolute; left: 12px; top: 10px; color: var(--muted-2); font-size: 14px; } .input-search .form-control { padding-left: 34px; }
.code-area { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.6; }

/* Layout shell */
.app { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; width: 252px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 50; transition: width .18s ease, transform .18s ease; }
.sidebar-brand, .brand { height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line-2); }
.brand { border: 0; padding: 0; height: auto; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: #2f4fd8; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.nav-group { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.nav-group-title { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); padding: 0 10px 8px; }
.nav-group-sep { display: none; height: 1px; background: var(--line-2); margin: 0 6px 10px; }
.nav-item { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; width: 100%; }
.nav-item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item > i { font-size: 16px; width: 18px; text-align: center; }
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-live { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); padding: 1px 6px; border-radius: 4px; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line-2); }
.sidebar-foot .nav-item { color: var(--muted); }
body.sidebar-collapsed .sidebar { width: 68px; }
body.sidebar-collapsed .sidebar .brand-name, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .nav-group-title, body.sidebar-collapsed .nav-live { display: none !important; }
body.sidebar-collapsed .nav-group-sep { display: block; }
body.sidebar-collapsed .sidebar-brand, body.sidebar-collapsed .nav-item { justify-content: center; }
.sidebar-backdrop { display: none; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-title { min-width: 0; flex: 1; }
#page-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#page-subtitle { font-size: 12.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.send-pill { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--accent-line); border-radius: 16px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap; }
.send-pill:hover { text-decoration: none; color: var(--accent-hover); }
.send-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.notif-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #c8402f; border: 1.5px solid var(--surface); }
.profile-btn { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 4px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted-2); font-size: 11px; }
.profile-btn:hover { background: var(--hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; }
.profile-text { text-align: left; line-height: 1.2; }
#profile-name { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
#profile-role { display: block; font-size: 12px; color: var(--muted-2); }
.dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--line); --bs-dropdown-border-radius: 10px; --bs-dropdown-link-color: var(--ink); --bs-dropdown-link-hover-bg: var(--hover); --bs-dropdown-link-active-bg: var(--hover-2); --bs-dropdown-link-active-color: var(--ink); --bs-dropdown-font-size: 13.5px; box-shadow: var(--shadow-pop); }
.dropdown-item { display: flex; align-items: center; gap: 10px; height: 36px; border-radius: 6px; }
.profile-menu { width: 240px; padding: 6px; }
.profile-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
#menu-name { font-size: 14px; font-weight: 600; } #menu-email { font-size: 12.5px; color: var(--muted-2); margin-top: 2px; word-break: break-all; }
.notif-menu { width: 360px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-3); }
.notif-item.unread { background: var(--surface-2); }
.notif-item:last-child { border-bottom: 0; }
.page-main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 28px 32px 56px; }

@media (max-width: 899.98px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: 260px !important; box-shadow: var(--shadow-pop); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(17,18,22,.4); z-index: 40; }
  body.sidebar-collapsed .sidebar .brand-name, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .nav-group-title { display: block !important; }
  body.sidebar-collapsed .nav-group-sep { display: none; }
  body.sidebar-collapsed .nav-item { justify-content: flex-start; }
  .page-main { padding: 20px 16px 48px; }
  .topbar { padding: 0 12px; gap: 8px; }
}

/* Surfaces */
.card-x { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px; }
.card-head.bordered { border-bottom: 1px solid var(--line-2); }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 10px 10px; }
.h-page { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.h-section { margin: 0; font-size: 15px; font-weight: 600; }
.sub { font-size: 13px; color: var(--muted-2); margin-top: 3px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 14px; }
.grid-21 { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 20px; align-items: start; }
.grid-compose { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(380px,1fr); gap: 20px; align-items: start; }
.grid-settings { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 24px; align-items: start; }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 1179.98px) { .grid-21, .grid-compose { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 899.98px) { .grid-settings { grid-template-columns: minmax(0,1fr); } }
.sticky-preview { position: sticky; top: 84px; }
@media (max-width: 1179.98px) { .sticky-preview { position: static; } }

/* Stat strip */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.stat { padding: 16px 18px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); margin: 0 -1px -1px 0; }
.stat-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-label .sw { width: 7px; height: 7px; border-radius: 2px; }
.stat-value { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; margin-top: 4px; color: var(--muted-2); }
.count-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; font: inherit; cursor: pointer; color: inherit; width: 100%; }
.count-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.count-card .stat-value { font-size: 26px; margin-top: 6px; }
.count-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.mini-grid > div { padding: 12px 14px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); margin: 0 -1px -1px 0; }
.mini-grid .k { font-size: 12px; color: var(--muted-2); } .mini-grid .v { font-size: 19px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Segmented */
.seg { display: inline-flex; padding: 3px; background: var(--hover); border-radius: 8px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20,20,30,.08); }

/* Tables */
.table-scroll { overflow: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; padding: 10px 16px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-3); vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl .r { text-align: right; } .tbl .nowrap { white-space: nowrap; }
.tbl.compact td { padding-top: 9px; padding-bottom: 9px; font-size: 13.5px; }
.tbl tr.clickable { cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface-2); }
.cell-title { font-weight: 600; } .cell-sub { font-size: 12.5px; color: var(--muted-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.row-num { color: var(--muted-2); font-family: 'JetBrains Mono', monospace; font-size: 12px; text-align: right; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px 10px 20px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }

/* Status badges */
.status { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-ok { background: var(--ok-soft); color: var(--ok); } .status-bad { background: var(--bad-soft); color: var(--bad); }
.status-warn { background: var(--warn-soft); color: var(--warn); } .status-info { background: var(--accent-soft); color: var(--accent); }
.status-muted { background: var(--hover); color: var(--muted); }
.tag { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--hover); padding: 2px 7px; border-radius: 4px; white-space: nowrap; }

/* Alerts & states */
.alert-x { display: flex; gap: 10px; padding: 11px 14px; border-radius: 8px; font-size: 13.5px; line-height: 1.45; border: 1px solid; align-items: flex-start; }
.alert-x > i { margin-top: 1px; }
.alert-x-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.alert-x-bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.alert-x-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.alert-x-info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.alert-x .grow { flex: 1; }
.note-dashed { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); padding: 9px 12px; border: 1px dashed var(--input-line); border-radius: 8px; background: var(--surface-2); }
.state-block { padding: 64px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.state-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--hover); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.state-icon.accent { background: var(--accent-soft); color: var(--accent); } .state-icon.bad { background: var(--bad-soft); color: var(--bad); }
.state-title { font-size: 16px; font-weight: 600; margin-top: 4px; }
.state-text { font-size: 14px; color: var(--muted); max-width: 460px; line-height: 1.5; }
.empty-inline { padding: 40px; text-align: center; color: var(--muted-2); font-size: 14px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent-line); border-top-color: var(--accent); display: inline-block; animation: bs-spin .8s linear infinite; flex-shrink: 0; }
.spin-light { width: 16px; height: 16px; border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes bs-spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--hover) 0%, var(--line-3) 50%, var(--hover) 100%); background-size: 200% 100%; animation: bs-shimmer 1.2s ease-in-out infinite; border-radius: 6px; }
@keyframes bs-shimmer { to { background-position: -200% 0; } }

/* Upload */
.dropzone { border: 1.5px dashed var(--input-line); background: var(--surface-2); border-radius: 12px; padding: 64px 24px; text-align: center; cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone.drag, .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; }
.file-icon { width: 40px; height: 40px; border-radius: 9px; background: var(--ok-soft); color: var(--ok); display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.cell-email-invalid { color: var(--bad); font-weight: 500; } .cell-email-duplicate { color: var(--warn); font-weight: 500; } .cell-email { font-weight: 500; }
.col-email { color: var(--accent) !important; }

/* Compose */
.var-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--accent-line); border-radius: 6px; background: var(--accent-soft); cursor: pointer; font: inherit; }
.var-chip:hover { border-color: var(--accent); }
.var-chip code { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--accent); font-weight: 500; }
.var-chip small { font-size: 11.5px; color: var(--muted-2); }
.attach-chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 4px 0 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: var(--surface-2); }
.preview-meta { padding: 14px 20px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.preview-meta > div { display: flex; gap: 8px; min-width: 0; } .preview-meta .k { width: 56px; color: var(--muted-2); flex-shrink: 0; }
.preview-meta .v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-stage { background: #f3f3f0; padding: 16px; display: flex; justify-content: center; }
[data-bs-theme=dark] .preview-stage { background: #0d0e10; }
.preview-frame { width: 100%; height: 580px; border: 0; display: block; background: #f3f3f0; transition: width .18s; }
.preview-frame.mobile { width: 375px; max-width: 100%; border: 8px solid #17181c; border-radius: 28px; }
.save-status { font-size: 13px; color: var(--muted-2); display: inline-flex; align-items: center; gap: 6px; }
.tox-tinymce { border: 0 !important; border-radius: 0 !important; }
.tpl-thumb { height: 190px; overflow: hidden; background: #f3f3f0; border-bottom: 1px solid var(--line-2); position: relative; cursor: pointer; border-radius: 10px 10px 0 0; }
.tpl-thumb iframe { width: 640px; height: 760px; border: 0; transform: scale(.45); transform-origin: top left; pointer-events: none; position: absolute; left: 0; top: 0; }

/* Live */
.big-pct { font-size: 44px; font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.bar-stack { display: flex; height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.bar-stack > div { transition: width .3s; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.smtp-msg { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted-2); }
.smtp-msg.bad { color: var(--bad); }

/* Settings */
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav button { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.settings-nav button:hover { background: var(--hover); }
.settings-nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
@media (max-width: 899.98px) { .settings-nav { flex-direction: row; overflow-x: auto; } .settings-nav button { flex-shrink: 0; } }
.settings-panel { max-width: 760px; padding: 24px; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-3); }
.list-row:last-child { border-bottom: 0; }
.list-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--hover); display: flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.logo-box { width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; font-weight: 700; font-size: 18px; color: var(--muted); }
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.meter { flex: 1; height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; } .meter > div { height: 100%; transition: width .2s; }
.type-card { display: flex; gap: 12px; text-align: left; padding: 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; font: inherit; cursor: pointer; color: inherit; width: 100%; }
.type-card.active { border-color: var(--accent); background: var(--accent-soft); }
.type-card > i { font-size: 17px; color: var(--muted); margin-top: 1px; } .type-card.active > i { color: var(--accent); }
.check-row { display: flex; align-items: center; gap: 9px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: 13.5px; font-weight: 500; }
.kv { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 10px 16px; font-size: 14px; }
.kv > span:nth-child(odd) { color: var(--muted-2); } .kv > span { overflow-wrap: anywhere; }

/* Modals & toasts */
.modal { --bs-modal-bg: var(--surface); --bs-modal-border-color: transparent; --bs-modal-border-radius: 12px; --bs-modal-header-border-color: var(--line-2); --bs-modal-footer-border-color: var(--line-2); --bs-modal-header-padding: 18px 24px; --bs-modal-padding: 20px 24px; }
.modal-content { box-shadow: 0 24px 60px rgba(0,0,0,.2); }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-footer { gap: 8px; padding: 16px 24px; } .modal-footer > * { margin: 0; }
.modal-backdrop { --bs-backdrop-bg: #111216; --bs-backdrop-opacity: .45; }
.toast-stack { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; max-width: calc(100vw - 40px); }
.toast-x { display: flex; align-items: center; gap: 10px; background: #17181c; color: #fff; padding: 12px 16px; border-radius: 9px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 440px; animation: bs-toast-in .18s ease-out; transition: opacity .25s, transform .25s; }
.toast-x.out { opacity: 0; transform: translateY(6px); }
.toast-ok i { color: #5fd39b; } .toast-err i { color: #f08a7a; } .toast-info i { color: #9fb0f5; }
@keyframes bs-toast-in { from { opacity: 0; transform: translateY(6px); } }
[data-bs-theme=dark] .toast-x { background: #2a2c33; }

/* Auth screens */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.auth-main { display: flex; flex-direction: column; padding: 36px 44px; min-height: 100vh; }
.auth-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.auth-box { width: 100%; max-width: 400px; }
.auth-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.auth-sub { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.auth-foot { font-size: 12.5px; color: var(--muted-2); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.auth-aside { background: #15171c; color: #f3f3f0; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside-title { font-size: 40px; line-height: 1.12; font-weight: 600; letter-spacing: -.025em; max-width: 480px; text-wrap: balance; }
.auth-steps { margin-top: 36px; max-width: 440px; border-top: 1px solid #2c2f37; }
.auth-steps > div { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid #2c2f37; font-size: 14.5px; color: #c9cad0; }
.auth-steps span { font-family: 'JetBrains Mono', monospace; color: #7d8fe8; }
.auth-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #8a8c94; }
.dot-ok { width: 7px; height: 7px; border-radius: 50%; background: #3fb27f; }
@media (max-width: 899.98px) { .auth-split { grid-template-columns: 1fr; } .auth-aside { display: none; } .auth-main { padding: 24px 20px; } }
.min-w-0 { min-width: 0; }
