/* Fuentes del sistema — funciona sin internet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@700;800;900&display=swap');

/* ══════════════════════════════════════════
   BOBCAM CRM — Design System
   Theme: Dark Sidebar · Light Content · Premium
   ══════════════════════════════════════════ */

:root {
  --brand:        #2563eb;
  --brand-lt:     #3b82f6;
  --brand-dark:   #1d4ed8;
  --brand-bg:     #eff6ff;
  --brand-glow:   rgba(37,99,235,.18);
  --sb-bg:        #0f1623;
  --sb-bg2:       #151e2e;
  --sb-text:      rgba(255,255,255,.52);
  --sb-text-hov:  rgba(255,255,255,.9);
  --sb-border:    rgba(255,255,255,.07);
  --sb-active-bg: rgba(37,99,235,.16);
  --bg:           #f1f5f9;
  --bg-white:     #ffffff;
  --text:         #0f172a;
  --text-mid:     #334155;
  --text-muted:   #64748b;
  --border:       #e2e8f0;
  --border-mid:   #cbd5e1;
  --green:        #059669; --green-bg: #ecfdf5;
  --orange:       #d97706; --orange-bg: #fffbeb;
  --red:          #dc2626; --red-bg: #fef2f2;
  --purple:       #7c3aed; --purple-bg: #f5f3ff;
  --teal:         #0891b2; --teal-bg: #ecfeff;
  --gold:         #b45309; --gold-bg: #fef3c7;
  --shadow-xs:    0 1px 3px rgba(15,23,42,.06);
  --shadow-sm:    0 2px 8px rgba(15,23,42,.08);
  --shadow-md:    0 4px 20px rgba(15,23,42,.10);
  --shadow-lg:    0 12px 40px rgba(15,23,42,.13);
  --shadow-blue:  0 8px 24px rgba(37,99,235,.28);
  --sidebar-w:    260px;
  --topbar-h:     64px;
  --r:            10px;
  --r-lg:         16px;
  --r-xl:         20px;
  --ease:         .2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-stretch: normal;
  line-height: 1.6; overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Layout ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); height: 100vh;
  background: var(--sb-bg);
  position: fixed; top: 0; left: 0; z-index: 50;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--sb-border);
  overflow: hidden;
}
.main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.content { flex: 1; padding: 28px; }

/* ── Sidebar Logo ── */
.sidebar__logo {
  padding: 26px 20px 22px;
  border-bottom: 1px solid var(--sb-border);
}
.sidebar__logo-wrap { display: flex; align-items: center; gap: 12px; }
.sidebar__logo-mark {
  width: 44px; height: 44px; flex-shrink: 0;
  background: linear-gradient(145deg, #1d4ed8 0%, var(--brand) 55%, #3b82f6 100%);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(37,99,235,.45), inset 0 1px 0 rgba(255,255,255,.15);
  position: relative; overflow: hidden;
}
.sidebar__logo-mark::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,.12), transparent);
  border-radius: 13px 13px 0 0;
}
.sidebar__logo-mark svg { width: 24px; height: 24px; fill: #fff; position: relative; z-index: 1; }
.sidebar__brand {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 1.3rem; font-weight: 800;
  color: #fff; letter-spacing: -0.3px; line-height: 1;
  display: block;
}
.sidebar__brand em { color: #60a5fa; font-style: normal; }
.sidebar__tagline {
  font-size: .62rem; font-weight: 600;
  color: rgba(255,255,255,.28);
  letter-spacing: 1.8px; text-transform: uppercase;
  display: block; margin-top: 3px;
}

/* ── Sidebar Nav ── */
.sidebar__nav { flex: 1; padding: 16px 10px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; overflow-x: hidden; }
.sidebar__nav::-webkit-scrollbar { width: 4px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.sidebar__nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }
.nav-section { font-size: .6rem; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: rgba(255,255,255,.18); padding: 14px 12px 5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  font-size: .845rem; font-weight: 500;
  color: var(--sb-text);
  transition: all var(--ease);
  cursor: pointer; background: none; width: 100%; text-align: left;
  position: relative;
}
.nav-item__icon {
  width: 33px; height: 33px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: rgba(255,255,255,.06);
  transition: all var(--ease);
}
.nav-item__icon svg { width: 16px; height: 16px; fill: currentColor; }
.nav-item:hover { color: var(--sb-text-hov); background: rgba(255,255,255,.05); }
.nav-item:hover .nav-item__icon { background: rgba(255,255,255,.1); }
.nav-item.active { color: #fff; background: var(--sb-active-bg); font-weight: 600; }
.nav-item.active .nav-item__icon { background: var(--brand); box-shadow: 0 4px 12px rgba(37,99,235,.4); }
.nav-item.active::before {
  content: ''; position: absolute; left: -10px; top: 25%; bottom: 25%;
  width: 3px; background: var(--brand-lt); border-radius: 0 3px 3px 0;
}

/* ── Sidebar Footer ── */
.sidebar__footer { padding: 14px 16px; border-top: 1px solid var(--sb-border); }
.sidebar__footer-inner {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  background: rgba(255,255,255,.04); cursor: default;
}
.sidebar__footer-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.sidebar__footer-name { font-size: .78rem; font-weight: 600; color: rgba(255,255,255,.65); line-height: 1; }
.sidebar__footer-role { font-size: .66rem; color: rgba(255,255,255,.28); margin-top: 2px; }

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h); background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 40;
  box-shadow: var(--shadow-xs);
}
.topbar__title { font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 1.05rem; font-weight: 800; color: var(--text); }
.topbar__right { display: flex; align-items: center; gap: 10px; }
.topbar__btn {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--r);
  font-size: .83rem; font-weight: 600; transition: all var(--ease);
}
.topbar__btn--primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-blue); }
.topbar__btn--primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.topbar__btn svg { width: 15px; height: 15px; fill: currentColor; }

