/* =========================================================================
   Gesty360 — Design System v2 (CSS propio, sin dependencias de UI)
   Identidad visual unificada: color, tipografía, espaciado y componentes.
   Build: 2026-06-14.3 — bultos (precio bulto, toggle carrito, tarjeta POS)
   (El hash de @Assets cambia solo con el contenido; este sello lo hace evidente.)
   ========================================================================= */
:root {
    /* Marca (colores reales del logo Gesty360: navy + azul + verde) */
    --g-primary: #1366cc;
    --g-primary-600: #0f57b0;
    --g-primary-700: #0b4893;
    --g-primary-soft: #e7f0fb;
    --g-primary-rgb: 19, 102, 204;
    --g-accent: #4aac2e;
    --g-navy: #0a2a5e;

    /* Semánticos */
    --g-success: #15a34a;
    --g-success-soft: #dcfce7;
    --g-danger: #e11d48;
    --g-danger-soft: #ffe4e6;
    --g-warning: #d97706;
    --g-warning-soft: #fef3c7;
    --g-info: #0ea5e9;
    --g-info-soft: #e0f2fe;

    /* Neutros */
    --g-bg: #f4f6fb;
    --g-surface: #ffffff;
    --g-surface-2: #f8fafc;
    --g-sidebar: #0b1220;
    --g-sidebar-2: #11192b;
    --g-sidebar-text: #94a3b8;
    --g-text: #0f172a;
    --g-text-soft: #475569;
    --g-text-muted: #94a3b8;
    --g-border: #e6eaf1;
    --g-border-strong: #d4dae6;

    /* Forma y profundidad */
    --g-radius: 14px;
    --g-radius-sm: 9px;
    --g-radius-lg: 22px;
    --g-shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
    --g-shadow-sm: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
    --g-shadow: 0 6px 18px -6px rgba(15, 23, 42, .14), 0 2px 6px -2px rgba(15, 23, 42, .08);
    --g-shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, .28);
    --g-ring: 0 0 0 3px rgba(var(--g-primary-rgb), .25);

    --g-sidebar-width: 264px;
    --g-topbar-height: 66px;
    --g-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --g-transition: .18s cubic-bezier(.4, 0, .2, 1);
}

/* ===== Modo oscuro ===== (se activa con data-theme="dark" en <html>) */
[data-theme="dark"] {
    --g-primary-soft: #16335c;
    --g-success-soft: rgba(21, 163, 74, .20);
    --g-danger-soft: rgba(225, 29, 72, .22);
    --g-warning-soft: rgba(217, 119, 6, .22);
    --g-info-soft: rgba(14, 165, 233, .20);

    --g-bg: #0b1220;
    --g-surface: #131c2e;
    --g-surface-2: #0f1828;
    --g-text: #e8edf6;
    --g-text-soft: #b6c2d4;
    --g-text-muted: #8493a8;
    --g-border: #243149;
    --g-border-strong: #32425e;

    --g-shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --g-shadow-sm: 0 1px 3px rgba(0, 0, 0, .45);
    --g-shadow: 0 6px 18px -6px rgba(0, 0, 0, .55);
    --g-shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .65);
    color-scheme: dark;
}

/* Ajustes de componentes en modo oscuro (colores que estaban fijos en claro) */
[data-theme="dark"] .g-topbar { background: rgba(19, 28, 46, .82); }
[data-theme="dark"] .auth,
[data-theme="dark"] .auth__form { background: var(--g-bg); }

/* ===== Pantallas de acceso (login / demo) — compartidas ===== */
.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: #fff;
}

.auth__sub {
    color: rgba(255, 255, 255, .86);
    font-size: 1.02rem;
    line-height: 1.45;
    margin: 14px 0 0;
    max-width: 390px;
}

.auth__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--g-text-muted);
    font-size: .82rem;
    margin: 24px 0 14px;
}

.auth__divider::before,
.auth__divider::after {
    content: "";
    height: 1px;
    background: var(--g-border);
    flex: 1;
}

.auth__demo-note {
    text-align: center;
    color: var(--g-text-muted);
    font-size: .8rem;
    margin: 10px 0 0;
}

/* Logo centrado en el lado del formulario (login / demo) */
.auth__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin: 0 0 26px;
}

.auth__logo img:first-child {
    height: 76px;
}

.auth__logo img:last-child {
    height: 46px;
}

/* Funciones en rejilla compacta (2 columnas) para que todo entre sin scroll */
.auth__features--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 24px;
}

.auth__features--grid .auth__feat {
    gap: 10px;
    padding: 10px 12px;
    margin: 0;
    background: rgba(255, 255, 255, .06);
}

.auth__features--grid .auth__feat:hover {
    background: rgba(255, 255, 255, .14);
}

.auth__features--grid .auth__feat .material-symbols-rounded {
    font-size: 19px;
    width: 34px;
    height: 34px;
}

.auth__features--grid .auth__feat-txt {
    font-size: .9rem;
    font-weight: 600;
}

.auth__brand {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 44px 52px;
    background: radial-gradient(circle at 82% 88%, rgba(74, 172, 46, .34), transparent 44%),
        linear-gradient(150deg, #0a2a5e 0%, #103e8f 50%, #1366cc 100%);
}

.auth__brand-inner {
    position: relative;
    z-index: 2;
    max-width: 500px;
    width: 100%;
}

.auth__lockup {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    background: #fff;
    padding: 12px 18px;
    border-radius: 16px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
}

.auth__lk-icon {
    height: 40px;
    width: auto;
}

.auth__lk-word {
    height: 23px;
    width: auto;
    display: block;
}

.auth__headline {
    color: #fff;
    font-size: 2.05rem;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 18px 0 0;
}

.auth__features {
    list-style: none;
    padding: 0;
    margin: 26px 0 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth__features li {
    display: flex;
    align-items: center;
    gap: 13px;
    color: rgba(255, 255, 255, .92);
    font-size: 1.02rem;
    font-weight: 500;
}

.auth__features .material-symbols-rounded {
    font-size: 22px;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .15);
    border-radius: 12px;
    color: #fff;
}

.auth__blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.auth__blob--1 {
    width: 380px;
    height: 380px;
    top: -130px;
    left: -130px;
    background: rgba(255, 255, 255, .06);
}

.auth__blob--2 {
    width: 280px;
    height: 280px;
    bottom: -100px;
    right: -70px;
    background: rgba(255, 255, 255, .05);
}

.auth__form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #fff;
}

.auth__form-inner {
    width: 100%;
    max-width: 380px;
}

.auth__mobile-logo {
    display: none;
    align-items: center;
    gap: 11px;
    justify-content: center;
    margin-bottom: 30px;
}

.auth__mobile-logo img:first-child {
    height: 46px;
}

