/* ============ CARDS DE RESUMEN ============ */
.cards-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.card-resumen {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 22px 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.3s, box-shadow 0.3s, border-color 0.3s, transform 0.2s ease-out;
    cursor: default;
    transform-style: preserve-3d;
    will-change: transform;
}

.card-resumen:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.card-resumen .label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.card-resumen .valor {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.card-resumen .sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.card-destacado {
    border-left: 3px solid transparent;
}

.card-destacado.verde { border-left-color: var(--green); }
.card-destacado.naranja { border-left-color: var(--orange); }
.card-destacado.azul { border-left-color: var(--accent); }

/* ============ ALERTAS ============ */
.alerta-stock {
    background: var(--yellow-bg);
    border: 1px solid rgba(250, 204, 21, 0.25);
    border-radius: var(--radius);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #fde68a;
    backdrop-filter: blur(8px);
}

/* ============ TABLAS ============ */
.tabla-contenedor {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.tabla-contenedor .tabla-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-card);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.tabla {
    width: 100%;
    border-collapse: collapse;
}

.tabla th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-card);
}

.tabla td {
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 14px;
    color: var(--text-secondary);
}

.tabla tr:last-child td { border-bottom: none; }

.tabla tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.badge-mp {
    display: inline-block;
    background: rgba(91, 141, 239, 0.15);
    color: var(--accent-hover);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.badge-efectivo {
    display: inline-block;
    background: var(--green-bg);
    color: var(--green);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.stock-bajo {
    color: var(--red);
    font-weight: 600;
}

.badge-rol {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
}

/* ============ BOTONES ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: -0.2px;
}

.btn:active { transform: scale(0.97); }

.btn-primario {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primario:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-secundario {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-card);
}

.btn-secundario:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-peligro {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-peligro:hover {
    background: rgba(248, 113, 113, 0.2);
}

.btn-chico {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: var(--radius-xs);
}

.btn-icono {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-card);
    color: var(--text-secondary);
}

.btn-icono:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* ============ FORMULARIOS ============ */
.grupo-campo {
    margin-bottom: 18px;
}

.grupo-campo label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grupo-campo input,
.grupo-campo select {
    width: 100%;
    padding: 11px 15px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    transition: all var(--transition);
}

.grupo-campo input:focus,
.grupo-campo select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(255, 255, 255, 0.06);
}

.grupo-campo input::placeholder {
    color: var(--text-muted);
}

.grupo-campo select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2359647a'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.grupo-campo select option {
    background: #161b2c;
    color: var(--text-primary);
}

.mensaje-error {
    background: var(--red-bg);
    color: var(--red);
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    border: 1px solid rgba(248, 113, 113, 0.2);
    margin-bottom: 16px;
    display: none;
}

.mensaje-error.visible { display: block; }

.fila-campos {
    display: grid;
    gap: 14px;
}

.fila-campos.col-2 { grid-template-columns: 1fr 1fr; }
.fila-campos.col-3 { grid-template-columns: 1fr 1fr 1fr; }
.fila-campos.col-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: overlayIn 0.2s ease;
}


.modal {
    background: var(--bg-glass);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 520px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}