/* ── Cards ── */
.card {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
}
.card__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0; margin-bottom: 4px;
}
.card__title { font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: .95rem; font-weight: 800; color: var(--text); }
.card__body { padding: 16px 24px 24px; }

/* ── Stat Tiles ── */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.stat-tile {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px 22px 20px;
  box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
  transition: all var(--ease);
}
.stat-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-tile__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stat-tile__icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-tile__icon svg { width: 20px; height: 20px; }
.stat-tile__num { font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 1.9rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; letter-spacing: -0.5px; }
.stat-tile__label { font-size: .78rem; color: var(--text-muted); font-weight: 500; }
.stat-tile__stripe { position: absolute; top: 0; left: 0; width: 3px; height: 100%; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem; font-weight: 600; padding: 8px 16px;
  border-radius: var(--r); border: 1.5px solid transparent; transition: all var(--ease);
}
.btn svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }
.btn--sm { padding: 5px 11px; font-size: .75rem; border-radius: 7px; }
.btn--primary { background: var(--text); color: #fff; border-color: var(--text); }
.btn--primary:hover { background: var(--text-mid); }
.btn--blue { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 2px 8px rgba(37,99,235,.22); }
.btn--blue:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow-blue); }
.btn--outline { background: transparent; color: var(--text-mid); border-color: var(--border-mid); }
.btn--outline:hover { border-color: var(--text-mid); color: var(--text); background: var(--bg); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); padding: 6px 8px; }
.btn--ghost:hover { background: var(--bg); color: var(--text); }
.btn--danger { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.btn--danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn--full { width: 100%; justify-content: center; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 20px;
}
.badge::before { content:''; width:5px;height:5px;border-radius:50%;flex-shrink:0; }
.badge--lead       { background:#f1f5f9; color:#475569; } .badge--lead::before{background:#94a3b8;}
.badge--cotizado   { background:var(--orange-bg); color:var(--orange); } .badge--cotizado::before{background:var(--orange);}
.badge--aprobado   { background:var(--brand-bg); color:var(--brand); } .badge--aprobado::before{background:var(--brand);}
.badge--instalando { background:var(--purple-bg); color:var(--purple); } .badge--instalando::before{background:var(--purple);}
.badge--cobrado    { background:var(--green-bg); color:var(--green); } .badge--cobrado::before{background:var(--green);}
.badge--cancelado  { background:var(--red-bg); color:var(--red); } .badge--cancelado::before{background:var(--red);}
.badge--pendiente  { background:#f1f5f9; color:#64748b; } .badge--pendiente::before{background:#94a3b8;}
.badge--programado { background:var(--teal-bg); color:var(--teal); } .badge--programado::before{background:var(--teal);}
.badge--en_proceso { background:var(--purple-bg); color:var(--purple); } .badge--en_proceso::before{background:var(--purple);}
.badge--completado { background:var(--green-bg); color:var(--green); } .badge--completado::before{background:var(--green);}
.badge--garantia   { background:var(--gold-bg); color:var(--gold); } .badge--garantia::before{background:var(--gold);}
.badge--residencial{ background:var(--brand-bg); color:var(--brand); } .badge--residencial::before{background:var(--brand);}
.badge--comercial  { background:var(--orange-bg); color:var(--orange); } .badge--comercial::before{background:var(--orange);}
.badge--empresa    { background:var(--purple-bg); color:var(--purple); } .badge--empresa::before{background:var(--purple);}

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
thead tr { border-bottom: 2px solid var(--border); background: #fafbfc; }
th { padding: 11px 16px; text-align: left; font-size: .67rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--ease); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
td { padding: 13px 16px; color: var(--text-mid); vertical-align: middle; }
td strong { color: var(--text); font-weight: 600; }
.td-actions { display: flex; gap: 5px; }

/* ── Filters ── */
.filters { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-white); border: 1.5px solid var(--border);
  border-radius: var(--r); padding: 0 12px;
  flex: 1; min-width: 220px; transition: border-color var(--ease);
}
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.search-box svg { width: 15px; height: 15px; fill: var(--text-muted); flex-shrink: 0; }
.search-box input { border: none; background: transparent; padding: 9px 0; font-size: .86rem; color: var(--text); outline: none; width: 100%; }
.filter-select { border: 1.5px solid var(--border); border-radius: var(--r); padding: 9px 12px; font-size: .84rem; color: var(--text-mid); background: var(--bg-white); outline: none; transition: border-color var(--ease); }
.filter-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group--full { grid-column: 1 / -1; }
.form-label { font-size: .68rem; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--text-muted); }
.form-control {
  background: var(--bg); border: 1.5px solid var(--border); color: var(--text);
  border-radius: var(--r); padding: 9px 13px; font-size: .88rem; outline: none;
  transition: border-color var(--ease), box-shadow var(--ease); width: 100%;
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); background: var(--bg-white); }
textarea.form-control { resize: vertical; min-height: 82px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.52);
  backdrop-filter: blur(4px); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-white); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  animation: modal-in .22s cubic-bezier(.34,1.56,.64,1);
}
.modal--lg { max-width: 700px; }
@keyframes modal-in { from{opacity:0;transform:scale(.95) translateY(10px)} to{opacity:1;transform:none} }
.modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 0; margin-bottom: 20px;
}
.modal__title { font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 1.1rem; font-weight: 800; color: var(--text); }
.modal__close {
  width: 30px; height: 30px; border-radius: 8px; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--text-muted); transition: all var(--ease);
}
.modal__close:hover { background: var(--red-bg); color: var(--red); }
.modal__body { padding: 0 28px 28px; }