.auth__mobile-logo img:last-child {
    height: 26px;
}

.auth__h {
    font-size: 1.95rem;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--g-text);
    letter-spacing: -.01em;
}

.auth__p {
    color: var(--g-text-muted);
    margin: 0 0 30px;
    font-size: .95rem;
    line-height: 1.45;
}

.auth__form-inner .g-btn--primary {
    background: linear-gradient(135deg, #1366cc, #0b4893);
    border: 0;
    box-shadow: 0 10px 24px rgba(11, 72, 147, .28);
}

.auth__form-inner .g-btn--primary:hover {
    background: linear-gradient(135deg, #0f57b0, #0a3f80);
}

.auth__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    background: none;
    border: 0;
    color: var(--g-primary);
    cursor: pointer;
    margin-top: 18px;
    font-size: .88rem;
    font-weight: 600;
}

.auth__link .material-symbols-rounded {
    font-size: 18px;
}

.auth__empresas {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth__empresa {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    background: var(--g-surface);
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius);
    padding: 14px 16px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.auth__empresa:hover:not(:disabled) {
    border-color: var(--g-primary);
    box-shadow: var(--g-ring);
    background: var(--g-primary-soft);
}

.auth__empresa:disabled {
    opacity: .6;
    cursor: default;
}

.auth__empresa>.material-symbols-rounded {
    font-size: 22px;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--g-primary-soft);
    border-radius: 12px;
    color: var(--g-primary);
}

.auth__empresa-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.auth__empresa-name {
    font-weight: 700;
    color: var(--g-text);
    font-size: .98rem;
}

.auth__empresa-rol {
    color: var(--g-text-muted);
    font-size: .82rem;
}

.auth__empresa-arrow {
    font-size: 22px;
    color: var(--g-text-muted);
    flex-shrink: 0;
}

/* Badge, funciones clicables, confianza y modal de detalle */
.auth__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 4px 0 0;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    padding: 6px 13px;
    border-radius: 999px;
}

.auth__badge .material-symbols-rounded {
    font-size: 16px;
    color: #8fe388;
}

.auth__headline {
    margin-top: 22px;
}

.auth__feat {
    cursor: pointer;
    padding: 8px 10px;
    margin: 0 -10px;
    border-radius: 12px;
    transition: background .15s;
}

.auth__feat:hover {
    background: rgba(255, 255, 255, .10);
}

.auth__feat-txt {
    flex: 1;
}

.auth__feat-arrow {
    font-size: 20px !important;
    width: auto !important;
    height: auto !important;
    background: none !important;
    color: rgba(255, 255, 255, .55) !important;
}

.auth__feat:hover .auth__feat-arrow {
    color: #fff !important;
}

.auth__trust {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 28px 0 0;
}

.auth__trust span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, .82);
    font-size: .84rem;
}

.auth__trust .material-symbols-rounded {
    font-size: 18px;
    color: #8fe388;
}

.auth__featmodal {
    text-align: center;
}

.auth__featmodal-icon {
    font-size: 40px;
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    background: var(--g-primary-soft);
    color: var(--g-primary);
    border-radius: 18px;
}

.auth__featmodal-desc {
    color: var(--g-text-soft);
    margin: 0 0 14px;
    line-height: 1.5;
}

.auth__featmodal-points {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.auth__featmodal-points li {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--g-text);
    font-size: .92rem;
}

.auth__featmodal-points .material-symbols-rounded {
    font-size: 19px;
    color: var(--g-success);
    flex-shrink: 0;
}

@media (max-width: 880px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth__brand {
        display: none;
    }

    .auth__form {
        padding: 24px;
        background: radial-gradient(at 0% 0%, #e0e7ff 0, transparent 55%),
            radial-gradient(at 100% 0%, #ede9fe 0, transparent 55%), #f1f5f9;
    }

    .auth__form-inner {
        background: #fff;
        padding: 36px 28px;
        border-radius: 24px;
        box-shadow: 0 25px 60px rgba(15, 23, 42, .18);
    }

    .auth__mobile-logo {
        display: flex;
    }
}

/* Campo numérico: oculta el spinner nativo y usa botones +/- propios */
.g-numfield input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
    padding-right: 36px;
}

.g-numfield input[type=number]::-webkit-inner-spin-button,
.g-numfield input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.g-numfield__steps {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.g-numfield__steps button {
    width: 25px;
    height: 17px;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    border: 1px solid var(--g-border);
    background: var(--g-surface-2);
    color: var(--g-text-soft);
    border-radius: 6px;
    transition: var(--g-transition);
}

.g-numfield__steps button:hover {
    background: var(--g-primary-soft);
    color: var(--g-primary);
    border-color: var(--g-primary);
}

.g-numfield__steps .material-symbols-rounded {
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--g-font);
    background: var(--g-bg);
    color: var(--g-text);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -.018em;
    color: var(--g-text);
}

a {
    color: var(--g-primary-600);
    text-decoration: none;
}

:focus-visible {
    outline: none;
    box-shadow: var(--g-ring);
    border-radius: 6px;
}

::selection {
    background: rgba(var(--g-primary-rgb), .2);
}

/* Material Symbols */
.material-symbols-rounded {
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
    font-size: 20px;
    line-height: 1;
    vertical-align: middle;
    user-select: none;
}

/* Scrollbars */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    background-clip: content-box;
}

/* ----------------------------- Splash de carga ------------------------- */
#gesty-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    background: var(--g-bg);
    color: var(--g-text);
    transition: opacity .4s ease, visibility .4s ease;
}

#gesty-splash.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#gesty-splash .logo {
    height: 96px;
    width: auto;
    background: none;
    box-shadow: none;
    border-radius: 0;
    animation: g-bounce 1.6s ease-in-out infinite;
}

#gesty-splash .brand {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

#gesty-splash .brand span {
    color: var(--g-primary-600);
}

#gesty-splash .bar {
    width: 170px;
    height: 4px;
    border-radius: 4px;
    background: var(--g-border);
    overflow: hidden;
}

#gesty-splash .bar::after {
    content: "";
    display: block;
    width: 40%;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--g-primary), var(--g-accent));
    animation: g-indeterminate 1.1s ease-in-out infinite;
}

@keyframes g-indeterminate {
    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(360%);
    }
}

@keyframes g-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-9px);
    }
}

/* Blazor error UI (oculto por defecto; Blazor lo muestra ante un error no controlado) */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    padding: 12px 22px;
    background: #fef3c7;
    color: #713f12;
    box-shadow: 0 -3px 14px rgba(0, 0, 0, .12);
    font-size: .85rem;
}

#blazor-error-ui .reload {
    color: var(--g-primary-600);
    font-weight: 700;
    margin-left: 6px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
    font-size: 1.1rem;
}

