/* Made by: Bert Rendon */
/* vabcv-erp-demo - Visual mockup of VabcV-ERP */
/* main.css - Estilos modulares. Stack: HTML5 + CSS3 vanilla. */

/* ===== RESET + BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: 'Avenir Next', 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #f4f7fa;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; font-size: inherit; color: inherit; }

/* ===== AB BLUE DESIGN TOKENS ===== */
:root {
  --ab-sidebar: #0b3d5c;
  --ab-sidebar-hover: #0e486d;
  --ab-sidebar-active: #145c85;
  --ab-sidebar-text: #d6e9f5;
  --ab-sidebar-text-dim: #8fb0c4;
  --ab-primary: #2094c7;
  --ab-primary-hover: #1d7fa8;
  --ab-primary-dark: #156a8c;
  --ab-accent: #5ec5f0;
  --ab-accent-light: #d6edf7;
  --ab-amber: #f59e0b;
  --ab-amber-light: #fff4e0;
  --ab-amber-dark: #854f0b;
  --ab-green: #17a34a;
  --ab-green-light: #d1f4dd;
  --ab-red: #dc2626;
  --ab-bg: #f8fafb;
  --ab-white: #ffffff;
  --ab-text: #003d66;
  --ab-text-body: #1a2634;
  --ab-text-muted: #6b7a85;
  --ab-text-dim: #9ba7b0;
  --ab-border: #e4ebf0;
  --ab-border-strong: #ccd8e0;
  --ab-row-hover: #f1f6f9;
  --ab-radius: 4px;
  --ab-radius-lg: 8px;
}

/* ===== LAYOUT PRINCIPAL ===== */
.app {
  display: grid;
  grid-template-columns: 64px 240px 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "nav secondary topbar"
    "nav secondary main";
  height: 100vh;
  overflow: hidden;
}

/* ===== PRIMARY SIDEBAR (64px icon-only) ===== */
.nav-primary {
  grid-area: nav;
  background: var(--ab-sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border-right: 1px solid rgba(0,0,0,0.08);
  z-index: 10;
}
.nav-logo {
  width: 64px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ab-sidebar);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-logo-box {
  width: 36px;
  height: 36px;
  background: var(--ab-accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ab-sidebar);
  font-weight: 700;
  font-size: 16px;
}
.nav-items {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  width: 100%;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  color: var(--ab-sidebar-text-dim);
  cursor: pointer;
  font-size: 10.5px;
  gap: 3px;
  width: 100%;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  text-align: center;
  line-height: 1.2;
  position: relative;
}
.nav-item:hover {
  background: var(--ab-sidebar-hover);
  color: #fff;
}
.nav-item.active {
  background: var(--ab-sidebar-hover);
  color: #fff;
  border-left-color: var(--ab-accent);
}
.nav-item svg {
  width: 22px;
  height: 22px;
  display: block;
}
.nav-item.coming {
  opacity: 0.55;
}
.nav-item-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  background: var(--ab-amber);
  color: #1a1a1a;
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  letter-spacing: 0.02em;
}
.nav-spacer { flex: 1; }
.nav-bottom {
  width: 100%;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 8px 0;
}

/* ===== SECONDARY SIDEBAR (240px expandable) ===== */
.nav-secondary {
  grid-area: secondary;
  background: var(--ab-white);
  border-right: 1px solid var(--ab-border);
  overflow-y: auto;
  padding: 14px 0;
}
.nav-sec-title {
  padding: 6px 18px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ab-text-muted);
  text-transform: uppercase;
}
.nav-sec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 18px;
  color: var(--ab-text-body);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.12s;
  border-left: 3px solid transparent;
}
.nav-sec-item:hover { background: var(--ab-bg); }
.nav-sec-item.active {
  background: var(--ab-accent-light);
  color: var(--ab-text);
  font-weight: 600;
  border-left-color: var(--ab-primary);
}
.nav-sec-item svg {
  width: 16px;
  height: 16px;
  color: var(--ab-text-muted);
}
.nav-sec-divider {
  margin: 14px 18px;
  border-top: 1px solid var(--ab-border);
}
.nav-sec-badge {
  background: var(--ab-amber-light);
  color: var(--ab-amber-dark);
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}

/* ===== TOP BAR ===== */
.topbar {
  grid-area: topbar;
  background: var(--ab-white);
  border-bottom: 1px solid var(--ab-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 20px;
  z-index: 5;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ab-text);
}
.topbar-brand-tag {
  font-size: 11px;
  color: var(--ab-text-muted);
  font-weight: 400;
  padding: 3px 8px;
  background: var(--ab-bg);
  border-radius: 4px;
  border: 1px solid var(--ab-border);
}
.topbar-search {
  flex: 1;
  max-width: 560px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  height: 36px;
  background: var(--ab-bg);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 0 14px 0 36px;
  font-size: 13.5px;
  color: var(--ab-text-body);
  font-family: inherit;
  transition: all 0.15s;
}
.topbar-search input:focus {
  outline: none;
  border-color: var(--ab-primary);
  background: var(--ab-white);
  box-shadow: 0 0 0 3px rgba(32, 148, 199, 0.15);
}
.topbar-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ab-text-muted);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ab-text-body);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--ab-radius);
}
.topbar-contact:hover { background: var(--ab-bg); }
.topbar-contact-dot {
  width: 6px;
  height: 6px;
  background: var(--ab-red);
  border-radius: 50%;
}
.topbar-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ab-radius);
  color: var(--ab-text-muted);
  cursor: pointer;
  position: relative;
  transition: background 0.12s;
}
.topbar-icon:hover { background: var(--ab-bg); }
.topbar-icon svg { width: 18px; height: 18px; }
.topbar-icon-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--ab-red);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}
.topbar-avatar {
  width: 32px;
  height: 32px;
  background: var(--ab-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== MAIN CONTENT ===== */
.main {
  grid-area: main;
  overflow-y: auto;
  padding: 24px 32px 0;
  background: var(--ab-bg);
  display: flex;
  flex-direction: column;
}
.main-content { flex: 1; }
.view { display: none; }
.view.active { display: block; }

/* ===== DASHBOARD: HEADER ===== */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.dash-greeting {
  font-size: 22px;
  font-weight: 500;
  color: var(--ab-text);
}
.dash-actions-right {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--ab-text-muted);
}
.dash-actions-right span {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--ab-radius);
}
.dash-actions-right span:hover { background: var(--ab-white); }

