@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --ink: #101828;
  --ink-soft: #475467;
  --ink-faint: #98A2B3;
  --line: #E4E7EC;
  --line-soft: #F2F4F7;
  --paper: #F7F9FC;
  --card: #FFFFFF;

  --brand: #1A56DB;
  --brand-dark: #0B1739;
  --brand-darker: #060E24;
  --brand-light: #EAF1FE;

  --accent: #0EA5E9;
  --accent-dark: #0284C7;
  --accent-ink: #FFFFFF;

  --good: #178754;
  --good-bg: #E5F6EC;
  --bad: #D6402C;
  --bad-bg: #FDEBE8;
  --warn: #B5750B;
  --warn-bg: #FFF4E0;
  --info: #1A56DB;
  --info-bg: #EAF1FE;
  --muted-bg: #F0F2F5;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(10, 36, 32, 0.06);
  --shadow-md: 0 6px 20px rgba(10, 36, 32, 0.08);
  --shadow-lg: 0 16px 40px rgba(10, 36, 32, 0.14);

  --sidebar-w: 252px;
  --font-display: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

  font-family: var(--font-body);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.015em; margin: 0 0 4px; color: var(--ink); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; margin-bottom: 16px; }
p { margin: 0 0 8px; line-height: 1.55; }

.muted { color: var(--ink-soft); }
.small { font-size: 0.82rem; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  background: var(--muted-bg);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.85em;
  font-family: var(--font-mono);
}

