@font-face {
  font-family: 'Cairo';
  src: url('/assets/fonts/cairo-arabic.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Cairo';
  src: url('/assets/fonts/cairo-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --sidebar: #0d1a2b;
  --sidebar-2: #13253a;
  --gold: #d8ad52;
  --gold-light: #f7e7bd;
  --primary: #176b87;
  --primary-dark: #11536a;
  --primary-soft: #e8f3f7;
  --text: #172536;
  --muted: #6f7f93;
  --border: #e2e9f2;
  --border-strong: #cfdae7;
  --success: #137a59;
  --success-bg: #e6f6ef;
  --danger: #b83b36;
  --danger-bg: #fdebea;
  --warning: #a86b16;
  --warning-bg: #fdf2dd;
  --info: #2563a8;
  --info-bg: #e9f1fb;
  --violet: #6547d8;
  --violet-bg: #f0edff;
  --shadow: 0 10px 35px rgba(18, 40, 66, .06);
  --shadow-sm: 0 4px 14px rgba(18, 40, 66, .05);
  --radius: 16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; color: var(--text); }
h1 { font-size: 23px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 800; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.num { direction: ltr; unicode-bidi: embed; display: inline-block; white-space: nowrap; }

/* ---------- Shell ---------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset-block: 0;
  right: 0;
  width: 270px;
  padding: 20px 15px;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 40;
  border-left: 1px solid rgba(255, 255, 255, .06);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 9px 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #13253a;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 8px 22px rgba(216, 173, 82, .22);
}
.found-logo { max-height: 42px; max-width: 160px; object-fit: contain; }
.brand-copy { min-width: 0; }
.found-wordmark {
  display: block;
  color: var(--gold-light);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.1;
}
.brand-sub { display: block; color: #9fb0c5; font-size: 11px; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; padding: 1px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  color: #b9c7d8;
  font-size: 13.5px;
  font-weight: 600;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-link:hover { background: rgba(255, 255, 255, .065); color: #fff; transform: translateX(-2px); }
.nav-link.active {
  background: linear-gradient(90deg, rgba(216, 173, 82, .19), rgba(216, 173, 82, .045));
  color: var(--gold-light);
  box-shadow: inset 3px 0 0 var(--gold);
}
.nav-icon { width: 19px; height: 19px; flex: 0 0 19px; opacity: .9; }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .055);
}
.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #13253a;
  font-weight: 800;
  font-size: 16px;
}
.user-meta { min-width: 0; }
.user-meta strong { display: block; color: #fff; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { display: block; color: #9fb0c5; font-size: 11px; }
.logout-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 9px;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .13);
  color: #d7e2ee;
  font-size: 12.5px;
  font-weight: 600;
}
.logout-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.main { margin-right: 270px; min-height: 100vh; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 30px;
  background: rgba(243, 246, 251, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.eyebrow { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 1.8px; color: var(--muted); text-transform: uppercase; }
.topbar h1 { margin-top: 2px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.role-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.content { width: 100%; max-width: 1520px; min-width: 0; margin: 0 auto; padding: 25px 30px 55px; }

/* ---------- Panels / metrics ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 21px;
  margin-bottom: 19px;
  min-width: 0;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-title { font-size: 17px; font-weight: 800; margin: 0; }
.panel-sub { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 6px 0 14px; }
.section-head h2 { font-size: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-bottom: 19px; min-width: 0; }
.grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-height: 105px;
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.metric::after { content: ''; position: absolute; inset-block: 0; right: 0; width: 3px; background: var(--primary); opacity: .75; }
.metric.gold::after { background: var(--gold); }
.metric.green::after { background: var(--success); }
.metric.violet::after { background: var(--violet); }
.metric.red::after { background: var(--danger); }
.metric.amber::after { background: var(--warning); }
.metric-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.metric.gold .metric-icon { background: #fcf4df; color: #a6781f; }
.metric.green .metric-icon { background: var(--success-bg); color: var(--success); }
.metric.violet .metric-icon { background: var(--violet-bg); color: var(--violet); }
.metric.red .metric-icon { background: var(--danger-bg); color: var(--danger); }
.metric.amber .metric-icon { background: var(--warning-bg); color: var(--warning); }
.metric-body { min-width: 0; flex: 1; }
.metric-label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-value { display: block; margin-top: 2px; font-size: 26px; line-height: 1.25; font-weight: 800; color: var(--text); overflow-wrap: anywhere; }
.metric-note { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 19px; }
.stat {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.stat-icon { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat.success .stat-icon { background: var(--success-bg); color: var(--success); }
.stat.danger .stat-icon { background: var(--danger-bg); color: var(--danger); }
.stat.warning .stat-icon { background: var(--warning-bg); color: var(--warning); }
.stat-value { display: block; font-size: 21px; font-weight: 800; line-height: 1.2; }
.stat-label { display: block; color: var(--muted); font-size: 11.5px; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
table { width: 100%; min-width: 900px; border-collapse: collapse; }
th, td { padding: 12px 13px; text-align: right; vertical-align: middle; border-bottom: 1px solid var(--border); font-size: 12.8px; }
th { background: var(--surface-soft); color: var(--muted); font-size: 10.8px; font-weight: 800; letter-spacing: .35px; text-transform: uppercase; white-space: nowrap; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f7fbfd; }
tbody tr:last-child td { border-bottom: 0; }
.table-link { color: var(--text); font-weight: 800; }
.table-link:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.empty-state {
  padding: 38px 18px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--muted);
}
.empty-state strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 15px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.5;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-amber { background: var(--warning-bg); color: var(--warning); }
.badge-blue { background: var(--info-bg); color: var(--info); }
.badge-violet { background: var(--violet-bg); color: var(--violet); }
.badge-slate { background: #edf1f6; color: #5a6b7e; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

/* ---------- Toolbar / buttons ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 17px; }
.toolbar h2 { margin: 0; }
.actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 15px; }
.inline-form { display: inline; }
.pref-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 15px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-soft); }
.pref-row > div { flex: 1 1 260px; }
.pref-row strong { display: block; font-size: 13px; color: var(--text); }
.pref-row form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; flex: 1 1 320px; justify-content: flex-end; }
.pref-row .field { min-width: 210px; }
.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, background .16s ease;
}
.btn:hover, button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn:active, button:active { transform: translateY(0); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.alt { background: #eef3f8; color: var(--text); border-color: var(--border); }
.btn.alt:hover { background: #e7eef6; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.success { background: var(--success); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { min-height: 32px; padding: 6px 11px; font-size: 11.5px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-button { background: none; border: 0; color: var(--primary); font-weight: 800; padding: 0; min-height: 0; }
.link-button:hover { text-decoration: underline; filter: none; transform: none; }

/* ---------- Forms ---------- */
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 14px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--muted); font-size: 11.5px; font-weight: 800; }
.field input, .field select, .field textarea, input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=tel], input[type=email], select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(23, 107, 135, .11);
}
input[type=checkbox] { width: auto; min-height: auto; accent-color: var(--primary); }
.check-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.helper { color: var(--muted); font-size: 11.5px; margin-top: 7px; }