/* ===== APP CHIPS ===== */
.app-chips {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  overflow-x: auto;
  padding: 4px 0;
}
.app-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 12px;
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
  font-weight: 500;
  color: var(--ab-text-body);
}
.app-chip:hover {
  border-color: var(--ab-primary);
  box-shadow: 0 2px 8px rgba(11, 61, 92, 0.1);
}
.app-chip.coming { opacity: 0.6; }
.app-chip-icon {
  width: 28px;
  height: 28px;
  background: var(--ab-sidebar);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ab-accent);
  font-size: 13px;
  font-weight: 700;
}

/* ===== DEMO BANNER ===== */
.demo-banner {
  background: var(--ab-accent-light);
  border: 1px solid var(--ab-accent);
  border-radius: var(--ab-radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  position: relative;
}
.demo-banner.hidden { display: none; }
.demo-banner-icon { font-size: 22px; }
.demo-banner-text { flex: 1; font-size: 13.5px; color: var(--ab-text); line-height: 1.5; }
.demo-banner-text strong { font-weight: 600; }
.demo-banner-text a { color: var(--ab-primary); font-weight: 600; margin-left: 8px; cursor: pointer; }
.demo-banner-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ab-text-muted);
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
}
.demo-banner-close:hover { background: rgba(11, 61, 92, 0.08); }

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ab-text);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-title a { color: var(--ab-primary); font-size: 13px; font-weight: 500; cursor: pointer; }

/* ===== BUSINESS FEED ===== */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.feed-card {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 18px 20px;
  position: relative;
  transition: all 0.2s;
  cursor: pointer;
}
.feed-card:hover {
  border-color: var(--ab-primary);
  box-shadow: 0 2px 10px rgba(11, 61, 92, 0.06);
}
.feed-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.feed-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ab-text);
}
.feed-card-title .feed-icon-sq {
  width: 22px; height: 22px;
  background: var(--ab-sidebar);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ab-accent);
  font-size: 12px;
  font-weight: 700;
}
.feed-card-dots { color: var(--ab-text-muted); cursor: pointer; }
.feed-card-body {
  font-size: 13px;
  color: var(--ab-text-body);
  line-height: 1.55;
  margin-bottom: 12px;
}
.feed-card-link {
  color: var(--ab-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== CREATE ACTIONS (pills) ===== */
.create-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.create-actions-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ab-text);
  margin-right: 4px;
}
.action-pill {
  padding: 7px 14px;
  background: var(--ab-white);
  border: 1px solid var(--ab-border-strong);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ab-text-body);
  cursor: pointer;
  transition: all 0.15s;
}
.action-pill:hover {
  background: var(--ab-accent-light);
  border-color: var(--ab-primary);
  color: var(--ab-text);
}
.action-pill-link {
  color: var(--ab-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 4px;
}

/* ===== BUSINESS AT A GLANCE ===== */
.glance-row {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  margin-bottom: 28px;
}
.glance-card {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 20px 24px;
}
.glance-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.glance-subtitle {
  font-size: 11.5px;
  color: var(--ab-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.glance-period {
  font-size: 12.5px;
  color: var(--ab-text-muted);
  padding: 4px 10px;
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== FUNNEL ===== */
.funnel {
  display: grid;
  grid-template-columns: 1fr 20px 1fr 20px 1fr 20px 1fr;
  gap: 0;
  align-items: center;
}
.funnel-step {
  padding: 14px;
  border-top: 4px solid var(--ab-green);
  background: var(--ab-white);
  border-right: 1px solid var(--ab-border);
  border-bottom: 1px solid var(--ab-border);
  border-left: 1px solid var(--ab-border);
  border-radius: 6px;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.funnel-step:first-child {
  border-top-color: var(--ab-primary);
  background: var(--ab-accent-light);
}
.funnel-step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ab-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.funnel-step-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--ab-text);
  line-height: 1.1;
}
.funnel-step-sub {
  font-size: 11.5px;
  color: var(--ab-green);
  margin-top: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.funnel-step-sub.muted { color: var(--ab-text-muted); }
.funnel-arrow {
  color: var(--ab-border-strong);
  font-size: 18px;
  text-align: center;
  font-weight: 300;
}

/* ===== BANK ACCOUNTS ===== */
.bank-card {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 18px 20px;
}
.bank-row {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ab-border);
}
.bank-row:last-child { border-bottom: none; }
.bank-icon {
  width: 32px; height: 32px;
  background: var(--ab-accent-light);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ab-primary);
  flex-shrink: 0;
}
.bank-info { flex: 1; min-width: 0; }
.bank-name { font-size: 13px; font-weight: 600; color: var(--ab-text-body); }
.bank-sub { font-size: 11.5px; color: var(--ab-text-muted); line-height: 1.4; }
.bank-amounts { text-align: right; font-size: 12.5px; }
.bank-amount-big { font-size: 13px; font-weight: 600; color: var(--ab-text); }
.bank-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--ab-green);
  font-weight: 500;
  margin-top: 2px;
}
.bank-status.warn { color: var(--ab-amber); }