/* ----------------------------- App shell ------------------------------- */
.g-app {
    display: flex;
    min-height: 100vh;
}

.g-sidebar {
    width: var(--g-sidebar-width);
    background: var(--g-surface);
    color: var(--g-text-soft);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    transition: transform var(--g-transition);
    border-right: 1px solid var(--g-border);
}

.g-sidebar__brand {
    height: var(--g-topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    color: var(--g-text);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -.02em;
    border-bottom: 1px solid var(--g-border);
}

.g-sidebar__brand .logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--g-primary), var(--g-accent));
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    color: #fff;
    box-shadow: 0 6px 16px rgba(var(--g-primary-rgb), .5);
}

.g-sidebar__nav {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}

.g-nav-group {
    margin-bottom: 4px;
}

.g-nav-title {
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--g-text-muted);
    padding: 16px 14px 6px;
    font-weight: 700;
}

.g-nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 10px 13px;
    border-radius: 11px;
    color: var(--g-text-soft);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--g-transition);
    margin-bottom: 2px;
    position: relative;
    font-size: .9rem;
}

.g-nav-item .material-symbols-rounded {
    font-size: 21px;
}

.g-nav-item:hover {
    background: var(--g-primary-soft);
    color: var(--g-primary-600);
}

.g-nav-item.active {
    background: linear-gradient(135deg, var(--g-primary-600), var(--g-primary));
    color: #fff;
    box-shadow: 0 8px 18px -4px rgba(var(--g-primary-rgb), .55);
}

.g-nav-item.active .material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 500;
}

.g-sidebar__footer {
    padding: 12px;
    border-top: 1px solid var(--g-border);
}

.g-sidebar__footer .g-nav-item {
    width: 100%;
    border: 0;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: .9rem;
    color: var(--g-danger);
}

.g-sidebar__footer .g-nav-item:hover {
    background: var(--g-danger-soft);
    color: var(--g-danger);
}

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

.g-topbar {
    height: var(--g-topbar-height);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--g-border);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 26px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.g-topbar__title {
    font-size: 1.05rem;
    font-weight: 700;
}

.g-topbar__spacer {
    flex: 1;
}

.g-topbar__heading {
    flex-shrink: 0;
}

.g-topbar__center {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.g-topbar__center .g-search {
    flex: 0 1 460px;
    max-width: 460px;
    min-width: 0;
    position: relative;
}

.g-topbar__center .g-search input {
    width: 100%;
    padding-left: 40px;
}

.g-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 760px) {
    .g-topbar__center {
        display: none;
    }
}

.g-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    border-radius: 999px;
    cursor: default;
    transition: background var(--g-transition);
}

.g-user:hover {
    background: var(--g-surface-2);
}

.g-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--g-primary), var(--g-accent));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    box-shadow: var(--g-shadow-sm);
}

.g-content {
    padding: 26px 32px;
    flex: 1;
    width: 100%;
    min-width: 0;
    animation: g-fade-up .3s ease;
}

.g-menu-toggle {
    display: grid;
    place-items: center;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--g-text);
    padding: 6px;
    border-radius: 8px;
}

.g-menu-toggle:hover {
    background: var(--g-surface-2);
}

@keyframes g-fade-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ----------------------------- Buttons --------------------------------- */
.g-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--g-radius-sm);
    padding: 9px 16px;
    font-size: .875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--g-transition);
    white-space: nowrap;
    line-height: 1.2;
    user-select: none;
}

.g-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.g-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.g-btn .material-symbols-rounded,
.g-btn__ic {
    font-size: 19px;
}

.g-btn--primary {
    background: linear-gradient(135deg, var(--g-primary-600), var(--g-primary));
    color: #fff;
    box-shadow: 0 4px 12px -3px rgba(var(--g-primary-rgb), .5);
}

.g-btn--primary:hover:not(:disabled) {
    box-shadow: 0 8px 20px -4px rgba(var(--g-primary-rgb), .6);
    filter: brightness(1.05);
}

.g-btn--secondary {
    background: var(--g-surface);
    color: var(--g-text);
    border-color: var(--g-border-strong);
    box-shadow: var(--g-shadow-xs);
}

.g-btn--secondary:hover:not(:disabled) {
    background: var(--g-surface-2);
    border-color: var(--g-text-muted);
}

.g-btn--ghost {
    background: transparent;
    color: var(--g-text-soft);
}

.g-btn--ghost:hover:not(:disabled) {
    background: var(--g-surface-2);
    color: var(--g-text);
}

.g-btn--danger {
    background: var(--g-danger);
    color: #fff;
    box-shadow: 0 4px 12px -3px rgba(225, 29, 72, .5);
}

.g-btn--danger:hover:not(:disabled) {
    filter: brightness(1.06);
}

.g-btn--success {
    background: var(--g-success);
    color: #fff;
    box-shadow: 0 4px 12px -3px rgba(21, 163, 74, .5);
}

.g-btn--success:hover:not(:disabled) {
    filter: brightness(1.06);
}

.g-btn--sm {
    padding: 6px 11px;
    font-size: .8rem;
    border-radius: 8px;
}

.g-btn--sm .material-symbols-rounded {
    font-size: 17px;
}

.g-btn--block {
    width: 100%;
}

.g-btn--lg {
    padding: 13px 22px;
    font-size: 1rem;
    border-radius: 12px;
}

.g-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    color: var(--g-text-soft);
    transition: all var(--g-transition);
}

.g-icon-btn:hover {
    background: var(--g-surface-2);
    color: var(--g-text);
}

.g-icon-btn .material-symbols-rounded {
    font-size: 20px;
}

.g-icon-btn--primary:hover {
    background: var(--g-primary-soft);
    color: var(--g-primary-600);
}

.g-icon-btn--danger {
    color: var(--g-danger);
}

.g-icon-btn--danger:hover {
    background: var(--g-danger-soft);
    color: var(--g-danger);
}

/* Menú de usuario (topbar) */
.g-usermenu {
    position: relative;
}

.g-usermenu__btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 4px 6px 4px 4px;
    border-radius: 999px;
    transition: background var(--g-transition);
}

.g-usermenu__btn:hover {
    background: var(--g-surface-2);
}

.g-usermenu__backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
}

.g-usermenu__pop {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 50;
    background: var(--g-surface);
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius);
    box-shadow: var(--g-shadow-lg);
    min-width: 244px;
    overflow: hidden;
    animation: g-pop .16s ease;
}

.g-usermenu__head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 15px 16px;
}

.g-usermenu__divider {
    height: 1px;
    background: var(--g-border);
}

.g-usermenu__item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 500;
    color: var(--g-text);
    text-align: left;
    transition: background var(--g-transition);
}

.g-usermenu__item:hover {
    background: var(--g-surface-2);
}

