/* ============ Investor Lead System — blue & white theme ============ */

:root {
  --bg: #eef3fb;
  --bg-alt: #e4ecf9;
  --panel: #ffffff;
  --panel-alt: #eaf1fb;
  --border: #d3e0f5;
  --text: #1e293b;
  --text-muted: #52627a;
  --text-dim: #8493ab;
  --text-strong: #0b1830;
  --accent-blue: #2563eb;
  --accent-green: #16a34a;
  --accent-purple: #7c3aed;
  --accent-red: #dc2626;
  --accent-amber: #d97706;
  --accent-teal: #0d9488;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }

/* ---------- shell / sidebar ---------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
}

.brand {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .5px;
  color: #fff;
  padding: 4px 6px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand::before {
  content: '';
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  display: inline-block;
}

.profile {
  text-align: center;
  padding: 14px 6px 20px;
  border-bottom: 1px solid rgba(255,255,255,.15);
  margin-bottom: 14px;
}

.profile .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  margin: 0 auto 8px;
}

.profile div { font-size: 13px; font-weight: 600; color: #fff; }
.profile div + div { color: rgba(255,255,255,.65); font-size: 11px; font-weight: 700; letter-spacing: .5px; margin-top: 2px; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  font-weight: 600;
}

.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }

.sidebar nav a.active {
  background: rgba(255,255,255,.16);
  color: #fff;
  border-left: 3px solid #fff;
  padding-left: 9px;
}

.sidebar nav a[href="/logout"] { margin-top: auto; color: #fca5a5; }

/* ---------- main content ---------- */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  padding: 14px 26px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-strong);
}

.topbar-title { display: flex; align-items: center; gap: 16px; min-width: 0; }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.topbar-icon-wrap { position: relative; }

.topbar-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}
.topbar-icon:hover { border-color: var(--accent-blue); }

.topbar-wallet-amount { font-size: 12px; color: var(--text-muted); }

.topbar-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.topbar-popover {
  display: none;
  position: absolute;
  top: 46px;
  right: 0;
  width: 320px;
  max-height: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(15,23,42,.14);
  z-index: 50;
  overflow: hidden;
  flex-direction: column;
}
.topbar-popover.open { display: flex; }

.topbar-popover-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-strong);
}

.link-btn { background: none; border: none; color: var(--accent-blue); font-size: 11px; cursor: pointer; padding: 0; font-weight: 700; }

.topbar-popover-body { overflow-y: auto; }
.topbar-empty { padding: 20px 14px; text-align: center; color: var(--text-dim); font-size: 12px; }

.notif-row-form { display: block; }
.notif-row {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}
.notif-row:hover { background: #f1f5f9; color: var(--text); }
.notif-row:active { background: var(--accent-blue); color: #fff; }
.notif-row:active .notif-text { color: #fff; }
.notif-row:active .notif-time { color: rgba(255,255,255,.75); }
.notif-row .notif-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: transparent; }
.notif-row.unread .notif-dot { background: var(--accent-blue); }
.notif-row.unread .notif-text { color: var(--text-strong); font-weight: 700; }
.notif-text { flex: 1; font-size: 12px; line-height: 1.4; }
.notif-time { font-size: 10px; color: var(--text-dim); flex-shrink: 0; white-space: nowrap; }

/* ---------- flag / star action icons (inbox) ---------- */

.flag-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--panel-alt); cursor: pointer; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.flag-btn.on.star { background: rgba(217,119,6,.16); border-color: var(--accent-amber); }
.flag-btn.on.green { background: rgba(22,163,74,.16); border-color: var(--accent-green); }
.flag-btn.on.red { background: rgba(220,38,38,.16); border-color: var(--accent-red); }

/* ---------- emoji popover (ticket / inbox reply boxes) ---------- */

.emoji-popover {
  display: none;
  position: absolute;
  bottom: 44px;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  width: 220px;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 30;
  box-shadow: 0 12px 30px rgba(15,23,42,.16);
}
.emoji-popover.open { display: flex; }
.emoji-popover button {
  background: none; border: none; font-size: 18px; cursor: pointer; padding: 4px; border-radius: 4px;
}
.emoji-popover button:hover { background: var(--panel-alt); }

/* ---------- JS popup modal (conversation popup, manage tags, etc.) ---------- */

.popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.35);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.popup-overlay.open { display: flex; }