/* ===== METRICS ===== */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.metric-card {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 16px 18px;
  transition: all 0.15s;
}
.metric-card:hover {
  border-color: var(--ab-primary);
  box-shadow: 0 2px 8px rgba(11, 61, 92, 0.06);
}
.metric-label {
  font-size: 11.5px;
  color: var(--ab-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 6px;
}
.metric-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--ab-text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.metric-sub {
  font-size: 11.5px;
  color: var(--ab-text-muted);
  margin-top: 4px;
}
.metric-card.alert {
  background: var(--ab-amber-light);
  border-color: var(--ab-amber);
}
.metric-card.alert .metric-label,
.metric-card.alert .metric-value { color: var(--ab-amber-dark); }
.metric-card.placeholder {
  background: var(--ab-bg);
  border-style: dashed;
  opacity: 0.75;
}
.metric-card.placeholder .metric-value {
  font-size: 14px;
  font-style: italic;
  color: var(--ab-text-muted);
  font-weight: 400;
}

/* ===== PAGE HEADER (vistas no-dashboard) ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.page-title {
  font-size: 22px;
  font-weight: 500;
  color: var(--ab-text);
}
.page-subtitle {
  font-size: 13px;
  color: var(--ab-text-muted);
  margin-top: 2px;
}

/* ===== BOTONES ===== */
.btn-primary {
  background: var(--ab-primary);
  color: #fff;
  padding: 9px 18px;
  border-radius: var(--ab-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover { background: var(--ab-primary-hover); }
.btn-secondary {
  padding: 9px 16px;
  background: var(--ab-white);
  color: var(--ab-text-body);
  border: 1px solid var(--ab-border-strong);
  border-radius: var(--ab-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--ab-bg); }

/* ===== COMING SOON PLACEHOLDER (vistas no implementadas en Sub-1) ===== */
.coming-card {
  background: var(--ab-white);
  border: 1px dashed var(--ab-border-strong);
  border-radius: var(--ab-radius-lg);
  padding: 60px 40px;
  text-align: center;
  max-width: 720px;
  margin: 40px auto;
}
.coming-icon {
  font-size: 48px;
  margin-bottom: 18px;
}
.coming-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--ab-text);
  margin-bottom: 10px;
}
.coming-tag {
  display: inline-block;
  background: var(--ab-amber-light);
  color: var(--ab-amber-dark);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.coming-body {
  font-size: 14px;
  color: var(--ab-text-muted);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 22px;
}
.coming-list {
  display: inline-block;
  text-align: left;
  font-size: 13.5px;
  color: var(--ab-text-body);
  line-height: 1.9;
}
.coming-list li { list-style: none; padding-left: 22px; position: relative; }
.coming-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--ab-primary);
  font-weight: 700;
}

/* ===== FOOTER ===== */
.app-footer {
  border-top: 1px solid var(--ab-border);
  padding: 14px 0;
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ab-text-muted);
}
.app-footer .footer-brand {
  color: var(--ab-text);
  font-weight: 600;
}
.app-footer .footer-version {
  font-family: 'SF Mono', Menlo, monospace;
  background: var(--ab-bg);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--ab-text-muted);
}

/* ===== MODAL DEMO ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 61, 92, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--ab-radius-lg);
  max-width: 520px;
  width: 90%;
  padding: 0;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  overflow: hidden;
}
.modal-head {
  padding: 18px 24px;
  background: var(--ab-accent-light);
  border-bottom: 1px solid var(--ab-accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ab-text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-close {
  font-size: 22px;
  color: var(--ab-text-muted);
  cursor: pointer;
  line-height: 1;
}
.modal-body {
  padding: 22px 24px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ab-text-body);
}
.modal-body p { margin-bottom: 10px; }
.modal-body strong { color: var(--ab-text); }
.modal-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--ab-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== SCROLLBARS ===== */
.main::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb { background: #cfd8df; border-radius: 5px; }
.main::-webkit-scrollbar-thumb:hover { background: #aeb9c2; }
.nav-secondary::-webkit-scrollbar { width: 6px; }
.nav-secondary::-webkit-scrollbar-thumb { background: #d8dde1; border-radius: 3px; }

/* ===== STATS GRID (top of each view) ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card-label {
  font-size: 11.5px;
  color: var(--ab-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.stat-card-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--ab-text);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.stat-card-sub { font-size: 12px; color: var(--ab-text-muted); }
.stat-card.alert { background: var(--ab-amber-light); border-color: var(--ab-amber); }
.stat-card.alert .stat-card-label,
.stat-card.alert .stat-card-value { color: var(--ab-amber-dark); }
.stat-card.success { background: var(--ab-green-light); border-color: var(--ab-green); }
.stat-card.success .stat-card-label,
.stat-card.success .stat-card-value { color: #0d6e31; }
.stat-card.info { background: var(--ab-accent-light); border-color: var(--ab-accent); }
.stat-card.info .stat-card-label,
.stat-card.info .stat-card-value { color: var(--ab-text); }

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--ab-border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 10px 18px;
  font-size: 13.5px;
  color: var(--ab-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  font-weight: 500;
}
.tab:hover { color: var(--ab-text-body); }
.tab.active {
  color: var(--ab-primary);
  border-bottom-color: var(--ab-primary);
  font-weight: 600;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-search {
  flex: 1;
  min-width: 240px;
  max-width: 360px;
  position: relative;
}
.filter-search input {
  width: 100%;
  height: 36px;
  background: var(--ab-white);
  border: 1px solid var(--ab-border-strong);
  border-radius: var(--ab-radius);
  padding: 0 14px 0 36px;
  font-size: 13.5px;
  color: var(--ab-text-body);
  font-family: inherit;
}
.filter-search input:focus {
  outline: none;
  border-color: var(--ab-primary);
  box-shadow: 0 0 0 3px rgba(32, 148, 199, 0.12);
}
.filter-search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--ab-text-muted);
}
.filter-select {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-select label {
  font-size: 11.5px;
  color: var(--ab-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filter-select select,
.filter-select input[type="date"] {
  padding: 8px 28px 8px 12px;
  border: 1px solid var(--ab-border-strong);
  border-radius: var(--ab-radius);
  background: var(--ab-white);
  font-family: inherit;
  font-size: 13px;
  color: var(--ab-text-body);
  cursor: pointer;
  min-width: 140px;
}
.filter-select select { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.filter-checkbox {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ab-text-body); cursor: pointer;
}
.filter-spacer { flex: 1; }

/* ===== DATA TABLE (generalización de .inv-table) ===== */
.data-table-wrap {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table thead { background: var(--ab-bg); }
.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ab-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--ab-border);
  white-space: nowrap;
}
.data-table th.num { text-align: right; }
.data-table th.center { text-align: center; }
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ab-border);
  color: var(--ab-text-body);
  vertical-align: middle;
}
.data-table tbody tr { cursor: pointer; transition: background 0.12s; }
.data-table tbody tr:hover { background: var(--ab-row-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.data-table td.center { text-align: center; }
.data-table td.muted { color: var(--ab-text-muted); }
.data-table td.strong { font-weight: 600; color: var(--ab-text); }
.data-table td.positive { color: var(--ab-green); font-weight: 600; }
.data-table td.negative { color: var(--ab-amber-dark); font-weight: 600; }
.data-table .hash {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--ab-text-muted);
  background: var(--ab-bg);
  padding: 2px 6px;
  border-radius: 3px;
}

.table-footer {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ab-bg);
  border-top: 1px solid var(--ab-border);
  font-size: 13px;
  color: var(--ab-text-muted);
}