.g-usermenu__item--danger {
    color: var(--g-danger);
}

.g-usermenu__item--danger:hover {
    background: var(--g-danger-soft);
}

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

.g-card__header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--g-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.g-card__title {
    font-size: 1rem;
    font-weight: 700;
}

.g-card__body {
    padding: 22px;
}

.g-page-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.g-page-header__text h1 {
    font-size: 1.55rem;
}

.g-page-header__text p {
    color: var(--g-text-muted);
    margin: 3px 0 0;
    font-size: .92rem;
}

.g-page-header__actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ----------------------------- KPI cards ------------------------------- */
.g-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.g-kpi {
    background: var(--g-surface);
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius);
    padding: 20px;
    box-shadow: var(--g-shadow-sm);
    display: flex;
    gap: 16px;
    align-items: center;
    transition: transform var(--g-transition), box-shadow var(--g-transition);
}

.g-kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--g-shadow);
}

.g-kpi__icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.g-kpi__icon .material-symbols-rounded {
    font-size: 26px;
}

.g-kpi__label {
    color: var(--g-text-muted);
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.g-kpi__value {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.g-kpi--primary .g-kpi__icon {
    background: var(--g-primary-soft);
    color: var(--g-primary-600);
}

.g-kpi--success .g-kpi__icon {
    background: var(--g-success-soft);
    color: var(--g-success);
}

.g-kpi--danger .g-kpi__icon {
    background: var(--g-danger-soft);
    color: var(--g-danger);
}

.g-kpi--warning .g-kpi__icon {
    background: var(--g-warning-soft);
    color: var(--g-warning);
}

.g-kpi--info .g-kpi__icon {
    background: var(--g-info-soft);
    color: var(--g-info);
}

/* ----------------------------- Forms ----------------------------------- */
/* ── Campos de formulario con etiqueta flotante (Material outlined) ── */
.g-field {
    margin-bottom: 18px;
}

.g-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--g-text-soft);
    display: block;
    margin-bottom: 6px;
}

.g-label .req,
.req {
    color: var(--g-danger);
}

.g-field__control {
    position: relative;
}

.g-input,
.g-select,
.g-textarea {
    width: 100%;
    padding: 16px 14px;
    font-size: .95rem;
    font-family: inherit;
    line-height: 1.2;
    border: 1.5px solid var(--g-border-strong);
    border-radius: var(--g-radius);
    background: var(--g-surface);
    color: var(--g-text);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.g-textarea {
    min-height: 96px;
    padding-top: 22px;
    resize: vertical;
}

.g-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 40px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
}

.g-input:hover,
.g-select:hover,
.g-textarea:hover {
    border-color: var(--g-text-muted);
}

.g-input:focus,
.g-select:focus,
.g-textarea:focus {
    outline: none;
    border-color: var(--g-primary);
    box-shadow: 0 0 0 3px rgba(var(--g-primary-rgb), .14);
}

.g-input:disabled,
.g-select:disabled,
.g-textarea:disabled {
    background: var(--g-surface-2);
    color: var(--g-text-muted);
    cursor: not-allowed;
}

/* etiqueta flotante */
.g-float-label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--g-text-muted);
    font-size: .95rem;
    font-weight: 500;
    pointer-events: none;
    transition: all .15s ease;
    padding: 0 5px;
    max-width: calc(100% - 30px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.g-field--icon .g-float-label {
    left: 44px;
}

.g-field__control:focus-within .g-float-label,
.g-input:not(:placeholder-shown)~.g-float-label,
.g-textarea:not(:placeholder-shown)~.g-float-label,
.g-field--filled .g-float-label {
    top: 0;
    left: 11px;
    transform: translateY(-50%) scale(.82);
    background: var(--g-surface);
    font-weight: 600;
}

.g-field--textarea .g-float-label {
    top: 22px;
    transform: none;
}

.g-field--textarea .g-field__control:focus-within .g-float-label,
.g-field--textarea .g-textarea:not(:placeholder-shown)~.g-float-label {
    top: 0;
    transform: translateY(-50%) scale(.82);
}

.g-field__control:focus-within .g-float-label {
    color: var(--g-primary-700);
    font-weight: 700;
}

/* icono izquierdo */
.g-field__icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--g-text-muted);
    font-size: 21px;
    pointer-events: none;
    transition: color .15s ease;
}

.g-field--icon .g-input,
.g-field--icon .g-select {
    padding-left: 44px;
}

.g-field__control:focus-within .g-field__icon {
    color: var(--g-primary);
}

/* error */
.g-input--error,
.g-select--error,
.g-field--error .g-input,
.g-field--error .g-select,
.g-field--error .g-textarea {
    border-color: var(--g-danger);
}

.g-field--error .g-float-label {
    color: var(--g-danger) !important;
}

.g-error {
    color: var(--g-danger);
    font-size: .78rem;
    margin: 5px 4px 0;
    display: block;
}

.g-filter-bar .g-field {
    margin-bottom: 0;
}

.g-grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0 18px;
}

.g-checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: .9rem;
}

.g-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--g-primary);
}

/* Autocomplete (buscable) */
.g-autocomplete__control .g-input {
    padding-right: 38px;
    cursor: pointer;
}

.g-autocomplete__chevron {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--g-text-muted);
    pointer-events: none;
    font-size: 22px;
    transition: transform var(--g-transition);
}

.g-autocomplete__control.is-open .g-autocomplete__chevron {
    transform: translateY(-50%) rotate(180deg);
}

.g-autocomplete__control.is-open .g-input {
    border-color: var(--g-primary);
    box-shadow: 0 0 0 3px rgba(var(--g-primary-rgb), .15);
}

.g-autocomplete__list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 55;
    background: var(--g-surface);
    border: 1px solid var(--g-border-strong);
    border-radius: var(--g-radius);
    box-shadow: var(--g-shadow-lg);
    max-height: 280px;
    overflow-y: auto;
    padding: 5px;
}

.g-autocomplete__item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: .88rem;
    border-radius: var(--g-radius-sm);
    transition: background var(--g-transition);
}

.g-autocomplete__item:hover,
.g-autocomplete__item.active {
    background: var(--g-primary-soft);
    color: var(--g-primary-700);
    font-weight: 600;
}

.g-autocomplete__empty {
    padding: 14px 12px;
    color: var(--g-text-muted);
    font-size: .85rem;
    text-align: center;
}

/* ----------------------------- Tables ---------------------------------- */
.g-table-wrap {
    overflow-x: auto;
    border-radius: var(--g-radius);
    border: 1px solid var(--g-border);
    background: var(--g-surface);
    box-shadow: var(--g-shadow-sm);
}

.g-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.g-table thead th {
    background: var(--g-primary-600);
    text-align: left;
    padding: 13px 16px;
    font-weight: 700;
    color: #fff;
    border-bottom: 0;
    white-space: nowrap;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    position: sticky;
    top: 0;
}

