/* AM ERP BILLAR - Boron Admin adaptation
   Default: modo día de alta legibilidad. Dark mode queda opcional. */
:root,
html[data-bs-theme="light"] {
    --pos-bg: #f8fafc;
    --pos-bg-warm: #fffaf3;
    --pos-surface: #ffffff;
    --pos-surface-soft: #f1f5f9;
    --pos-surface-raised: #ffffff;
    --pos-border: #d8e0eb;
    --pos-border-strong: #b8c4d4;
    --pos-muted: #475569;
    --pos-muted-strong: #334155;
    --pos-text: #0f172a;
    --pos-heading: #111827;
    --pos-accent: #15803d;
    --pos-info: #2563eb;
    --pos-info-soft: #dbeafe;
    --pos-warn: #b45309;
    --pos-danger: #dc2626;
    --pos-shadow: 0 16px 40px rgba(15, 23, 42, .08);
    --pos-shadow-soft: 0 10px 24px rgba(15, 23, 42, .06);
    --pos-sidebar-bg: #ffffff;
    --pos-topbar-bg: #ffffff;
    --pos-focus: rgba(37, 99, 235, .28);
}

html[data-bs-theme="dark"] {
    --pos-bg: #0f172a;
    --pos-bg-warm: #111827;
    --pos-surface: #1e293b;
    --pos-surface-soft: #111827;
    --pos-surface-raised: #1f2937;
    --pos-border: rgba(148, 163, 184, .28);
    --pos-border-strong: rgba(203, 213, 225, .36);
    --pos-muted: #cbd5e1;
    --pos-muted-strong: #e2e8f0;
    --pos-text: #f8fafc;
    --pos-heading: #ffffff;
    --pos-accent: #22c55e;
    --pos-info: #38bdf8;
    --pos-info-soft: rgba(56, 189, 248, .16);
    --pos-warn: #f59e0b;
    --pos-danger: #ef4444;
    --pos-shadow: 0 18px 45px rgba(2, 6, 23, .35);
    --pos-shadow-soft: 0 12px 28px rgba(2, 6, 23, .30);
    --pos-sidebar-bg: #020617;
    --pos-topbar-bg: #020617;
    --pos-focus: rgba(56, 189, 248, .35);
}

html {
    scroll-behavior: smooth;
    scroll-padding-bottom: 6.5rem;
}

body {
    color: var(--pos-text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .08), transparent 34rem),
        radial-gradient(circle at top right, rgba(21, 128, 61, .08), transparent 30rem),
        linear-gradient(135deg, var(--pos-bg) 0%, var(--pos-bg-warm) 100%);
    overscroll-behavior-y: contain;
}

html[data-bs-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, .14), transparent 34rem),
        radial-gradient(circle at top right, rgba(34, 197, 94, .13), transparent 30rem),
        var(--pos-bg);
}

.wrapper,
.page-content {
    background: transparent !important;
    color: var(--pos-text);
}

.page-content .page-container {
    padding-bottom: 2.5rem;
}