.session-warning {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--orange-bg); border: 1px solid #fde68a;
  border-radius: var(--r); padding: 16px; margin-bottom: 18px;
}
.session-warning__icon {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--orange); color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-family: 'Outfit', 'Inter', system-ui, sans-serif;
}
.session-warning__text { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.session-warning__muted { font-size: .84rem; color: var(--text-muted); }

/* ── Detail ── */
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.detail-name { font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.meta-item { display: flex; align-items: center; gap: 5px; font-size: .82rem; color: var(--text-muted); }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab { padding: 9px 18px; font-size: .83rem; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--ease); background: none; border-left: none; border-right: none; border-top: none; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.info-item { display: flex; flex-direction: column; gap: 3px; }
.info-label { font-size: .66rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); }
.info-value { font-size: .9rem; color: var(--text); font-weight: 500; }

/* ── Activity ── */
.activity-feed { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.activity-dot svg { width: 14px; height: 14px; fill: #fff; }
.activity-dot--nota{background:var(--text-muted);} .activity-dot--llamada{background:var(--green);}
.activity-dot--visita{background:var(--brand);} .activity-dot--cotizacion{background:var(--orange);} .activity-dot--instalacion{background:var(--purple);}
.activity-text { font-size: .83rem; color: var(--text-mid); line-height: 1.55; }
.activity-date { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

/* ── Kanban ── */
.kanban { display: grid; grid-template-columns: repeat(6,minmax(168px,1fr)); gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.kanban-col { display: flex; flex-direction: column; gap: 8px; min-width: 165px; }
.kanban-col__hdr { padding: 9px 12px; border-radius: var(--r); font-size: .67rem; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; text-align: center; }
.kanban-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--r); padding: 13px 15px; box-shadow: var(--shadow-xs); cursor: pointer; transition: all var(--ease); }
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-mid); }
.kanban-card__folio { font-size: .67rem; font-weight: 700; color: var(--text-muted); margin-bottom: 5px; letter-spacing: -0.3px; }
.kanban-card__name { font-size: .86rem; font-weight: 600; color: var(--text); margin-bottom: 8px; line-height: 1.35; }
.kanban-card__monto { font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 1rem; font-weight: 800; color: var(--brand); }
.kanban-card__pkg { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

/* ── Misc ── */
.empty { text-align: center; padding: 48px 24px; }
.empty svg { width: 48px; height: 48px; fill: var(--border); margin: 0 auto 12px; }
.empty p { color: var(--text-muted); font-size: .9rem; }
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: .83rem; font-weight: 500; box-shadow: var(--shadow-lg); min-width: 220px; animation: toast-in .22s cubic-bezier(.34,1.56,.64,1); }
.toast--success{background:var(--green);} .toast--error{background:var(--red);}
@keyframes toast-in{from{opacity:0;transform:translateX(24px) scale(.95)}to{opacity:1;transform:none}}
.section-title { font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: .9rem; font-weight: 800; color: var(--text); margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; font-size: .73rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.text-muted { color: var(--text-muted); font-size: .83rem; }
.text-money { font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-weight: 800; color: var(--text); }
.loading { text-align: center; padding: 60px 24px; color: var(--text-muted); font-size: .9rem; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.loading::before { content:''; width:32px;height:32px;border-radius:50%;border:3px solid var(--border);border-top-color:var(--brand);animation:spin .7s linear infinite; }
@keyframes spin{to{transform:rotate(360deg)}}
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 1.35rem; font-weight: 800; color: var(--text); }
.page-sub { font-size: .8rem; color: var(--text-muted); font-weight: 500; margin-top: 2px; }
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.inst-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--bg); border-radius: var(--r); border: 1px solid var(--border); transition: all var(--ease); }
.inst-row:hover { border-color: var(--border-mid); box-shadow: var(--shadow-xs); }
.inst-row__name { font-size: .87rem; font-weight: 600; color: var(--text); }
.inst-row__sub  { font-size: .73rem; color: var(--text-muted); margin-top: 1px; }

