/* =========================================================
   JC MARK CRM — Estilos base
   Paleta derivada del logo JCmark Creative Solutions
   ========================================================= */

:root {
  /* Marca */
  --brand-pink: #E31C6F;
  --brand-pink-dark: #B8155A;
  --brand-pink-light: #FDE7EF;
  --brand-black: #1B1B1D;

  /* Neutros */
  --bg: #F6F6F8;
  --surface: #FFFFFF;
  --surface-alt: #FBFBFC;
  --border: #E7E7EC;
  --border-strong: #D8D8E0;
  --text: #1B1B1D;
  --text-muted: #6B6B76;
  --text-faint: #9A9AA5;

  /* Estados */
  --success: #17A672;
  --success-bg: #E8F8F1;
  --warning: #E08A00;
  --warning-bg: #FEF3E0;
  --danger: #E23B3B;
  --danger-bg: #FCEAEA;
  --info: #3B82C4;
  --info-bg: #EAF3FA;

  /* Tipografía */
  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  /* Layout */
  --sidebar-w: 248px;
  --header-h: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(27,27,29,0.06);
  --shadow-md: 0 6px 20px rgba(27,27,29,0.08);
  --shadow-lg: 0 16px 40px rgba(27,27,29,0.14);
  --transition: 160ms ease;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

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

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

/* ---------- Layout general ---------- */

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

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--brand-black);
  color: #F1F1F3;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform var(--transition);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar__brand img { height: 26px; width: auto; display: block; }

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.72);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }

.nav-item.is-active {
  background: var(--brand-pink);
  color: #fff;
}

.icon { width: 18px; height: 18px; flex-shrink: 0; display: block; }
.nav-item .icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar__footer {
  padding: 14px 20px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
  gap: 16px;
}

.topbar__title { font-size: 18px; }
.topbar__title span { display:block; font-family: var(--font-body); font-weight: 400; font-size: 12px; color: var(--text-muted); margin-top: 2px;}

.searchbox {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
}
.searchbox input {
  border: none; background: transparent; outline: none; width: 100%;
  font-size: 14px; color: var(--text);
}
.searchbox svg { width: 18px; height: 18px; color: var(--text-faint); flex-shrink: 0; }