.modal-grande {
    width: 700px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.modal-cerrar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-card);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-cerrar:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.modal-footer {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============ TICKET ============ */
.ticket {
    background: #fff;
    color: #111;
    font-family: 'Courier New', monospace;
    padding: 20px;
    border-radius: 0;
    font-size: 12px;
    line-height: 1.6;
    width: 280px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.ticket .ticket-header {
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 4px;
}

.ticket .ticket-sub {
    text-align: center;
    font-size: 10px;
    color: #555;
    margin-bottom: 10px;
}

.ticket hr {
    border: none;
    border-top: 1px dashed #ccc;
    margin: 8px 0;
}

.ticket .ticket-item {
    display: flex;
    justify-content: space-between;
}

.ticket .ticket-total {
    font-weight: bold;
    font-size: 14px;
    text-align: right;
    margin-top: 4px;
}

.ticket .ticket-footer {
    text-align: center;
    font-size: 10px;
    color: #555;
    margin-top: 8px;
}

/* ============ FILTROS ============ */
.filtros-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
}

.filtros-bar .grupo-campo {
    margin-bottom: 0;
    min-width: 140px;
}

.filtros-bar .grupo-campo label {
    font-size: 10px;
    margin-bottom: 4px;
}

.filtros-bar .grupo-campo input,
.filtros-bar .grupo-campo select {
    padding: 8px 12px;
    font-size: 13px;
}

/* ============ BUSQUEDA EN SECCIONES ============ */
.busqueda-seccion {
    width: 280px;
}

.busqueda-seccion input {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    width: 100%;
    transition: all var(--transition);
}

.busqueda-seccion input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.busqueda-seccion input::placeholder {
    color: var(--text-muted);
}

/* ============ ANIMACION VUELO ============ */
.vuelo-item {
    position: fixed;
    z-index: 1001;
    pointer-events: none;
    border-radius: 12px;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* ============ THEME TOGGLE FANCY ============ */
.toggle-wrapper {
    margin-top: 10px;
    display: flex;
}

.toggle {
    -webkit-tap-highlight-color: transparent;
    width: var(--toggle-w, 200px);
    aspect-ratio: 8 / 3;
    border-radius: 100vh;
    border: 0;
    position: relative;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.5s cubic-bezier(.4,-0.3,.6,1.3);
    --sky: hsl(204, 53%, 47%);
    --night: hsl(229, 25%, 16%);
    outline-color: transparent;
    background: hsl(calc(204 + (var(--dark, 0) * 25)) calc((53 - (var(--dark, 0) * 28)) * 1%) calc((47 - (var(--dark, 0) * 31)) * 1%));
    box-shadow:
        calc(var(--toggle-w, 200px) * 0) calc(var(--toggle-w, 200px) * 0.02) calc(var(--toggle-w, 200px) * 0.01) calc(var(--toggle-w, 200px) * -0.0025) hsl(210 10% 100% / 0.8),
        calc(var(--toggle-w, 200px) * 0) calc(var(--toggle-w, 200px) * -0.02) calc(var(--toggle-w, 200px) * 0.01) calc(var(--toggle-w, 200px) * -0.0025) hsl(210 10% 10% / 0.2),
        calc(var(--toggle-w, 200px) * 0) calc(var(--toggle-w, 200px) * 0.02) calc(var(--toggle-w, 200px) * 0.5) 0 hsl(210 10% 100% / 0.15);
}

.toggle:after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow:
        calc(var(--toggle-w, 200px) * 0) calc(var(--toggle-w, 200px) * -0.025) calc(var(--toggle-w, 200px) * 0.025) 0 hsl(210 10% 10% / 0.15) inset,
        calc(var(--toggle-w, 200px) * 0) calc(var(--toggle-w, 200px) * 0.025) calc(var(--toggle-w, 200px) * 0.025) 0 hsl(210 10% 10% / 0.65) inset;
    border-radius: 100vh;
}

.toggle__content {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    border-radius: 100vh;
    display: block;
    clip-path: inset(0 0 0 0 round 100vh);
    container-type: inline-size;
}

.toggle__backdrop {
    overflow: visible !important;
    position: absolute;
    bottom: 0;
    width: 100%;
    left: 0;
    transition: translate 0.5s cubic-bezier(.4,-0.3,.6,1.3);
    translate: 0 calc(var(--dark, 0) * (100% - (3 / 8 * var(--toggle-w, 200px))));
}

[aria-pressed=false] .toggle__backdrop:last-of-type {
    transition-timing-function: cubic-bezier(.2,-0.6,.7,1.6);
}
[aria-pressed=false] .stars path {
    transition-delay: 0s;
}

.stars path {
    transform-box: fill-box;
    transform-origin: 25% 50%;
    scale: calc(0.25 + (var(--dark, 0) * 0.75));
    transition: scale 0.5s calc(0.5s * 0.5) cubic-bezier(.4,-0.3,.6,1.3);
}

.toggle__indicator {
    height: 100%;
    aspect-ratio: 1;
    border-radius: 0%;
    display: grid;
    place-items: center;
    padding: 3%;
    transition: translate 0.5s cubic-bezier(.8,-0.3,.2,1.3);
    translate: calc(var(--dark, 0) * (100cqi - 100%)) 0;
}

.toggle__star {
    height: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    position: relative;
    transition: translate 0.5s cubic-bezier(.4,-0.3,.6,1.3);
    translate: calc((var(--dark, 0) * -10%) + 5%) 0;
}

.sun {
    background: hsl(47, 91%, 58%);
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    box-shadow:
        calc(var(--toggle-w, 200px) * 0.01) calc(var(--toggle-w, 200px) * 0.01) calc(var(--toggle-w, 200px) * 0.02) 0 hsl(210 10% 100% / 0.95) inset,
        calc(var(--toggle-w, 200px) * -0.01) calc(var(--toggle-w, 200px) * -0.01) calc(var(--toggle-w, 200px) * 0.02) 0 hsl(210 10% 20% / 0.5) inset;
}

.moon {
    position: absolute;
    inset: -1%;
    border-radius: 50%;
    background: hsl(212, 13%, 82%);
    transition: translate 0.5s ease-in-out;
    translate: calc((100 - (var(--dark, 0) * 100)) * 1%) 0%;
    box-shadow:
        calc(var(--toggle-w, 200px) * 0.01) calc(var(--toggle-w, 200px) * 0.01) calc(var(--toggle-w, 200px) * 0.02) 0 hsl(210 10% 100% / 0.95) inset,
        calc(var(--toggle-w, 200px) * -0.01) calc(var(--toggle-w, 200px) * -0.01) calc(var(--toggle-w, 200px) * 0.02) 0 hsl(210 10% 10% / 0.95) inset;
}

.moon__crater {
    position: absolute;
    background: hsl(221, 16%, 68%);
    border-radius: 50%;
    width: calc(var(--size, 10) * 1%);
    aspect-ratio: 1;
    left: calc(var(--x) * 1%);
    top: calc(var(--y) * 1%);
    box-shadow:
        calc(var(--toggle-w, 200px) * 0.01) calc(var(--toggle-w, 200px) * 0.01) calc(var(--toggle-w, 200px) * 0.01) 0 hsl(210 10% 6% / 0.25) inset,
        0 calc(var(--toggle-w, 200px) * 0.005) calc(var(--toggle-w, 200px) * 0.01) 0 hsl(210 10% 100% / 0.25);
}

.moon__crater:nth-of-type(1) { --size: 18; --x: 40; --y: 15; }
.moon__crater:nth-of-type(2) { --size: 20; --x: 65; --y: 58; }
.moon__crater:nth-of-type(3) { --size: 34; --x: 18; --y: 40; }

.toggle__star:before {
    content: "";
    z-index: -1;
    width: 356%;
    background:
        radial-gradient(hsl(0 0% 100% / 0.25) 40%, transparent 40.5%),
        radial-gradient(hsl(0 0% 100% / 0.25) 56%, transparent 56.5%) hsl(0 0% 100% / 0.25);
    border-radius: 50%;
    aspect-ratio: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transition: translate 0.5s cubic-bezier(.4,-0.3,.6,1.3);
    translate: calc((50 - (var(--dark, 0) * 4)) * -1%) -50%;
}

.toggle__star:after {
    content: "";
    position: absolute;
    inset: 0;
    display: block;
    background: hsl(0 0% 0% / 0.5);
    filter: blur(4px);
    translate: 2% 4%;
    border-radius: 50%;
    z-index: -1;
}

.toggle__indicator-wrapper {
    position: absolute;
    inset: 0;
}

[aria-pressed=true] { --dark: 1; }

.stars g {
    transform-box: fill-box;
    transform-origin: 50% 50%;
}
.stars g:nth-of-type(3) { animation: twinkle 4s -2s infinite; }
.stars g:nth-of-type(11) { animation: twinkle 6s -2s infinite; }
.stars g:nth-of-type(9) { animation: twinkle 4s -1s infinite; }


/* ============ DROPDOWN USUARIO ============ */
.usuario-dropdown {
    position: relative;
    display: inline-block;
}

.usuario-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    border: 1px solid transparent;
    transition: all var(--transition);
    user-select: none;
}