@media(max-width:1100px){.stats-row{grid-template-columns:repeat(2,1fr)}.dash-grid-2{grid-template-columns:1fr}}
@media(max-width:900px){.info-grid,.form-grid{grid-template-columns:1fr}.form-group--full{grid-column:1}}
@media(max-width:768px){:root{--sidebar-w:0px}.sidebar{transform:translateX(-260px)}.main{margin-left:0}.stats-row{grid-template-columns:1fr 1fr}.content{padding:16px}}

/* ── Pipeline full-screen layout ── */
.content--pipeline,
.content--pos {
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  height: calc(100vh - var(--topbar-h)) !important;
  overflow: hidden !important;
}

.pipe-topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 18px 12px;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 10px;
}

.pipe-topbar__main,
.pipe-toolbar,
.pipe-actions,
.pipe-summary,
.pipe-title {
  display: flex;
  align-items: center;
}

.pipe-topbar__main {
  justify-content: space-between;
  gap: 16px;
}

.pipe-title {
  gap: 10px;
  min-width: 210px;
}

.pipe-title__icon {
  width: 28px;
  height: 28px;
  display: none;
  place-items: center;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 900;
}

.pipe-title__text {
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  font-size: .92rem;
  font-weight: 800;
  color: #0f172a;
}

.pipe-title__sub {
  font-size: .75rem;
  color: #64748b;
  margin-top: 1px;
}