.topbar__actions { display: flex; align-items: center; gap: 14px; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-pink-light); color: var(--brand-pink-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

.content {
  padding: 24px;
  max-width: 1400px;
  width: 100%;
}

.menu-toggle {
  display: none;
  background: none; border: none; color: var(--text);
}

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .searchbox { display: none; }
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary { background: var(--brand-pink); color: #fff; }
.btn-primary:hover { background: var(--brand-pink-dark); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--brand-pink); color: var(--brand-pink); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }

.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Cards / KPI ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card-pad { padding: 20px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-card__label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-card__value { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.kpi-card__accent { width: 34px; height: 34px; border-radius: 10px; display:flex; align-items:center; justify-content:center; margin-bottom: 4px; }

/* ---------- Secciones / grid utilidades ---------- */

.section { margin-bottom: 28px; }
.section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section__title { font-size: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Listas "Hoy" ---------- */

.today-list { display: flex; flex-direction: column; }
.today-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.today-item:last-child { border-bottom: none; }
.today-item__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.today-item__main { flex: 1; min-width: 0; }
.today-item__title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-item__sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.today-item__meta { font-size: 12px; color: var(--text-faint); flex-shrink: 0; }
.empty-state { padding: 28px 12px; text-align: center; color: var(--text-faint); font-size: 13.5px; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-nuevo        { background: var(--info-bg); color: var(--info); }
.badge-contactado   { background: #EDEAFB; color: #6B4FCB; }
.badge-interesado   { background: var(--warning-bg); color: var(--warning); }
.badge-cotizacion   { background: #FBEAFD; color: #A63BC4; }
.badge-negociacion  { background: var(--brand-pink-light); color: var(--brand-pink-dark); }
.badge-cliente,
.badge-ganado       { background: var(--success-bg); color: var(--success); }
.badge-perdido      { background: var(--danger-bg); color: var(--danger); }

.badge-baja  { background: var(--info-bg); color: var(--info); }
.badge-media { background: var(--warning-bg); color: var(--warning); }
.badge-alta  { background: var(--danger-bg); color: var(--danger); }

.badge-pendiente  { background: var(--info-bg); color: var(--info); }
.badge-completada { background: var(--success-bg); color: var(--success); }
.badge-vencida    { background: var(--danger-bg); color: var(--danger); }

/* ---------- Tablas ---------- */

.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.data-table thead th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition); cursor: pointer; }
.data-table tbody tr:hover { background: var(--surface-alt); }
.cell-strong { font-weight: 600; }
.cell-muted { color: var(--text-muted); }

.table-toolbar { display:flex; align-items:center; justify-content:space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-pills { display:flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-muted);
}
.pill.is-active { background: var(--brand-black); color: #fff; border-color: var(--brand-black); }

/* ---------- Formularios ---------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }
@media (max-width: 640px) { .field.span-2 { grid-column: span 1; } }

.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12px; color: var(--text-faint); }

.input, select.input, textarea.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  transition: border-color var(--transition);
}
.input:focus { outline: none; border-color: var(--brand-pink); box-shadow: 0 0 0 3px var(--brand-pink-light); }
textarea.input { resize: vertical; min-height: 80px; }

/* ---------- Modales ---------- */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,20,22,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px);
  transition: transform var(--transition);
}
.modal-overlay.is-open .modal { transform: translateY(0); }

.modal.modal-lg { max-width: 760px; }

.modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.modal__body { padding: 24px; }
.modal__footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--surface);
}

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-black);
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.login-card img.logo { height: 34px; margin-bottom: 28px; }
.login-card h1 { font-size: 20px; margin-bottom: 6px; }
.login-card p.sub { color: var(--text-muted); font-size: 13.5px; margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-error {
  background: var(--danger-bg); color: var(--danger);
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px;
  display: none;
}
.login-error.is-visible { display: block; }

/* ---------- Ficha de cliente ---------- */

.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--brand-pink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.profile-header__meta h2 { font-size: 20px; }
.profile-header__meta p { color: var(--text-muted); font-size: 13.5px; margin-top: 2px; }

.info-list { display: flex; flex-direction: column; gap: 12px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row .label { color: var(--text-muted); }
.info-row .value { font-weight: 600; text-align: right; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab-btn {
  padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none;
}
.tab-btn.is-active { color: var(--brand-pink); border-bottom-color: var(--brand-pink); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------- Timeline ---------- */

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content:''; position:absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before { content:''; position:absolute; left: -22px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-pink); border: 2px solid var(--surface); }
.timeline-item__text { font-size: 13.5px; }
.timeline-item__time { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* ---------- Misceláneo ---------- */

.text-muted { color: var(--text-muted); }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.w-full { width: 100%; }
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--brand-black); color: #fff; padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; box-shadow: var(--shadow-md); animation: toast-in 200ms ease;
}
.toast.toast-error { background: var(--danger); }
.toast.toast-success { background: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px);} to { opacity:1; transform: translateY(0);} }

.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--brand-pink);
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display:flex; align-items:center; justify-content:center; padding: 40px; }

