/* ==========================================================================
   UNIDERMA CUSTOM DASHBOARDS & LOGIN STYLES (PREMIUM UI)
   ========================================================================== */

/* Variables de Diseño */
:root {
    --uniderma-primary: #283F80;
    --uniderma-secondary: #1a2f69;
    --uniderma-accent: #00bcd4;
    --uniderma-light-bg: #f8fafc;
    --uniderma-card-bg: #ffffff;
    --uniderma-border: #e2e8f0;
    --uniderma-text: #334155;
    --uniderma-text-muted: #64748b;
    --uniderma-success: #10b981;
    --uniderma-warning: #f59e0b;
    --uniderma-danger: #ef4444;
    --uniderma-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --uniderma-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --uniderma-radius: 12px;
    --uniderma-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Contenedor Principal Dashboard */
.uniderma-dashboard-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--uniderma-text);
}

/* Cabecera del Panel */
.uniderma-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--uniderma-primary), var(--uniderma-secondary));
    padding: 24px 32px;
    border-radius: var(--uniderma-radius);
    color: #ffffff;
    box-shadow: var(--uniderma-shadow-lg);
    margin-bottom: 30px;
}

.uniderma-dashboard-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff !important;
}

.uniderma-dashboard-header h2 i,
.uniderma-dashboard-header h2 svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.uniderma-user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.uniderma-user-badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 0 16px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    line-height: 1;
    margin: 0;
}

.uniderma-logout-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5 !important;
    padding: 0 16px;
    height: 38px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--uniderma-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    line-height: 1;
    margin: 0;
}

.uniderma-logout-btn:hover {
    background: rgba(239, 68, 68, 0.8);
    color: #ffffff !important;
    border-color: transparent;
    transform: translateY(-2px);
}




/* Tarjetas y Contenedores */
.uniderma-dashboard-card {
    background: var(--uniderma-card-bg);
    border-radius: var(--uniderma-radius);
    padding: 24px;
    box-shadow: var(--uniderma-shadow);
    border: 1px solid var(--uniderma-border);
    margin-bottom: 30px;
    transition: var(--uniderma-transition);
}

.uniderma-dashboard-card:hover {
    box-shadow: var(--uniderma-shadow-lg);
}

.uniderma-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--uniderma-primary);
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--uniderma-light-bg);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Parámetros de Vista (Filtros de Fecha) */
.uniderma-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    background: var(--uniderma-light-bg);
    padding: 16px;
    border-radius: 8px;
    align-items: flex-end;
}

.uniderma-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 180px;
}

.uniderma-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--uniderma-text-muted);
}

.uniderma-filter-group input[type="date"] {
    padding: 10px 14px;
    border: 1px solid var(--uniderma-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--uniderma-text);
    outline: none;
    transition: var(--uniderma-transition);
    background: #ffffff;
}

.uniderma-filter-group input[type="date"]:focus {
    border-color: var(--uniderma-secondary);
    box-shadow: 0 0 0 3px rgba(26, 79, 138, 0.15);
}

/* Tablas Modernas */
.uniderma-table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--uniderma-border);
    background: #ffffff;
    margin: 20px 0 30px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

/* Scrollbar personalizado y estético */
.uniderma-table-responsive::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.uniderma-table-responsive::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 4px;
}

.uniderma-table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    border: 2px solid #f8fafc;
}

.uniderma-table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.uniderma-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.uniderma-table th {
    background-color: var(--uniderma-secondary);
    color: #ffffff;
    font-weight: 600;
    padding: 16px 24px !important;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.8px;
    white-space: nowrap;
    border-bottom: 3px solid rgba(0, 0, 0, 0.08);
}

.uniderma-table th:first-child,
.uniderma-table td:first-child {
    padding-left: 24px !important;
}

.uniderma-table th:last-child,
.uniderma-table td:last-child {
    padding-right: 24px !important;
}

.uniderma-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--uniderma-transition);
}

.uniderma-table th.sortable:hover {
    background-color: var(--uniderma-primary);
}

.uniderma-table td {
    padding-left: 24px !important;
    border-bottom: 1px solid var(--uniderma-border);
    color: var(--uniderma-text);
    vertical-align: middle;
    white-space: nowrap;
}

.uniderma-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.uniderma-table tbody tr:last-child td {
    border-bottom: none;
}

.uniderma-table tbody tr {
    transition: background-color 0.2s ease;
}

.uniderma-table tbody tr:hover {
    background-color: rgba(40, 63, 128, 0.04) !important;
}