::selection { background: var(--brand-light); color: var(--brand-dark); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ============================================================
   Sidebar layout
   ============================================================ */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(185deg, var(--brand-dark) 0%, var(--brand-darker) 100%);
  color: #D6E4FB;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
}
.brand-badge { color: #fff; flex-shrink: 0; display: flex; }
.brand-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.brand-chip img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.sidebar-close { display: none; margin-left: auto; background: none; border: none; color: #C7D6F5; cursor: pointer; padding: 4px; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  flex: 1;
  overflow-y: auto;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #B8C9F0;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-link:hover { background: rgba(255,255,255,0.07); color: #fff; text-decoration: none; }
.sidebar-link.active { background: var(--brand); color: #fff; }
.sidebar-link .icon { flex-shrink: 0; opacity: 0.9; }

.sidebar-link-locked { opacity: 0.45; cursor: pointer; }
.sidebar-link-locked:hover { opacity: 0.75; background: rgba(255,255,255,0.05); }
.sidebar-link-locked .icon { opacity: 0.6; }
.sidebar-lock-icon { margin-left: auto; font-size: 0.75rem; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.notif-unread { border-left: 3px solid var(--brand); background: var(--brand-light); }
.notif-row-body p { margin: 4px 0; }
.notif-row-actions { display: flex; gap: 6px; flex-shrink: 0; }

.locked-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

.module-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 16px;
  margin-bottom: 10px;
}
.module-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
.module-checkbox input { margin: 0; }
.module-preset-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.sidebar-footer {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-actor { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sidebar-actor-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.sidebar-actor-avatar-img { object-fit: cover; }
.sidebar-actor-name { font-size: 0.85rem; font-weight: 600; color: #fff; line-height: 1.2; }
.sidebar-actor-role { font-size: 0.74rem; color: #93A8D6; }
.sidebar-logout {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #D6E4FB;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.sidebar-logout:hover { background: rgba(255,255,255,0.12); }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(6, 16, 13, 0.5);
  z-index: 39;
}
.sidebar-backdrop.open { display: block; }

.mobile-topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; height: 56px;
  background: var(--brand-dark);
  color: #fff;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 41;
}
.mobile-topbar-btn { background: none; border: none; color: #fff; cursor: pointer; padding: 6px; display: flex; }
.mobile-topbar-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 0.92rem; }

.container {
  max-width: 1080px;
  margin-left: var(--sidebar-w);
  padding: 32px 32px 90px;
}

.impersonation-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--warn-bg);
  color: var(--warn);
  padding: 10px 32px;
  margin-left: var(--sidebar-w);
  font-size: 0.86rem;
  font-weight: 600;
}
.impersonation-banner form { margin: 0; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-close { display: block; }
  .mobile-topbar { display: flex; }
  .container { margin-left: 0; padding: 84px 18px 70px; max-width: 100%; }
  .impersonation-banner { margin-left: 0; margin-top: 56px; padding: 10px 18px; }
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-heading h2 { margin-bottom: 3px; }
.section-heading p { margin-bottom: 0; }
.filter-label { margin: 0; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sales-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
/* Grid children default to min-width:auto, so a wide table inside a card
   pushed the whole card past the viewport on phones. */
.sales-summary-grid > *,
.kpi-grid > *,
.form-grid > *,
.field-grid > * { min-width: 0; }

/* ============================================================
   KPI / stat cards
   ============================================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.kpi-sub { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
.kpi-accent .kpi-value { color: var(--brand); }

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.card-narrow { max-width: 480px; }
.card-danger { border-color: #F2CFC9; }

/* ============================================================
   Forms
   ============================================================ */

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin: 14px 0 6px;
}
label:first-child { margin-top: 0; }

/* Shared form-control system. `input:not([type])` matters: an <input> with no
   type attribute is a text box, but attribute selectors like
   input[type="text"] don't match it — those rendered as raw browser inputs. */
input:not([type]),
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="week"],
input[type="number"],
input[type="url"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.4;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  box-shadow: none;
  appearance: auto;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

input[type="color"] {
  width: 100%;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

/* Standard admin form layout — used by all internal sales forms and future admin modules. */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
.form-grid > label {
  min-width: 0;
}
.form-grid > .form-span-full,
.form-grid > .span-full {
  grid-column: 1 / -1;
}
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 18px;
  margin-top: 4px;
  border-top: 1px solid var(--line-soft);
}
.form-actions-left {
  justify-content: flex-start;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
@media (max-width: 560px) {
  .field-grid,
  .form-grid,
  .sales-summary-grid { grid-template-columns: minmax(0, 1fr); }
  .form-actions { justify-content: stretch; flex-direction: column-reverse; align-items: stretch; }
  .form-actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 760px) {
  .sales-summary-grid { grid-template-columns: minmax(0, 1fr); }
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 0.92rem;
  margin: 4px 0 16px;
}
.switch-row input { width: 18px; height: 18px; margin: 0; }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--muted-bg); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #A9331F; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 22px; font-size: 0.95rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.save-bar {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--paper) 65%, transparent);
  padding: 18px 0 8px;
  display: flex;
  justify-content: flex-end;
}

/* ============================================================
   Alerts / badges
   ============================================================ */

.alert {
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-error { background: var(--bad-bg); color: var(--bad); border-color: #F5D4CE; }
.alert-success { background: var(--good-bg); color: var(--good); border-color: #C7E9D5; }
.alert-warning { background: #FEF6E7; color: #92400E; border-color: #FDE4B0; }
.alert-info { background: var(--info-bg); color: var(--ink); border-color: #C9DAFB; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-active { background: var(--good-bg); color: var(--good); }
.badge-inactive { background: var(--warn-bg); color: var(--warn); }
.badge-muted { background: var(--muted-bg); color: var(--ink-soft); }
.badge-danger { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-purple { background: #EFE7FB; color: #6B3FC9; }
.badge-orange { background: #FFEADB; color: #C25A0F; }
.badge-yellow { background: #FFF6D6; color: #97740A; }
.badge-teal { background: #DFF5F1; color: #0F7A6C; }
.badge-row { display: flex; gap: 6px; margin: 8px 0 12px; flex-wrap: wrap; }

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--good);
  display: inline-block;
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(23, 135, 84, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(23, 135, 84, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .status-dot { animation: none; }
}

/* ============================================================
   Landing-page grid (dashboard)
   ============================================================ */

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.client-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.client-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.client-card-top {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.client-card-logo { height: 36px; max-width: 120px; object-fit: contain; }
.client-card-initial {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.28); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.client-card-body { padding: 14px 16px 16px; }
.client-card-body h3 { font-size: 1rem; margin-bottom: 2px; font-family: var(--font-body); font-weight: 700; }
.client-card-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ============================================================
   Field builder
   ============================================================ */

.field-row {
  display: grid;
  grid-template-columns: 28px 1.4fr 1fr 0.8fr auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.field-row:last-child { border-bottom: none; }
.field-row .drag-handle { cursor: grab; color: var(--ink-faint); text-align: center; }
.field-row input, .field-row select { margin: 0; padding: 7px 9px; font-size: 0.85rem; }
.field-row-options {
  grid-column: 1 / -1;
  padding: 0 0 10px 36px;
}
.field-row-options input { width: 100%; }
.field-row .req-toggle { display: flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--ink-soft); white-space: nowrap; }
.field-row .req-toggle input { width: 15px; height: 15px; }
.field-row .icon-btn {
  background: none; border: none; cursor: pointer; color: var(--ink-faint);
  font-size: 0.95rem; padding: 4px;
}
.field-row .icon-btn:hover { color: var(--bad); }
.field-row-head {
  display: grid;
  grid-template-columns: 28px 1.4fr 1fr 0.8fr auto auto auto;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
}

.option-editor {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.option-editor-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.option-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.option-row { display: flex; align-items: center; gap: 6px; }
.option-row input[type="text"] { flex: 1; width: auto; padding: 7px 10px; font-size: 0.85rem; }
.option-drag { color: var(--ink-faint); font-size: 0.8rem; cursor: grab; user-select: none; }
.option-empty { padding: 6px 2px; }
.file-field-note { margin: 0; padding: 6px 2px; }

.resume-attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.resume-file-icon { font-size: 1.1rem; }
.resume-file-name { font-weight: 600; }
.resume-actions { display: flex; gap: 6px; margin-left: 4px; }

/* ============================================================
   Tables
   ============================================================ */

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.leads-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.leads-table th, .leads-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.leads-table th { background: var(--muted-bg); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); }
.leads-table tr:last-child td { border-bottom: none; }
.leads-table tbody tr:hover { background: var(--paper); }
.nowrap { white-space: nowrap; }

/* ============================================================
   Test send / uploads
   ============================================================ */

.test-send-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.test-send-row input { width: 220px; margin: 0; }

.upload-hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 2px 0 10px;
  line-height: 1.5;
}
.inline-upload-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.upload-preview {
  display: block;
  max-height: 60px;
  max-width: 100%;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: #fafafa;
}

/* ============================================================
   Auth screens (split panel)
   ============================================================ */

.auth-body { margin: 0; }
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-panel-brand { display: none; }
}

.auth-panel-brand {
  background: linear-gradient(160deg, var(--brand-dark) 0%, var(--brand-darker) 100%);
  color: #fff;
  padding: 56px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-panel-brand::before {
  content: '';
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,106,69,0.18) 0%, transparent 70%);
  top: -160px; right: -160px;
}
.auth-brand-top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.auth-logo-lockup {
  max-width: 260px;
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-md);
}
.auth-brand-top .brand-name { font-size: 1.05rem; }
.auth-panel-headline {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 420px;
  position: relative;
  z-index: 1;
}
.auth-panel-headline .accent { color: var(--accent); }
/* The global h1 colour is dark ink; on the navy brand panel the headline
   must be white, otherwise it is invisible (every auth screen). */
.auth-panel-headline { color: #fff; }
.signup-hero-headline { color: #fff; } /* same global-h1 ink issue on the signup hero */
.auth-panel-sub { color: #B8C9F0; font-size: 0.95rem; max-width: 380px; margin-top: 12px; position: relative; z-index: 1; }
.auth-feature-list { list-style: none; padding: 0; margin: 28px 0 0; position: relative; z-index: 1; }
.auth-feature-list li {
  display: flex; align-items: center; gap: 10px;
  color: #D6E4FB; font-size: 0.88rem; padding: 7px 0;
}
.auth-feature-list .icon { color: var(--accent); flex-shrink: 0; }
.auth-panel-foot { color: #7085B3; font-size: 0.8rem; position: relative; z-index: 1; }

.auth-panel-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--paper);
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-md);
}
.auth-card h1 { font-size: 1.4rem; margin-bottom: 4px; }
.auth-switch { text-align: center; margin-top: 18px; }

/* ============================================================
   v2: multi-tenant / SaaS additions
   ============================================================ */

.usage-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}
.usage-bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--muted-bg);
  overflow: hidden;
  width: 160px;
  margin-top: 6px;
}
.usage-bar-fill { height: 100%; background: var(--brand); border-radius: 999px; }
.usage-bar-fill.usage-full { background: var(--accent); }

.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
/* Compact controls for filter/search bars. Every control in a filter row gets
   the same height, padding and type size, and sizes to its content instead of
   inheriting the global width:100% (which stacked selects full-width). */
.filter-row input:not([type]),
.filter-row input[type="text"],
.filter-row input[type="search"],
.filter-row input[type="email"],
.filter-row input[type="tel"],
.filter-row input[type="number"],
.filter-row input[type="date"],
.filter-row input[type="datetime-local"],
.filter-row input[type="month"],
.filter-row input[type="week"],
.filter-row input[type="time"],
.filter-row select,
.search-row input:not([type]),
.search-row input[type="text"],
.search-row input[type="search"],
.search-row select {
  width: auto;
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.85rem;
  background: var(--card);
}
.filter-row select { min-width: 150px; max-width: 100%; }
.filter-row input[type="date"],
.filter-row input[type="datetime-local"],
.filter-row input[type="month"],
.filter-row input[type="week"] { min-width: 150px; }
.filter-row input[type="number"] { min-width: 90px; max-width: 140px; }
.filter-row .btn,
.search-row .btn { min-height: 36px; }
.filter-row > label,
.filter-row .filter-label { margin: 0; }
@media (max-width: 560px) {
  .filter-row > input,
  .filter-row > select,
  .filter-row > label,
  .search-row > input { flex: 1 1 100%; width: 100%; min-width: 0; }
  .filter-row > label select,
  .filter-row > label input { width: 100%; }
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.search-input,
input[type="search"] {
  width: auto;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  min-width: 240px;
  max-width: 100%;
}
.search-input:focus, input[type="search"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.danger-zone-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.danger-zone-row > div { padding-top: 4px; }
@media (max-width: 640px) {
  .danger-zone-row { grid-template-columns: 1fr; }
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.plan-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}
.plan-card-current { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-light); }
.plan-card-selectable:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.plan-price { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; margin: 6px 0 12px; color: var(--ink); }
.plan-price .small { font-weight: 400; font-family: var(--font-body); }

.billing-toggle {
  display: inline-flex;
  background: var(--muted-bg);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
}
.billing-toggle-btn {
  border: none;
  background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
}
.billing-toggle-btn.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.billing-toggle-btn .badge { font-size: 0.62rem; padding: 1px 7px; }

.signup-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.signup-header { text-align: center; margin-bottom: 32px; }
.signup-logo { max-width: 220px; width: 100%; height: auto; margin-bottom: 12px; }
.signup-foot { text-align: center; margin-top: 20px; }

.plain-list { list-style: none; padding: 0; margin: 0 0 14px; text-align: left; }
.plain-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.88rem;
}
.plain-list li:last-child { border-bottom: none; }

.detail-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.detail-table th {
  text-align: left;
  padding: 9px 10px 9px 0;
  color: var(--ink-soft);
  font-weight: 600;
  width: 40%;
  vertical-align: top;
}
.detail-table td { padding: 9px 0; vertical-align: top; }
.detail-table tr { border-bottom: 1px solid var(--line-soft); }
.detail-table tr:last-child { border-bottom: none; }

.hidden { display: none !important; }

/* QR code page */
.link-copy-row { display: flex; gap: 8px; }
.link-copy-row input { flex: 1; font-family: var(--font-mono); font-size: 13px; }
.qr-card { text-align: center; }
.qr-preview-wrap { display: flex; justify-content: center; padding: 24px 0; }
.qr-preview-img {
  width: 260px; height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.qr-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

.embed-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.embed-preview-fab {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}
.embed-preview-fab img { width: 26px; height: 26px; }
.embed-code-wrap { display: flex; gap: 8px; align-items: flex-start; }
.embed-code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--brand-dark);
  color: #D6E4FB;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  resize: none;
  white-space: pre-wrap;
  word-break: break-all;
}

.doc-items-table { margin-bottom: 10px; }
.doc-items-head, .doc-item-row {
  display: grid;
  grid-template-columns: 2.2fr 0.7fr 1fr 1fr 32px;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
}
.doc-items-head { font-size: 0.75rem; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.doc-item-row input { margin: 0; padding: 7px 9px; font-size: 0.85rem; }
.doc-line-total { font-size: 0.85rem; font-weight: 600; text-align: right; padding-right: 8px; }
.doc-remove-row { background: none; border: none; color: var(--ink-faint); cursor: pointer; font-size: 0.9rem; }
.doc-remove-row:hover { color: var(--bad); }

.doc-totals { max-width: 280px; margin-left: auto; }
.doc-totals-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.88rem; color: var(--ink-soft); }
.doc-totals-final { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; font-size: 1.05rem; color: var(--ink); }

/* ============================================================
   v4: CRM depth — insights, scoring, follow-ups, timeline
   ============================================================ */

.funnel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.funnel-stage { text-align: center; }
.funnel-count {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.funnel-arrow { color: var(--ink-faint); font-size: 1.2rem; }

.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding: 8px 0;
}
.trend-bar-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.trend-bar {
  width: 100%;
  background: var(--brand);
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: background 0.15s ease;
}
.trend-bar-wrap:hover .trend-bar { background: var(--accent); }
.trend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--ink-faint);
  margin-top: 4px;
}

.rate-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
}
.rate-bar-wrap span { font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.rate-bar {
  height: 8px;
  background: var(--brand);
  border-radius: 999px;
  min-width: 2px;
  flex-shrink: 0;
}

.timeline { position: relative; padding-left: 20px; }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -15px; top: 14px; bottom: -4px;
  width: 1px;
  background: var(--line);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  position: absolute;
  left: -19px; top: 4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--card);
}
.timeline-content p { margin: 0 0 4px; font-size: 0.9rem; white-space: pre-wrap; }

.dup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.dup-row:last-of-type { border-bottom: none; }

.followup-list { display: flex; flex-direction: column; gap: 10px; }
.followup-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  flex-wrap: wrap;
}
.followup-card-main { display: flex; gap: 14px; align-items: flex-start; }
.followup-time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 68px;
  text-align: center;
}
.followup-time .muted { display: block; font-weight: 500; font-size: 0.7rem; }
.followup-card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.followup-reschedule { display: flex; gap: 6px; margin-top: 8px; width: 100%; }
.followup-reschedule input { margin: 0; padding: 6px 8px; font-size: 0.82rem; }

.kpi-warn { border-color: #F2CFC9; }
.kpi-warn .kpi-value { color: var(--bad); }

.dash-list { display: flex; flex-direction: column; gap: 8px; }
.dash-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.dash-row:last-child { border-bottom: none; }
.dash-row-actions { display: flex; gap: 6px; }

.quick-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.quick-filter {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.quick-filter:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.quick-filter.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.quick-actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.call-log-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.call-log-row select { margin: 0; max-width: 220px; }

/* ============================================================
   v5: activity timeline extras, tags, Kanban pipeline, bulk actions
   ============================================================ */

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 0.78rem;
  font-weight: 600;
}
.tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  font-size: 0.75rem;
  padding: 0;
  line-height: 1;
}
.tag-remove:hover { opacity: 1; }
.tag-add-form { display: flex; gap: 8px; align-items: center; }
.tag-add-form input { max-width: 240px; margin: 0; }

.container-wide { max-width: 1400px; }

.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.kanban-column {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 200px;
}
.kanban-column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--line);
}
.kanban-cards {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  transition: background 0.15s ease;
}
.kanban-cards.drag-over { background: var(--brand-light); }
.kanban-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
}
.kanban-card.dragging { opacity: 0.4; }
.kanban-card-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 3px; }
.kanban-card-meta { margin-bottom: 6px; }
.kanban-card-link { font-size: 0.78rem; font-weight: 600; display: inline-block; margin-top: 6px; }

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--brand-dark);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.bulk-bar select {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.82rem;
}
.bulk-bar span { font-size: 0.85rem; font-weight: 600; margin-right: 6px; }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.chart-card-wide { grid-column: span 2; }
.chart-card-head { margin-bottom: 10px; }
.chart-card-head h3 { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--ink); }
.chart-canvas-wrap { position: relative; height: 220px; }
.chart-card-wide .chart-canvas-wrap { height: 240px; }
.chart-empty-state {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
@media (max-width: 860px) {
  .chart-grid { grid-template-columns: 1fr; }
  .chart-card-wide { grid-column: span 1; }
}

/* ---------- Signup page redesign ---------- */

.signup-hero {
  background: linear-gradient(160deg, var(--brand-dark) 0%, var(--brand-darker) 100%);
  color: #fff;
  padding: 64px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.signup-hero::before {
  content: '';
  position: absolute;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14,165,233,0.22) 0%, transparent 70%);
  top: -220px; right: -160px;
}
.signup-hero::after {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26,86,219,0.18) 0%, transparent 70%);
  bottom: -200px; left: -140px;
}
.signup-hero-inner { position: relative; z-index: 1; max-width: 740px; margin: 0 auto; }
.signup-logo-light {
  max-width: 200px;
  width: 100%;
  height: auto;
  display: inline-block;
  background: #fff;
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: var(--shadow-md);
  margin-bottom: 28px;
}
.signup-hero-headline {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 14px;
}
.signup-hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.78);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.signup-hero-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.signup-hero-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}
.signup-hero-feature svg { flex-shrink: 0; stroke: #7DD3FC; }

.signup-shell { max-width: 1040px; margin: -48px auto 60px; padding: 0 20px; position: relative; z-index: 2; }
.signup-details-card { box-shadow: var(--shadow-md); }

.signup-plans-section { margin-top: 8px; text-align: center; }
.signup-section-title { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 6px; color: var(--ink); }
.signup-section-sub { color: var(--ink-soft); max-width: 560px; margin: 0 auto 24px; }

.signup-plan-grid { align-items: stretch; }
.signup-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding-top: 28px;
}
.signup-plan-card-recommended {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand), var(--shadow-md);
  transform: translateY(-6px);
}
.signup-plan-ribbon {
  position: absolute;
  top: -13px;
  left: 20px;
  background: var(--brand);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.signup-plan-capacity { margin-bottom: 10px; }
.signup-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  flex-grow: 1;
  text-align: left;
}
.signup-plan-features li {
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 5px 0;
}