/* ---------- Beta multiempresa / correo ---------- */
.org-chip { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--border); border-radius:999px; padding:6px 10px; font-size:12px; font-weight:600; color:var(--text-muted); background:var(--surface-alt); }
.org-chip small { font-size:9px; letter-spacing:.08em; color:var(--brand-pink-dark); }
.beta-banner { display:flex; gap:10px; align-items:flex-start; padding:14px 16px; background:var(--brand-pink-light); border:1px solid #f5bfd4; border-radius:var(--radius-md); margin-bottom:22px; font-size:13px; }
.beta-banner strong { white-space:nowrap; color:var(--brand-pink-dark); }
.beta-banner span { color:var(--text-muted); line-height:1.45; }
.connection-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:14px; }
.connection-empty { grid-column:1/-1; display:flex; flex-direction:column; gap:5px; padding:28px; border:1px dashed var(--border-strong); border-radius:var(--radius-md); color:var(--text-muted); background:var(--surface); }
.connection-empty strong { color:var(--text); }
.connection-card { display:flex; align-items:center; gap:12px; padding:16px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); }
.provider-mark { width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center; background:var(--brand-black); color:#fff; font-weight:700; flex-shrink:0; }
.connection-card__main { display:flex; flex-direction:column; min-width:0; flex:1; }
.connection-card__main strong { font-size:13.5px; }
.connection-card__main span,.connection-card__main small { color:var(--text-muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; }
.connection-status { display:inline-flex; align-items:center; border-radius:999px; padding:4px 9px; font-size:11px; font-weight:700; }
.connection-status.is-connected { background:var(--success-bg); color:var(--success); }
.provider-options { display:grid; gap:9px; }
.provider-option { display:flex; align-items:center; gap:12px; padding:12px; border:1px solid var(--border-strong); background:var(--surface); border-radius:var(--radius-sm); text-align:left; }
.provider-option span:last-child { display:flex; flex-direction:column; gap:2px; }
.provider-option small { color:var(--text-muted); }
.provider-option.is-selected { border-color:var(--brand-pink); box-shadow:0 0 0 3px var(--brand-pink-light); }
.secure-note { margin-top:16px; padding:11px 12px; border-radius:var(--radius-sm); background:var(--surface-alt); color:var(--text-muted); font-size:12px; line-height:1.5; }
.mini-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 0; border-bottom:1px solid var(--border); }
.mini-row:last-child { border-bottom:none; }
.mini-row>div { display:flex; flex-direction:column; gap:2px; }
.mini-row strong { font-size:13.5px; }
.mini-row span:not(.badge) { font-size:12px; color:var(--text-muted); }
.pipeline-settings-grid { display:grid; gap:14px; }
.pipeline-settings-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); padding:17px; }
.pipeline-settings-card__head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.pipeline-settings-card__head>div { display:flex; flex-direction:column; gap:3px; }
.pipeline-settings-card__head span:not(.badge) { font-size:12px; color:var(--text-muted); }
.stage-strip { display:flex; flex-wrap:wrap; gap:7px; margin-top:14px; }
.stage-strip span { display:inline-flex; align-items:center; gap:6px; padding:5px 8px; border:1px solid var(--border); border-radius:999px; font-size:11.5px; color:var(--text-muted); }
.stage-strip i { width:7px; height:7px; border-radius:50%; }
.pipeline-select { width:auto; min-width:190px; padding:7px 10px; }
@media(max-width:760px){ .org-chip{display:none}.beta-banner{flex-direction:column}.connection-grid{grid-template-columns:1fr} }

/* --- Identidad sidebar: logo blanco solo sobre fondo oscuro --- */
.sidebar-logo { width: 132px; max-width: 100%; height: auto; display:block; object-fit:contain; }
.sidebar__brand { min-height:64px; }