/* ---------- Alerts ---------- */
.success, .alert, .notice { padding: 12px 15px; border-radius: 12px; margin-bottom: 16px; font-size: 12.8px; font-weight: 600; border: 1px solid transparent; }
.success { background: var(--success-bg); color: var(--success); border-color: #bde6d5; }
.alert { background: var(--danger-bg); color: var(--danger); border-color: #f5c9c6; }
.notice { background: var(--warning-bg); color: var(--warning); border-color: #f0d9a9; }

/* ---------- Login ---------- */
.guest {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(216, 173, 82, .17), transparent 32%),
    radial-gradient(circle at 85% 90%, rgba(23, 107, 135, .17), transparent 35%),
    var(--bg);
}
.login-card {
  width: min(440px, 100%);
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(13, 26, 43, .16);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand .found-wordmark { color: var(--sidebar); }
.login-brand .brand-sub { color: var(--muted); }
.login-card h2 { font-size: 24px; }
.login-card > p { margin: 5px 0 20px; color: var(--muted); font-size: 13px; }
.login-card .field { margin-bottom: 13px; }
.login-card .actions { margin-top: 19px; }
.login-card .btn, .login-card button { width: 100%; min-height: 44px; font-size: 14px; }

/* ---------- Lead choice / tabs ---------- */
.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 17px;
  border-radius: 12px;
  background: #e9eff6;
}
.seg-btn {
  min-height: 34px;
  padding: 7px 18px;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 9px;
  box-shadow: none;
  font-size: 12.5px;
}
.seg-btn:hover { background: rgba(255, 255, 255, .5); color: var(--text); filter: none; transform: none; }
.seg-btn.active { background: #fff; color: var(--text); box-shadow: 0 3px 10px rgba(18, 40, 66, .09); }
.accounts-tabs { flex-wrap: wrap; }
.segmented a.seg-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 13px; }
.choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--text);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.choice-card:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); color: var(--text); }
.choice-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 12px; background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.choice-copy strong { display: block; font-size: 13px; }
.choice-copy small { display: block; color: var(--muted); font-size: 11px; }

