/* AVIPAR design system — tokens, tema claro/oscuro, shell y componentes */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../vendor/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../vendor/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --av-brand-50: #fffbeb;
  --av-brand-100: #fef3c7;
  --av-brand-200: #fde68a;
  --av-brand-400: #f5b942;
  --av-brand-500: #d97706;
  --av-brand-600: #b45309;
  --av-brand-700: #92400e;
  --av-accent-rgb: 245, 185, 66;
  --av-accent-text: #fcd34d;

  --av-sidebar-bg: #1f1812;
  --av-sidebar-border: rgba(255, 255, 255, 0.07);
  --av-sidebar-text: #cfc7bb;
  --av-sidebar-muted: #8c8478;

  --av-radius: 0.875rem;
  --av-radius-sm: 0.625rem;
  --av-shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 1px 3px rgba(28, 25, 23, 0.06);
  --av-shadow-lg: 0 10px 30px rgba(28, 25, 23, 0.12);
  --av-sidebar-w: 16.5rem;

  --bs-font-sans-serif: "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-body-font-size: 0.9375rem;
  --bs-body-color: #1c1917;
  --bs-body-bg: #f6f5f2;
  --bs-secondary-color: #6b645c;
  --bs-border-color: #e7e4de;
  --bs-border-radius: var(--av-radius-sm);
  --bs-border-radius-lg: var(--av-radius);
  --bs-primary: var(--av-brand-600);
  --bs-primary-rgb: 180, 83, 9;
  --bs-link-color: var(--av-brand-600);
  --bs-link-color-rgb: 180, 83, 9;
  --bs-link-hover-color: var(--av-brand-700);
  --bs-link-hover-color-rgb: 146, 64, 14;
  --bs-focus-ring-color: rgba(217, 119, 6, 0.28);
  --av-surface: #ffffff;
  --av-surface-2: #faf9f7;
  --av-hover: rgba(28, 25, 23, 0.04);
}

[data-bs-theme="dark"] {
  --bs-body-color: #ece8e2;
  --bs-body-bg: #141210;
  --bs-secondary-color: #a39b90;
  --bs-border-color: #2f2a25;
  --bs-primary: var(--av-brand-400);
  --bs-primary-rgb: 245, 185, 66;
  --bs-link-color: var(--av-brand-400);
  --bs-link-color-rgb: 245, 185, 66;
  --bs-link-hover-color: var(--av-accent-text);
  --bs-link-hover-color-rgb: 252, 211, 77;
  --bs-tertiary-bg: #1c1917;
  --av-surface: #1c1917;
  --av-surface-2: #181513;
  --av-hover: rgba(255, 255, 255, 0.05);
  --av-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --av-sidebar-bg: #100e0c;
}

html { -webkit-text-size-adjust: 100%; }
body { font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { letter-spacing: -0.015em; font-weight: 650; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Botones ---------- */
.btn { font-weight: 550; border-radius: var(--av-radius-sm); padding: 0.5rem 0.95rem; }
.btn-lg { padding: 0.7rem 1.25rem; font-size: 1rem; border-radius: 0.75rem; }
.btn-sm { padding: 0.3rem 0.65rem; }
.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--av-brand-600);
  --bs-btn-border-color: var(--av-brand-600);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--av-brand-700);
  --bs-btn-hover-border-color: var(--av-brand-700);
  --bs-btn-active-bg: #78350f;
  --bs-btn-active-border-color: #78350f;
  --bs-btn-focus-shadow-rgb: 217, 119, 6;
  --bs-btn-disabled-bg: var(--av-brand-600);
  --bs-btn-disabled-border-color: var(--av-brand-600);
  box-shadow: 0 1px 2px rgba(146, 64, 14, 0.25);
}
[data-bs-theme="dark"] .btn-primary {
  --bs-btn-color: #1c1206;
  --bs-btn-bg: var(--av-brand-400);
  --bs-btn-border-color: var(--av-brand-400);
  --bs-btn-hover-color: #1c1206;
  --bs-btn-hover-bg: var(--av-accent-text);
  --bs-btn-hover-border-color: var(--av-accent-text);
  --bs-btn-active-bg: #fbbf24;
  --bs-btn-active-color: #1c1206;
}
.btn-outline-secondary {
  --bs-btn-color: var(--bs-body-color);
  --bs-btn-border-color: var(--bs-border-color);
  --bs-btn-hover-bg: var(--av-hover);
  --bs-btn-hover-color: var(--bs-body-color);
  --bs-btn-hover-border-color: #cfc9c0;
  --bs-btn-active-bg: var(--av-hover);
  --bs-btn-active-color: var(--bs-body-color);
}
.btn-ghost { --bs-btn-color: var(--bs-secondary-color); --bs-btn-hover-bg: var(--av-hover); --bs-btn-hover-color: var(--bs-body-color); border-color: transparent; }