/* Login */
.auth-bg {
    color: var(--pos-text);
    background:
        radial-gradient(circle at 18% 20%, rgba(37, 99, 235, .15), transparent 28rem),
        radial-gradient(circle at 82% 18%, rgba(21, 128, 61, .12), transparent 26rem),
        linear-gradient(135deg, #f8fafc 0%, #fffaf3 58%, #eef6ff 100%);
}
html[data-bs-theme="dark"] .auth-bg {
    background:
        radial-gradient(circle at 18% 20%, rgba(56, 189, 248, .24), transparent 28rem),
        radial-gradient(circle at 82% 18%, rgba(34, 197, 94, .18), transparent 26rem),
        linear-gradient(135deg, #020617 0%, #0f172a 58%, #111827 100%);
}

/* Boron chrome: sidebar/topbar legible in day mode */
.sidenav-menu {
    background: var(--pos-sidebar-bg) !important;
    border-right: 1px solid var(--pos-border) !important;
    box-shadow: var(--pos-shadow-soft);
}
.app-topbar {
    background: var(--pos-topbar-bg) !important;
    border-bottom: 1px solid var(--pos-border) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    z-index: 1020;
}
html[data-bs-theme="dark"] .app-topbar {
    box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}
.topbar-menu,
.footer {
    color: var(--pos-text) !important;
}
.footer {
    border-top: 1px solid var(--pos-border);
    background: transparent;
}
.topbar-search {
    min-height: 42px;
    padding: .55rem .9rem;
    border: 1px solid var(--pos-border);
    border-radius: .6rem;
    background: var(--pos-surface-soft);
    color: var(--pos-muted-strong) !important;
}
.side-nav-title {
    color: var(--pos-muted) !important;
    font-weight: 900;
    letter-spacing: .12em;
}
.side-nav .side-nav-link {
    color: var(--pos-muted-strong) !important;
    border: 1px solid transparent;
    border-radius: .72rem;
    margin: .15rem .35rem;
    font-weight: 750;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.side-nav .side-nav-link:hover {
    color: var(--pos-heading) !important;
    background: var(--pos-surface-soft) !important;
    border-color: var(--pos-border);
}
.side-nav-item.active > .side-nav-link,
.side-nav .side-nav-link.active {
    color: var(--pos-heading) !important;
    background: #eef4ff !important;
    border-color: #bfdbfe;
    box-shadow: inset 3px 0 0 #2563eb;
}
html[data-bs-theme="dark"] .side-nav-item.active > .side-nav-link,
html[data-bs-theme="dark"] .side-nav .side-nav-link.active {
    background: rgba(56, 189, 248, .14) !important;
    border-color: rgba(56, 189, 248, .28);
    box-shadow: inset 3px 0 0 #38bdf8;
}

/* Logo */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: var(--pos-heading);
    text-decoration: none;
    line-height: 1.05;
}
.brand-logo-mark {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}
.brand-logo-mark svg {
    display: block;
    width: 44px;
    height: 44px;
}
.brand-logo-sm .brand-logo-mark svg { width: 38px; height: 38px; }
.brand-logo-lg .brand-logo-mark svg { width: 64px; height: 64px; }
.brand-logo-copy {
    display: grid;
    gap: .18rem;
    min-width: 0;
}
.brand-logo-name {
    color: var(--pos-heading);
    font-weight: 950;
    letter-spacing: -.02em;
    white-space: nowrap;
}
.brand-logo-subtitle {
    color: var(--pos-info);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
}
.brand-logo-stacked {
    flex-direction: column;
    text-align: center;
    gap: .75rem;
}
.brand-logo-stacked .brand-logo-name {
    font-size: 1.15rem;
    letter-spacing: .01em;
}
.brand-logo-stacked .brand-logo-subtitle {
    font-size: .7rem;
}
.brand-mark-bg { fill: #0b1f3a; }
.brand-mark-ball,
.brand-mark-node { fill: #22c55e; }
.brand-mark-hole { fill: #0b1f3a; }
.brand-mark-line {
    fill: none;
    stroke: #ffffff;
    stroke-width: 5.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.brand-mark-cue {
    fill: none;
    stroke: #38bdf8;
    stroke-width: 4;
    stroke-linecap: round;
}
.brand-mark-circuit {
    fill: none;
    stroke: #22c55e;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.brand-login-logo {
    display: flex;
    justify-content: center;
}
.logo-wordmark {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-weight: 900;
    letter-spacing: .01em;
    color: var(--pos-heading);
}
.logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    color: #052e16;
    background: linear-gradient(135deg, #86efac, #22c55e);
    box-shadow: 0 12px 28px rgba(34, 197, 94, .28);
    font-weight: 900;
}
.logo-sm .logo-mark { width: 34px; height: 34px; }
.pos-logo {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    color: var(--pos-heading) !important;
    padding-inline: 1rem !important;
}
.pos-logo .logo-title,
.topbar-logo {
    color: var(--pos-heading) !important;
}
.topbar-logo {
    min-height: 44px;
}
.pos-logo .logo-wordmark {
    width: 100%;
    padding: 0 1rem;
}
html[data-sidenav-size="condensed"] .pos-logo .logo-title,
html[data-sidenav-size="sm-hover"] .pos-logo .logo-title {
    display: none;
}
html[data-sidenav-size="condensed"] .pos-logo .brand-logo-copy,
html[data-sidenav-size="sm-hover"] .pos-logo .brand-logo-copy {
    display: none;
}

/* Page hierarchy */
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.page-eyebrow {
    color: var(--pos-info);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 900;
    font-size: .72rem;
    margin-bottom: .25rem;
}
.page-heading h1,
.card h1,
.card h2,
.card h3,
h1, h2, h3, h4, h5, h6 {
    color: var(--pos-heading);
}
.page-heading h1 {
    margin: 0;
    font-size: clamp(1.65rem, 2.1vw, 2.35rem);
    font-weight: 900;
}
.page-heading p { max-width: 62rem; }
.text-muted,
.muted {
    color: var(--pos-muted) !important;
}

/* Cards and surfaces */
.glass-card,
.card {
    color: var(--pos-text);
    background: var(--pos-surface) !important;
    border: 1px solid var(--pos-border) !important;
    box-shadow: var(--pos-shadow);
}
.card-body {
    color: var(--pos-text);
}
.card-soft {
    color: var(--pos-text);
    background: var(--pos-surface-soft);
    border: 1px solid var(--pos-border);
    border-radius: 1rem;
    padding: 1rem;
}
html[data-bs-theme="dark"] .card-soft {
    background: rgba(15, 23, 42, .62);
}

.grid {
    display: grid;
    gap: 1rem;
}
.grid.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.payments { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.tables { grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1.5fr) minmax(320px, .55fr); align-items: start; }
.split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
}

.metric-card {
    overflow: hidden;
    position: relative;
}
.metric-card::after {
    content: "";
    position: absolute;
    right: -32px;
    top: -32px;
    width: 108px;
    height: 108px;
    border-radius: 999px;
    background: var(--pos-info-soft);
    pointer-events: none;
}
.metric .label,
.metric-label {
    color: var(--pos-muted) !important;
    font-size: .82rem;
    font-weight: 800;
}
.metric .value,
.metric-value {
    font-size: clamp(1.55rem, 2vw, 2.1rem);
    font-weight: 900;
    margin-top: .25rem;
    color: var(--pos-heading) !important;
    font-variant-numeric: tabular-nums;
}
.table-card {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

/* Status chips */
.status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 30px;
    padding: .35rem .65rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
.status.available { color: #166534; background: #dcfce7; border: 1px solid #86efac; }
.status.occupied { color: #991b1b; background: #fee2e2; border: 1px solid #fca5a5; }
.status.reserved { color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; }
.status.inactive { color: #334155; background: #e2e8f0; border: 1px solid #cbd5e1; }
html[data-bs-theme="dark"] .status.available { color: #bbf7d0; background: rgba(34, 197, 94, .18); border-color: rgba(34, 197, 94, .35); }
html[data-bs-theme="dark"] .status.occupied { color: #fecaca; background: rgba(239, 68, 68, .18); border-color: rgba(239, 68, 68, .35); }
html[data-bs-theme="dark"] .status.reserved { color: #fde68a; background: rgba(245, 158, 11, .18); border-color: rgba(245, 158, 11, .35); }
html[data-bs-theme="dark"] .status.inactive { color: #cbd5e1; background: rgba(148, 163, 184, .16); border-color: rgba(148, 163, 184, .28); }

.amount,
.money {
    font-variant-numeric: tabular-nums;
    font-weight: 900;
}
.text-success { color: var(--pos-accent) !important; }
.text-warning { color: var(--pos-warn) !important; }
.text-danger { color: var(--pos-danger) !important; }

/* Forms */
.form-control,
.form-select,
.btn {
    min-height: 44px;
}
.form-label {
    color: var(--pos-muted-strong) !important;
    font-weight: 800;
    margin-bottom: .35rem;
}
.form-control,
.form-select,
.input-group-text {
    color: var(--pos-text) !important;
    background-color: var(--pos-surface-raised) !important;
    border-color: var(--pos-border-strong) !important;
}
.form-control::placeholder {
    color: #64748b;
    opacity: 1;
}
html[data-bs-theme="dark"] .form-control::placeholder {
    color: #94a3b8;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--pos-info) !important;
    box-shadow: 0 0 0 .22rem var(--pos-focus) !important;
}
.form-control:disabled,
.form-select:disabled,
.btn:disabled,
.btn.disabled {
    opacity: .72;
    cursor: not-allowed;
}
textarea.form-control { min-height: 96px; }

/* Buttons: readable text in both themes */
.btn {
    font-weight: 800;
    border-radius: .55rem;
}
.btn-icon,
.sidenav-toggle-button,
.topbar-link.btn-icon {
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn.block,
.btn.w-full { width: 100%; }
.btn-primary,
.btn.primary {
    --bs-btn-bg: #1d4ed8;
    --bs-btn-border-color: #1d4ed8;
    --bs-btn-color: #ffffff;
    --bs-btn-hover-bg: #1e40af;
    --bs-btn-hover-border-color: #1e40af;
    --bs-btn-hover-color: #ffffff;
}
.btn-success,
.btn.good {
    --bs-btn-bg: #15803d;
    --bs-btn-border-color: #15803d;
    --bs-btn-color: #ffffff;
    --bs-btn-hover-bg: #166534;
    --bs-btn-hover-border-color: #166534;
    --bs-btn-hover-color: #ffffff;
}
.btn-warning,
.btn.warn {
    --bs-btn-bg: #f59e0b;
    --bs-btn-border-color: #f59e0b;
    --bs-btn-color: #111827;
    --bs-btn-hover-bg: #d97706;
    --bs-btn-hover-border-color: #d97706;
    --bs-btn-hover-color: #111827;
}
.btn-danger,
.btn.bad {
    --bs-btn-bg: #dc2626;
    --bs-btn-border-color: #dc2626;
    --bs-btn-color: #ffffff;
    --bs-btn-hover-bg: #b91c1c;
    --bs-btn-hover-border-color: #b91c1c;
    --bs-btn-hover-color: #ffffff;
}
.btn-outline-primary {
    --bs-btn-color: #1e293b;
    --bs-btn-border-color: #94a3b8;
    --bs-btn-bg: #ffffff;
    --bs-btn-hover-color: #1d4ed8;
    --bs-btn-hover-bg: #eff6ff;
    --bs-btn-hover-border-color: #60a5fa;
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: #1d4ed8;
    --bs-btn-active-border-color: #1d4ed8;
}
.btn-outline-danger {
    --bs-btn-color: #991b1b;
    --bs-btn-border-color: #ef4444;
    --bs-btn-bg: #ffffff;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: #b91c1c;
    --bs-btn-hover-border-color: #b91c1c;
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: #991b1b;
    --bs-btn-active-border-color: #991b1b;
}
html[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #e2e8f0;
    --bs-btn-border-color: rgba(148, 163, 184, .45);
    --bs-btn-bg: transparent;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: rgba(56, 189, 248, .14);
    --bs-btn-hover-border-color: rgba(56, 189, 248, .55);
}
html[data-bs-theme="dark"] .btn-outline-danger {
    --bs-btn-color: #fecaca;
    --bs-btn-border-color: rgba(248, 113, 113, .65);
    --bs-btn-bg: transparent;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: rgba(239, 68, 68, .22);
    --bs-btn-hover-border-color: rgba(248, 113, 113, .8);
}
.action-stack {
    display: grid;
    gap: .75rem;
}
#venta-rapida {
    scroll-margin-top: 1rem;
    scroll-margin-bottom: 7rem;
}

/* Tables */
.table-responsive {
    border-radius: .95rem;
    border: 1px solid var(--pos-border);
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--pos-text);
    --bs-table-border-color: var(--pos-border);
    --bs-table-hover-bg: #eef4ff;
    --bs-table-hover-color: var(--pos-heading);
    color: var(--pos-text) !important;
}
html[data-bs-theme="dark"] .table {
    --bs-table-hover-bg: rgba(56, 189, 248, .08);
}
.table > :not(caption) > * > * {
    vertical-align: middle;
    color: inherit;
}
.table thead th {
    white-space: nowrap;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--pos-muted-strong) !important;
    background: var(--pos-surface-soft);
}

/* Layout utilities */
.quick-row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: .85rem;
    align-items: end;
}
.quick-row > * { grid-column: span 3; }
.quick-row .wide { grid-column: span 6; }
.quick-row .full { grid-column: 1 / -1; }
.kpi-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 1.3rem;
    position: relative;
    z-index: 1;
}
html[data-bs-theme="dark"] .kpi-icon {
    background: rgba(56, 189, 248, .14);
    color: #7dd3fc;
}

/* Reports */
.reports-layout,
.grid.two.reports-layout {
    grid-template-columns: 1fr;
}
.reports-layout > aside.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.data-table {
    width: 100%;
    min-width: 860px;
    font-size: .86rem;
}
.data-table th,
.data-table td {
    padding: .6rem .4rem;
}
.data-table .operation-number {
    max-width: 13rem;
    white-space: normal;
    overflow-wrap: anywhere;
}
.payment-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .25rem .55rem;
    color: #075985;
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    font-weight: 900;
}
html[data-bs-theme="dark"] .payment-badge {
    color: #bae6fd;
    background: rgba(56, 189, 248, .16);
    border-color: rgba(56, 189, 248, .28);
}
.text-nowrap-soft {
    white-space: nowrap;
}

/* Dropdowns and alerts */
.dropdown-menu {
    color: var(--pos-text);
    background: var(--pos-surface) !important;
    border-color: var(--pos-border) !important;
    box-shadow: var(--pos-shadow);
}
.dropdown-item,
.dropdown-item-text {
    color: var(--pos-text);
}
.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--pos-surface-soft);
    color: var(--pos-heading);
}
.alert-success {
    color: #14532d;
    background: #dcfce7;
    border-color: #86efac;
}
.alert-warning {
    color: #713f12;
    background: #fef3c7;
    border-color: #fcd34d;
}
.alert-danger {
    color: #7f1d1d;
    background: #fee2e2;
    border-color: #fca5a5;
}
html[data-bs-theme="dark"] .alert-success {
    color: #bbf7d0;
    background: rgba(34, 197, 94, .18);
    border-color: rgba(34, 197, 94, .35);
}
html[data-bs-theme="dark"] .alert-warning {
    color: #fde68a;
    background: rgba(245, 158, 11, .18);
    border-color: rgba(245, 158, 11, .35);
}
html[data-bs-theme="dark"] .alert-danger {
    color: #fecaca;
    background: rgba(239, 68, 68, .18);
    border-color: rgba(239, 68, 68, .35);
}

/* SweetAlert2: reemplazo profesional para mensajes flash */
.swal2-popup {
    border-radius: 1rem !important;
    border: 1px solid var(--pos-border) !important;
    background: var(--pos-surface) !important;
    color: var(--pos-text) !important;
    box-shadow: var(--pos-shadow) !important;
}
.swal2-title {
    color: var(--pos-heading) !important;
    font-weight: 900 !important;
}
.swal2-html-container,
.swal2-content {
    color: var(--pos-muted-strong) !important;
}
.swal2-toast {
    padding: .95rem 1rem !important;
    border-radius: .85rem !important;
    border-left: 5px solid #16a34a !important;
}
.swal2-toast.swal2-icon-error {
    border-left-color: #dc2626 !important;
}
.swal2-timer-progress-bar {
    background: rgba(37, 99, 235, .45) !important;
}
.swal2-confirm,
.swal2-cancel {
    min-height: 44px !important;
    border-radius: .55rem !important;
    font-weight: 800 !important;
}

/* Mobile UX: navegación fija inferior, acceso rápido y safe areas */
.mobile-bottom-nav {
    position: fixed;
    left: max(.75rem, env(safe-area-inset-left));
    right: max(.75rem, env(safe-area-inset-right));
    bottom: max(.75rem, env(safe-area-inset-bottom));
    z-index: 1040;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .35rem;
    padding: .45rem;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 20px 45px rgba(15, 23, 42, .18);
    backdrop-filter: blur(18px);
}
.mobile-bottom-nav-link {
    min-height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    border-radius: 1rem;
    color: var(--pos-muted-strong);
    text-decoration: none;
    font-size: .72rem;
    font-weight: 900;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.mobile-bottom-nav-link i {
    font-size: 1.25rem;
    line-height: 1;
}
.mobile-bottom-nav-link:hover,
.mobile-bottom-nav-link:focus-visible {
    color: #1d4ed8;
    background: #eff6ff;
}
.mobile-bottom-nav-link.active {
    color: #0f3a8a;
    background: #dbeafe;
    box-shadow: inset 0 0 0 1px #bfdbfe;
}
.mobile-bottom-nav-link:active {
    transform: translateY(1px) scale(.98);
}
.mobile-quick-actions {
    display: grid;
    gap: .65rem;
}
.mobile-quick-action {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .8rem 1rem;
    border-radius: 1rem;
    text-decoration: none;
    font-weight: 900;
    border: 1px solid var(--pos-border-strong);
    color: var(--pos-heading);
    background: var(--pos-surface);
    box-shadow: var(--pos-shadow-soft);
}
.mobile-quick-action.primary {
    color: #ffffff;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    border-color: rgba(37, 99, 235, .65);
}
.mobile-quick-action:hover,
.mobile-quick-action:focus-visible {
    color: #ffffff;
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
}
html[data-bs-theme="dark"] .mobile-bottom-nav {
    background: rgba(15, 23, 42, .94);
    border-color: rgba(148, 163, 184, .25);
    box-shadow: 0 20px 45px rgba(0, 0, 0, .42);
}
html[data-bs-theme="dark"] .mobile-bottom-nav-link {
    color: #cbd5e1;
}
html[data-bs-theme="dark"] .mobile-bottom-nav-link:hover,
html[data-bs-theme="dark"] .mobile-bottom-nav-link:focus-visible {
    color: #e0f2fe;
    background: rgba(56, 189, 248, .12);
}
html[data-bs-theme="dark"] .mobile-bottom-nav-link.active {
    color: #ffffff;
    background: rgba(56, 189, 248, .18);
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, .28);
}
.swal-validation-list {
    margin: .5rem 0 0;
    padding-left: 1.2rem;
    text-align: left;
}
.swal-validation-list li + li {
    margin-top: .35rem;
}

.cash-flow-alert {
    border-color: rgba(245, 158, 11, .45);
    background: #fffbeb;
    color: #78350f;
}

html[data-bs-theme="dark"] .cash-flow-alert {
    border-color: rgba(251, 191, 36, .32);
    background: rgba(146, 64, 14, .20);
    color: #fde68a;
}

.cash-required-hint {
    display: flex;
    align-items: flex-start;
    gap: .35rem;
    color: var(--pos-warn);
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.35;
}

.cash-flow-modal .modal-content {
    overflow: hidden;
    color: var(--pos-text);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .10), transparent 15rem),
        var(--pos-surface);
    border: 1px solid var(--pos-border-strong);
    border-radius: 1.15rem;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
}

.cash-flow-modal .modal-header,
.cash-flow-modal .modal-footer {
    border-color: var(--pos-border);
    background: var(--pos-surface-raised);
}

.cash-modal-summary {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid #bfdbfe;
    border-radius: 1rem;
    background: #eff6ff;
    color: #1e3a8a;
}

.cash-modal-icon {
    width: 44px;
    min-width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #15803d, #22c55e);
    box-shadow: 0 10px 24px rgba(21, 128, 61, .20);
}

html[data-bs-theme="dark"] .cash-flow-modal .modal-content {
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, .16), transparent 15rem),
        var(--pos-surface);
}

html[data-bs-theme="dark"] .cash-modal-summary {
    border-color: rgba(125, 211, 252, .25);
    background: rgba(56, 189, 248, .12);
    color: #e0f2fe;
}

.consumption-modal .modal-content {
    overflow: hidden;
    color: var(--pos-text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .08), transparent 17rem),
        var(--pos-surface);
    border: 1px solid var(--pos-border-strong);
    border-radius: 1.15rem;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .22);
}