/* ===== STATUS PILLS (extiende sub-1) ===== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.status-pill-dot { width: 6px; height: 6px; border-radius: 50%; }
.status-pill.paid,
.status-pill.active,
.status-pill.deposited,
.status-pill.ok       { background: var(--ab-green-light); color: #0d6e31; }
.status-pill.paid .status-pill-dot,
.status-pill.active .status-pill-dot,
.status-pill.deposited .status-pill-dot,
.status-pill.ok .status-pill-dot       { background: var(--ab-green); }
.status-pill.pending,
.status-pill.issued,
.status-pill.warn,
.status-pill.low      { background: var(--ab-amber-light); color: var(--ab-amber-dark); }
.status-pill.pending .status-pill-dot,
.status-pill.issued .status-pill-dot,
.status-pill.warn .status-pill-dot,
.status-pill.low .status-pill-dot      { background: var(--ab-amber); }
.status-pill.overdue,
.status-pill.empty,
.status-pill.danger,
.status-pill.inactive { background: #fde6e6; color: #9a1b1b; }
.status-pill.overdue .status-pill-dot,
.status-pill.empty .status-pill-dot,
.status-pill.danger .status-pill-dot,
.status-pill.inactive .status-pill-dot { background: var(--ab-red); }
.status-pill.draft,
.status-pill.neutral  { background: #eceff3; color: #556470; }
.status-pill.draft .status-pill-dot,
.status-pill.neutral .status-pill-dot  { background: #6b7a85; }
.status-pill.info     { background: var(--ab-accent-light); color: var(--ab-text); }
.status-pill.info .status-pill-dot     { background: var(--ab-primary); }

/* ===== ROW ACTIONS ===== */
.row-actions {
  display: inline-flex;
  gap: 8px;
  color: var(--ab-primary);
  font-weight: 500;
  font-size: 13px;
}
.row-actions a { cursor: pointer; }
.row-actions a:hover { text-decoration: underline; }
.row-sep { color: var(--ab-border-strong); }

/* ===== EMPTY STATE ===== */
.empty-state {
  padding: 60px 30px;
  text-align: center;
  color: var(--ab-text-muted);
  background: var(--ab-white);
  border: 1px dashed var(--ab-border-strong);
  border-radius: var(--ab-radius-lg);
}
.empty-state-icon { font-size: 32px; opacity: 0.6; margin-bottom: 12px; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--ab-text-body); margin-bottom: 6px; }
.empty-state-body { font-size: 13px; }

/* ===== DRAWER (slide-in derecha) ===== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 61, 92, 0.32);
  display: none;
  z-index: 90;
}
.drawer-overlay.active { display: block; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 480px;
  max-width: 92vw;
  background: var(--ab-white);
  box-shadow: -8px 0 30px rgba(0,0,0,0.12);
  transform: translateX(100%);
  transition: transform 0.22s ease-out;
  display: flex;
  flex-direction: column;
  z-index: 95;
}
.drawer.active { transform: translateX(0); }
.drawer-head {
  padding: 18px 22px;
  background: var(--ab-accent-light);
  border-bottom: 1px solid var(--ab-accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-head h3 { font-size: 16px; font-weight: 600; color: var(--ab-text); }
.drawer-close { font-size: 22px; color: var(--ab-text-muted); cursor: pointer; line-height: 1; }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
}
.drawer-foot {
  padding: 12px 22px;
  border-top: 1px solid var(--ab-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== DETAIL ROWS (en drawer / modal) ===== */
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--ab-border);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .detail-label { color: var(--ab-text-muted); font-weight: 500; }
.detail-row .detail-value { color: var(--ab-text-body); font-weight: 600; text-align: right; }
.detail-row .detail-value.hash {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 400;
  word-break: break-all;
  max-width: 60%;
}
.detail-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--ab-border);
}
.detail-section h4 {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ab-text-muted);
  margin-bottom: 10px;
}

