:root {
    --primary-color: #5b21b6;
    --sidebar-bg: #fff;
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 70px;
    --transition: 0.3s ease;
    --text-color: #333;
    --icon-color: #5b21b6;
    --shadow: 0 0 10px rgba(0, 0, 0, 0.06);
    --border-radius: 12px;
    --font-family: 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: #f5f5f5;
    color: var(--text-color);
    overflow-x: auto;
}

/* Layout principal */
.layout {
    display: flex;
    min-height: 100vh;
    transition: var(--transition);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    position: fixed;
    /* clave */
    top: 0;
    left: 0;
    bottom: 0;
    height: 100%;
    max-height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

/* Cuando sidebar está colapsado */
.sidebar.collapsed+.main {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    color: var(--icon-color);
    font-size: 1.8rem;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: bold;
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.sidebar-menu li {
    display: block;
    list-style: none;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
    border-radius: 8px;
}

.sidebar-menu a:hover {
    background: #f0f0f0;
}

.sidebar-menu a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.sidebar-menu li:not(:has(a)) {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sidebar-menu li:not(:has(a)):hover {
    background: #f0f0f0;
}

.sidebar.collapsed .link-text {
    display: none;
}

.sidebar-footer {
    padding: 1rem;
    text-align: center;
    background: #fff;
    position: sticky;
    bottom: 0;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--icon-color);
    font-size: 1.5rem;
}

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

/* Navbar */
.navbar {
    background: #fff;
    padding: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-title {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Contenido */
.content {
    padding: 2rem;
}

.card {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    /* previene desbordes horizontales */
    box-sizing: border-box;
}


/* Responsive: apilar en pantallas pequeñas */
@media (max-width: 1024px) {
    .card-grid.grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        height: 100dvh;
        z-index: 1000;
        left: -250px;
        width: var(--sidebar-width);
    }

    .form-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar.collapsed {
        left: -70px;
    }

    .main {
        margin-left: 0;
    }

    .form-modern {
        gap: 1rem;
    }

    .form-buttons {
        display: flex;
        flex-direction: column;
        gap: 1.2rem;
        margin-top: 1rem;
    }

    .form-buttons .btn {
        width: 100%;
        padding: 0.85rem;
        font-size: 1rem;
    }

    .card {
        width: 100%;
    }

    .card-grid.grid-2,
    .card-grid.grid-3,
    .card-grid.grid-4 {
        grid-template-columns: 1fr !important;
    }
}

/* Botones */
.btn {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: white;
}

.btn-aceptar {
    background-color: #4caf50;
}

.btn-aceptar:hover {
    background-color: #43a047;
}

.btn-cancelar {
    background-color: #f44336;
}

.btn-cancelar:hover {
    background-color: #e53935;
}

.btn-info {
    background-color: #2196f3;
}

.btn-info:hover {
    background-color: #1976d2;
}

.btn-disabled {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    box-shadow: none;
}

/* Formulario */
.form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.form-grid.grid-2,
.form-grid.grid-3,
.form-grid.grid-4 {
    display: grid;
    gap: 1rem;
}

.form-grid.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-grid.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.form-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Tabla */

.data-table {
    min-width: 900px;
    width: max-content;
    border-collapse: collapse;
    table-layout: auto;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

.tabla-card {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    background: #fff;
    overflow: hidden;
}

.tabla-wrapper {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #ddd;
}


/* badge */
.badge {
    padding: 0.3rem 0.7rem;
    border-radius: 100px;
    font-size: 0.8rem;
    color: white;
}

.badge.success {
    background-color: #4caf50;
}

.badge.warning {
    background-color: #ff9800;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.input-icon {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    padding: 0.6rem 1rem;
    gap: 0.5rem;
}

.input-icon span.material-icons {
    color: var(--icon-color);
    font-size: 1.2rem;
}

.input-icon input,
.input-icon select,
.input-icon textarea {
    border: none;
    outline: none;
    font-size: 1rem;
    width: 100%;
    background: transparent;
}

/* Contenedor de alerts flotantes */
.floating-alert {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 8px;
    color: #333;
    font-weight: bold;
    z-index: 2000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease;
}

.floating-alert.success {
    background-color: #d4edda;
    color: #155724;
}

.floating-alert.error {
    background-color: #f8d7da;
    color: #721c24;
}

.floating-alert.info {
    background-color: #d1ecf1;
    color: #0c5460;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Modal base */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* === GRILLAS DE TARJETAS === */
.card-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-grid.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.card-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.card-grid.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Tooltip */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.4rem 0.7rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 99999;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* spinner global */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 6px solid #ccc;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.hidden {
    display: none;
}

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

/* tabs */

.tabs {
    margin-top: 1rem;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tab-button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--border-radius);
    background-color: #e0e0e0;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s ease;
}

.tab-button.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.tab-content.active {
    display: block;
}

/* Switch moderno */
.switch {
    position: relative;
    display: inline-block;
    width: 45px;
    height: 25px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    background-color: #ccc;
    border-radius: 50px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3.5px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.switch input:checked+.slider {
    background-color: var(--primary-color);
}

.switch input:checked+.slider::before {
    transform: translateX(20px);
}


/* acordeon */
.accordion {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    background: #e7e7e7;
}

.accordion-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    font-weight: bold;
    border-bottom: 1px solid #112c4eff;
}

.accordion-body {
    padding: 1rem;
    display: none;
}

/* Estilos generales para listas con selección */
.selector-list label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0;
    font-size: 0.95rem;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.3s ease;
}

/* Cambia color al estar seleccionado */
.selector-list input[type="checkbox"]:checked+span,
.selector-list input[type="radio"]:checked+span {
    color: var(--primary-color);
    font-weight: 600;
}

/* Selector con buscador incorporado */
.smart-selector {
    max-width: 400px;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    background: #fff;
}

.smart-selector-search {
    margin-top: 12px;
    width: 100%;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.smart-selector-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.smart-selector-list label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    color: var(--text-color);
}

.smart-selector-list input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* TOASTIFY */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.toast {
    min-width: 250px;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    box-shadow: var(--shadow);
    animation: fadeInRight 0.4s ease, fadeOut 0.4s ease 4.5s forwards;
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background-color: #4caf50;
}

.toast.error {
    background-color: #f44336;
}

.toast.info {
    background-color: #2196f3;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Toast con boton */
#toast-container-boton {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.toast-boton {
    min-width: 250px;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeInRight 0.4s ease;
}

.toast-boton.success {
    background-color: #4caf50;
}

.toast-boton.error {
    background-color: #f44336;
}

.toast-boton.info {
    background-color: #2196f3;
}

.toast-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* Tarjeta de usuarios */
.user-card {
    border: 2px solid var(--primary-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.user-name {
    font-weight: bold;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: normal;
    font-size: 1rem;
}

.icon-email {
    font-size: 20px;
    color: #7e22ce;
}


/* triple layout */
.triple-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.triple-categorias {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.triple-categorias h3 {
    margin-bottom: 1rem;
}

.triple-categorias ul {
    list-style: none;
    padding: 0;
}

.triple-categorias li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.triple-categorias li:hover {
    color: var(--primary-color);
}

.triple-derecha {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.triple-form {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.triple-form h3 {
    margin-bottom: 1rem;
}

.triple-form form input,
.triple-form form select {
    width: 100%;
}

.triple-tarjetas .card {
    min-height: 120px;
}


.product-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    transition: box-shadow 0.2s ease;
}

.product-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.product-header {
    background-color: #e0e7ff;
    padding: 1rem;
    border-bottom: 1px solid #ccc;
}

.product-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
    color: #1e1e2f;
}

.product-header p {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    color: #666;
}

.product-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.metric {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: #555;
}

.metric strong {
    font-size: 1.1rem;
    color: #000;
}

.btn-view {
    padding: 0.5rem 1rem;
    background-color: #e0e0ff;
    color: #333;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.btn-view:hover {
    background-color: #c7d2fe;
}


.accordion-categorias {
    list-style: none;
    padding: 0;
    margin: 0;
}

.accordion-categorias li {
    margin-bottom: 0.5rem;
}

.categoria-btn {
    background: none;
    border: none;
    padding: 0.4rem 0;
    font-size: 1rem;
    color: var(--text-color);
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s ease;
}

.categoria-btn:hover {
    color: var(--primary-color);
}

.subcategorias {
    display: none;
    padding-left: 1rem;
    margin-top: 0.3rem;
    list-style: none;
}

.subcategorias li {
    padding: 0.3rem 0;
    font-size: 0.95rem;
    border-bottom: 1px dashed #eee;
    cursor: pointer;
}

.subcategorias li:hover {
    color: var(--primary-color);
}


@media (max-width: 768px) {
    .triple-layout {
        grid-template-columns: 1fr;
    }

    .triple-categorias,
    .triple-form,
    .triple-tarjetas {
        width: 100%;
    }

    .triple-tarjetas.card-grid.grid-3 {
        grid-template-columns: 1fr;
    }

    .triple-derecha {
        gap: 1.5rem;
    }

    .form-grid.grid-4 {
        grid-template-columns: 1fr !important;
    }

    .triple-form .input-group {
        width: 100%;
    }

    .product-card {
        flex-direction: column;
    }

    .product-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* tutorial paso a paso */
#tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: 5000;
}

.tour-tooltip {
    position: fixed;
    z-index: 6000;
    max-width: 300px;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

.tour-tooltip::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-top-color: white;
    bottom: -20px;
    left: 20px;
}

.tour-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.tour-actions button {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-color: #5b21b6;
    color: white;
}

.tour-actions button:hover {
    background-color: #4c1c9e;
}

/* clase para ocultar objetos */

.oculto {
    display: none !important;
}

/* Clases de las metricas */
/* === Métricas redondas === */
.metrics-round-grid {
    --metric-size: 120px;
    /* ajustá tamaño del círculo */
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    justify-items: center;
}

/* En pantallas grandes, fuerza ~8 por fila */
@media (min-width: 1280px) {
    .metrics-round-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

.metric-round {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Círculo visual */
.metric-circle {
    width: var(--metric-size);
    height: var(--metric-size);
    border-radius: 50%;
    background: linear-gradient(180deg, #faf5ff, #ffffff);
    border: 2px solid #ede9fe;
    box-shadow: var(--shadow);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: .5rem;
}

/* Título arriba, cantidad grande al centro */
.metric-name {
    font-size: .8rem;
    font-weight: 600;
    color: #6b21a8;
    /* tono del primario */
    margin-bottom: .2rem;
}

.metric-count {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1;
}

/* Botón central para desplegar */
.metric-center-btn {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--primary-color);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 16px rgba(91, 33, 182, .25);
    transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}

.metric-center-btn:hover {
    transform: translateX(-50%) translateY(-1px);
    box-shadow: 0 8px 20px rgba(91, 33, 182, .32);
}

.metric-center-btn[aria-expanded="true"] .material-icons {
    transform: rotate(180deg);
    transition: transform .2s ease;
}

/* Panel de detalles */
.metric-extra-round {
    width: 100%;
    max-width: 260px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-top: 18px;
    /* separa del círculo (debajo del botón) */
    padding: .75rem .9rem;
    font-size: .9rem;
    color: #555;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height .25s ease, opacity .25s ease;
}

.metric-extra-round.open {
    opacity: 1;
    /* max-height se setea dinámicamente para animar hacia la altura de contenido */
}

.metric-extra-round ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.metric-extra-round li {
    padding: .15rem 0;
    border-bottom: 1px dashed #eee;
}

.metric-extra-round li:last-child {
    border-bottom: 0;
}

/* Ajustes responsive finos */
@media (max-width: 420px) {
    .metrics-round-grid {
        --metric-size: 108px;
    }

    .metric-extra-round {
        max-width: 100%;
    }
}


/* ===========================
   Google Forms-like (estable)
   =========================== */

/* GRID: mobile 1 col; desktop configurable */
.gform-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    /* móvil: 1 por fila */
}

.gform-grid>* {
    min-width: 0;
    /* evita empujes/overflow en CSS Grid */
    box-sizing: border-box;
}

@media (min-width:1024px) {
    .gform-grid.cols-1 {
        grid-template-columns: 1fr;
    }

    .gform-grid.cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gform-grid.cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .gform-grid.cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .gform-question.span-2,
    .gform-actions.span-2 {
        grid-column: span 2;
    }

    .gform-question.span-3,
    .gform-actions.span-3 {
        grid-column: span 3;
    }

    .gform-question.span-4,
    .gform-actions.span-4 {
        grid-column: span 4;
    }
}

/* Tarjeta de cada pregunta */
.gform-question {
    position: relative;
    background: #fff;
    border: 1px solid #e9d7f7;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    overflow: hidden;
    /* NADA se escapa de la tarjeta */
}

/* Título de la pregunta (reemplaza <legend>) */
.gform-legend,
.gform-label {
    display: block;
    width: 100%;
    margin: 0 0 .35rem 0;
    font-weight: 800;
    letter-spacing: .02em;
    color: #111827;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    /* quiebra títulos MUY largos */
    word-break: break-word;
}

.gform-required {
    color: #e53935;
    margin-left: .15rem;
}

/* Texto auxiliar */
.gform-helper {
    font-size: .9rem;
    color: #6b7280;
    margin-bottom: .35rem;
    overflow-wrap: anywhere;
}

/* Inputs estilo subrayado */
.gform-input {
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 2px solid #e5e7eb;
    padding: .6rem .2rem .45rem .2rem;
    font-size: 1rem;
    outline: none;
    transition: border-color .2s ease;
}

.gform-input::placeholder {
    color: #9ca3af;
}

.gform-input:focus {
    border-bottom-color: var(--primary-color);
}

.gform-textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.4;
}

/* Select con flecha nativa */
.gform-select {
    position: relative;
}

.gform-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 2px solid #e5e7eb;
    padding: .6rem 2rem .45rem .2rem;
    font-size: 1rem;
    outline: none;
    transition: border-color .2s ease;
}

.gform-select select:focus {
    border-bottom-color: var(--primary-color);
}

.gform-arrow {
    position: absolute;
    right: .25rem;
    bottom: .45rem;
    pointer-events: none;
    color: #6b7280;
    font-size: 1.25rem;
}

/* Radios / Checkboxes */
.gform-options {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin-top: .35rem;
}

.gform-option {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.gform-option input[type="radio"],
.gform-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* "Otros" inline */
.gform-input-inline {
    display: inline-block;
    width: 240px;
    margin-left: .5rem;
    vertical-align: middle;
}

@media (max-width:640px) {
    .gform-input-inline {
        width: 100%;
        margin: .5rem 0 0 0;
        display: block;
    }
}

/* Errores */
.gform-question.is-error {
    border-color: #ef9a9a;
}

.gform-question.is-error .gform-legend,
.gform-question.is-error .gform-label {
    color: #c62828;
}

.gform-error {
    display: none;
    color: #c62828;
    font-size: .9rem;
    margin-top: .4rem;
}

.gform-question.is-error .gform-error {
    display: block;
}

/* Acciones */
.gform-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: .5rem;
    flex-wrap: wrap;
}

.gform-btn {
    background: #e5e7eb;
    color: #111;
    border: none;
    border-radius: 8px;
    padding: .6rem 1rem;
    font-weight: 600;
    cursor: pointer;
}

.gform-primary {
    background: var(--primary-color);
    color: #fff;
}

.gform-clear {
    margin-left: auto;
    color: #c2185b;
    text-decoration: none;
    font-size: .95rem;
}

.gform-clear:hover {
    text-decoration: underline;
}


/* Complementos por opción */
.gform-optbox {
    display: block;
}

.gform-complement[hidden],
.gform-brand[hidden] {
    display: none !important;
}

.gform-complement {
    margin: .35rem 0 0 1.8rem;
    padding: .5rem .75rem;
    border-left: 2px solid #e9d7f7;
    border-radius: 8px;
    background: #fafafa;
}

.gform-miniopts {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: .25rem;
}

/* Matris de google forms */

/* ===== Matriz (Google Forms-like) ===== */
.gform-matrix {
  width: 100%;
  border: 1px solid #e9d7f7;
  border-radius: 12px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.gform-matrix thead th {
  background: #faf5ff;
  color: #111827;
  font-weight: 700;
  text-align: center;
  padding: 12px 16px;
  font-size: .95rem;
  border-bottom: 1px solid #efe7fb;
}

.gform-matrix thead .gfm-empty {
  background: #fff;
  border-bottom-color: transparent;
}

.gform-matrix tbody th[scope="row"] {
  text-align: left;
  font-weight: 600;
  color: #374151;
  padding: 14px 16px;
  white-space: nowrap;
}

.gform-matrix td {
  text-align: center;
  padding: 10px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.gform-matrix tbody tr:nth-child(even) {
  background: #fafafa;
}

.gform-matrix tbody tr:last-child td,
.gform-matrix tbody tr:last-child th {
  border-bottom: 0;
}

/* Producto (checkbox al lado del nombre) */
.gfm-prod {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
}

.gfm-prod input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

/* Radio centrado y "material-like" */
.gfm-radio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 32px;
  cursor: pointer;
}

.gfm-radio input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #9ca3af;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  outline: none;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.gfm-radio input[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.gfm-radio input:hover:not([disabled]) {
  box-shadow: 0 0 0 4px rgba(91, 33, 182, .08);
}

.gfm-radio input:checked {
  border-color: var(--primary-color);
}

.gfm-radio input:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* === Typeahead (input con sugerencias) === */
.typeahead-wrapper {
  position: relative;
}

.typeahead-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: .25rem 0;
  list-style: none;
  z-index: 2000;
}

.typeahead-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .8rem;
  cursor: pointer;
  line-height: 1.2;
}

.typeahead-item .material-icons {
  font-size: 18px;
  color: var(--icon-color);
  opacity: .9;
}

.typeahead-item strong {
  color: #111827;
}

.typeahead-item small {
  color: #6b7280;
}

.typeahead-item:hover,
.typeahead-item[aria-selected="true"] {
  background: #f3f4f6;
}

.typeahead-empty {
  padding: .6rem .8rem;
  color: #6b7280;
}

/* ============================================
   TARJETAS DE RESUMEN (Summary Cards)
   ============================================ */

/* Header del resumen */
.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9d7f7;
}

.summary-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.summary-subtitle {
    margin: 0.3rem 0 0 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.summary-actions {
    display: flex;
    gap: 0.5rem;
}

.summary-actions .btn-icon {
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.summary-actions .btn-icon:hover {
    background: #f9fafb;
    border-color: var(--primary-color);
}

.summary-actions .material-icons {
    font-size: 20px;
    color: var(--primary-color);
}

/* Grid de tarjetas internas */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

/* Tarjeta interna con borde */
.summary-card {
    background: #fff;
    border: 1px solid #e9d7f7;
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
}

.summary-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(91, 33, 182, 0.08);
}

/* Header de la tarjeta interna */
.summary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.summary-icon-main {
    font-size: 28px;
    color: var(--primary-color);
    background: #faf5ff;
    padding: 0.5rem;
    border-radius: 8px;
}

.summary-icon-main.success {
    color: #4caf50;
    background: #e8f5e9;
}

.summary-icon-action {
    font-size: 18px;
    color: var(--primary-color);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.summary-icon-action:hover {
    opacity: 1;
}

/* Título y total */
.summary-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
}

.summary-total {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 1rem 0;
}

/* Secciones (MAÑANA, TARDE, NOCHE) */
.summary-section {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.summary-section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.summary-period {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem 0;
}

/* Items dentro de cada sección */
.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.875rem;
}

.summary-item span {
    color: #6b7280;
    flex: 1;
}

.summary-item strong {
    color: var(--text-color);
    font-weight: 600;
    text-align: right;
    min-width: 60px;
}

/* Responsive */
@media (max-width: 1400px) {
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .summary-header {
        flex-direction: column;
        gap: 1rem;
    }

    .summary-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .summary-total {
        font-size: 1.75rem;
    }
}


/* ============================================
   CLASES NO USADAS EN EL PROYECTO ACTUAL
   (Comentadas para referencia futura)
   ============================================ */

/* .form-group {
    flex: 1 1 250px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.3rem;
    font-weight: bold;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
}

.has-error .input-icon {
    border: 1px solid #f44336;
}

.input-error-text {
    color: #f44336;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    display: none;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    width: 100%;
    position: relative;
    cursor: pointer;
}

.custom-select input {
    border: none;
    outline: none;
    font-size: 1rem;
    width: 100%;
    background: transparent;
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    box-shadow: var(--shadow);
    border-radius: 8px;
    max-height: 160px;
    overflow-y: auto;
    display: none;
    padding: 0.3rem 0;
    margin-top: 0.3rem;
}

.custom-options li {
    padding: 0.6rem 1rem;
    cursor: pointer;
}

.custom-options li:hover {
    background: #f0f0f0;
}

.checkbox-label {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.5rem 0;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #444;
}

.checkbox-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.card-tabla {
    overflow-x: auto;
    padding: 1.5rem;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.tabla-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.role {
    font-size: 0.85rem;
    color: #5b21b6;
}

.team-avatars {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.extra-count {
    background-color: #e0f7fa;
    color: #00bcd4;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
}

.badge.danger {
    background-color: #f44336;
} */
