/* ==========================================================================
   UTILIDADES CSS - CLASES PARA REEMPLAZAR ESTILOS INLINE
   ========================================================================== */

/* -------------------------------------------------------------------------
   TEXTO Y ALINEACIÓN
   ------------------------------------------------------------------------- */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-xs { font-size: 0.75rem; }    /* 12px */
.text-sm { font-size: 0.875rem; }   /* 14px */
.text-base { font-size: 1rem; }     /* 16px */
.text-lg { font-size: 1.125rem; }   /* 18px */
.text-xl { font-size: 1.25rem; }    /* 20px */

.text-gray { color: var(--text-secondary); }
.text-white { color: var(--white); }
.text-dark { color: var(--text-primary); }

/* Nuevas clases de texto con variables CSS */
.text-primary { color: var(--primary); }
.text-green { color: var(--corporate-green); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-muted); }
.text-on-green { color: var(--text-on-green); }

/* -------------------------------------------------------------------------
   DIMENSIONES Y LAYOUT
   ------------------------------------------------------------------------- */

.w-full { width: 100%; }
.h-full { height: 100%; }
.w-auto { width: auto; }
.w-75 { width: 75%; }
.w-50 { width: 50%; }
.w-30 { width: 120px; }
.w-25 { width: 25%; }

.max-w-xs { max-width: 300px; }
.max-w-sm { max-width: 400px; }
.max-w-md { max-width: 500px; }
.max-w-lg { max-width: 600px; }

.h-auto { height: auto; }
.h-screen { height: 100vh; }
.h-8 { height: 2rem; }      /* 32px */
.h-16 { height: 4rem; }     /* 64px */
.h-20 { height: 5rem; }     /* 80px */

/* -------------------------------------------------------------------------
   DISPLAY Y POSICIONAMIENTO
   ------------------------------------------------------------------------- */

.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.hidden { display: none; }

.justify-center { justify-content: center; }
.items-center { align-items: center; }

.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* -------------------------------------------------------------------------
   MÁRGENES Y PADDINGS
   ------------------------------------------------------------------------- */

.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }   /* 4px */
.m-2 { margin: 0.5rem; }    /* 8px */
.m-3 { margin: 0.75rem; }  /* 12px */
.m-4 { margin: 1rem; }     /* 16px */
.m-6 { margin: 1.5rem; }   /* 24px */
.m-8 { margin: 2rem; }     /* 32px */

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }
.ml-6 { margin-left: 1.5rem; }