.usuario-dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-card);
}

.usuario-dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 6px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
    z-index: 300;
    animation: fadeIn 0.15s ease;
}

.usuario-dropdown-menu.visible {
    display: block;
}

.usuario-dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 4px;
    transition: all var(--transition);
}

.usuario-dropdown-menu button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.usuario-dropdown-menu button.peligro {
    color: var(--red);
}

.usuario-dropdown-menu button.peligro:hover {
    background: var(--red-bg);
}

.usuario-dropdown-menu button.usuario-actual-btn {
    background: rgba(91, 141, 239, 0.08);
}

.usuario-dropdown-menu hr {
    border: none;
    border-top: 1px solid var(--border-card);
    margin: 4px 0;
}

/* ============ ICONS THEME AWARE ============ */
[data-theme="light"] .icono-tema-img {
    filter: none;
}

.icono-tema-img {
    filter: brightness(0) invert(1);
}

/* ============ AVATARES ============ */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-card);
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 16px;
    text-transform: uppercase;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar-chico {
    width: 26px;
    height: 26px;
    font-size: 12px;
}

.avatar-empresa {
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-color: rgba(255,255,255,0.2);
}

.sidebar-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

/* ============ EMOJI GRID ============ */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 6px;
    margin-bottom: 4px;
}

.emoji-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.03);
}

.emoji-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.15);
}

.emoji-item.seleccionado {
    border-color: var(--accent);
    background: var(--accent-glow);
    transform: scale(1.1);
}