.consumption-modal .modal-header,
.consumption-modal .modal-footer {
    border-color: var(--pos-border);
    background: var(--pos-surface-raised);
}

.consumption-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}

.consumption-summary-card {
    min-height: 82px;
    padding: .9rem;
    border: 1px solid var(--pos-border);
    border-radius: 1rem;
    background: var(--pos-surface-soft);
}

.consumption-summary-card span {
    display: block;
    margin-bottom: .35rem;
    color: var(--pos-muted);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .02em;
}

.consumption-summary-card strong {
    color: var(--pos-heading);
    font-size: 1.15rem;
    line-height: 1.15;
}

.consumption-summary-card.accent {
    border-color: rgba(21, 128, 61, .28);
    background: #ecfdf5;
}

.consumption-summary-card.accent strong {
    color: var(--pos-accent);
}

.empty-consumption-state {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: 1rem;
    color: var(--pos-muted-strong);
    border: 1px dashed var(--pos-border-strong);
    border-radius: 1rem;
    background: var(--pos-surface-soft);
    font-weight: 800;
}

.empty-consumption-state i {
    font-size: 1.25rem;
    color: var(--pos-info);
}

.consumption-movement-list {
    display: grid;
    gap: .65rem;
    max-height: 320px;
    overflow: auto;
    padding-right: .15rem;
}