/* --- Asistente IA --- */
.ai-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr);gap:18px}.ai-hero{background:linear-gradient(135deg,#fff 0%,#fff7fa 100%);border:1px solid var(--border);border-radius:var(--radius-md);padding:22px}.ai-badge{display:inline-flex;align-items:center;gap:7px;background:var(--brand-pink-light);color:var(--brand-pink-dark);font-size:12px;font-weight:700;padding:6px 10px;border-radius:999px}.ai-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:18px}.ai-action{background:#fff;border:1px solid var(--border);border-radius:10px;padding:14px;text-align:left;transition:.16s}.ai-action:hover{border-color:var(--brand-pink);box-shadow:var(--shadow-sm)}.ai-action strong{display:block;font-size:13px;margin-bottom:4px}.ai-action span{font-size:12px;color:var(--text-muted)}.ai-chat{display:flex;flex-direction:column;min-height:430px}.ai-messages{flex:1;display:flex;flex-direction:column;gap:10px;overflow:auto;max-height:460px;padding:4px 0 14px}.ai-msg{max-width:88%;padding:11px 13px;border-radius:12px;font-size:13px;line-height:1.5;white-space:pre-wrap}.ai-msg.bot{background:var(--surface-alt);border:1px solid var(--border)}.ai-msg.user{align-self:flex-end;background:var(--brand-pink);color:#fff}.ai-compose{display:flex;gap:8px;border-top:1px solid var(--border);padding-top:14px}.ai-compose textarea{flex:1;min-height:72px;resize:vertical;border:1px solid var(--border);border-radius:10px;padding:11px}.ai-insight{padding:12px 0;border-bottom:1px solid var(--border);font-size:13px;line-height:1.45}.ai-insight:last-child{border-bottom:0}.ai-insight b{display:block;margin-bottom:3px}.ai-note{font-size:12px;color:var(--text-muted);margin-top:10px}@media(max-width:1000px){.ai-grid{grid-template-columns:1fr}.ai-actions{grid-template-columns:1fr}}

/* ---------- Email builder drag & drop ---------- */
.mini-row-button{width:100%;background:transparent;border:0;text-align:left;cursor:pointer}.mini-row-button:hover{background:var(--surface-alt);border-radius:8px;padding-left:8px;padding-right:8px}.modal-overlay-wide .modal{width:min(1180px,96vw);max-width:none}.email-builder-modal{height:min(850px,94vh);display:flex;flex-direction:column}.email-builder-modal form{display:flex;flex-direction:column;min-height:0;flex:1}.email-builder-top{display:grid;grid-template-columns:1fr 1.2fr 180px;gap:12px;padding:16px 18px;border-bottom:1px solid var(--border)}.email-builder{display:grid;grid-template-columns:180px minmax(0,1fr) 250px;min-height:0;flex:1;overflow:hidden}.builder-palette,.builder-properties{padding:16px;background:var(--surface-alt);overflow:auto}.builder-palette{border-right:1px solid var(--border)}.builder-properties{border-left:1px solid var(--border)}.builder-palette h4,.builder-properties h4{font-size:13px;margin:0}.builder-palette p{font-size:11.5px;color:var(--text-muted);margin:3px 0 12px}.builder-blocks{display:grid;grid-template-columns:1fr 1fr;gap:8px}.builder-block{display:flex;flex-direction:column;align-items:center;gap:6px;padding:10px 6px;border:1px solid var(--border);background:#fff;border-radius:9px;font-size:11px;cursor:grab}.builder-block span{font-weight:800;font-size:15px;color:var(--brand-pink)}.builder-block:hover{border-color:var(--brand-pink)}.builder-vars{margin-top:20px;padding-top:16px;border-top:1px solid var(--border)}.builder-vars h4{margin-bottom:8px}.builder-vars button{display:block;width:100%;text-align:left;border:1px solid var(--border);background:#fff;border-radius:7px;padding:7px 8px;margin-bottom:6px;font-size:11px;color:var(--text-muted)}.builder-stage-wrap{background:#eceef2;display:flex;flex-direction:column;min-width:0;overflow:hidden}.builder-stage-toolbar{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;background:#fff;border-bottom:1px solid var(--border);font-size:12px;font-weight:600}.builder-stage-shell{overflow:auto;padding:28px;flex:1}.builder-canvas{width:min(620px,100%);min-height:520px;margin:auto;background:#fff;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.08);padding:22px 0;transition:.2s}.builder-canvas.is-mobile{width:360px}.builder-canvas.is-dragover{outline:3px solid var(--brand-pink-light)}.builder-email-block{position:relative;margin:3px 14px;border:1px solid transparent;border-radius:8px;padding:8px 14px;cursor:pointer}.builder-email-block:hover{border-color:#f4bfd2}.builder-email-block.is-selected{border-color:var(--brand-pink);box-shadow:0 0 0 3px var(--brand-pink-light)}.builder-grip,.builder-delete{position:absolute;top:5px;border:0;background:#fff;border-radius:7px;box-shadow:0 2px 8px rgba(0,0,0,.1);width:26px;height:26px;display:none;align-items:center;justify-content:center;z-index:2}.builder-email-block:hover .builder-grip,.builder-email-block:hover .builder-delete,.builder-email-block.is-selected .builder-grip,.builder-email-block.is-selected .builder-delete{display:flex}.builder-grip{left:-10px;cursor:grab}.builder-delete{right:-10px;color:var(--danger);font-size:18px}.builder-block-preview{padding:5px 0;font-family:Arial,sans-serif;color:#333}.builder-block-preview p{line-height:1.55}.builder-preview-button{display:inline-block;background:var(--brand-pink);color:#fff;padding:10px 16px;border-radius:8px;font-weight:700}.builder-image-placeholder{padding:28px;text-align:center;background:var(--surface-alt);border:1px dashed var(--border-strong);border-radius:8px;color:var(--text-muted);font-size:12px}.builder-cols{display:grid;grid-template-columns:1fr 1fr;gap:12px}.builder-cols>div{padding:12px;background:var(--surface-alt);border-radius:7px}.builder-drop-empty{margin:28px;border:2px dashed var(--border-strong);border-radius:10px;padding:60px 20px;text-align:center;color:var(--text-muted)}.builder-empty-props{display:flex;flex-direction:column;gap:5px;font-size:12px;color:var(--text-muted)}.builder-empty-props strong{color:var(--text)}.builder-props-head{display:flex;justify-content:space-between;align-items:center;padding-bottom:10px;border-bottom:1px solid var(--border)}.builder-props-head strong{font-size:13px}.builder-props-head span{font-size:11px;color:var(--text-muted)}.builder-prop-textarea{min-height:100px;resize:vertical;padding:10px}.email-builder-modal .modal__footer{margin-top:auto}
@media(max-width:980px){.email-builder{grid-template-columns:150px minmax(0,1fr)}.builder-properties{position:absolute;right:0;top:0;bottom:0;width:250px;z-index:5;box-shadow:-8px 0 20px rgba(0,0,0,.08)}.email-builder-top{grid-template-columns:1fr 1fr}.email-builder-top .field:last-child{grid-column:1/-1}}@media(max-width:720px){.email-builder{grid-template-columns:1fr}.builder-palette{display:none}.builder-properties{display:none}.email-builder-top{grid-template-columns:1fr}.builder-stage-shell{padding:12px}}
.login-signup{margin:16px 0 0;text-align:center;font-size:13px;color:#777}.login-signup a{color:#e91e63;font-weight:700;text-decoration:none}.quote-total{font-family:Sora,sans-serif;font-size:28px;font-weight:700}.quote-preview{background:#fff;border:1px solid #e8e8ed;border-radius:16px;padding:32px;max-width:920px;margin:auto}.quote-preview__brand{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid #eee;padding-bottom:22px;margin-bottom:22px}.quote-preview__brand img{max-height:58px;max-width:190px}.quote-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 24px}.quote-line{display:grid;grid-template-columns:1fr 90px 120px 120px;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid #f0f0f3}.quote-line.header{font-weight:700;font-size:12px;color:#777;text-transform:uppercase}.quote-actions{display:flex;gap:10px;flex-wrap:wrap}.brand-preview{width:100%;min-height:130px;border:1px dashed #d8d8df;border-radius:12px;display:flex;align-items:center;justify-content:center;padding:16px}.brand-preview img{max-width:220px;max-height:90px}.team-role{font-size:12px;text-transform:capitalize}@media(max-width:800px){.quote-line{grid-template-columns:1fr 70px 90px}.quote-line>*:nth-child(3){display:none}.quote-summary-grid{grid-template-columns:1fr}}

/* ===== Final platform admin / branding additions ===== */
.modal-xl{max-width:1040px;width:min(1040px,96vw)}
.settings-section-title{font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--text-muted,#71717a);padding-bottom:9px;border-bottom:1px solid var(--border,#e8e8ec)}
.company-admin-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(330px,1fr));gap:16px}
.company-admin-card{min-height:210px}.company-admin-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.company-mini-logo{width:52px;height:52px;object-fit:contain;border:1px solid #eee;border-radius:12px;padding:6px;background:#fff}.company-logo-placeholder{width:52px;height:52px;border-radius:12px;display:grid;place-items:center;background:#f1f2f5;font-weight:800}.company-admin-metrics{display:flex;gap:18px;margin-top:18px;font-size:12px;color:#777}.company-admin-metrics b{color:#222}
#company-edit-modal .modal__body{max-height:72vh;overflow:auto}.brand-preview{min-height:130px;border:2px solid #eee;border-radius:16px;padding:24px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;background:#fff}.brand-preview img{max-width:220px;max-height:82px;object-fit:contain}
input[type="file"]{max-width:210px;font-size:12px}