/* ===== FORMS ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row.full { grid-column: 1 / -1; }
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ab-text-body);
  letter-spacing: 0.01em;
}
.form-label .req { color: var(--ab-red); }
.form-input,
.form-select,
.form-textarea {
  padding: 9px 12px;
  border: 1px solid var(--ab-border-strong);
  border-radius: var(--ab-radius);
  background: var(--ab-white);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ab-text-body);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--ab-primary);
  box-shadow: 0 0 0 3px rgba(32, 148, 199, 0.12);
}
.form-textarea { min-height: 70px; resize: vertical; }
.form-help { font-size: 11.5px; color: var(--ab-text-muted); }
.form-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ab-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ab-border);
}

/* ===== TOGGLE SWITCH ===== */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle-track {
  width: 36px;
  height: 20px;
  background: var(--ab-border-strong);
  border-radius: 999px;
  position: relative;
  transition: background 0.15s;
}
.toggle-thumb {
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute; top: 2px; left: 2px;
  transition: left 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.toggle.active .toggle-track { background: var(--ab-primary); }
.toggle.active .toggle-thumb { left: 18px; }
.toggle-label { font-size: 13px; color: var(--ab-text-body); }

/* ===== LIST ROWS (integraciones) ===== */
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  background: var(--ab-white);
  margin-bottom: 10px;
}
.list-row-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--ab-accent-light);
  color: var(--ab-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.list-row-info { flex: 1; min-width: 0; }
.list-row-title { font-size: 14px; font-weight: 600; color: var(--ab-text); }
.list-row-sub { font-size: 12px; color: var(--ab-text-muted); margin-top: 2px; }

/* ===== CHART PLACEHOLDER ===== */
.chart-placeholder {
  background: linear-gradient(180deg, var(--ab-white), var(--ab-bg));
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 24px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--ab-text-muted);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.chart-placeholder-svg { width: 100%; height: 160px; }
.chart-placeholder-label { font-size: 12px; }

/* ===== BREAKDOWN MINI-TABLES ===== */
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.breakdown-card {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 16px 18px;
}
.breakdown-card h4 {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ab-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--ab-border);
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row .lbl { color: var(--ab-text-body); }
.breakdown-row .val { color: var(--ab-text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ===== SECTION CARD (genérico) ===== */
.section-card {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.section-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ab-text);
  margin-bottom: 14px;
}

/* ===== BADGE small inline ===== */
.badge-inline {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--ab-accent-light);
  color: var(--ab-text);
  letter-spacing: 0.02em;
  vertical-align: middle;
  margin-left: 6px;
}
.badge-inline.amber { background: var(--ab-amber-light); color: var(--ab-amber-dark); }
.badge-inline.red { background: #fde6e6; color: #9a1b1b; }

/* ===== INVOICE PREVIEW (modal nueva factura) ===== */
.invoice-preview {
  background: var(--ab-bg);
  border: 1px dashed var(--ab-border-strong);
  border-radius: var(--ab-radius);
  padding: 16px;
  font-size: 12.5px;
}
.invoice-preview .line {
  display: grid;
  grid-template-columns: 2fr 50px 70px 70px;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--ab-border);
}
.invoice-preview .line:last-child { border-bottom: none; }
.invoice-preview .line .num { text-align: right; font-variant-numeric: tabular-nums; }
.invoice-totals {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ab-border-strong);
  font-size: 13px;
}
.invoice-totals .row {
  display: flex; justify-content: space-between; padding: 3px 0;
}
.invoice-totals .row.total {
  font-weight: 700; color: var(--ab-text); font-size: 15px;
  border-top: 1px solid var(--ab-border-strong);
  margin-top: 6px; padding-top: 6px;
}