.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.mr-6 { margin-right: 1.5rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.pl-0 { padding-left: 0; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

/* -------------------------------------------------------------------------
   BORDES Y SOMBRAS
   ------------------------------------------------------------------------- */

.border { border: 1px solid #d1d5db; }
.border-0 { border: 0; }
.border-2 { border: 2px solid #d1d5db; }
.border-gray { border-color: #6b7280; }
.border-black { border-color: #000000; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }

/* -------------------------------------------------------------------------
   COLORES DE FONDO ESTÁNDAR
   ------------------------------------------------------------------------- */

/* Fondo estándar para secciones */
.bg-section {
    background-color: var(--gray-200);
    border: 1px solid var(--border-medium);
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.bg-section-clean {
    background-color: var(--gray-100);
    border: none;
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin: 0.5rem 0;
}

/* -------------------------------------------------------------------------
   COLORES DE FONDO
   ------------------------------------------------------------------------- */

.bg-white { background-color: var(--white); }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-gray-200 { background-color: var(--gray-200); }
.bg-gray-300 { background-color: var(--gray-300); }
.bg-gray-900 { background-color: var(--gray-900); }
.bg-black { background-color: var(--black); }

/* Fondos con sistema verde corporativo */
.bg-primary { background-color: var(--primary); }
.bg-green { background-color: var(--corporate-green); }
.bg-success { background-color: var(--success); }
.bg-warning { background-color: var(--warning); }
.bg-error { background-color: var(--error); }

/* Fondos verdes adicionales */
.bg-green-light { background-color: var(--green-100); }
.bg-green-dark { background-color: var(--green-800); }

/* -------------------------------------------------------------------------
   TÍTULOS ESTANDARIZADOS CON VERDE CORPORATIVO
   ------------------------------------------------------------------------- */

/* Título principal de página */
.page-title {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 600;
    color: #000000;
    background-color: transparent;
    padding: 0.75rem 3rem 0.75rem 1rem;
    margin-bottom: 1rem;
    margin-right: 1rem;
    border: none;
    border-radius: 0;
    text-align: right;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.page-title {
    animation: bounceTitle 0.8s ease-out;
}

@keyframes bounceText {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    50% {
        transform: translateX(-10px);
        opacity: 1;
    }
    65% {
        transform: translateX(5px);
    }
    80% {
        transform: translateX(-5px);
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide titles */
.slide-title {
    position: absolute;
    bottom: 20px;
    right: 40px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 10;
}

.slide-title::before {
    content: attr(data-text);
    position: absolute;
    top: 10px;
    left: 20px;
    right: 20px;
    bottom: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 5px;
    z-index: -1;
}

.slide-title span {
    display: inline-block;
    animation: bounceText 0.8s ease-out;
}

/* Título de sección */
.section-title {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 600;
    color: #000000;
    background-color: transparent;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    margin: 1rem 0 0.5rem 0;
    margin-right: 1rem;
    border: none;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.section-title::after {
    content: "<";
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%) translateY(-1px);
    font-size: 1.125rem;
    color: #555555;
    animation: bounceSection 0.8s ease-out;
}

@keyframes bounceSection {
    0% {
        right: -20px;
        opacity: 0;
    }
    50% {
        right: 1.5rem;
        opacity: 1;
    }
    65% {
        right: 0.25rem;
    }
    80% {
        right: 0.75rem;
    }
    100% {
        right: 0.5rem;
        opacity: 1;
    }
}

/* -------------------------------------------------------------------------
   ESTILOS PARA GRÁFICOS DEL DASHBOARD
   ------------------------------------------------------------------------- */

.dashboard-stats {
    margin: 2rem 0;
}

/* Contenedor flexible para las tarjetas del dashboard */
.flex-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-start;
    align-items: stretch;
}

/* Enlaces en las tarjetas */
.card-link {
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
}

.card-link:hover {
    color: var(--corporate-green);
    text-decoration: none;
}

.stat-card {
    background: var(--white);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.stat-header {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: var(--white);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.stat-icon {
    font-size: 1.5rem;
    opacity: 0.8;
}

.stat-body {
    padding: 1.5rem;
}

/* Estilos compactos para PC */
.stat-card.compact {
    flex: 0 0 280px;
    max-width: 280px;
    margin: 0;
    height: 320px;
    display: flex;
    flex-direction: column;
}

.stat-card.compact .stat-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card.compact .progress-circle {
    width: 70px;
    height: 70px;
    margin: 0 auto 0.8rem;
}

.stat-card.compact .progress-circle::before {
    width: 52px;
    height: 52px;
}

.stat-card.compact .progress-circle::after {
    width: 100%;
    height: 100%;
}

.stat-card.compact .progress-percentage {
    font-size: 1.1rem;
}

.stat-card.compact .progress-text small {
    font-size: 0.65rem;
    margin-top: 0.15rem;
}

.stat-card.compact .stat-details .detail-item {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    gap: 0.3rem;
}

.stat-card.compact .detail-label {
    font-size: 0.7rem;
}

.stat-card.compact .detail-value {
    font-size: 0.8rem;
}

.stat-card.compact .location-count {
    font-size: 1.8rem;
    transform: scale(0.8);
    opacity: 0;
    animation: countAnimation 1.2s ease-out forwards;
}

.stat-card.compact .big-number {
    font-size: 2rem;
    transform: scale(0.8);
    opacity: 0;
    animation: countAnimation 1.4s ease-out forwards;
}

.stat-card.compact .big-label {
    font-size: 0.875rem;
}

.stat-card.compact .url-list {
    max-height: 80px;
}

.stat-card.compact .status-item {
    padding: 0.5rem;
}

.stat-card.compact .user-detail {
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
}

/* Círculo de Progreso Mejorado */
.progress-circle {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    position: relative;
    border-radius: 50%;
    background: conic-gradient(
        #e9ecef 0deg,
        #e9ecef 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.progress-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.progress-circle::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    background: var(--white);
    border-radius: 50%;
    z-index: 1;
}

.progress-circle::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #008000 0deg,
        #008000 var(--progress, 0deg),
        transparent var(--progress, 0deg),
        transparent 360deg
    );
    animation: progressAnimation 1.5s ease-out;
    transition: background 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes progressAnimation {
    0% {
        background: conic-gradient(
            from 0deg,
            #008000 0deg,
            #008000 0deg,
            transparent 0deg,
            transparent 360deg
        );
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        background: conic-gradient(
            from 0deg,
            #008000 0deg,
            #008000 var(--progress, 0deg),
            transparent var(--progress, 0deg),
            transparent 360deg
        );
        transform: scale(1);
        opacity: 1;
    }
}

.progress-text {
    position: relative;
    text-align: center;
    z-index: 2;
}

.progress-percentage {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #008000, #00a652);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: numberAnimation 1.2s ease-out;
}

@keyframes numberAnimation {
    0% {
        transform: scale(0.5) rotateY(90deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotateY(0deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

.progress-text small {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.5s forwards;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados según porcentaje */
.progress-circle.low-usage::after {
    background: conic-gradient(
        from 0deg,
        #28a745 0deg,
        #28a745 var(--progress, 0deg),
        transparent var(--progress, 0deg),
        transparent 360deg
    );
}

.progress-circle.medium-usage::after {
    background: conic-gradient(
        from 0deg,
        #ffc107 0deg,
        #ffc107 var(--progress, 0deg),
        transparent var(--progress, 0deg),
        transparent 360deg
    );
}

.progress-circle.high-usage::after {
    background: conic-gradient(
        from 0deg,
        #fd7e14 0deg,
        #fd7e14 var(--progress, 0deg),
        transparent var(--progress, 0deg),
        transparent 360deg
    );
}

.progress-circle.critical-usage::after {
    background: conic-gradient(
        from 0deg,
        #dc3545 0deg,
        #dc3545 var(--progress, 0deg),
        transparent var(--progress, 0deg),
        transparent 360deg
    );
}

.progress-circle.low-usage .progress-percentage {
    background: linear-gradient(135deg, #28a745, #34ce57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-circle.medium-usage .progress-percentage {
    background: linear-gradient(135deg, #ffc107, #ffca2c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-circle.high-usage .progress-percentage {
    background: linear-gradient(135deg, #fd7e14, #ff922b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-circle.critical-usage .progress-percentage {
    background: linear-gradient(135deg, #dc3545, #e4606d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-circle.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.stat-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-start;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: 0.375rem;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-20px);
}

.detail-item.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.detail-item:hover {
    background: var(--gray-100);
    transform: translateX(5px);
}

.detail-item.highlight {
    border-left-color: #008000;
    background: linear-gradient(90deg, rgba(0, 128, 0, 0.1) 0%, var(--gray-50) 100%);
}

.detail-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.detail-item.highlight .detail-value {
    color: #008000;
}

/* Grid de Localizaciones */
.location-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    justify-content: space-between;
}

.location-item {
    text-align: center;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.location-count {
    font-size: 2.5rem;
    font-weight: 700;
    color: #008000;
    line-height: 1;
    display: block;
    transform: scale(0.8);
    opacity: 0;
    animation: countAnimation 1.2s ease-out forwards;
}

@keyframes countAnimation {
    0% {
        transform: scale(0.5) rotateY(90deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotateY(0deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

.location-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.location-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
    align-content: flex-start;
    max-height: 120px;
    overflow-y: auto;
}

.location-chip {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    border: 1px solid var(--gray-200);
}

/* Números Grandes */
.big-number {
    font-size: 3rem;
    font-weight: 700;
    color: #008000;
    line-height: 1;
    margin-bottom: 0.5rem;
    display: block;
    transform: scale(0.8);
    opacity: 0;
    animation: countAnimation 1.4s ease-out forwards;
}

.big-label {
    color: var(--gray-600);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.url-list {
    max-height: 140px;
    overflow-y: auto;
    text-align: left;
    flex: 1;
}

.url-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: var(--gray-50);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-left: 3px solid #008000;
}

/* Grid de Estado */
.status-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    justify-content: center;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-active {
    background: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
    transform: scale(0.8);
    opacity: 0;
    animation: pulseIndicator 0.8s ease-out forwards;
}

.status-info {
    background: #17a2b8;
    box-shadow: 0 0 8px rgba(23, 162, 184, 0.4);
    transform: scale(0.8);
    opacity: 0;
    animation: pulseIndicator 0.8s ease-out 0.3s forwards;
}

@keyframes pulseIndicator {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.status-info {
    flex: 1;
}

.status-number {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    transform: scale(0.8);
    opacity: 0;
    animation: countAnimation 1s ease-out forwards;
}

.status-label {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Resumen de Usuario */
.user-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    justify-content: center;
}

.user-detail {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: 0.375rem;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInUserDetail 0.6s ease-out forwards;
}

.user-detail:nth-child(1) { animation-delay: 0.1s; }
.user-detail:nth-child(2) { animation-delay: 0.3s; }
.user-detail:nth-child(3) { animation-delay: 0.5s; }

@keyframes slideInUserDetail {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.user-detail i {
    color: #008000;
    width: 16px;
}

.user-detail span {
    color: var(--gray-600);
    font-size: 0.875rem;
    flex: 1;
}

.user-detail strong {
    color: var(--gray-900);
    font-weight: 600;
}

.status-good {
    color: #28a745 !important;
}

/* Responsive para el nuevo contenedor flexible */
@media (min-width: 1200px) {
    /* En pantallas muy grandes: ajustar el ancho de las tarjetas para que quepan más */
    .flex-cards-container .stat-card.compact {
        flex: 0 0 300px;
        max-width: 300px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    /* En PC grande: mantener las tarjetas compactas */
    .flex-cards-container .stat-card.compact {
        flex: 0 0 280px;
        max-width: 280px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    /* En tablets: hacer las tarjetas más anchas */
    .flex-cards-container .stat-card.compact {
        flex: 0 0 calc(50% - 0.5rem);
        max-width: calc(50% - 0.5rem);
    }
}

@media (max-width: 767px) {
    /* En móvil: las tarjetas ocupan todo el ancho */
    .flex-cards-container .stat-card.compact {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .flex-cards-container {
        gap: 0.5rem;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    /* En tablets: 2 columnas en ambas filas */
    .dashboard-stats .row .col-lg-4,
    .dashboard-stats .row .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* Desactivar estilos compactos en tablets */
    .stat-card.compact {
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    /* En móvil: 1 columna */
    .dashboard-stats .row .col-lg-4,
    .dashboard-stats .row .col-lg-3,
    .dashboard-stats .row .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    /* Desactivar estilos compactos en móvil */
    .stat-card.compact {
        max-width: 100%;
    }
    
    .progress-circle {
        width: 100px;
        height: 100px;
    }
    
    .progress-circle::before {
        width: 75px;
        height: 75px;
    }
    
    .progress-percentage {
        font-size: 1.25rem;
    }
    
    .big-number {
        font-size: 2.5rem;
    }
}

/* Mejoras adicionales para espaciado entre filas */
.dashboard-stats .row {
    margin-bottom: 2rem;
}

.dashboard-stats .row:last-child {
    margin-bottom: 0;
}

/* Subtítulo */
.subtitle {
    font-family: Arial, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    background-color: var(--gray-100);
    padding: 0.375rem 0.625rem;
    margin: 0.5rem 0;
    border: 1px solid var(--border-medium);
    border-radius: 0.25rem;
}

/* -------------------------------------------------------------------------
   COMPONENTES ESPECÍFICOS
   ------------------------------------------------------------------------- */

/* Input fields */
.form-input {
    max-width: 300px;
    display: inline-block;
}

.form-input-lg {
    width: 100%;
    max-width: none;
}

/* Textareas */
.code-editor {
    border: 1px solid var(--border-dark);
    width: 80%;
    height: 300px;
    margin: 0.125rem;
    background-color: var(--soft-black);
    color: var(--corporate-green);
    border-radius: 0.3125rem;
}

.info-text {
    font-size: 0.625rem;
    color: var(--text-muted);
}

/* Botones pequeños */
.btn-xs {
    font-size: 0.625rem;
    margin: 0.0625rem;
    padding: 0.125rem 0.375rem;
}

/* Iconos en botones */
.btn-icon-sm i {
    font-size: 0.875rem;
}

/* Lista sin estilos */
.list-unstyled {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

/* Flex para botones */
.btn-flex {
    list-style-type: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.btn-flex li {
    margin-right: 0.25rem;
}

/* Contenedor centrado */
.container-centered {
    text-align: center;
}

.container-fixed {
    text-align: center;
    width: 90%;
    margin-left: 3.125rem;
}

.input-container {
    margin-left: auto;
    margin-right: auto;
    width: 20em;
    text-align: center;
}

.input-container-lg {
    margin-left: auto;
    margin-right: auto;
    width: 18em;
    padding-left: 0.625rem;
}

/* Contenedor de eventos */
.event-container {
    margin: 0.0625rem;
    padding: 0.0625rem;
    border: 1px solid var(--primary);
    border-radius: 0.9375rem;
    font-size: 0.625rem;
}

/* Imágenes */
.img-max-w-xs {
    max-width: 1.5rem;
}

.img-max-w-sm {
    max-width: 12.5rem;
    border: 2px solid var(--border-medium);
}

/* Contenido colapsable */
.collapsible-header {
    list-style: none;
    background-color: var(--gray-200);
    border: 1px solid var(--border-medium);
    border-style: outset;
    padding: 0.5rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

.collapsible-header:hover {
    background-color: var(--gray-300);
}

/* -------------------------------------------------------------------------
   POSICIONAMIENTO AVANZADO
   ------------------------------------------------------------------------- */

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.static { position: static; }

.float-left { float: left; }
.float-right { float: right; }
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* -------------------------------------------------------------------------
   VISIBILIDAD Y ACCESIBILIDAD
   ------------------------------------------------------------------------- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* -------------------------------------------------------------------------
   ELEMENTOS INTERACTIVOS - CURSOR Y ESTILOS
   ------------------------------------------------------------------------- */

/* Filas de tabla clicables */
.clickable-row {
    cursor: pointer;
    transition: var(--transition-fast);
}

.clickable-row:hover {
    background-color: var(--gray-100);
}

/* Iconos clicables */
.clickable-icon {
    cursor: pointer;
    transition: var(--transition-fast);
}

.clickable-icon:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Elementos de texto clicables */
.clickable-text {
    cursor: pointer;
    transition: var(--transition-fast);
}

.clickable-text:hover {
    color: var(--primary);
}

/* Elemento genérico interactivo */
.interactive {
    cursor: pointer;
    transition: var(--transition-fast);
}

.interactive:hover {
    opacity: 0.8;
}

/* Solución global para elementos con data-toggle="modal" */
[data-toggle="modal"]:not(.btn) {
    cursor: pointer;
}

/* Solución global para elementos con onclick */
[onclick]:not(.btn):not([role="button"]):not(.clickable-row):not(.clickable-icon):not(.clickable-text):not(.interactive) {
    cursor: pointer;
}

/* Solución global para elementos específicos identificados */
tr[id*="Device"],
tr[id*="Modal"], 
tr[id*="User"],
tr[id="Diapos"],
[id="FuerzaReconexion"],
[id="ClicImage"],
[id="menuitem"][data-toggle="modal"] {
    cursor: pointer !important;
}

/* Efectos hover adicionales para elementos interactivos */
tr[id*="Device"]:hover,
tr[id*="Modal"]:hover, 
tr[id*="User"]:hover,
tr[id="Diapos"]:hover {
    background-color: var(--gray-100) !important;
}

/* -------------------------------------------------------------------------
   ESTADOS INTERACTIVOS
   ------------------------------------------------------------------------- */

.hover-scale:hover {
    transform: scale(1.05);
    transition: var(--transition-normal);
}

.hover-shadow:hover {
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.hover-green:hover {
    box-shadow: var(--shadow-green);
    transition: var(--transition-normal);
}

/* -------------------------------------------------------------------------
   COMPONENTES ESPECÍFICOS DE USUARIOS
   ------------------------------------------------------------------------- */

/* Header de sección */
.section-header {
    font-family: arial;
    font-weight: bold;
    color: var(--text-on-green);
    background-color: var(--corporate-green);
    width: 98%;
    padding: 0.5rem;
    border: 1px solid var(--border-green);
    border-radius: 0.375rem;
    box-shadow: var(--shadow-sm);
}

/* Búsqueda */
.search-input {
    width: 25%;
    margin-bottom: 0.3125rem;
}

.search-input-lg {
    width: 35%;
    margin-bottom: 0.3125rem;
}

/* Botón con margen */
.btn-margin-right {
    margin-right: 0.3125rem;
}

/* Tabla de permisos */
.permission-table td {
    width: 49%;
}

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

.text-left-cell {
    text-align: left;
}

/* Contenedor centrado para botones */
.button-container-centered {
    padding-left: 40%;
}

/* Widths específicos */
.w-5-6 {
    width: 83.333333%;
}

.ml-2 {
    margin-left: 0.5rem;
}

/* Modal content containers */
.modal-content-centered {
    color: black;
    text-align: center;
}

.modal-content-text {
    color: black;
    font-size: 0.75rem;
}

/* Padding mínimo para todos los modales - evitar contenido pegado a los bordes */
.modal-content {
    padding: 0.5rem !important;
}

.modal-header {
    padding: 1rem 1.5rem !important;
}

.modal-body {
    padding: 1.5rem !important;
}

.modal-footer {
    padding: 1rem 1.5rem !important;
}

/* Padding específico para los contenedores internos de modales de dispositivos */
#MDContent, 
#DDContent, 
#MBContent, 
#VPContent,
#ADContent,
#EPContent,
#EUContent,
#USContent,
#EditaDiaposContent,
#AddDiaposContent {
    padding: 1rem !important;
}

/* -------------------------------------------------------------------------
   RESPONSIVE HELPERS
   ------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .md-hidden { display: none; }
    .md-w-full { width: 100%; }
    .md-text-center { text-align: center; }
}

@media (max-width: 640px) {
    .sm-hidden { display: none; }
    .sm-w-full { width: 100%; }
    .sm-text-center { text-align: center; }
    .form-input { max-width: 100%; }
}