/* ---------- Formularios ---------- */
.form-label { font-weight: 550; font-size: 0.8125rem; margin-bottom: 0.35rem; }
.form-control, .form-select {
  padding: 0.6rem 0.8rem;
  border-radius: var(--av-radius-sm);
  background-color: var(--av-surface);
  border-color: #d9d5ce;
}
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { border-color: #3a342e; }
.form-control:focus, .form-select:focus {
  border-color: var(--av-brand-500);
  box-shadow: 0 0 0 0.22rem var(--bs-focus-ring-color);
}
.form-control-lg { padding: 0.75rem 1rem; font-size: 1.05rem; }
.form-text { font-size: 0.8rem; }
.input-group > .btn { border-color: #d9d5ce; }
.form-check-input:checked { background-color: var(--av-brand-600); border-color: var(--av-brand-600); }
.form-check-input:focus { border-color: var(--av-brand-500); box-shadow: 0 0 0 0.22rem var(--bs-focus-ring-color); }
.form-switch .form-check-input { width: 2.25em; height: 1.25em; }

/* ---------- Tarjetas ---------- */
.card {
  --bs-card-bg: var(--av-surface);
  --bs-card-border-color: var(--bs-border-color);
  --bs-card-border-radius: var(--av-radius);
  --bs-card-inner-border-radius: calc(var(--av-radius) - 1px);
  --bs-card-cap-bg: transparent;
  --bs-card-spacer-x: 1.25rem;
  --bs-card-spacer-y: 1.15rem;
  box-shadow: var(--av-shadow);
}
.card-header { font-weight: 600; padding-top: 0.95rem; padding-bottom: 0.95rem; }
.card-link-hover { transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; color: inherit; text-decoration: none; }
.card-link-hover:hover { border-color: var(--av-brand-400); box-shadow: var(--av-shadow-lg); transform: translateY(-1px); color: inherit; }

/* ---------- Tablas ---------- */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--av-hover); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 0.8rem 1rem; border-bottom-color: var(--bs-border-color); }
.table thead th {
  font-size: 0.72rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--bs-secondary-color); background: var(--av-surface-2); white-space: nowrap;
  border-bottom: 1px solid var(--bs-border-color);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table-card { padding: 0; overflow: hidden; }
.table-card .table-responsive { border-radius: inherit; }
tr.is-voided td { color: var(--bs-secondary-color); text-decoration: line-through; opacity: 0.7; }
tr.is-voided td:last-child { text-decoration: none; }