.popup-card {
  background: var(--panel);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(15,23,42,.25);
}
.popup-card.wide { max-width: 640px; }

.popup-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.popup-close { background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; line-height: 1; }

.popup-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.popup-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.popup-footer input[type="text"] { flex: 1; }

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  margin-left: 3px;
  vertical-align: top;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
  font-size: 12px;
  margin: 3px 4px 3px 0;
}
.tag-chip button { background: none; border: none; color: var(--accent-red); cursor: pointer; font-size: 13px; padding: 0 4px; }

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 34px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}
.drop-zone.dragover { border-color: var(--accent-blue); background: rgba(37,99,235,.06); color: var(--text-strong); }
.drop-zone input[type="file"] { display: none; }
.drop-zone .filename { color: var(--text-strong); font-weight: 700; margin-top: 8px; }

.content { padding: 22px 26px 40px; }

.page-header { margin-bottom: 20px; }
.page-header h1 { margin: 0 0 4px; font-size: 22px; color: var(--text-strong); }
.page-header .subtitle { color: var(--text-dim); font-size: 13px; }

/* ---------- cards / stat cards ---------- */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

.card .icon { font-size: 22px; margin-bottom: 8px; }
.card .title { font-weight: 700; font-size: 14px; color: var(--text-strong); }
.card .footer { color: var(--text-dim); font-size: 12px; margin-top: 4px; }

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.stat-icon.green { background: rgba(22,163,74,.12); color: var(--accent-green); }
.stat-icon.blue { background: rgba(37,99,235,.12); color: var(--accent-blue); }
.stat-icon.purple { background: rgba(124,58,237,.12); color: var(--accent-purple); }
.stat-icon.amber { background: rgba(217,119,6,.12); color: var(--accent-amber); }
.stat-icon.red { background: rgba(220,38,38,.12); color: var(--accent-red); }

.stat-card .stat-label { font-size: 12px; color: var(--text-dim); }
.stat-card .stat-value { font-size: 20px; font-weight: 800; color: var(--text-strong); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-body { padding: 18px; }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.three-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

@media (max-width: 900px) {
  .two-col, .three-col { grid-template-columns: 1fr; }
}

/* ---------- simple CSS bar chart ---------- */

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  height: 200px;
  padding: 10px 4px 0;
}

.bar-chart .bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.bar-chart .bar-value { font-size: 12px; font-weight: 700; color: var(--text-strong); margin-bottom: 6px; }

.bar-chart .bar {
  width: 60%;
  border-radius: 6px 6px 0 0;
  min-height: 4px;
}

.bar-chart .bar-label { font-size: 11px; color: var(--text-dim); margin-top: 8px; text-align: center; }