/* ===== STEPPER (modal multi-paso) ===== */
.stepper {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ab-border);
}
.stepper-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ab-text-muted);
}
.stepper-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ab-bg);
  color: var(--ab-text-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 11px;
  border: 1px solid var(--ab-border-strong);
}
.stepper-step.active .stepper-num {
  background: var(--ab-primary); color: #fff; border-color: var(--ab-primary);
}
.stepper-step.active { color: var(--ab-text); font-weight: 600; }
.stepper-step.done .stepper-num { background: var(--ab-green); color: #fff; border-color: var(--ab-green); }

/* ===== INTEGRITY CHECK (Kardex hash chain) ===== */
.integrity-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}
.integrity-check.ok { background: var(--ab-green-light); color: #0d6e31; }
.integrity-check.fail { background: #fde6e6; color: #9a1b1b; }

/* ===== MODAL FORM (extiende modal-box) ===== */
.modal-box.lg { max-width: 720px; }
.modal-box.xl { max-width: 880px; }

/* ===== WAVE 2 BANNER ===== */
.wave2-banner {
  background: linear-gradient(135deg, var(--ab-accent-light), var(--ab-bg));
  border: 1px solid var(--ab-accent);
  border-radius: var(--ab-radius-lg);
  padding: 16px 20px;
  margin-bottom: 22px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.wave2-banner-icon { font-size: 28px; line-height: 1; }
.wave2-banner-text { flex: 1; font-size: 13.5px; color: var(--ab-text); line-height: 1.55; }
.wave2-banner-text strong { font-weight: 700; }

/* ===== PAYMENT GATEWAY CARDS ===== */
.gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.gateway-card {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.15s;
}
.gateway-card:hover {
  border-color: var(--ab-primary);
  box-shadow: 0 2px 8px rgba(11, 61, 92, 0.06);
}
.gateway-head { display: flex; align-items: center; gap: 12px; }
.gateway-icon {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: var(--ab-accent-light);
  color: var(--ab-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.gateway-name { font-size: 15px; font-weight: 600; color: var(--ab-text); }
.gateway-region { font-size: 11.5px; color: var(--ab-text-muted); margin-top: 2px; }
.gateway-meta {
  font-size: 12.5px;
  color: var(--ab-text-body);
  line-height: 1.55;
  padding-top: 10px;
  border-top: 1px solid var(--ab-border);
}
.gateway-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}
.gateway-fee {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ab-text);
  text-align: right;
}
.gateway-actions { display: flex; gap: 8px; }
.gateway-actions .btn-secondary,
.gateway-actions .btn-primary { flex: 1; justify-content: center; }

/* ===== ACCOUNT TREE (Plan de cuentas) ===== */
.account-tree {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  overflow: hidden;
  list-style: none;
  margin: 0;
}
.account-tree-item {
  display: grid;
  grid-template-columns: 80px 1fr 200px;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--ab-border);
  font-size: 13.5px;
  align-items: center;
  list-style: none;
}
.account-tree-item:last-child { border-bottom: none; }
.account-tree-item.group { background: var(--ab-bg); font-weight: 600; color: var(--ab-text); }
.account-tree-item.level-0 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.account-tree-item.level-1 { padding-left: 36px; color: var(--ab-text-body); }
.account-tree-item.level-2 { padding-left: 60px; color: var(--ab-text-body); font-weight: 400; }
.account-tree-item .acc-code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--ab-text-muted);
  background: var(--ab-bg);
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
  text-transform: none;
  letter-spacing: 0;
  width: fit-content;
}
.account-tree-item.group .acc-code { background: var(--ab-accent-light); color: var(--ab-text); font-weight: 700; }
.account-tree-item .acc-balance {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* ===== COUNTRY CARDS (Multi-país) ===== */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.country-card {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 18px 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.country-card.active {
  border-color: var(--ab-primary);
  background: linear-gradient(180deg, var(--ab-accent-light), var(--ab-white));
}
.country-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.country-flag { font-size: 32px; line-height: 1; }
.country-name { font-size: 15px; font-weight: 600; color: var(--ab-text); }
.country-code { font-size: 11px; color: var(--ab-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.country-info-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 12.5px;
  border-bottom: 1px dashed var(--ab-border);
}
.country-info-row:last-of-type { border-bottom: none; }
.country-info-row .lbl { color: var(--ab-text-muted); }
.country-info-row .val { color: var(--ab-text-body); font-weight: 500; }
.country-card .country-actions { margin-top: 8px; }

/* ===== PRICING CARDS ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
}
.pricing-card {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 24px 22px 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}
.pricing-card.featured {
  border-color: var(--ab-primary);
  box-shadow: 0 6px 22px rgba(32, 148, 199, 0.18);
  transform: translateY(-4px);
}
.pricing-card.featured::before {
  content: 'POPULAR';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ab-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 12px;
  border-radius: 999px;
}
.pricing-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ab-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.pricing-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 10px;
}
.pricing-price {
  font-size: 36px;
  font-weight: 700;
  color: var(--ab-text);
  line-height: 1;
}
.pricing-currency { font-size: 16px; color: var(--ab-text-muted); font-weight: 500; }
.pricing-period { font-size: 13px; color: var(--ab-text-muted); font-weight: 400; }
.pricing-meta {
  font-size: 12.5px;
  color: var(--ab-text-muted);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ab-border);
}
.pricing-features {
  font-size: 13px;
  list-style: none;
  flex: 1;
  margin-bottom: 18px;
  padding: 0;
}
.pricing-features li {
  padding: 5px 0 5px 22px;
  color: var(--ab-text-body);
  position: relative;
  line-height: 1.5;
}
.pricing-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 5px;
  color: var(--ab-green);
  font-weight: 700;
}

/* ===== SCORE BADGE (CxC) ===== */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 12px;
}
.score-badge.A { background: var(--ab-green-light); color: #0d6e31; }
.score-badge.B { background: var(--ab-accent-light); color: var(--ab-text); }
.score-badge.C { background: var(--ab-amber-light); color: var(--ab-amber-dark); }
.score-badge.D { background: #fde6e6; color: #9a1b1b; }

/* ===========================================================
   WHATSAPP SALES ASSISTANT (Ola 2.5)
   =========================================================== */

/* WhatsApp official-ish colors */
:root {
  --wa-green:        #25D366;
  --wa-green-dark:   #1da856;
  --wa-bubble-out:   #d9fdd3;
  --wa-bubble-in:    #ffffff;
  --wa-wallpaper:    #efeae2;
  --wa-tick:         #34b7f1;
  --wa-text:         #111b21;
  --wa-text-muted:   #667781;
  --wa-divider:      rgba(0,0,0,0.06);
}

/* ===== WA: Layout split 320px + 1fr ===== */
.wa-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  overflow: hidden;
  background: var(--ab-white);
  height: 600px;
  max-height: calc(100vh - 280px);
  margin-bottom: 18px;
}

/* ===== WA: Sidebar (lista conversaciones) ===== */
.wa-sidebar {
  border-right: 1px solid var(--ab-divider);
  display: flex;
  flex-direction: column;
  background: var(--ab-white);
  min-height: 0;
}
.wa-sidebar-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--ab-divider);
  background: var(--ab-bg);
}
.wa-sidebar-head h4 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ab-text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wa-count-badge {
  background: var(--wa-green);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}
.wa-search-input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--ab-border-strong);
  border-radius: 999px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 12.5px;
  background: var(--ab-white);
  color: var(--ab-text-body);
}
.wa-search-input:focus {
  outline: none;
  border-color: var(--wa-green);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}
.wa-conv-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.wa-conv-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ab-divider);
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
  transition: background 0.12s;
}
.wa-conv-item:hover { background: var(--ab-bg); }
.wa-conv-item.active {
  background: var(--ab-accent-light);
  border-left: 3px solid var(--wa-green);
  padding-left: 11px;
}

.wa-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--ab-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  position: relative;
  letter-spacing: 0;
}
.wa-avatar.online::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 12px; height: 12px;
  background: var(--wa-green);
  border: 2px solid var(--ab-white);
  border-radius: 50%;
}

.wa-conv-info {
  flex: 1;
  min-width: 0;
}
.wa-conv-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ab-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wa-conv-last {
  font-size: 12px;
  color: var(--ab-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.wa-conv-segment {
  font-size: 10px;
  color: var(--ab-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.wa-conv-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.wa-conv-time {
  font-size: 10.5px;
  color: var(--ab-text-muted);
  white-space: nowrap;
}
.wa-unread-badge {
  background: var(--wa-green);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* ===== WA: Chat panel ===== */
.wa-chat {
  display: flex;
  flex-direction: column;
  background-color: var(--wa-wallpaper);
  background-image:
    radial-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,0.025) 1px, transparent 1px);
  background-size: 36px 36px, 36px 36px;
  background-position: 0 0, 18px 18px;
  min-height: 0;
}

.wa-chat-head {
  padding: 12px 18px;
  background: var(--ab-bg);
  border-bottom: 1px solid var(--ab-divider);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}
.wa-chat-head .wa-chat-info { flex: 1; min-width: 0; }
.wa-chat-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ab-text);
}
.wa-chat-status {
  font-size: 11.5px;
  color: var(--ab-text-muted);
}
.wa-chat-status.online { color: var(--wa-green); font-weight: 600; }
.wa-chat-head-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.wa-chat-head-actions .btn-primary,
.wa-chat-head-actions .btn-secondary { padding: 6px 12px; font-size: 12.5px; }

.wa-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

@keyframes wa-bubble-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wa-bubble {
  max-width: 75%;
  padding: 7px 12px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--wa-text);
  position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
  word-wrap: break-word;
  animation: wa-bubble-in 0.25s ease-out backwards;
}
.wa-bubble strong { font-weight: 600; }
.wa-bubble.inbound {
  background: var(--wa-bubble-in);
  align-self: flex-start;
  border-top-left-radius: 1px;
}
.wa-bubble.inbound::before {
  content: '';
  position: absolute;
  top: 0; left: -6px;
  width: 6px; height: 12px;
  background: var(--wa-bubble-in);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}