.g-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--g-border);
    vertical-align: middle;
}

.g-table tbody tr:last-child td {
    border-bottom: 0;
}

.g-table tbody tr {
    transition: background var(--g-transition);
}

.g-table tbody tr:hover {
    background: var(--g-primary-soft);
}

.g-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.g-table .center {
    text-align: center;
}

.g-table__empty {
    padding: 52px;
    text-align: center;
    color: var(--g-text-muted);
}

.g-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.g-search {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 400px;
}

.g-search input {
    padding-left: 40px;
}

.g-search .icon,
.g-search .material-symbols-rounded {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--g-text-muted);
    font-size: 20px;
    pointer-events: none;
}

.g-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 4px 2px;
    flex-wrap: wrap;
}

.g-pagination__info {
    color: var(--g-text-muted);
    font-size: .82rem;
}

.g-pagination__pages {
    display: flex;
    gap: 4px;
}

/* ----------------------------- Badges & chips -------------------------- */
.g-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
}

.g-badge--success {
    background: var(--g-success-soft);
    color: var(--g-success);
}

.g-badge--danger {
    background: var(--g-danger-soft);
    color: var(--g-danger);
}

.g-badge--warning {
    background: var(--g-warning-soft);
    color: var(--g-warning);
}

.g-badge--info {
    background: var(--g-info-soft);
    color: var(--g-info);
}

.g-badge--neutral {
    background: var(--g-surface-2);
    color: var(--g-text-soft);
    border: 1px solid var(--g-border);
}

.g-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--g-border-strong);
    background: var(--g-surface);
    color: var(--g-text-soft);
    transition: all var(--g-transition);
    white-space: nowrap;
}

.g-chip:hover {
    border-color: var(--g-primary);
    color: var(--g-primary-600);
}

.g-chip.active {
    background: var(--g-primary-600);
    border-color: var(--g-primary-600);
    color: #fff;
    box-shadow: 0 4px 12px -3px rgba(var(--g-primary-rgb), .5);
}

/* Fila del cliente en el POS: el field no debe aportar su margen inferior,
   así los botones (+ / info) quedan centrados con el input. */
.pos__cliente-row .g-field { margin-bottom: 0; }

/* Aviso "abre la caja" en el POS. */
.pos-cajawarn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; font: inherit; cursor: pointer;
    text-decoration: none; font-weight: 700; font-size: .85rem;
    color: var(--g-danger); background: var(--g-danger-soft, rgba(239,68,68,.1));
    border: 1px solid var(--g-danger); border-radius: 10px;
    padding: 9px 12px; margin-bottom: 8px;
}
.pos-cajawarn .material-symbols-rounded { font-size: 1.1rem; }
.pos-cajawarn--amber { color: #a15c00; background: rgba(245,158,11,.12); border-color: #f59e0b; }

/* Campo Código + botón "generar" (descuentos): el campo crece y el botón se centra. */
.g-desc-cod { display: flex; gap: 6px; align-items: center; }
.g-desc-cod .g-field { flex: 1; margin-bottom: 0; }

/* Campo con botón "+" al lado (ej. añadir proveedor/cliente sin salir del modal). */
.g-addrow { display: flex; gap: 6px; align-items: center; }
.g-addrow .g-field { flex: 1; margin-bottom: 0; }

/* Cabecera de "Nueva compra": proveedor (+), factura y fecha en una sola línea alineada. */
.g-compra-head { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.g-compra-head .g-field { margin-bottom: 0; }

/* Conmutador de moneda (POS multi-moneda) */
.pos-moneda-sw {
    display: inline-flex;
    align-items: center;
    background: var(--g-surface-2, #eef1f6);
    border: 1px solid var(--g-border-strong);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}
.pos-moneda-sw button {
    border: 0;
    background: transparent;
    color: var(--g-text-soft);
    font-weight: 700;
    font-size: .8rem;
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--g-transition);
    min-width: 42px;
}
.pos-moneda-sw button.active {
    background: var(--g-primary-600);
    color: #fff;
    box-shadow: 0 3px 10px -3px rgba(var(--g-primary-rgb), .5);
}

/* --------------------------- Estado vacío ------------------------------ */
.g-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    gap: 6px;
}
.g-empty__icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
    background: var(--g-primary-soft);
    color: var(--g-primary-600);
    box-shadow: 0 10px 28px -12px rgba(var(--g-primary-rgb), .45);
}
.g-empty__icon .material-symbols-rounded {
    font-size: 44px;
    font-variation-settings: 'wght' 300;
}
.g-empty__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--g-text);
}
.g-empty__subtitle {
    font-size: .9rem;
    color: var(--g-text-soft);
    max-width: 420px;
}
.g-empty__actions { margin-top: 12px; }

/* ----------------------------- Modal ----------------------------------- */
.g-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 56px 16px;
    z-index: 60;
    overflow-y: auto;
    backdrop-filter: blur(3px);
    animation: g-fade .15s ease;
}

.g-modal {
    background: var(--g-surface);
    border-radius: var(--g-radius-lg);
    box-shadow: var(--g-shadow-lg);
    width: 100%;
    max-width: 560px;
    animation: g-pop .2s cubic-bezier(.34, 1.56, .64, 1);
    margin: auto 0;
}

.g-modal--lg {
    max-width: 940px;
}

.g-modal--sm {
    max-width: 420px;
}

.g-modal__header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--g-border);
    display: flex;
    align-items: center;
}

.g-modal__title {
    font-size: 1.12rem;
    font-weight: 700;
}

.g-modal__close {
    margin-left: auto;
    background: var(--g-danger);
    border: 0;
    cursor: pointer;
    color: #fff;
    line-height: 1;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.55rem;
    font-weight: 400;
    transition: all var(--g-transition);
    box-shadow: 0 4px 10px -2px rgba(225, 29, 72, .5);
}

.g-modal__close:hover {
    filter: brightness(1.08);
    transform: rotate(90deg);
}

.g-modal__body {
    padding: 24px;
}