.bar.green { background: linear-gradient(180deg, #4ade80, var(--accent-green)); }
.bar.blue { background: linear-gradient(180deg, #60a5fa, var(--accent-blue)); }
.bar.purple { background: linear-gradient(180deg, #a78bfa, var(--accent-purple)); }
.bar.amber { background: linear-gradient(180deg, #fbbf24, var(--accent-amber)); }
.bar.gray { background: linear-gradient(180deg, #94a3b8, #64748b); }

.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }

/* ---------- simple CSS donut chart ---------- */

.donut {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto;
}

.donut-legend { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; font-size: 12px; }
.donut-legend .row { display: flex; align-items: center; justify-content: space-between; }

/* ---------- line+bar combo (leads over time) ---------- */

.combo-chart { position: relative; height: 200px; padding-top: 10px; }
.combo-chart svg { width: 100%; height: 100%; overflow: visible; }

/* ---------- forms ---------- */

.form-box, .panel form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.form-box label, label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 12px 0 5px;
}

.form-box label:first-of-type { margin-top: 0; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="file"], input[type="search"],
select, textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

textarea { resize: vertical; }

input:disabled { opacity: .55; }

input::placeholder, textarea::placeholder { color: var(--text-dim); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.form-actions { padding: 16px 0 0; }

.hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.or-divider { text-align: center; color: var(--text-dim); font-size: 11px; margin: 14px 0; text-transform: uppercase; letter-spacing: 1px; }

.error-banner {
  background: rgba(220,38,38,.08);
  border: 1px solid rgba(220,38,38,.35);
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ---------- buttons ---------- */

.btn, button, input[type="submit"],
.btn-teal, .btn-purple, .btn-green, .btn-red, .btn-danger, .btn-outline {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  display: inline-block;
  line-height: 1.3;
  text-align: center;
  box-sizing: border-box;
}

.btn, button[type="submit"] { background: var(--accent-blue); color: #fff; }
.btn:hover, button[type="submit"]:hover { filter: brightness(1.08); }

.btn-teal { background: var(--accent-teal); color: #fff; }
.btn-purple { background: var(--accent-purple); color: #fff; }
.btn-green { background: var(--accent-green); color: #fff; }
.btn-red, .btn-danger { background: var(--accent-red); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ---------- tables ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

thead { background: var(--panel-alt); }

th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-alt); }

.campaign-name-link, a.campaign-name-link { color: var(--accent-blue); text-decoration: none; font-weight: 600; }

/* ---------- badges ---------- */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
}

.badge.Pending, .badge.pending, .badge.New, .badge.new { background: rgba(37,99,235,.12); color: #1d4ed8; }
.badge.Processing, .badge.processing { background: rgba(124,58,237,.12); color: #6d28d9; }
.badge.Completed, .badge.completed, .badge.Resolved, .badge.resolved, .badge.Complete, .badge.Active, .badge.active { background: rgba(22,163,74,.12); color: #15803d; }
.badge.Failed, .badge.failed, .badge.Closed, .badge.closed, .badge.Deleted, .badge.deleted, .badge.Inactive, .badge.inactive { background: rgba(220,38,38,.12); color: #b91c1c; }
.badge.Open, .badge.open { background: rgba(217,119,6,.12); color: #b45309; }

.priority-badge { display:inline-block; padding:3px 9px; border-radius:6px; font-size: 11px; font-weight: 700; }
.priority-badge.Critical { background: rgba(220,38,38,.14); color: #b91c1c; }
.priority-badge.High { background: rgba(217,119,6,.14); color: #b45309; }
.priority-badge.Medium { background: rgba(124,58,237,.14); color: #6d28d9; }
.priority-badge.Low { background: rgba(100,116,139,.14); color: #475569; }

/* ---------- action icons ---------- */

.action-icons { display: flex; gap: 6px; align-items: center; }
.action-icons form { display: inline-flex; margin: 0; }

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
}

.icon-btn.edit { background: var(--accent-blue); }
.icon-btn.delete { background: var(--accent-red); }
.icon-btn.info { background: var(--accent-teal); }
.icon-btn.reschedule { background: var(--accent-amber); }

/* ---------- misc components carried over ---------- */

.campaign-panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.campaign-panel-header { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 700; color: var(--text-strong); }
.campaign-panel-body { padding: 18px; }

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.table-toolbar h3 { color: var(--text-strong); }

.search-box { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.search-box input { width: 220px; }

.filters-bar { display: flex; align-items: center; gap: 14px; margin: 14px 0; flex-wrap: wrap; font-size: 13px; color: var(--text-dim); }
.filters-bar select { width: auto; }

.filter-tabs { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.filter-tabs a {
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--panel-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.filter-tabs a.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }

.pagination-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 12px; color: var(--text-dim); }
.pagination-bar .pages { display: flex; gap: 6px; }
.pagination-bar .pages a, .pagination-bar .pages span {
  padding: 5px 10px;
  border-radius: 5px;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.pagination-bar .pages .current { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }

.msg-type-toggle { display: flex; gap: 10px; margin-bottom: 10px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.disabled-note { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.entries-select { width: auto; display: inline-block; }
.colon { margin: 0 4px; }
.switch-link { color: var(--accent-blue); text-decoration: none; font-size: 13px; }

/* ---------- avatars ---------- */

.avatar-mini {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; margin-right: 8px; vertical-align: middle;
}

.avatar-photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }

/* ---------- login / register ---------- */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #dbe7fb 0%, var(--bg) 60%);
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 34px;
  width: 360px;
  box-shadow: 0 12px 32px rgba(15,23,42,.08);
}

.auth-card h2 { color: var(--text-strong); margin-top: 0; }

/* ---------- split-screen login / register ---------- */

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.split-auth {
  min-height: 100vh;
  display: flex;
}

.split-auth-brand {
  flex: 1.1;
  background: linear-gradient(160deg, #1e3a8a 0%, #1e40af 45%, #3b82f6 100%);
  color: #fff;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.split-auth-brand::before {
  content: '';
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  top: -160px;
  right: -160px;
}
.split-auth-brand::after {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.10);
  bottom: -120px;
  left: -100px;
}

.split-auth-brand-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.split-auth-brand-top .wordmark { font-weight: 800; font-size: 15px; letter-spacing: .5px; }

.split-auth-brand-mid { position: relative; z-index: 1; max-width: 440px; }
.split-auth-brand-mid h1 { font-size: 34px; line-height: 1.25; margin: 0 0 16px; font-weight: 800; }
.split-auth-brand-mid p { font-size: 14px; color: rgba(255,255,255,.82); line-height: 1.6; }

.split-auth-brand-bottom { position: relative; z-index: 1; display: flex; gap: 28px; }
.split-auth-brand-bottom div { font-size: 12px; color: rgba(255,255,255,.75); }
.split-auth-brand-bottom strong { display: block; font-size: 20px; color: #fff; }

.split-auth-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg);
}

.split-auth-form-inner { width: 100%; max-width: 380px; }

.split-auth-lock {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin: 0 auto 14px;
}

.split-auth-form-inner h2 {
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 30px;
  color: var(--text-strong);
  margin: 0 0 4px;
}
.split-auth-form-inner .subtitle { text-align: center; color: var(--text-dim); font-size: 13px; margin-bottom: 24px; }

.split-auth-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 20px; font-size: 12px; }
.split-auth-row label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; color: var(--text-muted); }
.split-auth-row a { color: var(--accent-blue); text-decoration: none; }

.split-auth-form-inner .switch-link { text-align: center; margin-top: 18px; font-size: 13px; }

@media (max-width: 860px) {
  .split-auth-brand { display: none; }
}

/* ---------- SMS Inbox (chat view) ---------- */

.inbox-shell {
  display: flex;
  height: calc(100vh - 52px);
  background: var(--panel);
  border-top: 1px solid var(--border);
}

.inbox-panel-title {
  padding: 14px 18px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-strong);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.inbox-chats { width: 300px; flex-shrink: 0; border-right: 1px solid var(--border); overflow-y: auto; }
.inbox-chat-list { display: flex; flex-direction: column; }

.inbox-chat-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  text-decoration: none; color: inherit; border-bottom: 1px solid var(--border);
}
.inbox-chat-item:hover { background: var(--panel-alt); }
.inbox-chat-item.active { background: rgba(37,99,235,.10); }

.inbox-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  color: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700;
}

.inbox-avatar-lg {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 26px; margin: 0 auto;
}

.inbox-chat-meta { flex: 1; min-width: 0; }
.inbox-chat-name { font-weight: 700; font-size: 13px; color: var(--text-strong); }
.inbox-chat-preview { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-chat-time { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }

.inbox-conversation { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.inbox-conv-header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.inbox-conv-header div div:first-child { color: var(--text-strong); }

.inbox-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.inbox-bubble-row { display: flex; }
.inbox-bubble-row.out { justify-content: flex-end; }
.inbox-bubble-row.in { justify-content: flex-start; }
.inbox-bubble { max-width: 60%; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.inbox-bubble.out { background: var(--accent-blue); color: #fff; }
.inbox-bubble.in { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
.inbox-bubble-time { font-size: 10px; opacity: .7; margin-top: 4px; }

.inbox-reply-bar { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }
.inbox-reply-bar input { flex: 1; }

.inbox-details { width: 300px; flex-shrink: 0; border-left: 1px solid var(--border); overflow-y: auto; }
.inbox-tab { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent-purple); border-bottom: 2px solid var(--accent-purple); padding-bottom: 4px; }

.toggle-switch {
  width: 40px; height: 22px; border-radius: 11px; background: #cbd5e1; border: none; position: relative; cursor: pointer; flex-shrink: 0;
}
.toggle-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: left .15s ease;
}
.toggle-switch.on { background: var(--accent-red); }
.toggle-switch.on::after { left: 20px; }

/* ---------- modal-style edit page ---------- */

.modal-overlay {
  min-height: calc(100vh - 52px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  background: rgba(15,23,42,.25);
}

.modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 20px 60px rgba(15,23,42,.18);
}

.modal-card .modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--text-strong);
  font-size: 15px;
}

.modal-card .modal-body { padding: 20px 22px; }

/* ---------- rich-text-ish toolbar (static, for the ticket reply editor) ---------- */

.editor-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: var(--panel);
  color: var(--text-dim);
  font-size: 13px;
}
.editor-toolbar span { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 4px; }
.editor-toolbar span:hover { background: var(--panel); color: var(--text-strong); }

.editor-toolbar + textarea { border-radius: 0 0 6px 6px; }

/* ---------- homepage ---------- */

.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px; border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.landing-nav .brand-row { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; letter-spacing: .4px; color: var(--text-strong); }
.landing-nav .links { display: flex; gap: 24px; align-items: center; }
.landing-nav a.nav-link { text-decoration: none; color: var(--text-muted); font-size: 14px; font-weight: 600; }
.landing-nav a.cta { background: var(--accent-blue); color: #fff; padding: 9px 18px; border-radius: 6px; text-decoration: none; font-weight: 700; font-size: 13px; }

/* ---------- hero slider ---------- */

.hero-slider {
  position: relative;
  min-height: 480px;
  overflow: hidden;
}

.hero-slide {
  display: none;
  min-height: 480px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 90px 20px 70px;
  color: #fff;
}
.hero-slide.active { display: flex; }

.hero-slide.slide-1 { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.hero-slide.slide-2 { background: linear-gradient(135deg, #4c1d95, #8b5cf6); }
.hero-slide.slide-3 { background: linear-gradient(135deg, #0f766e, #14b8a6); }

.hero-slide .eyebrow {
  display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.15);
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .4px; margin-bottom: 18px;
}
.hero-slide h1 { font-size: 42px; margin: 0 0 18px; line-height: 1.2; max-width: 700px; }
.hero-slide p { font-size: 16px; color: rgba(255,255,255,.85); max-width: 600px; margin: 0 auto 30px; }
.hero-slide .hero-ctas { display: flex; gap: 14px; justify-content: center; }
.hero-slide .hero-ctas a.secondary { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35); color: #fff; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 700; }
.hero-slide .hero-ctas a.primary { background: #fff; color: var(--accent-blue); padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 700; }

.hero-dots { position: absolute; bottom: 22px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.4); border: none; cursor: pointer; padding: 0; }
.hero-dot.active { background: #fff; }

.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none; color: #fff; width: 38px; height: 38px;
  border-radius: 50%; cursor: pointer; font-size: 16px; z-index: 2;
}
.hero-arrow:hover { background: rgba(255,255,255,.28); }
.hero-arrow.prev { left: 20px; }
.hero-arrow.next { right: 20px; }

.hero {
  text-align: center;
  padding: 90px 20px 70px;
  background: radial-gradient(circle at 50% -10%, rgba(37,99,235,.10), transparent 55%);
}
.hero .eyebrow {
  display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(124,58,237,.12);
  color: #6d28d9; font-size: 12px; font-weight: 700; letter-spacing: .4px; margin-bottom: 18px;
}
.hero h1 { font-size: 44px; color: var(--text-strong); margin: 0 0 18px; line-height: 1.15; }
.hero h1 span { background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 16px; color: var(--text-muted); max-width: 620px; margin: 0 auto 30px; }
.hero .hero-ctas { display: flex; gap: 14px; justify-content: center; }
.hero .hero-ctas a.secondary { background: var(--panel); border: 1px solid var(--border); color: var(--text-strong); padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 700; }
.hero .hero-ctas a.primary { background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple)); color: #fff; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 700; }

.landing-section { padding: 60px 40px; max-width: 1100px; margin: 0 auto; }
.landing-section h2 { color: var(--text-strong); text-align: center; font-size: 28px; margin-bottom: 10px; }
.landing-section .lead { text-align: center; color: var(--text-muted); max-width: 560px; margin: 0 auto 40px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.feature-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.feature-card .icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 14px; background: rgba(37,99,235,.10); }
.feature-card h3 { color: var(--text-strong); font-size: 15px; margin: 0 0 8px; }
.feature-card p { color: var(--text-dim); font-size: 13px; line-height: 1.5; margin: 0; }

.landing-cta { text-align: center; padding: 70px 20px; background: var(--panel-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.landing-cta h2 { color: var(--text-strong); margin-bottom: 14px; }

.landing-footer { text-align: center; padding: 26px; color: var(--text-dim); font-size: 12px; background: var(--panel); }