/* ---------- Badges y estados ---------- */
.badge { font-weight: 600; letter-spacing: 0.01em; padding: 0.38em 0.7em; border-radius: 999px; }
.badge-soft-success { background: #dcfce7; color: #166534; }
.badge-soft-danger { background: #fee2e2; color: #991b1b; }
.badge-soft-warning { background: #fef3c7; color: #92400e; }
.badge-soft-neutral { background: #ece9e3; color: #57534e; }
.badge-soft-info { background: #e0f2fe; color: #075985; }
[data-bs-theme="dark"] .badge-soft-success { background: rgba(34, 197, 94, 0.15); color: #86efac; }
[data-bs-theme="dark"] .badge-soft-danger { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
[data-bs-theme="dark"] .badge-soft-warning { background: rgba(245, 185, 66, 0.15); color: #fcd34d; }
[data-bs-theme="dark"] .badge-soft-neutral { background: rgba(255, 255, 255, 0.08); color: #c9c2b8; }
[data-bs-theme="dark"] .badge-soft-info { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
.dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; margin-right: 0.4rem; }

/* ---------- Alertas ---------- */
.alert { border: 1px solid transparent; border-radius: var(--av-radius-sm); display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.85rem 1rem; }
.alert .bi { font-size: 1.1rem; line-height: 1.4; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.alert-info { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
[data-bs-theme="dark"] .alert-success { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.3); color: #86efac; }
[data-bs-theme="dark"] .alert-danger { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
[data-bs-theme="dark"] .alert-warning { background: rgba(245, 185, 66, 0.1); border-color: rgba(245, 185, 66, 0.3); color: #fcd34d; }
[data-bs-theme="dark"] .alert-info { background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.3); color: #7dd3fc; }
.alert-link { color: inherit; font-weight: 650; }

/* ---------- Shell de la aplicación ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  --bs-offcanvas-width: var(--av-sidebar-w);
  --bs-offcanvas-bg: var(--av-sidebar-bg);
  --bs-offcanvas-border-width: 0;
  background: var(--av-sidebar-bg);
  color: var(--av-sidebar-text);
  width: var(--av-sidebar-w);
  flex: 0 0 var(--av-sidebar-w);
}
@media (min-width: 992px) {
  .sidebar {
    position: sticky !important; top: 0; height: 100vh !important;
    width: var(--av-sidebar-w) !important; background: var(--av-sidebar-bg) !important;
    border-right: 1px solid var(--av-sidebar-border) !important;
  }
}
.sidebar .offcanvas-body { padding: 0; display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
.sidebar-brand { display: flex; align-items: center; gap: 0.7rem; padding: 1.15rem 1.25rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: 0.04em; }
.sidebar-brand img { width: 30px; height: 30px; }
.sidebar-brand:hover { color: #fff; }
.sidebar-org { margin: 0 0.9rem 0.5rem; padding: 0.65rem 0.8rem; border-radius: var(--av-radius-sm); background: rgba(255, 255, 255, 0.05); font-size: 0.8125rem; display: flex; align-items: center; gap: 0.6rem; }
.sidebar-org .bi { color: var(--av-brand-400); font-size: 1.05rem; }
.sidebar-org strong { display: block; color: #fff; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 11.5rem; }
.sidebar-org small { color: var(--av-sidebar-muted); }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 0.5rem 0.75rem 1rem; }
.nav-section { font-size: 0.68rem; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--av-sidebar-muted); padding: 1.1rem 0.75rem 0.4rem; }
.side-link {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.75rem; border-radius: var(--av-radius-sm);
  color: var(--av-sidebar-text); text-decoration: none; font-weight: 500; font-size: 0.9rem; position: relative;
  transition: background 0.12s, color 0.12s;
}
.side-link .bi { font-size: 1.1rem; opacity: 0.85; width: 1.25rem; text-align: center; }
.side-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-link.active { background: rgba(var(--av-accent-rgb), 0.14); color: var(--av-accent-text); }
.side-link.active .bi { opacity: 1; color: var(--av-brand-400); }
.side-link.active::before { content: ""; position: absolute; left: -0.75rem; top: 0.45rem; bottom: 0.45rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--av-brand-400); }
.sidebar-foot { padding: 0.9rem 1.25rem; border-top: 1px solid var(--av-sidebar-border); font-size: 0.75rem; color: var(--av-sidebar-muted); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 1.25rem; background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--bs-border-color);
}
.topbar .page-crumb { font-size: 0.85rem; color: var(--bs-secondary-color); margin: 0; }
.icon-btn { width: 2.4rem; height: 2.4rem; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--av-radius-sm); border: 0; background: transparent; color: var(--bs-secondary-color); font-size: 1.15rem; }
.icon-btn:hover { background: var(--av-hover); color: var(--bs-body-color); }
.avatar {
  width: 2.2rem; height: 2.2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--av-brand-100); color: var(--av-brand-700); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.02em; flex: none;
}
[data-bs-theme="dark"] .avatar { background: rgba(var(--av-accent-rgb), 0.18); color: var(--av-accent-text); }
.user-btn { display: flex; align-items: center; gap: 0.6rem; padding: 0.25rem 0.5rem 0.25rem 0.25rem; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--bs-body-color); }
.user-btn:hover { background: var(--av-hover); }
.dropdown-menu { border-radius: var(--av-radius-sm); border-color: var(--bs-border-color); box-shadow: var(--av-shadow-lg); padding: 0.4rem; }
.dropdown-item { border-radius: 0.5rem; padding: 0.5rem 0.7rem; font-size: 0.9rem; }

.app-content { padding: 1.75rem 1.5rem 3rem; width: 100%; max-width: 88rem; margin: 0 auto; flex: 1; }
@media (max-width: 575.98px) { .app-content { padding: 1.1rem 0.9rem 3rem; } }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.6rem; margin: 0; }
.page-header .subtitle { color: var(--bs-secondary-color); margin: 0.25rem 0 0; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.breadcrumb { --bs-breadcrumb-divider-color: var(--bs-secondary-color); font-size: 0.82rem; margin-bottom: 0.35rem; }

/* ---------- KPI ---------- */
.kpi { display: flex; gap: 0.9rem; align-items: flex-start; height: 100%; }
.kpi-icon { width: 2.6rem; height: 2.6rem; border-radius: 0.75rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; background: var(--av-brand-100); color: var(--av-brand-600); flex: none; }
[data-bs-theme="dark"] .kpi-icon { background: rgba(var(--av-accent-rgb), 0.15); color: var(--av-brand-400); }
.kpi-icon.success { background: #dcfce7; color: #15803d; }
.kpi-icon.danger { background: #fee2e2; color: #b91c1c; }
.kpi-icon.info { background: #e0f2fe; color: #0369a1; }
[data-bs-theme="dark"] .kpi-icon.success { background: rgba(34, 197, 94, 0.15); color: #86efac; }
[data-bs-theme="dark"] .kpi-icon.danger { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
[data-bs-theme="dark"] .kpi-icon.info { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
.kpi-label { font-size: 0.78rem; font-weight: 600; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 0.8rem; color: var(--bs-secondary-color); margin-top: 0.15rem; }
.trend-up { color: #15803d; } .trend-down { color: #b91c1c; }
[data-bs-theme="dark"] .trend-up { color: #86efac; } [data-bs-theme="dark"] .trend-down { color: #fca5a5; }

/* ---------- Estados vacíos ---------- */
.empty { text-align: center; padding: 3rem 1.5rem; }
.empty .bi { font-size: 2.2rem; color: var(--av-brand-400); display: block; margin-bottom: 0.75rem; }
.empty h2 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.empty p { color: var(--bs-secondary-color); max-width: 28rem; margin: 0 auto 1rem; }

/* ---------- Auth ---------- */
.auth { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 992px) { .auth { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.auth-brand {
  display: none; position: relative; overflow: hidden; color: #f5efe6; padding: 3rem 3.5rem;
  background: radial-gradient(1200px 600px at 10% -10%, #5a3a14 0%, transparent 60%), radial-gradient(900px 500px at 100% 110%, #7a4a0d 0%, transparent 55%), #1f1812;
}
@media (min-width: 992px) { .auth-brand { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-brand .brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.35rem; letter-spacing: 0.05em; color: #fff; text-decoration: none; }
.auth-brand .brand img { width: 38px; height: 38px; }
.auth-brand h2 { font-size: 2.35rem; line-height: 1.12; color: #fff; max-width: 28rem; margin-bottom: 1rem; }
.auth-brand .lead { color: #d6cdbf; max-width: 28rem; }
.auth-points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; max-width: 28rem; }
.auth-points li { display: flex; gap: 0.85rem; align-items: flex-start; }
.auth-points .bi { width: 2.25rem; height: 2.25rem; border-radius: 0.65rem; display: inline-flex; align-items: center; justify-content: center; background: rgba(var(--av-accent-rgb), 0.16); color: var(--av-brand-400); font-size: 1.05rem; flex: none; }
.auth-points strong { color: #fff; display: block; }
.auth-points span { color: #b9afa0; font-size: 0.875rem; }
.auth-brand .foot { color: #8c8478; font-size: 0.8rem; }
.auth-brand::after { content: ""; position: absolute; right: -90px; bottom: -90px; width: 320px; height: 400px; background: url("../img/logo.svg") no-repeat center / contain; opacity: 0.05; transform: rotate(14deg); pointer-events: none; }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: var(--bs-body-bg); position: relative; }
.auth-card { width: 100%; max-width: 26rem; }
.auth-card .mobile-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; letter-spacing: 0.05em; font-size: 1.25rem; margin-bottom: 2rem; color: var(--bs-body-color); text-decoration: none; }
.auth-card .mobile-brand img { width: 34px; height: 34px; }
@media (min-width: 992px) { .auth-card .mobile-brand { display: none; } }
.auth-card h1 { font-size: 1.65rem; margin-bottom: 0.35rem; }
.auth-card .lead-sm { color: var(--bs-secondary-color); margin-bottom: 1.75rem; }
.auth-theme { position: absolute; top: 1rem; right: 1rem; }
.otp-input { font-size: 1.6rem; letter-spacing: 0.5em; text-align: center; font-variant-numeric: tabular-nums; padding-left: 0.5em; }
.qr-box { background: #fff; padding: 0.75rem; border-radius: var(--av-radius); border: 1px solid var(--bs-border-color); display: inline-block; }
.pw-toggle { border-left: 0; }

/* ---------- Público ---------- */
.public-nav { position: sticky; top: 0; z-index: 1030; background: color-mix(in srgb, var(--bs-body-bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--bs-border-color); }
.public-brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; letter-spacing: 0.05em; font-size: 1.2rem; color: var(--bs-body-color); text-decoration: none; }
.public-brand img { width: 30px; height: 30px; }
.hero { padding: 5rem 0 4rem; text-align: center; background: radial-gradient(900px 380px at 50% -10%, var(--av-brand-100), transparent 70%); }
[data-bs-theme="dark"] .hero { background: radial-gradient(900px 380px at 50% -10%, rgba(var(--av-accent-rgb), 0.12), transparent 70%); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 750; line-height: 1.08; max-width: 18ch; margin: 0 auto 1.1rem; }
.hero .lead { max-width: 40rem; margin: 0 auto 2rem; color: var(--bs-secondary-color); font-size: 1.15rem; }
.eyebrow { display: inline-flex; gap: 0.4rem; align-items: center; padding: 0.3rem 0.75rem; border-radius: 999px; background: var(--av-brand-100); color: var(--av-brand-700); font-weight: 600; font-size: 0.8rem; margin-bottom: 1.25rem; }
[data-bs-theme="dark"] .eyebrow { background: rgba(var(--av-accent-rgb), 0.15); color: var(--av-accent-text); }
.feature-icon { width: 2.75rem; height: 2.75rem; border-radius: 0.8rem; display: inline-flex; align-items: center; justify-content: center; background: var(--av-brand-100); color: var(--av-brand-600); font-size: 1.3rem; margin-bottom: 0.9rem; }
[data-bs-theme="dark"] .feature-icon { background: rgba(var(--av-accent-rgb), 0.15); color: var(--av-brand-400); }

/* ---------- Componentes varios ---------- */
.role-pill { font-size: 0.75rem; }
.perm-group { border: 1px solid var(--bs-border-color); border-radius: var(--av-radius-sm); padding: 0.9rem 1rem; background: var(--av-surface); }
.perm-group legend { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--bs-secondary-color); font-weight: 650; float: none; width: auto; padding: 0 0.35rem; margin: 0 0 0.35rem -0.35rem; }
.toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 1100; display: grid; gap: 0.6rem; max-width: calc(100vw - 2rem); width: 22rem; }
.copy-field { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }
.code-block { background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); padding: 0.85rem 1rem; font-size: 0.82rem; overflow-x: auto; margin-bottom: 1rem; color: var(--bs-body-color); }
.code-block code { color: inherit; font-size: inherit; white-space: pre; }

/* ---------- Centro de ayuda ---------- */
.help-hero { overflow: hidden; }
.help-poster { position: relative; display: block; background: #111; }
.help-poster img { width: 100%; height: auto; display: block; opacity: 0.92; }
.help-play { position: absolute; inset: 0; display: grid; place-items: center; }
.help-play .bi { width: 4.5rem; height: 4.5rem; display: grid; place-items: center; border-radius: 50%; font-size: 2.4rem; color: #fff; background: rgba(180, 83, 9, 0.92); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4); padding-left: 0.25rem; transition: transform 0.15s; }
.help-poster:hover .help-play .bi { transform: scale(1.08); }
.help-card { transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s; }
.help-card:hover { transform: translateY(-2px); box-shadow: var(--bs-box-shadow); border-color: var(--av-accent-text); }
.help-video video { width: 100%; height: 100%; background: #000; border-radius: var(--bs-border-radius); }
.help-steps { counter-reset: none; }
.help-step { margin-bottom: 2rem; scroll-margin-top: 5rem; }
.help-step-head { display: flex; gap: 0.9rem; align-items: flex-start; margin-bottom: 0.9rem; }
.help-step-num { flex: 0 0 auto; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 50%; font-weight: 700; color: #fff; background: var(--av-brand-600, #b45309); }
.help-shot-link { display: block; }
.help-shot { width: 100%; height: auto; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); box-shadow: var(--bs-box-shadow-sm); background: var(--bs-tertiary-bg); }
.help-aside { top: 5rem; }
.help-toc a { text-decoration: none; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.6rem; }
.recovery-codes code { display: block; text-align: center; font-size: 1.05rem; padding: 0.55rem 0.5rem; background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); color: var(--bs-body-color); letter-spacing: 0.04em; }
.skip-link { position: absolute; left: -999px; top: 0.5rem; z-index: 2000; background: var(--av-brand-600); color: #fff; padding: 0.5rem 0.9rem; border-radius: 0.5rem; }
.skip-link:focus { left: 0.5rem; color: #fff; }
:focus-visible { outline: 2px solid var(--av-brand-500); outline-offset: 2px; }
.chart-box { position: relative; height: 18rem; }
.sticky-save {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem;
  padding: 0.85rem 1rem; margin: 1.5rem -0.5rem 0; border-top: 1px solid var(--bs-border-color);
  background: color-mix(in srgb, var(--bs-body-bg) 92%, transparent); backdrop-filter: blur(8px);
  border-radius: var(--av-radius) var(--av-radius) 0 0;
}
.text-brand { color: var(--av-brand-600) !important; }
.text-2xs { font-size: 0.72rem; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--av-brand-600); --bs-nav-pills-link-active-color: #fff; --bs-nav-link-color: var(--bs-secondary-color); --bs-nav-link-hover-color: var(--bs-body-color); --bs-nav-link-padding-y: 0.4rem; }
.nav-pills .nav-link { border-radius: 999px; font-weight: 500; }
[data-bs-theme="dark"] .nav-pills { --bs-nav-pills-link-active-bg: var(--av-brand-500); --bs-nav-pills-link-active-color: #1f1812; }

/* ---------- Marca por organización (data-brand en <html>) ---------- */
[data-brand="green"] { --av-accent-rgb: 74, 222, 128; --av-accent-text: #86efac; --av-brand-50: #f0fdf4; --av-brand-100: #dcfce7; --av-brand-200: #bbf7d0; --av-brand-400: #4ade80; --av-brand-500: #16a34a; --av-brand-600: #15803d; --av-brand-700: #166534; --bs-primary-rgb: 21, 128, 61; --bs-link-color-rgb: 21, 128, 61; --bs-link-hover-color-rgb: 22, 101, 52; --bs-focus-ring-color: rgba(22, 163, 74, 0.28); --av-sidebar-bg: #14201a; }
[data-brand="blue"] { --av-accent-rgb: 96, 165, 250; --av-accent-text: #93c5fd; --av-brand-50: #eff6ff; --av-brand-100: #dbeafe; --av-brand-200: #bfdbfe; --av-brand-400: #60a5fa; --av-brand-500: #2563eb; --av-brand-600: #1d4ed8; --av-brand-700: #1e40af; --bs-primary-rgb: 29, 78, 216; --bs-link-color-rgb: 29, 78, 216; --bs-link-hover-color-rgb: 30, 64, 175; --bs-focus-ring-color: rgba(37, 99, 235, 0.28); --av-sidebar-bg: #111827; }
[data-brand="rose"] { --av-accent-rgb: 251, 113, 133; --av-accent-text: #fda4af; --av-brand-50: #fff1f2; --av-brand-100: #ffe4e6; --av-brand-200: #fecdd3; --av-brand-400: #fb7185; --av-brand-500: #e11d48; --av-brand-600: #be123c; --av-brand-700: #9f1239; --bs-primary-rgb: 190, 18, 60; --bs-link-color-rgb: 190, 18, 60; --bs-link-hover-color-rgb: 159, 18, 57; --bs-focus-ring-color: rgba(225, 29, 72, 0.28); --av-sidebar-bg: #231218; }
[data-brand="green"][data-bs-theme="dark"] { --bs-primary-rgb: 74, 222, 128; --bs-link-color-rgb: 74, 222, 128; --bs-link-hover-color: #86efac; --av-sidebar-bg: #0c1511; }
[data-brand="blue"][data-bs-theme="dark"] { --bs-primary-rgb: 96, 165, 250; --bs-link-color-rgb: 96, 165, 250; --bs-link-hover-color: #93c5fd; --av-sidebar-bg: #0a0f1a; }
[data-brand="rose"][data-bs-theme="dark"] { --bs-primary-rgb: 251, 113, 133; --bs-link-color-rgb: 251, 113, 133; --bs-link-hover-color: #fda4af; --av-sidebar-bg: #170b10; }
[data-brand]:not([data-brand="amber"]) .btn-primary { --bs-btn-active-bg: var(--av-brand-700); --bs-btn-active-border-color: var(--av-brand-700); --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb); }
[data-brand]:not([data-brand="amber"])[data-bs-theme="dark"] .btn-primary { --bs-btn-hover-bg: var(--av-brand-500); --bs-btn-hover-border-color: var(--av-brand-500); --bs-btn-hover-color: #fff; --bs-btn-color: #0b0b0b; --bs-btn-active-bg: var(--av-brand-500); }
.org-logo { width: 1.9rem; height: 1.9rem; object-fit: contain; border-radius: 0.4rem; background: #fff; padding: 0.1rem; flex: none; }
.brand-swatches { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.brand-swatch { position: relative; }
.brand-swatch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.brand-swatch span { display: flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0.9rem; border: 1px solid var(--bs-border-color); border-radius: var(--av-radius-sm); background: var(--av-surface); font-weight: 550; }
.brand-swatch i { width: 1.1rem; height: 1.1rem; border-radius: 50%; display: inline-block; }
.brand-swatch input:checked + span { border-color: var(--av-brand-600); box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.18); }
.brand-swatch input:focus-visible + span { outline: 2px solid var(--av-brand-600); outline-offset: 2px; }
.sw-amber { background: #b45309; } .sw-green { background: #15803d; } .sw-blue { background: #1d4ed8; } .sw-rose { background: #be123c; }

/* ---------- Primeros pasos ---------- */
.onboarding .progress { height: 0.5rem; background: var(--av-hover); }
.onboarding .progress-bar { background: var(--av-brand-500); }
.onboarding-step { display: flex; align-items: center; gap: 0.9rem; padding: 0.7rem 0; border-top: 1px solid var(--bs-border-color); }
.step-mark { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; font-weight: 650; font-size: 0.8rem; background: var(--av-hover); color: var(--bs-secondary-color); }
.onboarding-step.is-done .step-mark { background: var(--av-brand-500); color: #fff; }
.onboarding-step.is-done strong { text-decoration: line-through; color: var(--bs-secondary-color); font-weight: 500; }

/* ---------- Planes ---------- */
.plan-card { position: relative; }
.plan-card.is-current { border-color: var(--av-brand-500); box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.14); }
.plan-price { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; white-space: nowrap; }
.plan-per { font-size: 0.95rem; font-weight: 400; color: var(--bs-secondary-color); }
.plan-custom { font-size: 1.5rem; }
.plan-features { list-style: none; padding: 0; margin: 1rem 0 0; font-size: 0.875rem; }
.plan-features li { display: flex; gap: 0.5rem; padding: 0.25rem 0; }
.plan-features .bi { color: var(--av-brand-500); }
.meter { height: 0.5rem; border-radius: 999px; background: var(--av-hover); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--av-brand-500); border-radius: inherit; }
.meter.is-warn > span { background: #d97706; } .meter.is-full > span { background: #dc2626; }
.perf-stat { padding: 0.75rem 0.9rem; border: 1px solid var(--bs-border-color); border-radius: var(--av-radius-sm); background: var(--av-surface-2); height: 100%; }
.perf-value { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.billing-banner { border-radius: var(--av-radius-sm); }
[data-bs-theme="dark"] .text-danger { color: #f87171 !important; }
[data-bs-theme="dark"] .text-success { color: #4ade80 !important; }

/* ---------- Importador ---------- */
.dropzone { border: 2px dashed var(--bs-border-color); border-radius: var(--av-radius); padding: 2rem 1.5rem; text-align: center; background: var(--av-surface-2); transition: border-color 0.15s, background 0.15s; }
.dropzone.is-over { border-color: var(--av-brand-500); background: var(--av-brand-50); }
[data-bs-theme="dark"] .dropzone.is-over { background: rgba(var(--av-accent-rgb), 0.08); }
.dropzone .bi { font-size: 2rem; color: var(--av-brand-500); }
.dropzone input[type="file"] { max-width: 22rem; margin: 0.75rem auto 0; }
.help-nav a { display: block; padding: 0.35rem 0.6rem; border-radius: 0.5rem; color: var(--bs-secondary-color); text-decoration: none; }
.help-nav a:hover { background: var(--av-hover); color: var(--bs-body-color); }
kbd { background: var(--av-hover); color: var(--bs-body-color); border: 1px solid var(--bs-border-color); }
.bell-badge { position: absolute; top: 0.1rem; right: 0.05rem; min-width: 1.05rem; height: 1.05rem; padding: 0 0.25rem; border-radius: 999px; background: #dc2626; color: #fff; font-size: 0.62rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--bs-body-bg); box-sizing: content-box; }
.severity-dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; display: inline-block; flex: none; }
.severity-critical { background: #dc2626; } .severity-warning { background: var(--av-brand-500); } .severity-info { background: #0284c7; }
.attention-item { display: flex; align-items: center; gap: 0.85rem; padding: 0.75rem 1.25rem; border-top: 1px solid var(--bs-border-color); }
.attention-item:first-child { border-top: 0; }
.attention-item > .bi { width: 2rem; height: 2rem; border-radius: 0.6rem; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 1rem; }
.attention-danger > .bi { background: #fee2e2; color: #b91c1c; }
.attention-warning > .bi { background: #fef3c7; color: #92400e; }
.attention-info > .bi { background: #e0f2fe; color: #0369a1; }
[data-bs-theme="dark"] .attention-danger > .bi { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
[data-bs-theme="dark"] .attention-warning > .bi { background: rgba(245, 185, 66, 0.15); color: #fcd34d; }
[data-bs-theme="dark"] .attention-info > .bi { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
.col-w-sm { min-width: 8.5rem; }
.col-w-md { min-width: 9.5rem; }
.void-menu { min-width: 18rem; }
.avatar-xl { width: 4.5rem; height: 4.5rem; font-size: 1.4rem; }
.min-w-0 { min-width: 0; }
[data-bs-theme="dark"] .text-brand { color: var(--av-brand-400) !important; }
.progress { height: 0.5rem; border-radius: 999px; background: var(--bs-border-color); }
.progress-bar { background: var(--av-brand-500); }
/* Anchos en pasos de 5 % (sin estilos inline por la CSP) */
.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; }
.w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; }
.w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; }
.w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .sidebar, .topbar, .page-actions { display: none !important; } .app-content { padding: 0; } }

/* ---------- Guía de despacho imprimible (siempre en blanco y negro sobre papel) ---------- */
.print-page { background: #e8e5df; }
.print-toolbar { max-width: 210mm; margin: 1rem auto 0; padding: 0 0.5rem; display: flex; justify-content: space-between; }
.doc {
  position: relative; max-width: 210mm; min-height: 270mm; margin: 1rem auto 2rem; padding: 14mm 14mm 12mm;
  background: #fff; color: #1c1917; box-shadow: var(--av-shadow-lg); font-size: 0.82rem; line-height: 1.45;
}
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 2px solid #1c1917; padding-bottom: 0.8rem; margin-bottom: 1rem; }
.doc-org { font-size: 1.35rem; font-weight: 750; }
.doc-muted { color: #6b645c; }
.doc-box { border: 2px solid #b91c1c; color: #b91c1c; padding: 0.5rem 1rem; text-align: center; min-width: 13rem; }
.doc-box-title { font-weight: 700; letter-spacing: 0.04em; font-size: 0.8rem; }
.doc-number { font-size: 1.25rem; font-weight: 800; }
.doc-box .doc-muted { color: #b91c1c; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.doc-grid > div { border: 1px solid #cfc9c0; border-radius: 6px; padding: 0.6rem 0.8rem; }
.doc-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: #6b645c; font-weight: 700; margin-bottom: 0.2rem; }
.doc-strong { font-weight: 700; }
.doc-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.doc-table th, .doc-table td { border-bottom: 1px solid #cfc9c0; padding: 0.4rem 0.5rem; text-align: left; }
.doc-table th { background: #f3f1ed; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.doc-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.doc-table tfoot td { font-weight: 800; border-top: 2px solid #1c1917; border-bottom: 0; }
.doc-trace { border: 1px dashed #cfc9c0; border-radius: 6px; padding: 0.6rem 0.8rem; margin-bottom: 1rem; }
.doc-trace-body { display: flex; justify-content: space-between; gap: 1rem; align-items: center; font-size: 0.74rem; }
.doc-qr { flex: none; }
.doc-notes { margin-bottom: 1rem; }
.doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 3.5rem; text-align: center; font-size: 0.74rem; color: #6b645c; }
.doc-line { border-top: 1px solid #1c1917; margin-bottom: 0.3rem; }
.doc-foot { position: absolute; left: 14mm; right: 14mm; bottom: 8mm; text-align: center; font-size: 0.68rem; color: #6b645c; }
.doc-watermark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 7rem; font-weight: 900; color: rgba(185, 28, 28, 0.13); transform: rotate(-24deg); pointer-events: none; }
@media print {
  @page { size: A4; margin: 0; }
  .print-page { background: #fff; }
  .print-toolbar { display: none !important; }
  .doc { margin: 0; box-shadow: none; max-width: none; min-height: 100vh; }
  .sidebar, .topbar, .page-actions { display: none !important; }
  .app-content { padding: 0; }
}