.consumption-movement {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .85rem;
    padding: .85rem .95rem;
    border: 1px solid var(--pos-border);
    border-radius: .9rem;
    background: var(--pos-surface-raised);
}

.consumption-movement span {
    display: block;
    margin-top: .15rem;
    color: var(--pos-muted);
    font-size: .82rem;
    font-weight: 800;
}

html[data-bs-theme="dark"] .consumption-modal .modal-content {
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, .12), transparent 17rem),
        var(--pos-surface);
}

html[data-bs-theme="dark"] .consumption-summary-card.accent {
    border-color: rgba(34, 197, 94, .26);
    background: rgba(34, 197, 94, .11);
}

/* Focus and motion */
.focus-ring:focus,
.btn:focus-visible,
a:focus-visible,
.form-control:focus,
.form-select:focus,
.dropdown-toggle:focus-visible {
    outline: 3px solid var(--pos-focus);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 1199.98px) {
    .sidenav-menu {
        display: none !important;
    }
    .sidenav-toggle-button {
        display: none !important;
    }
    .app-topbar,
    .page-content {
        left: 0 !important;
        margin-left: 0 !important;
        width: 100% !important;
    }
    .grid.two { grid-template-columns: 1fr; }
    .quick-row > *, .quick-row .wide { grid-column: span 6; }
    .page-content .page-container {
        padding-bottom: calc(7.25rem + env(safe-area-inset-bottom));
    }
    .footer {
        display: none;
    }
}
@media (max-width: 767.98px) {
    .page-heading,
    .split { flex-direction: column; align-items: stretch; }
    .topbar-menu {
        padding-inline: .8rem;
        gap: .5rem;
    }
    .topbar-logo .logo-mark {
        width: 34px;
        height: 34px;
        border-radius: 11px;
    }
    .topbar-logo .brand-logo-name {
        font-size: .95rem;
    }
    .topbar-logo {
        min-height: 48px;
    }
    .dropdown.topbar-item .topbar-link {
        min-width: 48px;
        padding-inline: .45rem;
    }
    .page-heading {
        gap: .85rem;
        margin-bottom: 1rem;
    }
    .page-heading h1 {
        font-size: clamp(1.55rem, 8vw, 2rem);
        line-height: 1.05;
        text-wrap: balance;
    }
    .page-heading p {
        font-size: .93rem;
    }
    .grid.metrics,
    .grid.payments,
    .grid.two { grid-template-columns: 1fr; }
    .grid.metrics {
        gap: .75rem;
    }
    .metric-card .split {
        flex-direction: row;
        align-items: center;
    }
    .metric-card .card-body {
        min-height: 96px;
        padding: 1rem;
    }
    .metric .value,
    .metric-value {
        font-size: clamp(1.65rem, 8vw, 2.1rem);
    }
    .quick-row > *, .quick-row .wide { grid-column: 1 / -1; }
    .table-card {
        min-height: auto;
        border-radius: 1rem;
    }
    .table-card .card-body {
        padding: 1rem;
    }
    .card-soft {
        padding: .9rem;
    }
    .action-stack {
        gap: .9rem;
    }
    .form-control,
    .form-select,
    .btn {
        min-height: 48px;
        font-size: 1rem;
    }
    .btn-icon,
    .sidenav-toggle-button,
    .topbar-link.btn-icon {
        min-width: 48px;
        width: 48px;
        min-height: 48px;
    }
    .status {
        min-height: 34px;
        justify-content: center;
        padding-inline: .75rem;
    }
    .swal2-confirm,
    .swal2-cancel {
        min-height: 48px !important;
    }
    .swal2-toast {
        width: calc(100vw - 1.5rem) !important;
        margin: .75rem !important;
    }
    .consumption-summary-grid {
        grid-template-columns: 1fr;
    }
    .consumption-modal .modal-body {
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }
    .consumption-movement {
        align-items: flex-start;
        flex-direction: column;
    }
    .reports-layout > aside.grid { grid-template-columns: 1fr; }
    .table-responsive::after {
        content: "Desliza la tabla hacia los lados si hay más columnas";
        display: block;
        padding: .55rem .8rem;
        color: var(--pos-muted);
        background: var(--pos-surface-soft);
        font-size: .78rem;
        font-weight: 800;
        border-top: 1px solid var(--pos-border);
    }
}

@media (max-width: 380px) {
    .mobile-bottom-nav {
        left: .45rem;
        right: .45rem;
        gap: .15rem;
        padding: .35rem;
    }
    .mobile-bottom-nav-link {
        font-size: .66rem;
        min-height: 56px;
    }
}