/* Estado de Tabla Vacía */
.uniderma-table-empty {
    text-align: center !important;
    padding: 60px 20px !important;
    color: var(--uniderma-text-muted);
}

.uniderma-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
    display: inline-block;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {

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

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

.uniderma-empty-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--uniderma-text);
}

/* Botones de Acción de Tabla */
.uniderma-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--uniderma-transition);
    text-decoration: none !important;
}

.uniderma-btn-info {
    background-color: rgba(0, 188, 214, 0.1);
    color: #0097a7 !important;
}

.uniderma-btn-info:hover {
    background-color: #00bcd4;
    color: #ffffff !important;
}

.uniderma-btn-download {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669 !important;
}

.uniderma-btn-download:hover {
    background-color: #10b981;
    color: #ffffff !important;
}

.uniderma-action-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Interruptores y Toggles de Configuración */
.uniderma-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.uniderma-toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--uniderma-light-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--uniderma-border);
}

.uniderma-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    margin-right: 16px;
}

.uniderma-toggle-label {
    font-weight: 600;
    font-size: 15px;
    color: var(--uniderma-primary);
}

.uniderma-toggle-desc {
    font-size: 13px;
    color: var(--uniderma-text-muted);
}

.uniderma-toggle-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Switch Estilo iOS */
.uniderma-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

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

.uniderma-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.uniderma-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.uniderma-slider {
    background-color: var(--uniderma-success);
}

input:focus+.uniderma-slider {
    box-shadow: 0 0 1px var(--uniderma-success);
}

input:checked+.uniderma-slider:before {
    transform: translateX(22px);
}

/* Botón Guardar Disquete */
.uniderma-save-btn {
    background: #ffffff !important;
    border: 1px solid var(--uniderma-border) !important;
    color: var(--uniderma-text-muted) !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: var(--uniderma-transition) !important;
    padding: 0 !important;
    box-shadow: none !important;
    opacity: 0.4 !important;
}

.uniderma-save-btn:disabled,
.uniderma-save-btn[disabled] {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    border-radius: 8px !important;
    opacity: 0.4 !important;
}

.uniderma-save-btn.active {
    background-color: var(--uniderma-secondary) !important;
    color: #ffffff !important;
    border-color: var(--uniderma-secondary) !important;
    box-shadow: 0 4px 10px rgba(26, 79, 138, 0.3) !important;
    opacity: 1 !important;
    cursor: pointer !important;
}

.uniderma-save-btn.active:hover {
    transform: translateY(-2px) !important;
    background-color: var(--uniderma-primary) !important;
    border-color: var(--uniderma-primary) !important;
}

.uniderma-save-btn svg {
    width: 20px !important;
    height: 20px !important;
    fill: currentColor !important;
    display: block !important;
}

/* Notificación Flotante (Toast) */
.uniderma-toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.uniderma-toast {
    background: #1e293b;
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    animation: slideIn 0.3s forwards cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid var(--uniderma-success);
}

.uniderma-toast.toast-error {
    border-left-color: var(--uniderma-danger);
}

@keyframes slideIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Estético de Confirmación */
.uniderma-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.uniderma-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.uniderma-modal-box {
    background: #ffffff;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--uniderma-shadow-lg);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.uniderma-modal-overlay.active .uniderma-modal-box {
    transform: scale(1);
}

.uniderma-modal-icon {
    font-size: 40px;
    color: var(--uniderma-warning);
    margin-bottom: 16px;
}

.uniderma-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--uniderma-primary);
    margin-bottom: 12px;
}

.uniderma-modal-text {
    font-size: 14px;
    color: var(--uniderma-text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.uniderma-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.uniderma-modal-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--uniderma-transition);
}

.uniderma-modal-cancel {
    background: #f1f5f9;
    color: #475569;
}

.uniderma-modal-cancel:hover {
    background: #e2e8f0;
}

.uniderma-modal-confirm {
    background: var(--uniderma-secondary);
    color: #ffffff;
}

.uniderma-modal-confirm:hover {
    background: var(--uniderma-primary);
}

/* Estilos de Carga / Spinner */
.uniderma-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

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

/* Responsividad */
@media (max-width: 768px) {
    .uniderma-dashboard-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        padding: 20px;
    }

    .uniderma-user-profile {
        width: 100%;
        justify-content: flex-end;
    }

    .uniderma-filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .uniderma-filter-group {
        width: 100%;
    }
}