/* ---------- Accounts review ---------- */
.review-list { display: grid; gap: 13px; }
.review-card {
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.review-title { font-size: 15px; font-weight: 800; }
.review-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 5px; color: var(--muted); font-size: 11.5px; }
.review-amount { font-size: 23px; font-weight: 800; color: var(--text); white-space: nowrap; }
.review-amount small { display: block; text-align: left; color: var(--muted); font-size: 10.5px; font-weight: 600; }
.review-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 14px; }
.review-panel { margin-top: 13px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.review-panel.approve { border-color: #bfe5d5; background: #f4fbf8; }
.review-panel.reject { border-color: #f0c6c3; background: #fff8f7; }
.hidden { display: none !important; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; margin: 0; }
.kv div { min-width: 0; }
.kv dt { color: var(--muted); font-size: 10.5px; font-weight: 800; }
.kv dd { margin: 2px 0 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- Misc ---------- */
.whatsapp-qr { width: 280px; max-width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.bar { height: 6px; border-radius: 999px; background: #e8eef6; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #35a0b5); }
.list-clean { margin: 0; padding: 0; list-style: none; }
.stack { display: grid; gap: 10px; }
.divider { height: 1px; background: var(--border); margin: 17px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .sidebar { width: 245px; }
  .main { margin-right: 245px; }
  .content { padding: 22px; }
  .topbar { padding: 15px 22px; }
}
@media (max-width: 920px) {
  .sidebar {
    position: sticky;
    inset: auto;
    top: 0;
    right: auto;
    width: 100%;
    height: auto;
    padding: 12px 15px;
    flex-direction: row;
    align-items: center;
    gap: 13px;
    overflow: hidden;
  }
  .brand { flex: 0 0 auto; padding: 0; margin: 0; border: 0; }
  .brand-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; font-size: 15px; }
  .brand-sub, .brand-copy .found-wordmark { display: none; }
  .nav { flex-direction: row; flex: 1; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .nav-link { white-space: nowrap; padding: 8px 10px; font-size: 11.5px; }
  .nav-icon { display: none; }
  .sidebar-footer { display: none; }
  .main { margin-right: 0; }
  .topbar { padding: 14px 18px; }
  .content { padding: 18px; }
  .topbar-user .role-chip { display: none; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .grid.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 7px; }
  .topbar h1 { font-size: 20px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 11px; }
  .grid.grid-3 { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 95px; padding: 14px; gap: 10px; }
  .metric-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
  .metric-value { font-size: 22px; }
  .metric-note { display: none; }
  .panel { padding: 16px; }
  .formgrid { grid-template-columns: 1fr; }
  .review-amount { font-size: 20px; }
  .review-head { gap: 8px; }
  .segmented { width: 100%; }
  .seg-btn { flex: 1; padding-inline: 10px; }
  th, td { padding: 10px; }
}
@media print {
  .sidebar, .topbar, .actions, .btn, button, .segmented { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .panel { box-shadow: none; border-color: #ddd; break-inside: avoid; }
}

/* ---------- WhatsApp multi-session ---------- */

.wa-connect-body { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.wa-row-error { margin-top: 5px; font-size: 10.5px; line-height: 1.5; max-width: 230px; }
.wa-qr-box { flex: 0 0 auto; }
.wa-qr { width: 220px; height: 220px; border-radius: 14px; border: 1px solid var(--border); background: #fff; padding: 8px; box-shadow: var(--shadow-sm); }
.wa-connect-actions { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 10px; }
.wa-status-line { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.wa-filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.wa-new-chat { padding: 12px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface-soft); }
.wa-new-chat .field { max-width: 240px; }
.wa-filters .field { min-width: 190px; flex: 1; }
.wa-layout { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); gap: 16px; min-height: 540px; min-width: 0; }
.wa-chats { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 14px; overflow-y: auto; max-height: 660px; padding: 6px; }
.wa-chat-item { display: block; padding: 10px 12px; border-radius: 11px; color: var(--text); border: 1px solid transparent; }
.wa-chat-item:hover { background: #fff; border-color: var(--border); color: var(--text); }
.wa-chat-item.active { background: #fff; border-color: var(--primary); box-shadow: var(--shadow-sm); }
.wa-chat-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.wa-chat-time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.wa-chat-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 2px; }
.wa-chat-preview { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-unread { background: var(--success); color: #fff; border-radius: 999px; font-size: 10px; padding: 1px 7px; font-weight: 800; }
.wa-chat-owner { font-size: 10px; color: var(--primary); margin-top: 3px; }
.wa-chat-empty { padding: 24px 14px; text-align: center; color: var(--muted); font-size: 12px; }
.wa-pane { min-width: 0; border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; background: #fff; }
.wa-conv { display: flex; flex-direction: column; height: 100%; min-height: 520px; }
.wa-conv-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--surface-soft); flex-wrap: wrap; }
.wa-conv-sub { font-size: 11px; margin-top: 2px; }
.wa-conv-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wa-lead-link { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.wa-lead-link select { max-width: 210px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.wa-lead-link .btn { margin: 0; }
.lead-file-number { display: inline-block; direction: ltr; font-weight: 800; color: var(--primary); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px; }
.lead-accordion { margin: 18px 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.lead-accordion > summary { cursor: pointer; list-style: none; padding: 18px 22px; font-size: 1.08rem; font-weight: 800; color: var(--text); background: var(--surface-soft); }
.lead-accordion > summary::-webkit-details-marker { display: none; }
.lead-accordion > summary::before { content: '＋'; display: inline-block; margin-left: 10px; color: var(--primary); font-weight: 900; }
.lead-accordion[open] > summary::before { content: '−'; }
.lead-accordion[open] > summary { border-bottom: 1px solid var(--border); }
.lead-accordion-panel { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.lead-accordion-panel > .panel-head { display: none; }
.lead-accordion-panel > .panel-head + * { margin-top: 0; }
.wa-messages { flex: 1; overflow-y: auto; padding: 18px 16px; background: linear-gradient(180deg, #f7fafc, #eef4f8); display: flex; flex-direction: column; gap: 8px; max-height: 520px; min-height: 330px; }
.wa-msg { display: flex; justify-content: flex-start; }
.wa-msg.out { justify-content: flex-end; }
.wa-bubble { max-width: 78%; background: #fff; border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 9px 12px; box-shadow: var(--shadow-sm); font-size: 12.8px; }
.wa-msg.out .wa-bubble { background: #dcf3e8; border-color: #bfe6d4; border-radius: 14px 14px 4px 14px; }
.wa-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.wa-meta { display: flex; gap: 8px; justify-content: flex-end; color: var(--muted); font-size: 9.5px; margin-top: 4px; }
.wa-state { color: var(--warning); }
.wa-type { color: var(--primary); }
.wa-composer { display: flex; gap: 10px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--border); background: #fff; }
.wa-composer textarea { flex: 1; resize: vertical; min-height: 44px; max-height: 140px; }
.wa-empty-chat { padding: 18px; }
@media (max-width: 980px) {
  .wa-layout { grid-template-columns: 1fr; }
  .wa-chats { max-height: 320px; }
}
@media (max-width: 620px) {
  .wa-qr { width: 170px; height: 170px; }
  .wa-filters .field { min-width: 100%; }
}
