:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --border: #e2e6ef;
  --text: #1a1d26;
  --text-muted: #6b7280;
  --primary: #534ab7;
  --primary-dark: #3c3489;
  --primary-light: #eeedfe;
  --success: #0f6e56;
  --success-bg: #e1f5ee;
  --warning: #854f0b;
  --warning-bg: #faeeda;
  --danger: #a32d2d;
  --danger-bg: #fcebeb;
  --sidebar-w: 240px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ─── Login ─────────────────────────────────────────────────────────────── */

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-brand {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-icon {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.brand-icon.sm { width: 36px; height: 36px; font-size: 1rem; border-radius: 8px; margin-bottom: 0; }

.login-brand h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.login-brand > p { opacity: 0.85; margin-bottom: 2rem; }

.brand-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.brand-features li::before { content: "✓ "; opacity: 0.8; }

.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}

.login-form-wrap .card {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}
.login-form-wrap h2 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.input-group { margin-bottom: 1rem; }
.input-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.input-group input, select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--surface);
  transition: border-color .2s;
}
.input-group input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.login-help { color: var(--text-muted); font-size: 0.82rem; margin-top: 1.25rem; text-align: center; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */

button { cursor: pointer; font-family: inherit; border: none; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background .2s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
}
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn-text {
  background: none;
  color: var(--primary);
  font-size: 0.85rem;
  padding: 0;
}
.btn-text:hover { text-decoration: underline; }
.btn-text.danger { color: var(--danger, #c0392b); }
.muted { color: var(--text-muted, #888); font-size: 0.85rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }
.actions-cell { white-space: nowrap; }
.portal-link-hint { margin-top: 0.5rem; }
.portal-link-hint a { color: var(--primary); word-break: break-all; }

/* ─── App shell ─────────────────────────────────────────────────────────── */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  transition: transform .3s;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 1rem;
  font-weight: 600;
  color: var(--primary-dark);
  border-bottom: 1px solid var(--border);
}

.sidebar-nav { flex: 1; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: right;
  transition: all .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 500; }
.nav-item.logout { color: var(--danger); }
.nav-item.logout:hover { background: var(--danger-bg); }

.sidebar-footer { padding: 0.75rem; border-top: 1px solid var(--border); }

.main-wrap {
  flex: 1;
  margin-right: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.menu-toggle {
  display: none;
  background: none;
  font-size: 1.3rem;
  padding: 0.25rem;
}

.topbar-title h1 { font-size: 1.15rem; }
.topbar-title span { font-size: 0.82rem; color: var(--text-muted); }

.topbar-wallet {
  margin-right: auto;
  background: var(--primary-light);
  padding: 0.45rem 1rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.wallet-label { font-size: 0.78rem; color: var(--primary-dark); }
.wallet-amount { font-weight: 600; color: var(--primary-dark); }

.embed-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.main-content { padding: 1.5rem; flex: 1; }

/* ─── Cards & stats ─────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.card-header h3 { font-size: 1rem; font-weight: 600; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow);
}
.stat-card.wallet-card { background: linear-gradient(135deg, var(--warning-bg), #fff); border-color: #e8c99a; }

.stat-icon { font-size: 1.5rem; line-height: 1; }
.stat-label { display: block; font-size: 0.8rem; color: var(--text-muted); }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; margin-top: 0.15rem; }
.stat-value.lg { font-size: 2rem; }
.stat-unit { font-size: 0.78rem; color: var(--text-muted); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ─── Channel chart ─────────────────────────────────────────────────────── */

.channel-chart { display: flex; flex-direction: column; gap: 0.75rem; }
.channel-bar-row { display: flex; align-items: center; gap: 0.75rem; }
.channel-bar-label { width: 70px; font-size: 0.82rem; color: var(--text-muted); text-transform: capitalize; }
.channel-bar-track { flex: 1; height: 24px; background: var(--bg); border-radius: 6px; overflow: hidden; display: flex; }
.channel-bar-fill { height: 100%; background: var(--primary); border-radius: 6px; transition: width .5s; min-width: 2px; }
.channel-bar-fill.failed { background: #d4a5a5; }
.channel-bar-count { font-size: 0.8rem; color: var(--text-muted); width: 50px; text-align: left; }

/* ─── Transaction list ───────────────────────────────────────────────────── */

.tx-list { display: flex; flex-direction: column; }
.tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.tx-item:last-child { border-bottom: none; }
.tx-item-left { display: flex; flex-direction: column; }
.tx-type { font-size: 0.85rem; font-weight: 500; }
.tx-date { font-size: 0.78rem; color: var(--text-muted); }
.tx-amount { font-weight: 600; font-size: 0.95rem; }
.tx-amount.credit { color: var(--success); }
.tx-amount.debit { color: var(--warning); }

/* ─── Wallet page ────────────────────────────────────────────────────────── */

.wallet-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--primary-light), var(--surface));
  flex-wrap: wrap;
  gap: 1rem;
}
.hero-balance { font-size: 2.5rem; font-weight: 700; color: var(--primary-dark); }
.recharge-box { text-align: left; }
.recharge-box p { font-size: 0.9rem; color: var(--text-muted); }
.recharge-hint { font-size: 0.78rem; color: var(--text-muted); opacity: 0.7; }

.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.filter-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Tables ────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 0.7rem 0.85rem; text-align: right; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 500; font-size: 0.8rem; background: var(--bg); }
tr:hover td { background: #fafbfe; }

.badge-status {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
}
.badge-sent { background: var(--success-bg); color: var(--success); }
.badge-failed { background: var(--danger-bg); color: var(--danger); }

.channel-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--bg);
  border-radius: 4px;
  font-size: 0.8rem;
  text-transform: capitalize;
}

.type-credit { color: var(--success); font-weight: 500; }
.type-debit { color: var(--warning); font-weight: 500; }
.type-refund { color: var(--primary); font-weight: 500; }
.tx-amount.refund { color: var(--primary); }

.page-desc { color: var(--text-muted); font-size: 0.88rem; margin: -0.5rem 0 1rem; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.quick-action-btn:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.qa-icon { font-size: 1.4rem; }

.preview-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.pagination-info { font-size: 0.82rem; color: var(--text-muted); }

.api-detail { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.api-detail div { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.api-label { color: var(--text-muted); }
.api-detail code { background: var(--surface); padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.78rem; }

.password-change {
  text-align: right;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.password-change h4 { font-size: 0.95rem; margin-bottom: 1rem; }

.form-msg {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
}
.form-msg.success { background: var(--success-bg); color: var(--success); }
.form-msg.error { background: var(--danger-bg); color: var(--danger); }

.filters input[type="search"] {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  min-width: 160px;
}

/* ─── Invoices ──────────────────────────────────────────────────────────── */

.invoice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.invoice-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: box-shadow .2s;
}
.invoice-card:hover { box-shadow: var(--shadow); }
.invoice-month { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--primary-dark); }
.invoice-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.3rem 0; }
.invoice-row span:first-child { color: var(--text-muted); }
.invoice-total { font-weight: 700; color: var(--warning); font-size: 1rem; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }

/* ─── Profile ───────────────────────────────────────────────────────────── */

.profile-card { max-width: 560px; margin: 0 auto; text-align: center; padding: 2rem; }
.profile-avatar {
  width: 72px;
  height: 72px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}
.profile-card h2 { margin-bottom: 0.25rem; }
.profile-badge {
  display: inline-block;
  background: var(--success-bg);
  color: var(--success);
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  margin-bottom: 1.5rem;
}
.profile-details { text-align: right; margin-bottom: 1.5rem; }
.profile-row {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.profile-label { color: var(--text-muted); font-size: 0.88rem; }
.mono { font-family: monospace; font-size: 0.75rem; word-break: break-all; }
.api-info {
  text-align: right;
  background: var(--bg);
  padding: 1rem;
  border-radius: 8px;
}
.api-info h4 { font-size: 0.9rem; margin-bottom: 0.35rem; }
.api-info p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }

/* ─── Alerts & toast ────────────────────────────────────────────────────── */

.alert {
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  z-index: 200;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

.empty-state { text-align: center; color: var(--text-muted); padding: 2rem; font-size: 0.9rem; }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page { display: none; }
.page.active { display: block; }

/* ─── Compose / Send ──────────────────────────────────────────────────────── */

.grid-compose {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) { .grid-compose { grid-template-columns: 1fr; } }

textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.char-count { font-size: 0.78rem; color: var(--text-muted); display: block; text-align: left; margin-top: 0.25rem; }
.cost-hint { font-size: 0.85rem; color: var(--warning); font-weight: 500; }

.compose-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.template-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text);
}
.template-chip:hover { border-color: var(--primary); color: var(--primary); }

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  padding: 0.35rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
}
.rich-btn {
  min-width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
}
.rich-btn:hover { border-color: var(--primary); color: var(--primary); }
.rich-btn.active { background: var(--primary-light); border-color: var(--primary); }

.rich-editor {
  min-height: 120px;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: var(--surface);
  font-size: 0.95rem;
  line-height: 1.6;
  outline: none;
}
.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}
.rich-preview {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.95rem;
  line-height: 1.6;
}
.rich-preview b, .rich-preview strong { font-weight: 700; }
.rich-hint { display: block; margin-top: 0.25rem; font-size: 0.78rem; }