.wa-bubble.outbound {
  background: var(--wa-bubble-out);
  align-self: flex-end;
  border-top-right-radius: 1px;
}
.wa-bubble.outbound::before {
  content: '';
  position: absolute;
  top: 0; right: -6px;
  width: 6px; height: 12px;
  background: var(--wa-bubble-out);
  clip-path: polygon(0 0, 0 100%, 100% 0);
}
.wa-bubble-time {
  display: inline-block;
  font-size: 10.5px;
  color: rgba(0,0,0,0.45);
  margin-top: 2px;
  margin-left: 8px;
  float: right;
}
.wa-bubble.outbound .wa-bubble-time::after {
  content: ' ✓✓';
  color: var(--wa-tick);
  font-weight: 700;
}
.wa-bubble::after {
  content: '';
  display: block;
  clear: both;
}

/* ===== WA: Input row ===== */
.wa-input-row {
  padding: 10px 14px;
  background: var(--ab-bg);
  border-top: 1px solid var(--ab-divider);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.wa-icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ab-text-muted);
  cursor: pointer;
  font-size: 18px;
  border-radius: 50%;
}
.wa-icon-btn:hover { background: rgba(0,0,0,0.05); }
.wa-input-row input {
  flex: 1;
  height: 38px;
  border: 1px solid var(--ab-border);
  border-radius: 999px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 13.5px;
  background: var(--ab-white);
  color: var(--ab-text-body);
}
.wa-input-row input:focus {
  outline: none;
  border-color: var(--wa-green);
}
.wa-send-btn {
  width: 38px; height: 38px;
  background: var(--wa-green);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.wa-send-btn:hover { background: var(--wa-green-dark); }
.wa-send-btn svg { width: 18px; height: 18px; }

/* ===== WA: Templates ===== */
.wa-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.wa-template-card {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.15s;
}
.wa-template-card:hover { border-color: var(--wa-green); box-shadow: 0 2px 10px rgba(37, 211, 102, 0.1); }
.wa-template-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.wa-template-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ab-text);
  line-height: 1.3;
}
.wa-template-preview {
  background: var(--wa-wallpaper);
  border-radius: var(--ab-radius);
  padding: 14px 14px 10px;
  position: relative;
  min-height: 80px;
}
.wa-template-preview .wa-bubble {
  max-width: 100%;
  margin: 0;
  font-size: 13px;
}
.wa-template-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wa-var-chip {
  background: var(--ab-accent-light);
  color: var(--ab-text);
  padding: 3px 9px;
  border-radius: 8px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 600;
}
.wa-template-meta {
  font-size: 11.5px;
  color: var(--ab-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
}
.wa-template-meta .meta-item { display: flex; gap: 4px; }
.wa-template-meta .meta-label { font-weight: 600; }
.wa-template-actions {
  display: flex;
  gap: 6px;
  border-top: 1px solid var(--ab-border);
  padding-top: 12px;
  margin-top: auto;
}
.wa-template-actions .btn-secondary,
.wa-template-actions .btn-primary { flex: 1; padding: 7px 10px; font-size: 12.5px; justify-content: center; }

/* ===== WA: NLP Parser card ===== */
.wa-parser-card {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 22px 24px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.wa-parser-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--wa-green), var(--ab-accent), var(--ab-primary));
}
.wa-parser-card h3 {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ab-text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wa-parser-input {
  background: var(--wa-bubble-out);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--wa-text);
  margin-bottom: 12px;
  font-style: italic;
  border-left: 3px solid var(--wa-green);
  max-width: 75%;
}
.wa-parser-input::before { content: '👤 '; font-style: normal; margin-right: 4px; }
.wa-parser-arrow {
  text-align: center;
  font-size: 24px;
  color: var(--ab-primary);
  margin: 4px 0;
  line-height: 1;
}
.wa-parser-output {
  background: var(--ab-bg);
  border: 1px dashed var(--ab-border-strong);
  border-radius: var(--ab-radius);
  padding: 16px 18px;
  font-size: 13px;
  color: var(--ab-text-body);
  line-height: 1.9;
}
.wa-parser-output .line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.wa-parser-output .line::before {
  content: '✓';
  color: var(--wa-green);
  font-weight: 700;
  font-size: 14px;
}
.wa-parser-output .hl {
  color: var(--ab-primary);
  font-weight: 600;
  background: var(--ab-accent-light);
  padding: 1px 6px;
  border-radius: 4px;
}
.wa-parser-output code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--ab-bg);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--ab-text-muted);
}
.wa-confidence {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--ab-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ab-text-muted);
}
.wa-confidence-bar {
  flex: 1;
  max-width: 240px;
  height: 8px;
  background: var(--ab-border);
  border-radius: 4px;
  overflow: hidden;
}
.wa-confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ab-accent), var(--wa-green));
  border-radius: 4px;
}

/* ===== WA: Empty state chat ===== */
.wa-chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--ab-text-muted);
}
.wa-chat-empty-icon { font-size: 48px; opacity: 0.4; margin-bottom: 14px; }