/* Headline tagline per plan, e.g. "Capture Leads" / "Convert Leads" */
.signup-plan-headline {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 2px 0 14px;
}
.signup-plan-billed-note {
  font-size: 0.78rem;
  color: var(--ink-faint);
  min-height: 1.1em;
  margin: -6px 0 12px;
}

/* Starter and Growth deliberately do not look like siblings — Starter
   stays plain and quiet, Growth gets the brand-tinted, elevated
   treatment on top of the existing recommended-ribbon/shadow/transform
   already applied via .signup-plan-card-recommended. */
.starter-plan-card { background: var(--paper); }
.starter-plan-card .signup-plan-headline { color: var(--ink-soft); }
.growth-plan-card.signup-plan-card-recommended {
  background: linear-gradient(180deg, var(--brand-light) 0%, var(--card) 140px);
}
.growth-plan-card .plan-price-amount { font-size: 1.5em; }

.signup-usage-disclaimer { text-align: center; margin-top: 18px; }

.signup-addons-section { margin-top: 52px; text-align: center; }
.signup-addon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}
.signup-addon-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-align: left;
}
.signup-addon-card h4 { margin: 0 0 6px; font-size: 0.95rem; color: var(--ink); }
.signup-addon-price { margin: 10px 0 0; font-weight: 700; color: var(--brand); }

