:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --text: #16221d;
  --muted: #68756f;
  --line: #dde5e1;
  --line-strong: #cbd7d1;
  --green: #0f8f5a;
  --green-dark: #087347;
  --green-soft: #e7f7ef;
  --teal: #0c7f7b;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #c33b3b;
  --purple: #7652c8;
  --shadow: 0 12px 30px rgba(21, 50, 38, .07);
  --shadow-soft: 0 5px 18px rgba(21, 50, 38, .05);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: 260px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: currentColor; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: var(--sidebar); background: #102c22; color: #dce9e3; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; box-shadow: 8px 0 30px rgba(7, 32, 23, .1); }
.brand { height: 82px; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(145deg, #28d487, #0f8f5a); color: white; box-shadow: 0 8px 20px rgba(15,143,90,.3); flex: 0 0 auto; }
.brand-mark span { font-weight: 900; font-size: 20px; letter-spacing: -.05em; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy strong { color: #fff; font-size: 18px; line-height: 1.1; }
.brand-copy small { color: #8fb5a5; font-size: 11px; margin-top: 3px; white-space: nowrap; }
.sidebar-nav { padding: 18px 12px; display: flex; flex-direction: column; gap: 5px; overflow-y: auto; }
.nav-link { border: 0; width: 100%; color: #a9c2b8; display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 11px; transition: .18s ease; background: transparent; text-align: left; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-link.is-active { background: rgba(39, 211, 133, .14); color: #5be1a0; box-shadow: inset 3px 0 0 #31d78a; }
.nav-link svg { width: 19px; height: 19px; }
.nav-button { font: inherit; }
.logout-symbol { width: 20px; text-align: center; font-size: 18px; transform: rotate(180deg); }
.sidebar-bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding: 14px 12px 18px; }
.account-mini { display: flex; gap: 10px; align-items: center; padding: 8px 10px 14px; }
.account-mini .avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(49,215,138,.16); color: #5be1a0; display: grid; place-items: center; font-weight: 800; }
.account-mini div:last-child { min-width: 0; display: flex; flex-direction: column; }
.account-mini strong { color: #fff; font-size: 13px; }
.account-mini small { color: #83a697; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 155px; }
.main-panel { margin-left: var(--sidebar); width: calc(100% - var(--sidebar)); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 82px; background: rgba(255,255,255,.93); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 30px; position: sticky; top: 0; z-index: 25; }
.topbar h1 { font-size: 22px; margin: 1px 0 0; letter-spacing: -.02em; }
.eyebrow { color: var(--green); text-transform: uppercase; letter-spacing: .11em; font-weight: 800; font-size: 10px; margin: 0; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #24b56f; box-shadow: 0 0 0 5px rgba(36,181,111,.12); }
.menu-button { display: none; margin-right: 14px; }
.icon-button { border: 1px solid var(--line); background: var(--surface); width: 40px; height: 40px; border-radius: 11px; color: var(--text); }
.content-wrap { padding: 28px 30px 40px; flex: 1; max-width: 1500px; width: 100%; margin: 0 auto; }
.app-footer { border-top: 1px solid var(--line); color: var(--muted); display: flex; justify-content: space-between; gap: 20px; padding: 18px 30px; font-size: 11px; }
.sidebar-overlay { display: none; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.page-actions .spacer { flex: 1; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 15px; border-radius: 10px; border: 1px solid transparent; font-weight: 750; font-size: 13px; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--green); box-shadow: 0 8px 18px rgba(15,143,90,.2); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: var(--text); background: var(--surface); border-color: var(--line); }
.button-secondary:hover { border-color: var(--line-strong); background: var(--surface-2); }
.button-danger { color: #fff; background: var(--red); }
.button-warning { color: #5f3b08; background: #fff4d7; border-color: #f3d899; }
.button-ghost { color: var(--green); background: transparent; }
.button-small { min-height: 32px; padding: 6px 10px; font-size: 11px; border-radius: 8px; }
.button-block { width: 100%; }
.button[disabled], .button.is-disabled { opacity: .5; pointer-events: none; transform: none; }
.alert { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; border-radius: 12px; border: 1px solid; padding: 13px 15px; margin-bottom: 18px; box-shadow: var(--shadow-soft); }
.alert button { border: 0; background: transparent; font-size: 20px; line-height: 1; color: inherit; opacity: .7; }
.alert-success { background: #ebf9f1; color: #12663f; border-color: #bfe7d0; }
.alert-danger { background: #fff0f0; color: #9d2c2c; border-color: #f1c2c2; }
.alert-warning { background: #fff8e8; color: #835510; border-color: #eed9a8; }
.alert-info { background: #edf6ff; color: #245f98; border-color: #c4ddf5; }
.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)); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-soft); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 74px; height: 74px; border-radius: 50%; right: -20px; top: -25px; opacity: .18; background: currentColor; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-value { font-size: 30px; font-weight: 850; letter-spacing: -.04em; margin: 8px 0 4px; color: var(--text); }
.stat-hint { color: var(--muted); font-size: 11px; }
.tone-green { color: var(--green); }
.tone-blue { color: var(--blue); }
.tone-purple { color: var(--purple); }
.tone-amber { color: var(--amber); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); overflow: hidden; }
.card + .card { margin-top: 18px; }
.card-header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.card-header h2, .card-header h3 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.card-header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.card-header .header-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }
.card-muted { background: var(--surface-2); }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-title h2 { margin: 0; font-size: 18px; }
.section-title p { margin: 4px 0 0; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: #f7faf8; color: #66756e; text-transform: uppercase; letter-spacing: .06em; font-size: 9px; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid #edf1ef; vertical-align: middle; }
tbody tr:hover { background: #fbfdfc; }
tbody tr:last-child td { border-bottom: 0; }
.table-title { font-weight: 750; color: var(--text); }
.table-subtitle { color: var(--muted); font-size: 11px; margin-top: 2px; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge-success { background: #e5f8ed; color: #147246; }
.badge-info { background: #e9f2ff; color: #2b62a4; }
.badge-warning { background: #fff3d8; color: #85550a; }
.badge-danger { background: #ffe9e9; color: #a43434; }
.badge-neutral { background: #edf1ef; color: #56645e; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.form-stack { display: flex; flex-direction: column; gap: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-label { color: #3f4d47; font-size: 11px; font-weight: 800; }
.field small { color: var(--muted); font-size: 10px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="datetime-local"], input[type="file"], select, textarea { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); border-radius: 10px; padding: 9px 11px; outline: none; transition: .15s ease; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,143,90,.1); }
input[readonly] { background: #f2f5f3; color: #64716b; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; color: #46544e; font-size: 12px; }
.checkbox input { margin-top: 3px; accent-color: var(--green); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.input-group { display: flex; gap: 8px; }
.input-group > *:first-child { flex: 1; }
.help-box { border: 1px solid #dbe7e1; background: #f5faf7; border-radius: 12px; padding: 14px 15px; color: #4c5e55; font-size: 12px; }
.help-box strong { color: var(--text); }
.code-box { border: 1px solid #d8e0dc; background: #101b17; color: #dff8eb; border-radius: 11px; padding: 13px 14px; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; word-break: break-all; }
.copy-row { display: flex; align-items: stretch; gap: 8px; }
.copy-row .code-box { flex: 1; }
.progress-wrap { margin: 12px 0; }
.progress-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.progress-track { height: 8px; background: #e7eeea; border-radius: 999px; overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--green),#31d78a); }
.health-list { display: flex; flex-direction: column; gap: 10px; }
.health-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; }
.health-dot { width: 10px; height: 10px; border-radius: 50%; background: #b9c3be; flex: 0 0 auto; }
.health-dot.good { background: #22ad69; box-shadow: 0 0 0 4px rgba(34,173,105,.1); }
.health-dot.warn { background: #d79a32; box-shadow: 0 0 0 4px rgba(215,154,50,.1); }
.health-copy { display: flex; flex-direction: column; }
.health-copy strong { font-size: 12px; }
.health-copy small { color: var(--muted); font-size: 10px; }
.empty-state { text-align: center; padding: 48px 20px; }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 16px; background: var(--green-soft); color: var(--green); font-size: 25px; }
.empty-state h3 { margin: 0 0 6px; }
.empty-state p { margin: 0 auto 18px; color: var(--muted); max-width: 460px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .field { min-width: 170px; flex: 1; }
.filter-bar .field.search-field { flex: 2; min-width: 240px; }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding: 14px 18px; border-top: 1px solid var(--line); }
.pagination a, .pagination span { min-width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.pagination .current { background: var(--green); border-color: var(--green); color: #fff; }
.template-preview { white-space: pre-wrap; border: 1px solid #dfe8e3; background: #f8fbf9; border-radius: 12px; padding: 15px; color: #31443a; line-height: 1.6; }
.mapping-row { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(180px, 1fr) minmax(220px, 1.4fr); gap: 12px; align-items: end; border-bottom: 1px dashed var(--line); padding: 12px 0; }
.mapping-row:last-child { border-bottom: 0; }
.mapping-label { font-weight: 750; font-size: 12px; padding-bottom: 11px; }
.status-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 10px; }
.status-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.status-box span { color: var(--muted); display: block; font-size: 10px; }
.status-box strong { font-size: 21px; }
.campaign-hero { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; }
.campaign-title h2 { margin: 0 0 5px; font-size: 22px; }
.campaign-title p { margin: 0; color: var(--muted); }
.campaign-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.split-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(310px,.65fr); gap: 18px; align-items: start; }
.info-list { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; margin: 0; }
.info-list dt { color: var(--muted); font-size: 11px; }
.info-list dd { margin: 0; font-weight: 650; word-break: break-word; }
.import-result { margin-top: 16px; }
.error-list { max-height: 180px; overflow: auto; margin: 10px 0 0; padding-left: 20px; color: #9c3838; font-size: 11px; }
.inbox-message { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: start; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.inbox-message:last-child { border-bottom: 0; }
.inbox-message.is-unread { background: #f5fbf8; }
.message-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-weight: 850; }
.message-copy strong { display: block; }
.message-copy p { margin: 4px 0 0; color: #42524a; }
.message-meta { color: var(--muted); font-size: 10px; text-align: right; white-space: nowrap; }
.callout { border-left: 4px solid var(--green); border-radius: 10px; background: #f0faf5; padding: 13px 15px; color: #355247; }
.callout.warning { border-left-color: #d3972e; background: #fff8e9; }
.callout.danger { border-left-color: var(--red); background: #fff1f1; }
.kpi-inline { display: flex; align-items: baseline; gap: 8px; }
.kpi-inline strong { font-size: 25px; }
.kpi-inline span { color: var(--muted); }
.login-body { min-height: 100vh; background: #eef4f1; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.2fr) minmax(420px,.8fr); }
.login-visual { background: radial-gradient(circle at 20% 20%, rgba(49,215,138,.18), transparent 36%), linear-gradient(145deg,#0b3426,#10271f); color: #fff; padding: 48px 60px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-visual::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); right: -120px; bottom: -140px; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018); }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; z-index: 1; }
.login-hero-copy { max-width: 680px; margin: auto 0; z-index: 1; }
.login-hero-copy h1 { font-size: clamp(34px,4.3vw,62px); letter-spacing: -.045em; line-height: 1.04; margin: 20px 0; }
.login-hero-copy p { color: #a9c7ba; font-size: 16px; max-width: 600px; }
.pill { display: inline-flex; border-radius: 999px; padding: 7px 11px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pill-light { background: rgba(255,255,255,.09); color: #7bf0b6; border: 1px solid rgba(255,255,255,.1); }
.visual-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; z-index: 1; }
.visual-stats div { padding: 16px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); border-radius: 14px; backdrop-filter: blur(6px); }
.visual-stats strong { display: block; font-size: 24px; }
.visual-stats span { color: #90b4a5; font-size: 10px; }
.login-panel { display: grid; place-items: center; padding: 30px; background: #f8faf9; }
.login-card { width: min(420px,100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 34px; }
.login-card h2 { font-size: 28px; margin: 6px 0; letter-spacing: -.03em; }
.login-note { color: var(--muted); font-size: 10px; margin: 18px 0 0; text-align: center; }
.mobile-login-brand { display: none; align-items: center; gap: 10px; margin-bottom: 24px; }
.installer-body { min-height: 100vh; background: radial-gradient(circle at top left, #e7f7ef, transparent 35%), #f4f7f5; padding: 36px 20px; }
.installer-shell { max-width: 1000px; margin: 0 auto; }
.installer-header { display: flex; align-items: center; gap: 15px; margin-bottom: 24px; }
.installer-header h1 { margin: 0; font-size: 26px; }
.installer-header p { margin: 3px 0 0; color: var(--muted); }
.requirements { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 18px; }
.requirement { background: #fff; border: 1px solid var(--line); padding: 12px; border-radius: 11px; display: flex; align-items: center; gap: 8px; }
.requirement .check { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--green-soft); color: var(--green); }
.requirement.bad .check { background: #ffeaea; color: var(--red); }
@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .status-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .split-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar: 270px; }
  .sidebar { transform: translateX(-100%); transition: .22s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(5,20,14,.45); z-index: 35; }
  .sidebar-overlay.is-open { display: block; }
  .main-panel { margin-left: 0; width: 100%; }
  .menu-button { display: inline-grid; place-items: center; }
  .topbar { padding: 0 18px; }
  .content-wrap { padding: 22px 18px 32px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .mobile-login-brand { display: flex; }
  .login-panel { min-height: 100vh; }
  .requirements { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 680px) {
  .topbar-label { display: none; }
  .topbar h1 { font-size: 19px; }
  .stats-grid, .grid-2, .grid-3, .grid-4, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mapping-row { grid-template-columns: 1fr; gap: 8px; }
  .mapping-label { padding-bottom: 0; }
  .campaign-hero { flex-direction: column; }
  .app-footer { flex-direction: column; padding: 18px; }
  .content-wrap { padding-left: 13px; padding-right: 13px; }
  .card-header { align-items: flex-start; flex-direction: column; }
  .card-header .header-actions { margin-left: 0; }
  .info-list { grid-template-columns: 1fr; gap: 2px; }
  .info-list dd { margin-bottom: 9px; }
  .filter-bar .field, .filter-bar .field.search-field { min-width: 100%; }
  .requirements { grid-template-columns: 1fr; }
  .installer-body { padding: 20px 10px; }
  .login-panel { padding: 14px; }
  .login-card { padding: 25px 20px; }
}