/* ===========================================================
   LEADS KANBAN (Sub-5)
   =========================================================== */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 14px;
  align-items: stretch;
}
.kanban-col {
  flex: 0 0 290px;
  display: flex;
  flex-direction: column;
  background: var(--ab-bg);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  overflow: hidden;
  min-height: 400px;
  max-height: 720px;
}
.kanban-col-head {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--ab-border);
  background: var(--ab-white);
  border-top: 3px solid var(--ab-border);
}
.kanban-col.stage-new        .kanban-col-head { border-top-color: var(--ab-primary); }
.kanban-col.stage-qualified  .kanban-col-head { border-top-color: var(--ab-accent); }
.kanban-col.stage-proposal   .kanban-col-head { border-top-color: var(--ab-amber); }
.kanban-col.stage-negotiation .kanban-col-head { border-top-color: #8b5cf6; }
.kanban-col.stage-won        .kanban-col-head { border-top-color: var(--ab-green); }

.kanban-col-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.kanban-col-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ab-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kanban-col-count {
  background: var(--ab-bg);
  color: var(--ab-text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--ab-border);
}
.kanban-col-sum {
  font-size: 12px;
  color: var(--ab-text-muted);
  font-variant-numeric: tabular-nums;
}
.kanban-col-sum strong { color: var(--ab-text); font-weight: 600; }

.kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-card {
  background: var(--ab-white);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius-lg);
  padding: 12px 14px;
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lead-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(11, 61, 92, 0.12);
  border-color: var(--ab-primary);
}
.lead-card:active { cursor: grabbing; }

.lead-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
}
.lead-card-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ab-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.lead-card-name { flex: 1; min-width: 0; }
.lead-card-contact {
  font-size: 13px;
  font-weight: 600;
  color: var(--ab-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead-card-company {
  font-size: 11.5px;
  color: var(--ab-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.lead-card-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--ab-text);
  font-variant-numeric: tabular-nums;
}
.lead-source-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lead-source-badge.whatsapp { background: #d1f4dd; color: #0d6e31; }
.lead-source-badge.web      { background: var(--ab-accent-light); color: var(--ab-text); }
.lead-source-badge.referido { background: #ece8fd; color: #5b21b6; }
.lead-source-badge.cold     { background: var(--ab-amber-light); color: var(--ab-amber-dark); }
.lead-source-badge.existente,
.lead-source-badge.cross,
.lead-source-badge.renewal { background: var(--ab-bg); color: var(--ab-text-muted); border: 1px solid var(--ab-border); }

.lead-card-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ab-text-muted);
}
.lead-progress-bar {
  flex: 1;
  height: 5px;
  background: var(--ab-border);
  border-radius: 3px;
  overflow: hidden;
}
.lead-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ab-accent), var(--ab-primary));
  border-radius: 3px;
}
.kanban-col.stage-won .lead-progress-fill { background: var(--ab-green); }

.lead-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--ab-text-muted);
  padding-top: 6px;
  border-top: 1px dashed var(--ab-border);
}
.lead-card-assigned {
  display: flex;
  align-items: center;
  gap: 5px;
}
.lead-assigned-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ab-sidebar);
  color: var(--ab-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

/* ===========================================================
   AUDIT TRAIL (Sub-5)
   =========================================================== */
.integrity-banner-large {
  background: linear-gradient(135deg, var(--ab-green-light), var(--ab-bg));
  border: 1px solid var(--ab-green);
  border-radius: var(--ab-radius-lg);
  padding: 18px 22px;
  margin-bottom: 18px;
  display: flex;
  gap: 18px;
  align-items: center;
}
.integrity-banner-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--ab-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}
.integrity-banner-content { flex: 1; min-width: 0; }
.integrity-banner-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0d6e31;
  margin-bottom: 4px;
}
.integrity-banner-meta {
  font-size: 12px;
  color: var(--ab-text-body);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.integrity-banner-meta strong { color: var(--ab-text); font-weight: 600; }
.integrity-banner-meta .hash-code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  background: var(--ab-white);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--ab-text-muted);
}

.audit-type-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.audit-type-badge.auth       { background: var(--ab-accent-light); color: var(--ab-text); }
.audit-type-badge.factura    { background: var(--ab-green-light); color: #0d6e31; }
.audit-type-badge.dgii       { background: #ece8fd; color: #5b21b6; }
.audit-type-badge.cliente    { background: var(--ab-amber-light); color: var(--ab-amber-dark); }
.audit-type-badge.producto   { background: #fce7f3; color: #9d174d; }
.audit-type-badge.inventario { background: #fff4e0; color: #854f0b; }
.audit-type-badge.usuario    { background: var(--ab-accent-light); color: var(--ab-primary-dark); }
.audit-type-badge.config     { background: var(--ab-bg); color: var(--ab-text-muted); border: 1px solid var(--ab-border); }
.audit-type-badge.reporte    { background: #d6edf7; color: var(--ab-text); }
.audit-type-badge.lead       { background: #d1f4dd; color: #0d6e31; }
.audit-type-badge.sistema    { background: #f3f4f6; color: #374151; border: 1px solid var(--ab-border); }

.audit-payload {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  background: #1a2634;
  color: #d1f4dd;
  padding: 14px 16px;
  border-radius: var(--ab-radius);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

/* ===========================================================
   LOGO SVG (Sub-5)
   =========================================================== */
.nav-logo-box svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .glance-row { grid-template-columns: 1fr; }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 64px 0 1fr; }
  .nav-secondary { display: none; }
  .metrics-row { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .funnel { grid-template-columns: 1fr; gap: 8px; }
  .funnel-arrow { display: none; }
  .drawer { width: 100%; }
  .pricing-card.featured { transform: none; }
  .account-tree-item { grid-template-columns: 60px 1fr 130px; }
  .wa-layout { grid-template-columns: 1fr; height: auto; }
  .wa-sidebar { max-height: 280px; border-right: none; border-bottom: 1px solid var(--ab-border); }
  .wa-chat { height: 480px; }
}