.pipe-actions {
  gap: 8px;
}

.pipe-view {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid #dbe3ee;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  font-weight: 800;
}

.pipe-view--active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
  cursor: default;
}

.pipe-toolbar {
  gap: 10px;
  flex-wrap: wrap;
}

.pipe-search,
.pipe-filter {
  height: 33px;
  border: 1px solid #dbe3ee;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: .82rem;
}

.pipe-search {
  min-width: 240px;
  flex: 1;
  padding: 0 11px;
}

.pipe-filter {
  width: 170px;
  padding: 0 8px;
}

.pipe-summary {
  gap: 10px;
  color: #64748b;
  font-size: .78rem;
  white-space: nowrap;
}

.pipe-summary strong {
  color: #0f172a;
}

.pipe-board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  overflow-x: auto;
  overflow-y: hidden;
  background: #f8fafc;
}

.pipe-col {
  min-width: 160px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
}

.pipe-col__header {
  padding: 12px 10px 9px;
  flex-shrink: 0;
  background: #fff;
  border-top: 3px solid var(--stage-color);
  border-bottom: 1px solid #edf2f7;
}

.pipe-col__name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .82rem;
  font-weight: 800;
  color: #0f172a;
}

.pipe-col__name strong {
  min-width: 24px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: .72rem;
}

.pipe-col__meta {
  margin-top: 3px;
  color: #64748b;
  font-size: .7rem;
  font-weight: 600;
}

.pipe-col__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 7px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pipe-card {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
  transition: box-shadow .15s, border-color .15s, transform .15s;
}

.pipe-card:hover {
  box-shadow: 0 4px 12px rgba(15,23,42,.1);
  border-color: #bdd0e8;
  transform: translateY(-1px);
}

.pipe-card__top,
.pipe-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pipe-card__folio {
  font-size: .68rem;
  font-weight: 800;
  color: #2563eb;
  margin-bottom: 2px;
}

.pipe-card__client {
  font-size: .82rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pipe-card__avatar {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: .65rem;
  font-weight: 900;
}

.pipe-card__amount {
  margin-top: 8px;
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  font-size: .96rem;
  font-weight: 900;
  color: #0f172a;
}

.pipe-card__amount span {
  font-size: .68rem;
  color: #64748b;
  font-weight: 700;
}

.pipe-card__details {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.pipe-card__details span {
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 2px 6px;
  color: #64748b;
  background: #f8fafc;
  font-size: .64rem;
  font-weight: 700;
}

.pipe-card__footer {
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #edf2f7;
}

.pipe-card__link,
.pipe-card__muted {
  font-size: .68rem;
  font-weight: 700;
}

.pipe-card__link {
  color: #059669;
  text-decoration: none;
}

.pipe-card__muted {
  color: #94a3b8;
}

.pipe-card__actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.pipe-card__action {
  width: 23px;
  height: 23px;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 900;
}

.pipe-card__action:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

.pipe-card__action--primary { color: #2563eb; }
.pipe-card__action--success { color: #059669; }
.pipe-card__action--danger { color: #dc2626; }

.pipe-empty {
  border: 1px dashed #dbe3ee;
  border-radius: 8px;
  padding: 16px 8px;
  color: #94a3b8;
  background: rgba(255,255,255,.65);
  text-align: center;
  font-size: .74rem;
  font-weight: 700;
}

.pipe-add {
  width: 100%;
  padding: 7px;
  border: 1.5px dashed #d1dae6;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s;
}

.pipe-add:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}

@media (max-width: 900px) {
  .pipe-topbar {
    padding: 10px 14px;
  }

  .pipe-topbar__main {
    align-items: flex-start;
    flex-direction: column;
  }

  .pipe-actions {
    width: 100%;
  }

  .pipe-search,
  .pipe-filter {
    width: 100%;
    min-width: 0;
  }

  .pipe-board {
    grid-template-columns: repeat(6, minmax(190px, 190px));
  }
}

/* ── Lightbox fade-in ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