@media (max-width: 640px) {
  .signup-hero { padding: 48px 18px 64px; }
  .signup-hero-headline { font-size: 1.7rem; }
  .signup-plan-card-recommended { transform: none; }
}

.profile-avatar-row { display: flex; align-items: center; gap: 18px; }
.profile-avatar-img {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.profile-avatar-placeholder {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
}

.pwa-install-banner {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 500;
  background: var(--brand-dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
}
.pwa-install-banner-text { font-size: 0.85rem; display: flex; flex-direction: column; gap: 2px; }
.pwa-install-banner-text strong { font-size: 0.9rem; }
.pwa-install-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (min-width: 860px) {
  .pwa-install-banner { left: auto; right: 24px; bottom: 24px; width: 360px; }
}

.calendar-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.calendar-nav h2 { font-size: 1.15rem; margin: 0; }
.calendar-grid {
  display: flex; flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.calendar-weekday {
  flex: 0 0 14.28%; box-sizing: border-box;
  background: var(--paper); color: var(--ink-soft);
  font-size: 0.78rem; font-weight: 700; text-align: center;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.calendar-cell {
  flex: 0 0 14.28%; box-sizing: border-box;
  background: var(--card); min-height: 96px;
  padding: 6px; display: flex; flex-direction: column; gap: 3px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.calendar-cell-blank { background: var(--line-soft); }
.calendar-cell-today { background: var(--brand-light); }
.calendar-day-num { font-size: 0.82rem; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.calendar-cell-today .calendar-day-num { color: var(--brand); }
.calendar-chip {
  display: block; font-size: 0.68rem; line-height: 1.3;
  background: var(--brand); color: #fff;
  padding: 2px 5px; border-radius: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.calendar-chip-offline { background: var(--accent-dark); }
.calendar-more { font-size: 0.68rem; color: var(--ink-soft); padding: 1px 5px; }
@media (max-width: 700px) {
  .calendar-cell { min-height: 64px; }
  .calendar-weekday { font-size: 0.68rem; padding: 6px 2px; }
}

/* Internal Sales — Phase 1B pipeline */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.pipeline-column {
  min-width: 220px;
  background: var(--muted-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}
.pipeline-column-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 3px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.pipeline-deal {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.pipeline-deal a { color: var(--ink); }
.pipeline-deal a:hover { color: var(--brand); }
.pipeline-deal-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 4px;
  font-size: .82rem;
}
.pipeline-empty { padding: 12px 3px; }
@media (max-width: 1100px) {
  .pipeline-board { grid-template-columns: repeat(8, 220px); }
}


/* Landing-page brochure card (page editor). */
.brochure-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 4px 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--muted-bg);
}
.brochure-file-icon {
  flex-shrink: 0;
  width: 40px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: #D64545;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.brochure-file-meta { flex: 1; min-width: 0; }
.brochure-file-meta strong { display: block; overflow-wrap: anywhere; }
.brochure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.brochure-actions form { margin: 0; }
.brochure-settings .form-actions { padding-top: 12px; }

/* Auth brand panel — feature layout (user sign-in, 2026-09-25). */
.auth-panel-body { position: relative; z-index: 1; margin: 40px 0 32px; }
.auth-eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-panel-body .auth-panel-headline { max-width: 520px; font-size: 2.25rem; }
.auth-panel-body .auth-panel-sub { max-width: 500px; line-height: 1.6; }
.auth-channels { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; max-width: 540px; }
.auth-channel-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #D6E4FB;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.auth-channel-chip .icon { color: var(--accent); }
.auth-feature-grid {
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 580px;
}
.auth-feature {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  min-width: 0;
}
.auth-feature .icon { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.auth-feature strong { display: block; color: #fff; font-size: 0.88rem; font-weight: 700; }
.auth-feature span { display: block; color: #9FB2DC; font-size: 0.78rem; line-height: 1.45; margin-top: 3px; }
.auth-new-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 2px;
}
.auth-mobile-brand { display: none; }
@media (max-width: 1100px) {
  .auth-feature-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-panel-brand { padding: 48px 40px; }
}
@media (max-width: 860px) {
  /* The original hide rule sits above the base .auth-panel-brand rule, so it
     never won; phones got the whole brand panel before the sign-in form. */
  .auth-panel-brand { display: none; }
  .auth-panel-form { flex-direction: column; justify-content: flex-start; padding-top: 32px; }
  .auth-mobile-brand { display: block; text-align: center; margin: 0 0 20px; max-width: 360px; }
  .auth-mobile-logo { max-width: 180px; width: 100%; height: auto; }
  .auth-mobile-brand p { margin: 10px 0 0; font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: 1rem; }
}

/* Partner program (reseller portal + admin), 2026-09-26. */
.seat-choice { display: grid; gap: 10px; margin-top: 4px; }
.seat-option {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 400;
}
.seat-option input { margin-top: 3px; }
.seat-option > span { display: flex; flex-direction: column; gap: 2px; }
.seat-option:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.seat-option-disabled { opacity: 0.5; cursor: not-allowed; }
.partner-callout { border-left: 4px solid var(--brand); }
.partner-offer { border: 1px solid var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.partner-price-row { display: flex; flex-wrap: wrap; gap: 28px; margin: 6px 0 4px; }
.partner-price-row > div { display: flex; flex-direction: column; gap: 2px; }
.partner-price-row strong { font-family: var(--font-display); font-size: 1.2rem; }
.partner-total { color: var(--brand); }
.agreement-text {
  max-height: 420px; overflow-y: auto;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--muted-bg); font-size: 0.9rem; line-height: 1.6;
}
.partner-managed-card { border-left: 4px solid var(--brand); }
.stack-list { display: flex; flex-direction: column; }
.stack-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.stack-item:last-child { border-bottom: 0; }
.stack-item > strong, .stack-item > a { text-align: right; overflow-wrap: anywhere; }

/* ============================================================
   UI consistency fixes — 2026-09-24
   ============================================================ */

/* Sidebar section headings (user + admin navigation). The class was used in
   the nav partials but never defined, so headings rendered as large plain
   white text, misaligned with the links. */
.sidebar-section-label {
  padding: 16px 12px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7F95C4;
  user-select: none;
}
.sidebar-nav > .sidebar-section-label:first-child { padding-top: 4px; }

/* Wide tables in admin tools (e.g. Database Migrations) scroll inside their
   card instead of widening the page on small screens. */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mono { overflow-wrap: anywhere; }

/* Appointments — day timeline. */
.appointment-day-grid { display: flex; flex-direction: column; }
.appointment-hour {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  min-height: 44px;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
}
.appointment-hour:first-child { border-top: none; }
.appointment-hour > .muted { grid-column: 1; padding-top: 2px; white-space: nowrap; }
.appointment-slot-line { grid-column: 2; }
.appointment-hour > .appointment-card { grid-column: 2; }
.appointment-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 2px 0 6px;
  padding: 10px 12px;
  background: var(--brand-light);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
}
.appointment-card .badge-row { margin: 0; align-items: center; }
.appointment-card form { display: inline; margin: 0; }

/* Appointments — week view. */
.week-appointment-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}
.week-appointment-grid > .card { padding: 12px; margin: 0; min-width: 0; }
.week-appointment-grid h3 { font-size: 0.9rem; margin: 0 0 8px; }
.appointment-mini {
  font-size: 0.8rem;
  line-height: 1.35;
  padding: 6px 8px;
  margin-bottom: 6px;
  background: var(--brand-light);
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .week-appointment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .week-appointment-grid { grid-template-columns: minmax(0, 1fr); }
  .appointment-hour { grid-template-columns: 52px minmax(0, 1fr); }
}

/* Billing — AI credit meter and AI tier cards. */
.ai-credit-meter { margin-top: 14px; max-width: 420px; }
.ai-credit-meter-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--muted-bg);
  overflow: hidden;
}
.ai-credit-meter-bar > span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}
.ai-addon-card { display: flex; flex-direction: column; }
.plan-price-suffix { margin-left: 2px; }

/* ---- Business logo (Settings → Business Profile) + invoice UPI (2026-10-02) ---- */
.business-logo-row { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; flex-wrap: wrap; }
.business-logo-preview { width: 180px; height: 72px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; display: flex; align-items: center; justify-content: center; padding: 8px; flex-shrink: 0; }
.business-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.business-logo-preview.is-empty { background: var(--paper); border-style: dashed; }
.business-logo-actions { flex: 1; min-width: 220px; }
.business-logo-actions p { margin: 6px 0 0; }
.hint-warn { color: var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: var(--radius-sm); }
.upi-pay-panel { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.upi-pay-panel .upi-qr { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; background: #fff; line-height: 0; }
.upi-pay-panel dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 0.88rem; }
.upi-pay-panel dt { color: var(--ink-soft); }
.upi-pay-panel dd { margin: 0; font-weight: 600; word-break: break-all; }
.upi-report-alert { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.upi-report-alert form { display: inline-flex; gap: 8px; margin: 0; }

/* ---- Mini Store (owner pages) ---- */
.store-checklist { border-left: 4px solid var(--warn); }
.store-checklist h2 { margin-bottom: 6px; }
.store-checklist ul { margin: 0; padding-left: 20px; }
.store-checklist li { margin: 4px 0; }
.store-share-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.store-share-qr { line-height: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; background: #fff; }
.store-share-body { flex: 1; min-width: 260px; }
.store-share-body h2 { margin-bottom: 8px; }
.store-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; display: block; border: 1px solid var(--line); }
.store-thumb-empty { background: var(--paper); }
.store-slug-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.store-slug-row input { flex: 1; min-width: 160px; }
.store-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 12px; }
.store-photo { position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.store-photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.store-photo .badge { position: absolute; top: 6px; left: 6px; }
.store-photo-actions { display: flex; gap: 4px; padding: 6px; flex-wrap: wrap; }
.store-order-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.store-order-grid > * { min-width: 0; }
@media (min-width: 980px) { .store-order-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.store-order-grid .card { margin-bottom: 16px; }
.store-name-cell { min-width: 180px; max-width: 320px; white-space: normal; }
.store-row-actions .btn { margin-left: 2px; }

/* Super Admin → client page: welcome message delivery status */
.welcome-status h2 { margin-bottom: 10px; }
.welcome-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; font-size: 0.92rem; }
.welcome-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex-shrink: 0; }
.welcome-row[data-state="sending"] .welcome-dot { background: var(--info); animation: welcome-pulse 1s ease-in-out infinite; }
.welcome-row[data-state="sent"] .welcome-dot { background: var(--good); }
.welcome-row[data-state="failed"] .welcome-dot { background: var(--bad); }
.welcome-row[data-state="skipped"] .welcome-dot { background: var(--warn); }
@keyframes welcome-pulse { 50% { opacity: 0.3; } }
.welcome-row [hidden] { display: none !important; }

/* Mini Store → order page: next steps, WhatsApp preview, updates timeline */
.btn-danger-ghost { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn-danger-ghost:hover { background: var(--bad-bg); }
.order-step { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 10px; background: var(--card); }
.order-step > summary { cursor: pointer; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.order-step > summary::-webkit-details-marker { display: none; }
.order-step[open] > summary { border-bottom: 1px solid var(--line-soft); }
.order-step-title { font-weight: 600; color: var(--ink); }
.order-step-title::before { content: '▸'; display: inline-block; width: 1em; color: var(--ink-faint); transition: transform 0.15s; }
.order-step[open] > summary .order-step-title::before { transform: rotate(90deg); }
.order-step-title.is-danger { color: var(--bad); }
.order-step-form { padding: 4px 14px 14px; }
.order-step-form label { margin-top: 10px; }
.wa-preview { margin-top: 10px; background: #EFEAE2; border-radius: var(--radius-sm); padding: 10px 12px; }
.wa-preview[data-off] { opacity: 0.45; }
.wa-preview-head { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); margin-bottom: 6px; }
.wa-bubble { background: #DCF8C6; color: #111B21; border-radius: 8px 8px 8px 2px; padding: 8px 10px; font-size: 0.88rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); margin-bottom: 6px; }
.order-tl-msg .wa-bubble { white-space: normal; margin-top: 6px; }
.order-timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.order-tl-item { position: relative; padding: 0 0 14px 12px; }
.order-tl-item::before { content: ''; position: absolute; left: -23px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--brand); }
.order-tl-cancelled::before { border-color: var(--bad); }
.order-tl-delivered::before { background: var(--good); border-color: var(--good); }
.order-tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-tl-note { margin: 4px 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.order-tl-error { margin: 4px 0 0; color: var(--bad); }
.order-tl-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; margin-top: 6px; }
.order-tl-actions form { margin: 0; }
.order-tl-msg { flex-basis: 100%; }
.order-tl-msg summary { cursor: pointer; color: var(--brand); }
.wa-chip { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: var(--muted-bg); color: var(--ink-soft); white-space: nowrap; }
.wa-chip-ok { background: var(--good-bg); color: var(--good); }
.wa-chip-bad { background: var(--bad-bg); color: var(--bad); }
.order-ship-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 8px; font-size: 0.9rem; }
.order-ship-dl dt { color: var(--ink-soft); }
.order-ship-dl dd { margin: 0; overflow-wrap: anywhere; }

/* Sidebar: Mini Store highlighted with a pink-to-blue colour stripe */
.sidebar-link-feature {
  position: relative;
  margin: 4px 0;
  color: #FDF2F8;
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.22) 0%, rgba(59, 130, 246, 0.14) 100%);
  box-shadow: inset 0 0 0 1px rgba(244, 114, 182, 0.30);
  overflow: hidden;
}
.sidebar-link-feature::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #F472B6 0%, #A855F7 50%, #3B82F6 100%);
}
.sidebar-link-feature .icon { color: #F472B6; opacity: 1; }
.sidebar-link-feature:hover { color: #fff; background: linear-gradient(90deg, rgba(236, 72, 153, 0.32) 0%, rgba(59, 130, 246, 0.22) 100%); }
.sidebar-link-feature.active { color: #fff; background: linear-gradient(90deg, #DB2777 0%, #9333EA 55%, #2563EB 100%); box-shadow: none; }
.sidebar-link-feature.active .icon { color: #fff; }
.sidebar-link-feature.active::before { background: #FBCFE8; }
.nav-badge-store { background: #EC4899; color: #fff; }
.sidebar-link-feature.active .nav-badge-store { background: #fff; color: #BE185D; }
.nav-tag-new {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, #EC4899, #3B82F6);
}

/* Signup: free trial card */
.signup-trial-card { max-width: 820px; margin: 0 auto 40px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; padding: 26px 28px; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--brand-light), #fff 70%); border: 2px solid var(--brand); box-shadow: var(--shadow-md); }
.signup-trial-badge { display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; color: #fff; background: var(--brand); border-radius: 999px; padding: 4px 10px; margin-bottom: 10px; }
.signup-trial-copy h2 { font-family: var(--font-display); font-size: 1.35rem; margin: 0 0 6px; color: var(--ink); }
.signup-trial-copy p { color: var(--ink-soft); margin: 0 0 12px; font-size: 0.92rem; }
.signup-trial-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.85rem; color: var(--ink); }
.signup-trial-list li::before { content: '✓ '; color: var(--good); font-weight: 700; }
.signup-trial-action { text-align: center; }
.signup-trial-action .btn { font-size: 1rem; padding: 14px 18px; }
.signup-trial-action p { margin: 8px 0 0; }
@media (max-width: 720px) { .signup-trial-card { grid-template-columns: 1fr; padding: 22px 20px; } }
.signup-trial-hint { margin: -4px 0 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--good-bg); color: var(--good); font-size: 0.86rem; }
.signup-trial-hint a { color: var(--good); font-weight: 700; text-decoration: underline; }

/* Super Admin → Clients: quick chips, filter bar, table, pager */
.client-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.client-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.client-chip span { font-size: 0.75rem; font-weight: 700; color: var(--ink-faint); }
.client-chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.client-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.client-chip.active span { color: rgba(255, 255, 255, 0.8); }
.client-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 12px; margin-bottom: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.client-filters select, .client-filters input { width: auto; margin: 0; min-width: 0; font-size: 0.86rem; padding: 7px 10px; }
.client-filter-search { flex: 1 1 260px; }
.client-filter-search input { width: 100%; }
.client-filter-date { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: 0.72rem; font-weight: 600; color: var(--ink-soft); }
.client-table td { vertical-align: top; }
.client-table .num { text-align: right; }
.client-cell { min-width: 200px; max-width: 260px; white-space: normal; }
.client-name { font-weight: 700; color: var(--ink); }
.client-sub { display: block; font-size: 0.78rem; color: var(--ink-soft); margin-top: 2px; overflow-wrap: anywhere; }
.client-table tr.row-muted td { opacity: 0.6; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.pager-info { font-size: 0.86rem; color: var(--ink-soft); }
.pager-pages { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pager-btn { min-width: 36px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); font-size: 0.86rem; font-weight: 600; text-decoration: none; }
.pager-btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pager-btn.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager-btn.disabled { color: var(--ink-faint); background: var(--paper); }
.pager-gap { padding: 0 4px; color: var(--ink-faint); }
.pager-per label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); }
.pager-per select { width: auto; margin: 0; padding: 6px 8px; }
@media (max-width: 720px) {
  .client-filters select, .client-filters .client-filter-date { flex: 1 1 calc(50% - 8px); }
  .client-filters .client-filter-date input { width: 100%; }
  .pager { flex-direction: column; align-items: stretch; }
}

/* Super Admin → Dashboard */
.dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 980px) { .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .dash-kpis { grid-template-columns: minmax(0, 1fr); } }
.admin-dash a.kpi-card { text-decoration: none; color: inherit; }
.admin-dash a.kpi-card:hover { border-color: var(--brand); }
.dash-delta { font-weight: 700; }
.dash-delta.up { color: var(--good); }
.dash-delta.down { color: var(--bad); }
.dash-attention { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.dash-flag { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); font-size: 0.86rem; text-decoration: none; }
.dash-flag strong { color: var(--ink); font-size: 0.95rem; }
.dash-flag:hover { border-color: var(--brand); text-decoration: none; }
.dash-flag.warn { background: var(--warn-bg); border-color: #F5DDB0; }
.dash-flag.bad { background: var(--bad-bg); border-color: #F6C9C1; }
.chart-card-head p { margin: 2px 0 0; }
.chart-canvas-wrap.dash-tall { height: 280px; }
.chart-data { margin-top: 10px; font-size: 0.82rem; }
.chart-data summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.chart-data .table-wrap { margin-top: 8px; max-height: 260px; overflow: auto; }
.chart-data .num, .dash-lists .num { text-align: right; }
.dash-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-lists .card { margin: 0; }
.dash-lists h2 { font-size: 1rem; margin-bottom: 10px; }
@media (max-width: 860px) { .dash-lists { grid-template-columns: minmax(0, 1fr); } }
.client-table th, .client-table td { padding: 10px 8px; }
.client-table th:first-child, .client-table td:first-child { padding-left: 14px; }
.client-table td.wrap { white-space: normal; min-width: 96px; max-width: 140px; }
.client-table .client-actions { display: flex; flex-wrap: wrap; gap: 4px; min-width: 150px; white-space: normal; }
.client-table .client-actions form { margin: 0; }
.row-menu { display: inline-block; position: relative; }
.row-menu > summary { list-style: none; cursor: pointer; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 170px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.row-menu-pop form { margin: 0; }
.row-menu-pop button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 6px; font: inherit; font-size: 0.86rem; color: var(--ink); cursor: pointer; }
.row-menu-pop button:hover { background: var(--paper); }
tr:nth-last-child(-n+2):not(:first-child) .row-menu-pop { top: auto; bottom: calc(100% + 4px); }
.table-wrap:has(.client-table) { min-height: 150px; }

/* Landing pages: link row on cards and in the editor header */
.card-link-row { display: flex; gap: 6px; align-items: center; margin: 4px 0 8px; }
.card-link-row input { flex: 1; min-width: 0; margin: 0; padding: 6px 9px; font-size: 0.8rem; color: var(--ink-soft); background: var(--paper); }
.page-link-row { width: min(520px, 100%); margin-top: 8px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; text-decoration: underline; cursor: pointer; }
.next-steps h2 { font-size: 1.05rem; }
.next-steps-list { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.next-steps-list li { counter-increment: step; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.next-steps-list li::before { content: counter(step); width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 0.85rem; }
.next-steps-list li span { font-size: 0.85rem; color: var(--ink-soft); }
.next-steps-list li form { margin: 0; }
@media (max-width: 760px) { .next-steps-list { grid-template-columns: 1fr; } }

/* Share & get links dialog */
.share-dialog { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); color: var(--ink); background: var(--card); }
.share-dialog::backdrop { background: rgba(11, 23, 57, 0.55); }
.share-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px 12px; background: var(--card); border-bottom: 1px solid var(--line-soft); }
.share-head h2 { margin: 0; font-size: 1.15rem; }
.share-head p { margin: 4px 0 0; }
.share-close { border: 0; background: var(--paper); width: 34px; height: 34px; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink-soft); flex-shrink: 0; }
.share-body { padding: 16px 22px 22px; display: grid; gap: 18px; }
.share-body h3 { font-size: 0.95rem; margin: 0 0 8px; }
.share-label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.share-link-row { display: flex; gap: 6px; flex-wrap: wrap; }
.share-link-input { flex: 1 1 260px; min-width: 0; margin: 0; font-size: 0.88rem; }
.share-code { font-family: var(--font-mono); font-size: 0.78rem; }
.share-warn { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--warn-bg); color: #7A4E07; font-size: 0.88rem; }
.share-warn form { margin: 0; }
.share-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.share-channel { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.share-channel:first-of-type { border-top: 0; }
.share-channel-text { display: flex; flex-direction: column; min-width: 0; }
.share-channel-text strong { font-size: 0.9rem; }
.share-channel-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.share-qr { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); text-align: center; background: var(--paper); }
.share-qr-img { display: block; margin: 0 auto 8px; background: #fff; border-radius: 8px; padding: 6px; width: 180px; height: 180px; }
.share-qr p { margin: 0 0 10px; }
.share-foot { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.88rem; font-weight: 600; }
.btn.is-copied { border-color: var(--good); color: var(--good); }
.btn-primary.is-copied { background: var(--good); color: #fff; }
@media (max-width: 720px) {
  .share-grid { grid-template-columns: minmax(0, 1fr); }
  .share-channel { flex-direction: column; align-items: flex-start; }
  .share-channel-actions { justify-content: flex-start; }
  .share-head, .share-body { padding-left: 16px; padding-right: 16px; }
}

/* Settings → WhatsApp check */
.wa-check-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.wa-check-grid .card { margin: 0; }
.wa-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wa-check { display: flex; gap: 10px; align-items: flex-start; }
.wa-check > div { display: flex; flex-direction: column; gap: 2px; font-size: 0.9rem; }
.wa-check > div span { color: var(--ink-soft); font-size: 0.85rem; }
.wa-check-icon { flex: 0 0 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.8rem; }
.wa-check-good .wa-check-icon { background: var(--good-bg); color: var(--good); }
.wa-check-warn .wa-check-icon { background: var(--warn-bg); color: var(--warn); }
.wa-check-bad .wa-check-icon { background: var(--bad-bg); color: var(--bad); }
.wa-check-info .wa-check-icon { background: var(--info-bg); color: var(--info); }
.wa-test { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-soft); margin: 0; }
.wa-test > div { display: flex; flex-direction: column; }
.wa-summary { display: flex; gap: 24px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.wa-summary > div { display: flex; flex-direction: column; }
.wa-summary .kpi-value { font-size: 1.5rem; }
.wa-bad { color: var(--bad); }
.wa-err { color: var(--bad); white-space: normal; max-width: 360px; }
@media (max-width: 860px) { .wa-check-grid { grid-template-columns: minmax(0, 1fr); } }
