:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --surface: #f8fafc;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --brand: #0753a5;
  --brand-dark: #053f7f;
  --brand-mid: #1d6ec4;
  --brand-soft: #eaf2fb;
  --brand-ring: rgba(7, 83, 165, 0.14);
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --sky: #0284c7;
  --sky-soft: #f0f9ff;
  --violet: #6d28d9;
  --violet-soft: #f5f3ff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.18);
  --radius: 14px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 14px; color: var(--ink); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
a { color: inherit; }
svg { display: block; }
kbd { font-family: inherit; font-size: 10px; font-weight: 600; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: #fff; color: var(--muted); }

/* Layout Shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; position: fixed; inset: 0 auto 0 0;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 14px 14px; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; padding: 2px 8px 26px; }
.brand-logo { width: 40px; height: 40px; flex: none; object-fit: cover; border-radius: 50%; box-shadow: 0 3px 10px rgba(7, 83, 165, 0.2); }
.brand strong { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; display: block; color: var(--ink); }
.brand small { display: block; font-size: 9px; letter-spacing: 1.5px; color: var(--faint); font-weight: 700; margin-top: 2px; }

.side-label, .eyebrow { font-size: 10px; letter-spacing: 1.2px; font-weight: 700; color: var(--faint); text-transform: uppercase; }
.side-label { padding: 0 10px 9px; }

.nav-list { display: grid; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border: 0; background: none; border-radius: 10px; color: var(--muted);
  text-align: left; width: 100%; font-size: 13px; font-weight: 600; transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--line-soft); color: var(--ink); }
.nav-item.active { color: var(--brand); background: var(--brand-soft); }
.nav-icon { width: 18px; height: 18px; flex: none; color: inherit; opacity: 0.85; }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.nav-count { margin-left: auto; border-radius: 999px; padding: 2px 8px; background: #e8f1fa; color: var(--brand); font-size: 11px; font-weight: 700; }

.sidebar-bottom { margin-top: auto; padding-top: 12px; }
.help-card { margin: 0 2px 12px; background: linear-gradient(155deg, #eef5fc, #f8fbff); border: 1px solid #dce9f7; border-radius: 12px; padding: 12px; }
.help-title { font-size: 11px; font-weight: 700; color: var(--brand); margin-bottom: 4px; }
.help-card p { font-size: 11px; line-height: 1.5; color: var(--muted); margin: 0; }
.logout { margin-top: 2px; }
.profile { border-top: 1px solid var(--line); margin-top: 10px; padding: 12px 6px 0; display: flex; align-items: center; gap: 9px; }
.profile b, .profile small { display: block; }
.profile b { font-size: 12px; color: var(--ink); }
.profile small { font-size: 10px; color: var(--muted); margin-top: 1px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 12px; flex: none; }
.profile-dot, .secure-dot { width: 7px; height: 7px; background: #10b981; border-radius: 50%; margin-left: auto; }
.credit-line { padding: 8px 6px 2px; text-align: center; color: var(--faint); font-size: 10px; }

/* Workspace & Topbar */
.workspace { margin-left: 248px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 66px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: sticky; top: 0; z-index: 15;
}
.breadcrumb { display: flex; gap: 8px; align-items: center; color: var(--faint); font-size: 12px; white-space: nowrap; }
.breadcrumb i { font-style: normal; color: var(--line); }
.breadcrumb b { color: var(--ink-2); font-weight: 600; }

.top-actions { display: flex; align-items: center; gap: 10px; }
.global-search {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  background: var(--surface); border-radius: 10px; padding: 7px 10px; width: 320px; transition: border-color 0.15s, box-shadow 0.15s;
}
.global-search:focus-within { border-color: var(--brand-mid); background: #fff; box-shadow: 0 0 0 3px var(--brand-ring); }
.search-svg { width: 15px; height: 15px; color: var(--faint); flex: none; }
.search-svg svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.global-search input, .filter-search input { border: 0; outline: 0; width: 100%; background: transparent; color: var(--ink); font-size: 12.5px; }
.search-clear { border: 0; background: #e2e8f0; color: var(--ink-2); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; line-height: 1; flex: none; padding: 0; }
.search-clear:hover { background: #cbd5e1; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 9px; padding: 9px 14px;
  font-size: 12.5px; font-weight: 600; transition: all 0.15s; white-space: nowrap; text-decoration: none;
}
.button.primary { color: #fff; background: var(--brand); box-shadow: 0 2px 8px rgba(7, 83, 165, 0.22); }
.button.primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.button.secondary { color: var(--ink-2); background: #fff; border-color: var(--line); box-shadow: var(--shadow-sm); }
.button.secondary:hover { background: var(--surface); border-color: #cbd5e1; }
.button.danger-soft { color: var(--red); background: var(--red-soft); border-color: #fecaca; }
.button.danger-soft:hover { background: #fee2e2; }
.button.small { padding: 6px 10px; font-size: 11.5px; border-radius: 8px; }
.button.wide { width: 100%; }
.text-button { border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 12px; padding: 4px 6px; border-radius: 6px; }
.text-button:hover { background: var(--brand-soft); }
.text-button.danger { color: var(--red); }
.text-button.danger:hover { background: var(--red-soft); }
.icon-button { height: 32px; width: 32px; border: 1px solid var(--line); background: #fff; border-radius: 9px; color: var(--muted); font-size: 17px; display: grid; place-items: center; transition: background 0.15s; }
.icon-button:hover { background: var(--surface); color: var(--ink); }

/* Content & Pages */
.content { max-width: 1520px; width: 100%; margin: 0 auto; padding: 26px 32px 60px; }
.page { display: none; animation: fadeIn 0.16s ease-out; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0.5; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 22px; }
.page-heading.compact { margin-bottom: 18px; }
.page-heading h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.7px; margin: 6px 0 4px; color: var(--ink); }
.subheading { font-size: 13px; color: var(--muted); margin: 0; }
.heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Panels & Metrics */
.panel, .metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2, .settings-title h2, .source-panel h2 { font-size: 15px; font-weight: 700; margin: 0 0 3px; color: var(--ink); }
.panel-head p, .settings-title p, .source-panel p { font-size: 12px; color: var(--muted); margin: 0; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card { padding: 18px 20px; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.metric-card.clickable { cursor: pointer; }
.metric-card.clickable:hover { border-color: #bfd7f2; transform: translateY(-2px); box-shadow: var(--shadow); }
.metric-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-card > strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: -0.8px; margin: 12px 0 3px; color: var(--ink); }
.metric-card > small { font-size: 11.5px; color: var(--faint); }
.metric-icon { height: 34px; width: 34px; display: grid; place-items: center; border-radius: 10px; font-size: 15px; flex: none; }
.metric-icon.blue { background: var(--brand-soft); color: var(--brand); }
.metric-icon.sky { background: var(--sky-soft); color: var(--sky); }
.metric-icon.amber { background: var(--amber-soft); color: var(--amber); }
.metric-icon.green { background: var(--green-soft); color: var(--green); }

.dashboard-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; margin-bottom: 16px; }
.secondary-grid { grid-template-columns: 1.15fr 0.85fr; }
.stage-summary { display: grid; gap: 10px; }
.stage-row {
  display: grid; grid-template-columns: 132px 1fr 44px; gap: 12px; align-items: center;
  font-size: 12px; padding: 4px 6px; border-radius: 8px; border: 0; background: transparent; width: 100%; text-align: left;
}
.stage-row:hover { background: var(--surface); }
.stage-row > span:first-child { color: var(--ink-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-count { text-align: right; color: var(--ink); font-weight: 700; }
.stage-track { height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.stage-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-mid), var(--brand)); transition: width 0.25s ease; }

.next-meetings, .followup-list, .upcoming-list, .day-meetings { display: grid; gap: 8px; }
.meeting-mini { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; transition: border-color 0.15s; }
.meeting-mini:hover { border-color: #bfd7f2; background: var(--surface); }
.date-chip { height: 42px; width: 42px; display: grid; place-content: center; text-align: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); flex: none; }
.date-chip b { font-size: 15px; font-weight: 800; line-height: 1; }
.date-chip small { font-size: 9px; font-weight: 700; text-transform: uppercase; margin-top: 2px; }
.meeting-mini-body { min-width: 0; flex: 1; }
.meeting-mini-body b, .meeting-mini-body span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meeting-mini-body b { font-size: 12.5px; color: var(--ink); }
.meeting-mini-body span { font-size: 11px; color: var(--muted); margin-top: 2px; }
.meeting-time { font-size: 11px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }

.followup-item { display: grid; grid-template-columns: 8px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line-soft); }
.followup-item:last-child { border-bottom: 0; }
.followup-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.followup-item.overdue .followup-dot { background: var(--red); }
.followup-main b { display: block; font-size: 12.5px; color: var(--ink); }
.followup-main span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.market-breakdown { display: grid; gap: 14px; }
.breakdown-group h3 { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.8px; margin: 0 0 8px; }
.breakdown-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.breakdown-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 11.5px; font-weight: 600; color: var(--ink-2);
}
.breakdown-pill:hover { border-color: var(--brand-mid); color: var(--brand); background: var(--brand-soft); }
.breakdown-pill b { color: var(--brand); font-weight: 700; }

/* Segment Tabs & Filter Bar */
.segment-tabs { display: flex; align-items: center; gap: 7px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.segment-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: all 0.15s;
}
.segment-tab:hover { border-color: #cbd5e1; color: var(--ink); }
.segment-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.segment-tab span { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: var(--line-soft); color: var(--ink-2); }
.segment-tab.active span { background: rgba(255, 255, 255, 0.22); color: #fff; }

.filter-shell { padding: 0; margin-bottom: 14px; overflow: hidden; }
.filter-bar { display: flex; align-items: center; padding: 9px 12px; gap: 10px; flex-wrap: wrap; }
.filter-search { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; min-width: 180px; }
.select-wrap { display: flex; align-items: center; gap: 6px; border-left: 1px solid var(--line); padding-left: 10px; font-size: 11px; color: var(--faint); font-weight: 600; white-space: nowrap; }
.select-wrap select { border: 0; outline: 0; background: transparent; color: var(--ink-2); font-size: 12px; font-weight: 600; max-width: 145px; cursor: pointer; }
.mini-badge { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 10px; }

.filter-advanced {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px;
  padding: 12px; border-top: 1px solid var(--line); background: var(--surface);
}
.adv-field { display: grid; gap: 4px; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.adv-field select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; background: #fff; color: var(--ink); font-size: 12px; outline: 0; }
.adv-field select:focus { border-color: var(--brand-mid); }

.list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 2px 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.list-summary b { color: var(--ink); font-size: 13px; }
.muted { color: var(--faint); margin-left: 6px; font-size: 11.5px; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.page-size-wrap { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.page-size-wrap select { border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; background: #fff; color: var(--ink); font-size: 11.5px; font-weight: 600; }
.view-switch { display: flex; padding: 3px; background: #e8edf4; border-radius: 9px; gap: 2px; }
.view-switch button { border: 0; background: none; color: var(--muted); border-radius: 7px; padding: 5px 10px; font-size: 11.5px; font-weight: 600; }
.view-switch button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); }

/* Bulk Bar */
.bulk-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px; border-radius: 12px;
  background: #eff6ff; border: 1px solid #bfdbfe; box-shadow: var(--shadow-sm);
}
.bulk-count { font-size: 12.5px; color: var(--brand-dark); font-weight: 600; }
.bulk-controls { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.bulk-controls select, .bulk-controls input {
  border: 1px solid #cbd5e1; border-radius: 8px; padding: 5px 8px; background: #fff; font-size: 11.5px; color: var(--ink);
}

/* Table */
.table-panel { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
thead th {
  font-size: 10px; letter-spacing: 0.7px; color: var(--faint); text-align: left;
  font-weight: 700; padding: 12px; background: var(--surface); border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: 12px; color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbff; }
tbody tr.selected-row { background: #eff6ff; }
.col-check { width: 38px; text-align: center; }
.col-check input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
td.company-cell { min-width: 220px; max-width: 290px; }
.company-button { border: 0; background: none; padding: 0; text-align: left; display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); font-size: 12.5px; width: 100%; }
.company-button:hover { color: var(--brand); }
.company-title-wrap { min-width: 0; }
.company-title-wrap > span:first-child { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-avatar {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px;
  background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 12px; flex: none; overflow: hidden;
}
.company-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cell-sub { display: block; color: var(--faint); font-size: 11px; margin-top: 2px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.sector-cell { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

/* Inline Selects & Badges */
.inline-stage {
  appearance: none; -webkit-appearance: none;
  border: 1px solid transparent; border-radius: 999px; padding: 4px 10px;
  font-size: 11px; font-weight: 700; cursor: pointer; background: #f1f5f9; color: #475569; outline: 0;
}
.inline-stage[data-stage="Por contactar"] { background: #f1f5f9; color: #475569; }
.inline-stage[data-stage="Contactado"] { background: #eef2ff; color: #4338ca; }
.inline-stage[data-stage="Diagnóstico / Demo"] { background: var(--sky-soft); color: #0369a1; }
.inline-stage[data-stage="Propuesta"] { background: var(--violet-soft); color: var(--violet); }
.inline-stage[data-stage="Ganado"] { background: var(--green-soft); color: var(--green); }
.inline-stage[data-stage="Perdido"] { background: var(--red-soft); color: var(--red); }

.stage-pill { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 11px; font-weight: 700; white-space: nowrap; }
.stage-pill[data-stage="Contactado"] { background: #eef2ff; color: #4338ca; }
.stage-pill[data-stage="Diagnóstico / Demo"] { background: var(--sky-soft); color: #0369a1; }
.stage-pill[data-stage="Propuesta"] { background: var(--violet-soft); color: var(--violet); }
.stage-pill[data-stage="Ganado"] { background: var(--green-soft); color: var(--green); }
.stage-pill[data-stage="Perdido"] { background: var(--red-soft); color: var(--red); }

.erp-chip { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 600; white-space: nowrap; }
.no-erp { color: var(--faint); font-size: 11.5px; white-space: nowrap; }

.priority-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; background: #f1f5f9; color: #64748b; }
.priority-pill[data-priority="Alta"] { background: var(--amber-soft); color: var(--amber); }
.priority-pill[data-priority="Urgente"] { background: var(--red-soft); color: var(--red); }

.followup-date { white-space: nowrap; font-size: 11.5px; }
.followup-date.late { color: var(--red); font-weight: 700; }
.followup-date.today { color: var(--amber); font-weight: 700; }

.row-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.mini-action {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--muted); text-decoration: none; font-size: 12px; transition: all 0.15s;
}
.mini-action:hover { border-color: var(--brand-mid); color: var(--brand); background: var(--brand-soft); }
.mini-action.wa { color: #059669; border-color: #a7f3d0; background: #ecfdf5; }
.mini-action.wa:hover { background: #d1fae5; }

/* Cards & Pagination */
.lead-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lead-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; display: flex; flex-direction: column;
}
.lead-card:hover { border-color: #bfd7f2; transform: translateY(-2px); box-shadow: var(--shadow); }
.lead-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lead-card-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lead-card h3 { font-size: 14px; font-weight: 700; margin: 12px 0 4px; color: var(--ink); }
.lead-card p { font-size: 11.5px; color: var(--muted); margin: 0; line-height: 1.45; }
.lead-card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.lead-card-foot { border-top: 1px solid var(--line-soft); padding-top: 11px; margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.pagination-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px;
  padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; color: var(--muted);
}
.pagination-buttons { display: flex; align-items: center; gap: 6px; }

.empty-state { display: grid; place-items: center; padding: 48px 20px; color: var(--muted); gap: 8px; font-size: 13px; text-align: center; }
.empty-state b { color: var(--ink); font-size: 14px; }
.empty-art { font-size: 28px; color: var(--brand-mid); opacity: 0.6; }
.empty-line { padding: 20px 10px; color: var(--faint); font-size: 12px; text-align: center; }
.hidden { display: none !important; }

/* Calendar / Agenda */
.calendar-layout { display: grid; grid-template-columns: 1.45fr 0.85fr; gap: 16px; }
.calendar-panel { padding: 18px; }
.calendar-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.calendar-head h2 { font-size: 16px; font-weight: 700; margin: 0 auto 0 4px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal-weekday, .cal-day { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 92px; padding: 7px; }
.cal-weekday { min-height: auto; text-align: center; font-size: 10px; color: var(--faint); font-weight: 700; letter-spacing: 0.5px; padding: 8px 2px; background: var(--surface); }
.cal-day { position: relative; background: #fff; cursor: pointer; }
.cal-day:hover { background: #fafcff; }
.cal-day.other-month { background: #fafbfd; color: var(--faint); }
.cal-day.selected { box-shadow: inset 0 0 0 2px var(--brand); z-index: 1; background: #f8fbff; }
.cal-day.today .cal-num { background: var(--brand); color: #fff; }
.cal-num { border: 0; background: transparent; font-size: 11px; font-weight: 700; color: var(--ink-2); height: 24px; width: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-events { display: grid; gap: 3px; margin-top: 4px; }
.cal-event {
  border: 0; border-left: 2.5px solid var(--brand); background: var(--brand-soft); border-radius: 4px;
  padding: 3px 5px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; font-weight: 600; color: var(--brand-dark);
}
.cal-event.done { opacity: 0.55; text-decoration: line-through; background: var(--green-soft); border-left-color: var(--green); color: var(--green); }
.agenda-panel { min-height: 400px; }
.day-meeting { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.day-meeting:last-child { border: 0; }
.day-meeting-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.day-meeting b { font-size: 12.5px; color: var(--ink); }
.day-meeting p { font-size: 12px; line-height: 1.45; color: var(--muted); margin: 5px 0; }
.meeting-meta { font-size: 11px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.meeting-actions-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.status-select { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 7px; padding: 4px 7px; font-size: 11px; font-weight: 600; }
.upcoming-panel { margin-top: 16px; }
.upcoming-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.no-events { padding: 28px 10px; color: var(--faint); font-size: 12px; line-height: 1.6; text-align: center; }

/* Pipeline Kanban */
.pipeline-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px; flex-wrap: wrap; }
.pipe-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-left: auto; cursor: pointer; }
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; }
.kanban-column {
  flex: 1 0 215px; min-width: 215px; background: #eef2f7; border: 1px solid var(--line); border-radius: 13px;
  padding: 10px; display: flex; flex-direction: column; max-height: calc(100vh - 265px);
}
.kanban-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 10px; }
.kanban-head b { font-size: 12px; color: var(--ink); }
.kanban-head span { display: inline-grid; place-items: center; min-width: 24px; height: 20px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--ink-2); font-size: 11px; font-weight: 700; }
.kanban-cards { display: grid; gap: 8px; overflow-y: auto; padding-right: 2px; min-height: 60px; }
.kanban-column.drag-over { background: #e0edfc; border-color: var(--brand-mid); }
.kanban-card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s;
}
.kanban-card:hover { border-color: #93c5fd; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06); }
.kanban-card.dragging { opacity: 0.5; }
.kanban-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.kanban-card b { font-size: 12.5px; color: var(--ink); display: block; line-height: 1.3; }
.kanban-card p { font-size: 11px; color: var(--muted); margin: 5px 0 9px; line-height: 1.4; }
.kanban-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kanban-card select { max-width: 130px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 4px 6px; font-size: 10.5px; color: var(--ink-2); font-weight: 600; }
.kanban-more { margin-top: 8px; width: 100%; }

/* Settings & Users */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.settings-title { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.settings-panel form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.settings-panel .self-pw-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-submit-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.settings-panel label, .modal label { display: grid; gap: 6px; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.settings-panel input, .modal input, .modal select, .modal textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); background: #fff;
  border-radius: 9px; color: var(--ink); font-size: 12.5px; font-weight: 400; outline: 0; transition: border-color 0.15s, box-shadow 0.15s;
}
.settings-panel input:focus, .modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--brand-mid); box-shadow: 0 0 0 3px var(--brand-ring); }
.form-message { font-size: 12px; color: var(--green); font-weight: 600; }

.source-panel { display: flex; align-items: flex-start; gap: 14px; }
.source-body { flex: 1; }
.source-panel p { line-height: 1.6; max-width: 660px; margin-top: 4px; }
.source-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.source-pills span { border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); padding: 5px 11px; font-size: 11px; font-weight: 600; }
.source-actions { margin-top: 14px; }

.user-create-panel, .user-list-panel { margin-bottom: 16px; }
.user-form { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); align-items: end; gap: 12px; }
.user-form label { display: grid; gap: 6px; font-size: 11.5px; color: var(--ink-2); font-weight: 700; }
.user-form input, .user-form select { height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; background: #fff; color: var(--ink); font-size: 12.5px; }
.user-form .button { height: 40px; }
.form-hint { margin: 10px 0 0; color: var(--faint); font-size: 11.5px; }
.user-status { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.user-status.active { background: var(--green-soft); color: var(--green); }
.user-status.inactive { background: var(--red-soft); color: var(--red); }
.user-actions { display: flex; gap: 6px; white-space: nowrap; }

/* Modals */
.modal { width: min(740px, calc(100vw - 24px)); max-height: 92vh; border: 1px solid var(--line); border-radius: 18px; padding: 0; box-shadow: var(--shadow-lg); color: var(--ink); overflow: hidden; }
.modal.modal-sm { width: min(440px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(15, 23, 42, 0.48); backdrop-filter: blur(4px); }
.large-modal { width: min(1020px, calc(100vw - 24px)); }
.modal-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.modal-top h2 { font-size: 18px; font-weight: 800; margin: 4px 0 0; letter-spacing: -0.3px; }
.modal-content { padding: 20px 24px 24px; overflow-y: auto; max-height: calc(92vh - 76px); }
.close-modal { font-size: 20px; }

/* Lead Detail Modal */
.lead-header-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.lead-identity { display: flex; align-items: center; gap: 13px; }
.logo-drop {
  position: relative; width: 58px; height: 58px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; overflow: hidden; cursor: pointer; flex: none;
}
.logo-drop img { width: 100%; height: 100%; object-fit: contain; }
.logo-placeholder { font-size: 22px; font-weight: 800; color: var(--brand); background: var(--brand-soft); width: 100%; height: 100%; display: grid; place-items: center; }
.logo-drop-overlay {
  position: absolute; inset: auto 0 0 0; background: rgba(15, 23, 42, 0.72); color: #fff;
  font-size: 9px; font-weight: 700; text-align: center; padding: 3px 0; opacity: 0; transition: opacity 0.15s;
}
.logo-drop:hover .logo-drop-overlay { opacity: 1; }
.logo-controls { display: flex; flex-direction: column; gap: 4px; }
.logo-controls b { font-size: 13px; color: var(--ink); }
.logo-controls small { font-size: 11px; color: var(--muted); }
.logo-btn-row { display: flex; gap: 6px; margin-top: 2px; }
.lead-quick-bar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.wa-button { color: #059669; border-color: #a7f3d0; background: #ecfdf5; }
.wa-button:hover { background: #d1fae5; }

.lead-detail-layout { display: grid; grid-template-columns: 1.35fr 0.85fr; gap: 24px; align-items: start; }
.lead-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lead-fields .full { grid-column: 1 / -1; }
.field-area { min-height: 68px; resize: vertical; line-height: 1.45; }
.detail-section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.detail-section-title { font-size: 11px; font-weight: 800; letter-spacing: 0.7px; margin: 0 0 12px; color: var(--ink-2); text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; }

.input-with-action { display: flex; gap: 6px; align-items: center; }
.input-with-action input { flex: 1; min-width: 0; }

.tag-editor { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 999px; }
.tag-chip button { border: 0; background: none; color: inherit; padding: 0; font-size: 13px; line-height: 1; opacity: 0.7; }
.tag-chip button:hover { opacity: 1; }
.tag-editor input { border: 0 !important; padding: 4px !important; box-shadow: none !important; flex: 1 1 120px; min-width: 100px; }

.notes-save-state { display: block; color: var(--muted); font-size: 11px; font-weight: 500; margin-top: 4px; }
.notes-field textarea { min-height: 92px; }

.detail-actions-sticky {
  position: sticky; bottom: -24px; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line); padding: 12px 0 14px; margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 3;
}
.detail-actions-right { display: flex; align-items: center; gap: 8px; }

/* Detail Sidebar & Fixed Activity Composer */
.detail-side { border-left: 1px solid var(--line); padding-left: 20px; display: grid; gap: 18px; }
.activity-composer { display: grid; gap: 8px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.kind-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.kind-pill {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 600;
}
.kind-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.activity-composer textarea { width: 100%; min-height: 74px; resize: vertical; }
.activity-composer-foot { display: flex; justify-content: flex-end; }

.timeline { display: grid; gap: 10px; max-height: 360px; overflow-y: auto; padding-right: 4px; }
.timeline-item { border-left: 2px solid #cbd5e1; padding: 2px 0 6px 11px; position: relative; }
.timeline-item.kind-Llamada { border-left-color: var(--brand); }
.timeline-item.kind-WhatsApp { border-left-color: var(--green); }
.timeline-item.kind-Reunión { border-left-color: var(--sky); }
.timeline-item.kind-Cambio { border-left-color: var(--violet); }
.timeline-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.timeline-head b { font-size: 11.5px; color: var(--ink); }
.timeline-head small { color: var(--faint); font-size: 10.5px; }
.timeline-item p { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin: 4px 0 0; white-space: pre-wrap; }

.detail-meeting { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 7px; font-size: 11.5px; background: #fff; }

.source-details { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; background: var(--surface); }
.source-details summary { cursor: pointer; font-weight: 700; font-size: 12px; color: var(--ink-2); }
.original-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.original-fields div { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; }
.original-fields small { display: block; font-size: 10px; font-weight: 700; color: var(--faint); margin-bottom: 3px; }
.original-fields span { display: block; font-size: 11.5px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 100px; overflow: auto; }

/* Meeting Lead Picker & Form Grid */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.spacer { margin-right: auto; }
.meeting-lead-results { max-height: 210px; overflow: auto; margin-top: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.meeting-search-hint { padding: 11px 12px; color: var(--muted); font-size: 12px; }
.meeting-lead-option { display: flex; width: 100%; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line-soft); background: #fff; text-align: left; }
.meeting-lead-option:hover { background: var(--brand-soft); }
.meeting-lead-option b { color: var(--ink); font-size: 12.5px; }
.meeting-lead-option span { color: var(--muted); font-size: 11px; }

/* Archived list */
.archived-list { display: grid; gap: 8px; }
.archived-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; }
.archived-item b { font-size: 13px; display: block; }
.archived-item small { font-size: 11px; color: var(--muted); }

/* Toast & Alerts */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0;
  background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-lg); pointer-events: none; transition: 0.2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.alert { background: var(--red-soft); border: 1px solid #fecaca; color: #b91c1c; padding: 10px 12px; border-radius: 9px; font-size: 12px; margin: 12px 0; }
.duplicate-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--amber-soft); border: 1px solid #fde68a; border-radius: 10px; font-size: 12px; color: #92400e; margin-bottom: 12px; }

/* Searchable Country Picker */
.country-picker { position: relative; }
.country-picker-input-wrap { position: relative; display: flex; align-items: center; }
.country-picker-input-wrap input { padding-right: 34px; cursor: text; }
.country-picker-toggle {
  position: absolute; right: 6px; width: 24px; height: 24px; border: 0; background: none;
  color: var(--faint); display: grid; place-items: center; border-radius: 6px; font-size: 12px;
}
.country-picker-toggle:hover { background: var(--line-soft); color: var(--ink); }
.country-picker-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  max-height: 250px; overflow-y: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 11px; box-shadow: var(--shadow); padding: 4px;
}
.country-picker-group {
  padding: 6px 8px 4px; font-size: 10px; font-weight: 800; letter-spacing: 0.7px;
  color: var(--faint); text-transform: uppercase;
}
.country-picker-option {
  width: 100%; border: 0; background: transparent; text-align: left; padding: 7px 9px;
  border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px; color: var(--ink); font-weight: 500;
}
.country-picker-option:hover, .country-picker-option.highlighted { background: var(--brand-soft); color: var(--brand-dark); }
.country-picker-option.selected { font-weight: 700; color: var(--brand); }
.country-dial { font-size: 11px; color: var(--faint); font-weight: 600; }

/* Contextual Info Tooltips & Live Field Hints */
.label-head { display: inline-flex; align-items: center; gap: 5px; }
.info-tip {
  position: relative; display: inline-grid; place-items: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); border: 1px solid #bfdbfe;
  font-size: 10px; font-weight: 800; line-height: 1; cursor: help; flex: none;
  transition: background 0.15s, color 0.15s;
}
.info-tip:hover, .info-tip:focus { background: var(--brand); color: #fff; outline: none; }
.info-tip::after {
  content: attr(data-tip);
  position: absolute; left: 0; bottom: calc(100% + 7px); z-index: 40;
  width: max-content; max-width: 245px; padding: 8px 10px; border-radius: 9px;
  background: #0f172a; color: #f8fafc; font-size: 11px; font-weight: 500; line-height: 1.45;
  white-space: normal; text-transform: none; letter-spacing: 0;
  box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s; pointer-events: none;
}
.info-tip.tip-right::after { left: auto; right: 0; }
.info-tip:hover::after, .info-tip:focus::after { opacity: 1; visibility: visible; transform: translateY(0); }

.phone-input-group { position: relative; display: flex; align-items: center; }
.phone-prefix-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 9px; height: 37px; border: 1px solid var(--line); border-right: 0;
  border-radius: 9px 0 0 9px; background: var(--surface); color: var(--brand);
  font-size: 11.5px; font-weight: 700; white-space: nowrap; flex: none;
}
.phone-input-group input { border-radius: 0 9px 9px 0 !important; }
.field-help { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.field-help.ready { color: var(--green); font-weight: 600; }

/* Login Page */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: radial-gradient(ellipse at 10% 10%, #e4effb 0, transparent 36%), radial-gradient(ellipse at 90% 90%, #eaf3fc 0, transparent 40%), var(--bg); }
.login-layout { width: min(980px, 100%); min-height: 580px; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(350px, 0.92fr); background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); }
.login-brand { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; padding: 38px 46px 32px; color: #fff; background: linear-gradient(145deg, #0a5ca8 0%, #07447f 50%, #062e58 100%); }
.login-brand::after { content: ""; position: absolute; z-index: -1; width: 460px; height: 460px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 50%; right: -210px; bottom: -240px; box-shadow: 0 0 0 36px rgba(255, 255, 255, 0.035), 0 0 0 74px rgba(255, 255, 255, 0.02); }
.login-brand-top { display: flex; align-items: center; gap: 13px; }
.login-brand-logo { width: 58px; height: 58px; flex: none; padding: 4px; background: #fff; border-radius: 50%; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
.login-brand-logo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.login-brand-top b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.login-brand-top small { display: block; margin-top: 3px; color: #c9def3; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; }
.login-brand-copy { margin: auto 0; max-width: 410px; padding: 44px 0; }
.login-brand-copy > span { color: #b8d8f6; font-size: 10px; font-weight: 800; letter-spacing: 1.8px; }
.login-brand-copy h2 { font-size: clamp(28px, 3.8vw, 40px); font-weight: 800; line-height: 1.15; letter-spacing: -1.1px; margin: 15px 0; }
.login-brand-copy p { max-width: 330px; color: #d8e7f6; font-size: 14px; line-height: 1.65; margin: 0; }
.login-brand-footer { display: flex; align-items: center; gap: 9px; color: #d6e7f8; font-size: 11px; }
.login-brand-dot { width: 7px; height: 7px; border-radius: 50%; background: #8bd4bd; box-shadow: 0 0 0 4px rgba(139, 212, 189, 0.16); }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 46px clamp(28px, 5vw, 56px); background: #fff; }
.login-welcome .eyebrow { color: var(--brand-mid); }
.login-welcome h1 { font-size: 29px; font-weight: 800; color: var(--ink); letter-spacing: -0.7px; margin: 10px 0 6px; }
.login-welcome p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 24px; }
.login-card form { display: grid; gap: 8px; }
.login-card label { margin-top: 6px; color: var(--ink-2); font-size: 11.5px; font-weight: 700; }
.login-card input { height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font-size: 13.5px; outline: 0; width: 100%; }
.login-card input:focus { border-color: var(--brand-mid); box-shadow: 0 0 0 3px var(--brand-ring); }
.password-wrap { position: relative; display: flex; align-items: center; }
.password-wrap input { padding-right: 68px; }
.password-toggle { position: absolute; right: 10px; border: 0; background: none; color: var(--brand); font-size: 11.5px; font-weight: 700; padding: 4px 6px; }
.login-card .button.primary { height: 45px; margin-top: 12px; }
.login-foot { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 11px; margin-top: 22px; }
.login-foot .secure-dot { margin: 0; }

/* Responsive */
#mobile-logout-form { display: none; }

@media (max-width: 1120px) {
  .sidebar { width: 214px; }
  .workspace { margin-left: 214px; }
  .topbar { padding: 0 20px; }
  .content { padding: 24px 20px 50px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-advanced { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lead-cards { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app-shell { display: block; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .sidebar {
    inset: auto 0 0 0; width: 100%; height: calc(64px + env(safe-area-inset-bottom));
    padding: 4px 4px env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--line);
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08); flex-direction: row;
  }
  .brand, .side-label, .sidebar-bottom { display: none; }
  .nav-list { width: 100%; display: flex; align-items: stretch; justify-content: space-around; gap: 0; }
  .nav-item { flex: 1; flex-direction: column; justify-content: center; align-items: center; gap: 3px; padding: 5px 2px; font-size: 10px; }
  .nav-count { display: none; }
  #mobile-logout-form { display: flex; flex: 1; }
  .workspace { margin-left: 0; }
  .topbar { height: 60px; padding: 0 14px; }
  .breadcrumb { display: none; }
  .top-actions { width: 100%; }
  .global-search { flex: 1; width: auto; }
  .global-search kbd { display: none; }
  #quick-add { padding: 9px 12px; font-size: 12px; }
  .content { padding: 18px 14px 28px; }
  .page-heading { flex-direction: column; align-items: flex-start; }
  .dashboard-grid, .secondary-grid, .calendar-layout, .upcoming-list { grid-template-columns: 1fr; }
  .filter-advanced { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .select-wrap { border-left: 0; padding-left: 0; }
  .lead-cards { grid-template-columns: 1fr; }
  .lead-detail-layout { grid-template-columns: 1fr; }
  .detail-side { border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }
  .lead-fields, .form-grid, .user-form, .settings-panel form, .settings-panel .self-pw-form { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; min-height: 0; }
  .login-brand { padding: 24px; min-height: 190px; }
  .login-brand-copy { padding: 22px 0 0; }
  .login-brand-copy p, .login-brand-footer { display: none; }
}