.g-modal__footer {
    padding: 16px 24px;
    border-top: 1px solid var(--g-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes g-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes g-pop {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ----------------------------- Toasts ---------------------------------- */
.g-toasts {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 370px;
}

.g-toast {
    position: relative;
    background: var(--g-surface);
    border: 1px solid var(--g-border);
    border-left: 4px solid var(--g-text-muted);
    border-radius: 14px;
    box-shadow: 0 16px 40px -12px rgba(15, 23, 42, .30), 0 4px 12px -4px rgba(15, 23, 42, .14);
    padding: 13px 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 300px;
    animation: g-slide .26s cubic-bezier(.2, .8, .2, 1);
}

.g-toast--success { border-left-color: var(--g-success); }
.g-toast--error   { border-left-color: var(--g-danger); }
.g-toast--info    { border-left-color: var(--g-info); }
.g-toast--warning { border-left-color: var(--g-warning); }

.g-toast__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 20px;
    background: var(--g-surface-2);
    color: var(--g-text-muted);
}

.g-toast--success .g-toast__icon { background: var(--g-success-soft); color: var(--g-success); }
.g-toast--error   .g-toast__icon { background: var(--g-danger-soft);  color: var(--g-danger); }
.g-toast--info    .g-toast__icon { background: var(--g-info-soft);    color: var(--g-info); }
.g-toast--warning .g-toast__icon { background: var(--g-warning-soft); color: var(--g-warning); }

.g-toast > div { flex: 1; min-width: 0; }

.g-toast__title {
    font-weight: 700;
    font-size: .9rem;
    color: var(--g-text);
    line-height: 1.3;
}

.g-toast__msg {
    font-size: .82rem;
    color: var(--g-text-soft);
    margin-top: 2px;
    line-height: 1.4;
}

.g-toast__close {
    flex-shrink: 0;
    align-self: flex-start;
    margin-left: 4px;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--g-text-muted);
    font-size: 1.15rem;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 7px;
}

.g-toast__close:hover { background: var(--g-surface-2); color: var(--g-text); }

@keyframes g-slide {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ----------------------------- Spinner --------------------------------- */
.g-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid var(--g-border);
    border-top-color: var(--g-primary);
    border-radius: 50%;
    animation: g-spin .7s linear infinite;
}

.g-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 60px;
    color: var(--g-text-muted);
}

.g-loader {
    display: inline-flex;
    gap: 9px;
    align-items: flex-end;
    height: 24px;
}

.g-loader span {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--g-primary);
    animation: g-bounce-dot 1s ease-in-out infinite;
}

.g-loader span:nth-child(2) {
    animation-delay: .15s;
}

.g-loader span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes g-bounce-dot {

    0%,
    80%,
    100% {
        transform: translateY(0) scale(.7);
        opacity: .45;
    }

    40% {
        transform: translateY(-15px) scale(1);
        opacity: 1;
    }
}

.g-loading__text {
    color: var(--g-text-muted);
    font-weight: 600;
    letter-spacing: .02em;
    animation: g-pulse-text 1.4s ease-in-out infinite;
}

@keyframes g-pulse-text {

    0%,
    100% {
        opacity: .55;
    }

    50% {
        opacity: 1;
    }
}

@keyframes g-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton */
.g-skeleton {
    background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%);
    background-size: 400% 100%;
    animation: g-shimmer 1.4s ease infinite;
    border-radius: 8px;
}

@keyframes g-shimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

/* ----------------------------- Charts ---------------------------------- */
.g-chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 44px;
    color: var(--g-text-muted);
}

.g-chart-empty .material-symbols-rounded {
    font-size: 42px;
    opacity: .4;
}

.g-chart-x {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    color: var(--g-text-muted);
    font-size: .78rem;
}

.g-bars-h {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.g-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.g-bar-row__label {
    width: 160px;
    flex-shrink: 0;
    font-size: .85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.g-bar-row__track {
    flex: 1;
    height: 11px;
    background: var(--g-surface-2);
    border-radius: 6px;
    overflow: hidden;
}

.g-bar-row__fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--g-primary-600), var(--g-accent));
    transition: width .4s ease;
    min-width: 2px;
}

.g-bar-row__val {
    width: 96px;
    text-align: right;
    font-weight: 700;
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}

.g-stat {
    display: flex;
    gap: 26px;
    flex-wrap: wrap;
}

.g-stat__item .l {
    color: var(--g-text-muted);
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.g-stat__item .v {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

/* ----------------------------- POS ------------------------------------- */
.pos {
    display: grid;
    grid-template-columns: 1fr 384px;
    gap: 20px;
    height: calc(100vh - var(--g-topbar-height) - 52px);
    min-height: 460px;
}

.pos__catalog {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.pos__search {
    position: relative;
    flex: 0 0 auto;
    margin-bottom: 14px;
}

.pos__search input {
    width: 100%;
    padding-left: 42px;
}

.pos__search .material-symbols-rounded {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--g-text-muted);
    pointer-events: none;
}

.pos__chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 2px 2px 14px;
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.pos__chips::-webkit-scrollbar {
    height: 6px;
}

.pos__chips .g-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.pos__chips .g-chip {
    border-radius: 12px;
}

.pos__chips .g-chip .material-symbols-rounded {
    font-size: 18px;
}

.pos__chipswrap {
    position: relative;
}

.pos__chiparrow {
    position: absolute;
    top: 4px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--g-border-strong);
    background: var(--g-surface);
    box-shadow: var(--g-shadow-sm);
    color: var(--g-text-soft);
    cursor: pointer;
    display: none;
    place-items: center;
    z-index: 3;
}

.pos__chiparrow.left {
    left: -2px;
}

.pos__chiparrow.right {
    right: -2px;
}

.pos__chiparrow:hover {
    border-color: var(--g-primary);
    color: var(--g-primary-600);
}

.pos__chipswrap.can-left .pos__chiparrow.left {
    display: grid;
}

.pos__chipswrap.can-right .pos__chiparrow.right {
    display: grid;
}

.pos__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 12px;
    overflow-y: auto;
    padding: 2px 6px 6px 2px;
    align-content: start;
    flex: 1;
    min-height: 0;
}

.pos-prod {
    position: relative;
    background: var(--g-surface);
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius);
    padding: 14px;
    cursor: pointer;
    transition: all var(--g-transition);
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    box-shadow: var(--g-shadow-xs);
    min-height: 122px;
    justify-content: space-between;
}

.pos-prod:hover {
    border-color: var(--g-primary);
    box-shadow: var(--g-shadow);
    transform: translateY(-2px);
}

.pos-prod:active {
    transform: scale(.97);
}

.pos-prod.is-in-cart {
    border-color: var(--g-primary);
    background: var(--g-primary-soft);
    box-shadow: 0 0 0 1px var(--g-primary) inset;
}

.pos-prod.is-out {
    opacity: .5;
}

.pos-prod__qty {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--g-primary);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    box-shadow: var(--g-shadow-sm);
    z-index: 1;
}

/* ----------------------------- Dashboard mejoras ----------------------- */
.g-kpis--5 {
    grid-template-columns: repeat(auto-fit, minmax(186px, 1fr));
}

.g-kpi {
    border-left-width: 4px;
    border-left-color: var(--g-primary);
}

.g-kpi--primary {
    border-left-color: var(--g-primary);
}

.g-kpi--success {
    border-left-color: var(--g-success);
}