.compose-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.compose-tab {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
}
.compose-tab.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}
.compose-send-type {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.compose-send-type label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.compose-group-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}
.compose-contact-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.compose-contact-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.compose-contact-item:last-child { border-bottom: none; }
.compose-contact-item:hover { background: var(--surface); }
.compose-contact-item .contact-meta { flex: 1; min-width: 0; }
.compose-contact-item .contact-phone { font-size: 0.82rem; color: var(--text-muted); }
.result-recipients { margin-top: 0.75rem; max-height: 200px; overflow-y: auto; }

.channel-fields { display: flex; flex-direction: column; gap: 0.65rem; }
.channel-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  transition: border-color .15s, background .15s;
}
.channel-row.active { border-color: var(--primary); background: var(--primary-light); }
.channel-row label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.9rem; white-space: nowrap; }
.channel-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.channel-row input[type="text"] {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  background: var(--surface);
}
.channel-row input[type="text"]:disabled { opacity: 0.4; background: #f5f5f5; }
.channel-price { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }

.result-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}
.result-badge.success { background: var(--success-bg); color: var(--success); }
.result-badge.partial { background: var(--warning-bg); color: var(--warning); }
.result-badge.failed { background: var(--danger-bg); color: var(--danger); }

.result-summary {
  background: var(--bg);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.8;
}
.result-channels { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.result-ch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
}
.result-ch-item.ok { border-color: #a8d5b5; background: var(--success-bg); }
.result-ch-item.simulated { border-color: #c9c4a0; background: var(--warning-bg); }
.result-ch-item.fail { border-color: #e8b4b4; background: var(--danger-bg); }

/* ─── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { padding: 2rem; min-height: auto; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-right: 0; }
  .menu-toggle { display: block; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}

@media print {
  .sidebar, .topbar, .menu-toggle, .alert, .filters, #print-invoices { display: none !important; }
  .main-wrap { margin: 0; }
  .page { display: none !important; }
  #page-invoices { display: block !important; }
}