/* ============ SISTEMA DE NOTIFICACIONES TOAST ============ */
#notificaciones-contenedor {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}

#notificaciones-contenedor.en-ventas {
    bottom: 90px;
}

.notificacion {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    background: color-mix(in srgb, var(--bg, #1e293b) 92%, #fff);
    border: 1px solid color-mix(in srgb, var(--text-muted, #94a3b8) 20%, transparent);
    border-radius: 12px;
    padding: 14px 18px;
    min-width: 280px;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.1);
    pointer-events: auto;
    animation: notif-bounce 0.55s cubic-bezier(0.21, 1.02, 0.58, 1) forwards;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.25s, transform 0.25s;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.notificacion.saliendo {
    animation: notif-salir 0.2s ease-in forwards;
}

.notificacion-contenido {
    flex: 1;
    font-size: 0.84rem;
    color: var(--text-primary, #e2e8f0);
    line-height: 1.4;
    font-weight: 450;
}

.notificacion-cerrar {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.notificacion-cerrar:hover { opacity: 1; }

.notificacion-barra {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 12px 12px;
    background: var(--notif-color, #22c55e);
    animation: notif-barra 5s linear forwards;
}

.notificacion.exito  { --notif-color: #22c55e; }
.notificacion.error  { --notif-color: #ef4444; }
.notificacion.alerta { --notif-color: #f59e0b; }
.notificacion.info   { --notif-color: #3b82f6; }

/* Bounce in */



/* ============ DROPDOWN NUEVO ITEM ============ */
.dropdown-nuevo-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 150px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 100;
    overflow: hidden;
    animation: dropdownIn 0.15s ease;
}

.dropdown-nuevo-menu button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-nuevo-menu button:hover {
    background: var(--bg-card-hover);
}

/* ============ DASHBOARD WIDGETS & MODO EDICIÓN ============ */

/* Botón Personalizar Widgets */
.btn-edit-widgets {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    user-select: none;
}

.btn-edit-widgets:hover {
    background: rgba(91, 141, 239, 0.12);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(91, 141, 239, 0.25);
}

.btn-edit-widgets.activo {
    background: rgba(52, 211, 153, 0.15);
    border-color: #34d399;
    color: #34d399;
    box-shadow: 0 0 16px rgba(52, 211, 153, 0.3);
}

.btn-edit-widgets.activo:hover {
    background: rgba(52, 211, 153, 0.22);
}

.btn-edit-widgets svg {
    transition: transform 0.3s ease;
}

.btn-edit-widgets:hover svg {
    transform: rotate(15deg) scale(1.1);
}

/* Grilla Unificada de 12 Columnas */
.dashboard-widgets-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-top: 16px;
    position: relative;
    transition: margin-right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Responsive Grid Spans */
.dash-widget {
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.dash-widget[data-span="3"] {
    grid-column: span 3;
}

.dash-widget[data-span="6"] {
    grid-column: span 6;
}

.dash-widget[data-span="12"] {
    grid-column: span 12;
}

@media (max-width: 1200px) {
    .dash-widget[data-span="3"] {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    .dash-widget[data-span="3"],
    .dash-widget[data-span="6"],
    .dash-widget[data-span="12"] {
        grid-column: span 12;
    }
}

/* Modo Edición en el Dashboard */
.dashboard-edit-mode .dashboard-widgets-grid {
    margin-right: 340px;
}

@media (max-width: 900px) {
    .dashboard-edit-mode .dashboard-widgets-grid {
        margin-right: 0;
    }
}

.dashboard-edit-mode .dash-widget {
    cursor: grab;
    border-radius: var(--radius-sm, 14px);
    outline: 1.5px dashed rgba(91, 141, 239, 0.55);
    outline-offset: -1px;
    will-change: transform;
}

/* Jiggle aplicado al hijo interno para no interferir con el transform FLIP del contenedor */
.dashboard-edit-mode .dash-widget > .card-resumen,
.dashboard-edit-mode .dash-widget > .tabla-contenedor {
    animation: widget-jiggle 0.65s infinite ease-in-out;
    transform-origin: center center;
    border-radius: inherit;
}

.dashboard-edit-mode .dash-widget:nth-child(even) > .card-resumen,
.dashboard-edit-mode .dash-widget:nth-child(even) > .tabla-contenedor {
    animation-delay: -0.32s;
    animation-direction: reverse;
}

.dashboard-edit-mode .dash-widget:hover {
    outline-color: var(--accent);
    box-shadow: 0 4px 20px rgba(91, 141, 239, 0.3);
}

.dashboard-edit-mode .dash-widget:hover > .card-resumen,
.dashboard-edit-mode .dash-widget:hover > .tabla-contenedor {
    animation-play-state: paused;
}

.dashboard-edit-mode .dash-widget.dragging {
    opacity: 0.35;
    transform: scale(0.98);
    cursor: grabbing;
    outline: 2px dashed var(--accent);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.dashboard-edit-mode .dash-widget.dragging > .card-resumen,
.dashboard-edit-mode .dash-widget.dragging > .tabla-contenedor {
    animation-play-state: paused;
}

.dashboard-edit-mode .dash-widget.flip-animating {
    will-change: transform;
}

.dashboard-edit-mode .dash-widget.drag-over {
    outline: 2px solid var(--accent);
    background: rgba(91, 141, 239, 0.12) !important;
}

/* Botón badge circular para quitar widget */
.widget-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: 2px solid var(--bg, #0f172a);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-edit-mode .widget-remove-btn {
    display: flex;
    animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.widget-remove-btn:hover {
    background: #dc2626;
    transform: scale(1.18);
}

/* Empty Drop Zone */
.dashboard-drop-empty {
    grid-column: span 12;
    min-height: 180px;
    border: 2px dashed rgba(91, 141, 239, 0.4);
    border-radius: 16px;
    background: rgba(91, 141, 239, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
    transition: all 0.2s ease;
}

.dashboard-drop-empty.drag-over {
    border-color: var(--accent);
    background: rgba(91, 141, 239, 0.14);
    color: var(--accent);
}

/* ============ DRAWER LATERAL DERECHO (ESTILO ANDROID) ============ */
.widget-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 330px;
    background: var(--bg-glass);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-left: 1px solid var(--border-glass);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
    z-index: 200;
    display: flex;
    flex-direction: column;
    animation: drawerSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: border-color 0.2s, background 0.2s;
}

.widget-drawer.drawer-drop-active {
    outline: 2px dashed #ef4444;
    outline-offset: -4px;
    background: rgba(239, 68, 68, 0.08) !important;
}

.widget-drawer-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.02);
}

.widget-drawer-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.widget-drawer-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.widget-drawer-header p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0 0 0;
    line-height: 1.4;
}

.widget-drawer-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.widget-drawer-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.widget-drawer-drop-hint {
    margin: 12px 16px 0 16px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px dashed rgba(239, 68, 68, 0.4);
    color: #f87171;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    display: none;
}

.widget-drawer.drawer-drop-active .widget-drawer-drop-hint {
    display: block;
    animation: popIn 0.2s ease;
}

.widget-drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Tarjeta Real WYSIWYG en Drawer */
.drawer-widget-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 10px;
    cursor: grab;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    user-select: none;
}

.drawer-widget-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(91, 141, 239, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.drawer-widget-card.dragging {
    opacity: 0.35;
    cursor: grabbing;
    transform: scale(0.96);
    outline: 2px dashed var(--accent);
}

.drawer-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.drawer-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.drawer-card-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.drawer-card-wysiwyg {
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

/* El contenido interno del widget real no debe bloquear el drag */
.drawer-card-wysiwyg .card-resumen,
.drawer-card-wysiwyg .tabla-contenedor {
    margin: 0 !important;
    width: 100% !important;
    border-radius: 10px !important;
}

.drawer-card-wysiwyg .tilt-card {
    transform: none !important;
    transition: none !important;
}

.drawer-card-wysiwyg .tabla-contenedor {
    max-height: 200px;
    overflow-x: hidden;
    overflow-y: auto;
}

.drawer-card-wysiwyg .tabla th,
.drawer-card-wysiwyg .tabla td {
    padding: 6px 8px;
    font-size: 11px;
}

.drawer-card-wysiwyg .card-resumen .label {
    font-size: 11px;
}

.drawer-card-wysiwyg .card-resumen .valor {
    font-size: 20px;
}

.drawer-card-wysiwyg .card-resumen .sub {
    font-size: 11px;
}

.btn-add-widget-quick {
    background: rgba(91, 141, 239, 0.15);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-widget-quick:hover {
    background: var(--accent);
    color: #fff;
    transform: scale(1.05);
}

/* Estado de Drawer Vacío */
.drawer-empty-state {
    padding: 30px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
}

.drawer-empty-state-icon {
    font-size: 40px;
    line-height: 1;
}

.drawer-empty-state h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.drawer-empty-state p {
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}

.widget-drawer-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: center;
}

.widget-drawer-footer .btn-reset-layout {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.widget-drawer-footer .btn-reset-layout:hover {
    color: var(--accent);
}