.g-kpi--warning {
    border-left-color: var(--g-warning);
}

.g-kpi--info {
    border-left-color: var(--g-info);
}

.g-kpi--danger {
    border-left-color: var(--g-danger);
}

/* El texto del valor se adapta al ancho de la card (números grandes no se desbordan) */
.g-kpi>div:last-child {
    min-width: 0;
}

.g-kpi__value {
    font-size: clamp(1.02rem, 2.1vw, 1.5rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.g-stat--center {
    justify-content: center;
    row-gap: 16px;
}

.g-stat--center .g-stat__item {
    text-align: center;
}

.g-chart-tip {
    position: absolute;
    transform: translate(-50%, calc(-100% - 12px));
    background: var(--g-text);
    color: #fff;
    padding: 7px 11px;
    border-radius: 9px;
    font-size: .78rem;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--g-shadow);
    z-index: 5;
}

.g-chart-tip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--g-text);
}

.g-chart-tip__label {
    opacity: .7;
    font-size: .68rem;
}

.g-chart-tip__val {
    font-weight: 800;
}

.g-chart rect {
    cursor: crosshair;
}

.g-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

/* Tarjeta de indicadores destacada (fondo primario, texto blanco, icono por métrica) */
.g-statcard {
    background: linear-gradient(135deg, var(--g-primary-700), var(--g-primary));
    color: #fff;
    border-radius: var(--g-radius);
    padding: 16px 20px;
    box-shadow: 0 10px 26px -8px rgba(var(--g-primary-rgb), .55);
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    justify-content: space-between;
    align-items: center;
    overflow-x: auto;
}

.g-statcard::-webkit-scrollbar {
    height: 6px;
}

.g-statcard__item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 0;
}

.g-statcard__item>.material-symbols-rounded {
    font-size: 21px;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.g-statcard__item .l {
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 600;
    opacity: .82;
    white-space: nowrap;
}

.g-statcard__item .v {
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
    color: #fff;
    white-space: nowrap;
}

/* Tooltip propio (CSS puro) — usar con clase g-tip y atributo data-tip */
.g-tip {
    position: relative;
}

.g-tip::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translate(-50%, -8px);
    background: #0f172a;
    color: #fff;
    padding: 6px 11px;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 8px 20px -6px rgba(15, 23, 42, .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s, transform .15s;
    z-index: 60;
}

.g-tip::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translate(-50%, 4px);
    border: 6px solid transparent;
    border-top-color: #0f172a;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s;
    z-index: 60;
}

.g-tip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -4px);
}

.g-tip:hover::before {
    opacity: 1;
    visibility: visible;
}

.g-fade-up {
    animation: g-fade-up .45s cubic-bezier(.2, .7, .3, 1) both;
}

/* === Tooltip personalizado (globo flotante en body, lo controla window.gestyTooltip) ===
   Secuestra el `title` nativo de cualquier elemento y muestra este globo. Vive en el
   body con position:fixed para no recortarse dentro de tablas u overflow. */
#g-tooltip {
    position: fixed;
    z-index: 100000;                 /* por encima de overlays (offline=99998) y modales */
    pointer-events: none;
    max-width: 260px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #1e293b;
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    box-shadow: 0 10px 24px -8px rgba(15, 23, 42, .55), 0 2px 6px rgba(15, 23, 42, .25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(2px);
    transition: opacity .12s ease, transform .12s ease;
}

[data-theme="dark"] #g-tooltip {
    background: #334155;
    box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .6);
}

#g-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Flecha: apunta hacia el objetivo según el globo esté arriba o abajo de él. */
#g-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
}

#g-tooltip.g-tip--above::after {
    top: 100%;                        /* globo arriba → flecha abajo apuntando al objetivo */
    border-top-color: #1e293b;
}

#g-tooltip.g-tip--below::after {
    bottom: 100%;                     /* globo abajo → flecha arriba */
    border-bottom-color: #1e293b;
}

[data-theme="dark"] #g-tooltip.g-tip--above::after { border-top-color: #334155; }
[data-theme="dark"] #g-tooltip.g-tip--below::after { border-bottom-color: #334155; }

@media (prefers-reduced-motion: reduce) {
    #g-tooltip { transition: opacity .12s ease; transform: none; }
    #g-tooltip.is-visible { transform: none; }
}

@keyframes g-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ----------------------------- Selector de iconos ---------------------- */
.g-iconpick__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 12px;
}

.g-iconpick__preview {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 26px;
    background: var(--g-primary-soft);
    color: var(--g-primary-600);
    border-radius: 12px;
}

.g-iconpick__bar .g-input {
    flex: 1;
}

.g-iconpick__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 8px;
    max-height: 230px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--g-border);
    border-radius: 12px;
    margin-bottom: 16px;
}

.g-iconpick__item {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid var(--g-border);
    border-radius: 10px;
    background: var(--g-surface);
    color: var(--g-text-soft);
    cursor: pointer;
    transition: all var(--g-transition);
}

.g-iconpick__item .material-symbols-rounded {
    font-size: 24px;
}

.g-iconpick__item:hover {
    border-color: var(--g-primary);
    color: var(--g-primary-600);
    background: var(--g-primary-soft);
}

.g-iconpick__item.active {
    border-color: var(--g-primary-600);
    background: var(--g-primary-600);
    color: #fff;
    box-shadow: 0 4px 12px -3px rgba(var(--g-primary-rgb), .5);
}

/* ----------------------------- Confirm (SweetAlert-like) --------------- */
.g-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
    padding: 20px;
    animation: g-conf-fade .15s ease;
}

.g-confirm {
    background: var(--g-surface);
    width: 100%;
    max-width: 420px;
    border-radius: var(--g-radius-lg);
    box-shadow: var(--g-shadow-lg);
    padding: 30px 28px 24px;
    text-align: center;
    animation: g-conf-pop .2s cubic-bezier(.34, 1.56, .64, 1);
}

.g-confirm__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
}

.g-confirm__icon .material-symbols-rounded {
    font-size: 40px;
    font-variation-settings: 'FILL' 1, 'wght' 600;
}

.g-confirm__icon.is-danger {
    background: var(--g-danger-soft);
    color: var(--g-danger);
}

.g-confirm__icon.is-info {
    background: var(--g-primary-soft);
    color: var(--g-primary-600);
}

.g-confirm__title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.g-confirm__msg {
    color: var(--g-text-soft);
    font-size: .92rem;
    line-height: 1.5;
    margin: 0 0 24px;
}

.g-confirm__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.g-confirm__actions .g-btn {
    min-width: 120px;
    justify-content: center;
}

@keyframes g-conf-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes g-conf-pop {
    from {
        opacity: 0;
        transform: scale(.9) translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.pos-prod__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.pos-prod__code {
    font-size: .68rem;
    font-weight: 700;
    color: var(--g-primary-600);
    letter-spacing: .03em;
}

.pos-prod__unit {
    font-size: .6rem;
    font-weight: 700;
    color: var(--g-text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
    background: var(--g-primary-soft);
    padding: 2px 7px;
    border-radius: 999px;
    white-space: nowrap;
}

.pos-prod__name {
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.25;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pos-prod__foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    margin-top: 4px;
}

.pos-prod__price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pos-prod__pricemain {
    font-weight: 800;
    font-size: 1rem;
    white-space: nowrap;
}

.pos-prod__per {
    font-size: .6rem;
    font-weight: 600;
    color: var(--g-text-muted);
}

.pos-prod__bulto {
    font-size: .6rem;
    font-weight: 700;
    color: var(--g-primary-700);
    background: var(--g-primary-soft);
    padding: 1px 6px;
    border-radius: 999px;
    align-self: flex-start;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-prod__stock {
    font-size: .7rem;
    padding: 2px 8px;
    border-radius: 999px;
}

.pos__cart {
    background: var(--g-surface);
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius);
    box-shadow: var(--g-shadow);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pos__cart-head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--g-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pos__cart-head h3 {
    font-size: 1.05rem;
}

.pos__cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
}

.pos__cart-empty {
    text-align: center;
    color: var(--g-text-muted);
    padding: 48px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.pos__cart-empty .material-symbols-rounded {
    font-size: 48px;
    opacity: .4;
}

.pos-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--g-border);
}

.pos-line:last-child {
    border-bottom: 0;
}

.pos-line__info {
    flex: 1;
    min-width: 0;
}

.pos-line__name {
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-line__price {
    font-size: .76rem;
    color: var(--g-text-muted);
}

.pos-line__bulto {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    padding: 1px 7px 1px 5px;
    border: 1px solid var(--g-border-strong);
    border-radius: 999px;
    background: var(--g-surface);
    color: var(--g-text-muted);
    font-size: .66rem;
    font-weight: 700;
    line-height: 1.6;
    cursor: pointer;
    vertical-align: middle;
    transition: all var(--g-transition);
}

.pos-line__bulto:hover {
    border-color: var(--g-primary);
    color: var(--g-primary-700);
    background: var(--g-primary-soft);
}

.pos-line__bulto.active {
    border-color: var(--g-primary);
    color: #fff;
    background: var(--g-primary);
}

.pos-line__bulto .material-symbols-rounded {
    font-size: 13px;
}

.pos-qty {
    display: inline-flex;
    align-items: stretch;
    height: 34px;
    border: 1px solid var(--g-border-strong);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.pos-qty button {
    width: 32px;
    border: 0;
    padding: 0;
    background: var(--g-surface-2);
    cursor: pointer;
    display: grid;
    place-items: center;
    color: var(--g-text);
    transition: background var(--g-transition);
}

.pos-qty button:hover {
    background: var(--g-border);
}

.pos-qty button .material-symbols-rounded {
    font-size: 18px;
}

.pos-qty span {
    min-width: 40px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .85rem;
    border-left: 1px solid var(--g-border);
    border-right: 1px solid var(--g-border);
}

.pos-qty__input {
    width: 56px;
    text-align: center;
    border: 0;
    border-left: 1px solid var(--g-border);
    border-right: 1px solid var(--g-border);
    font-weight: 700;
    font-size: .85rem;
    padding: 0 2px;
    background: var(--g-surface);
    color: var(--g-text);
    -moz-appearance: textfield;
}

.pos-qty__input::-webkit-outer-spin-button,
.pos-qty__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pos-qty__input:focus {
    outline: none;
    background: var(--g-primary-soft);
}

.pos-qty--edit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    cursor: pointer;
    color: var(--g-text);
}

.pos-qty--edit:hover {
    border-color: var(--g-primary);
    color: var(--g-primary-600);
    background: var(--g-primary-soft);
}

.pos-qty__edval {
    font-weight: 700;
    font-size: .9rem;
}

.pos-line__total {
    font-weight: 700;
    min-width: 64px;
    text-align: right;
    font-size: .85rem;
}

.pos__cart-foot {
    padding: 16px 18px;
    border-top: 1px solid var(--g-border);
    background: var(--g-surface-2);
    border-radius: 0 0 var(--g-radius) var(--g-radius);
}

.pos__totals {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.pos__totals .row {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    color: var(--g-text-soft);
}

.pos__totals .grand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--g-text);
    padding-top: 8px;
    border-top: 1px dashed var(--g-border-strong);
}

@media (max-width: 1100px) {
    .pos {
        grid-template-columns: 1fr;
        height: auto;
    }

    .pos__cart {
        position: sticky;
        bottom: 0;
    }
}

/* ----------------------------- Utilities ------------------------------- */
.g-flex {
    display: flex;
}

.g-flex-col {
    display: flex;
    flex-direction: column;
}

.g-items-center {
    align-items: center;
}

.g-justify-between {
    justify-content: space-between;
}

.g-gap-sm {
    gap: 8px;
}

.g-gap {
    gap: 16px;
}

.g-gap-lg {
    gap: 24px;
}

.g-mt {
    margin-top: 16px;
}

.g-mb {
    margin-bottom: 16px;
}

.g-mt-sm {
    margin-top: 8px;
}

.g-mb-sm {
    margin-bottom: 8px;
}

.g-text-muted {
    color: var(--g-text-muted);
}

.g-text-soft {
    color: var(--g-text-soft);
}

.g-text-right {
    text-align: right;
}

.g-text-success {
    color: var(--g-success);
}

.g-text-danger {
    color: var(--g-danger);
}

.g-fw-700 {
    font-weight: 700;
}

.g-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.g-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.g-divider {
    height: 1px;
    background: var(--g-border);
    margin: 18px 0;
    border: 0;
}

/* ----------------------------- Responsive / colapsar menú -------------- */
/* Escritorio: al colapsar se oculta el sidebar y el contenido se ensancha */
.g-sidebar {
    transition: transform var(--g-transition);
}

.g-app.is-collapsed .g-sidebar {
    transform: translateX(-100%);
}

.g-app.is-collapsed .g-main {
    margin-left: 0;
}

@media (max-width: 900px) {
    .g-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--g-shadow-lg);
    }

    .g-main {
        margin-left: 0;
    }

    .g-app.is-collapsed .g-sidebar {
        transform: translateX(0);
    }

    /* en móvil: abrir */
    .g-app.is-collapsed .g-main {
        margin-left: 0;
    }

    .g-grid-2 {
        grid-template-columns: 1fr;
    }

    .g-content {
        padding: 18px;
    }
}

.g-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 35;
    backdrop-filter: blur(2px);
}

@media (min-width: 901px) {
    .g-backdrop {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}