:root {
    /* Variables del Tema Soft UI */
    --card-radius: 20px;
    --btn-radius: 12px;
    --bg-body: #f8f9fc;
    --brand-primary: #f5a800; /* Amarillo UTN */
    --brand-primary-soft: rgba(245, 168, 0, 0.15);
    --text-main: #2d3436;
    --text-muted: #6c757d;
}

/* Ajuste global del fondo para que no sea blanco puro (descansa la vista) */
body {
    background-color: var(--bg-body) !important;
    color: var(--text-main);
}

/* --- TARJETAS FLOTANTES (Soft Cards) --- */
.card-soft {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.02);
    border-radius: var(--card-radius);
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.card-soft:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px -12px rgba(0,0,0,0.12);
}

.card-header-clean {
    background: transparent;
    border-bottom: 1px dashed #e9ecef;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- ELEMENTOS VISUALES --- */

/* Avatar "Squircle" (Cuadrado redondeado) con gradiente */
.avatar-gradient {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #ffc107 100%);
    color: white;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    box-shadow: 0 8px 20px -5px rgba(245, 168, 0, 0.4);
    font-weight: 600;
}

/* Badges tipo "Píldora" suaves */
.badge-pill-soft {
    padding: 0.5em 1em;
    border-radius: 50rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.badge-yellow { background-color: var(--brand-primary-soft); color: #b36b00; }
.badge-green { background-color: rgba(25, 135, 84, 0.1); color: #198754; }
.badge-grey { background-color: rgba(108, 117, 125, 0.1); color: #6c757d; }

/* --- TIPOGRAFÍA DE DATOS --- */
.data-item { margin-bottom: 1rem; }

.data-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #adb5bd;
    font-weight: 700;
    letter-spacing: 0.8px;
    margin-bottom: 0.2rem;
}

.data-value {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-main);
}

/* --- BOTONES PERSONALIZADOS --- */
.btn-soft-action {
    border-radius: var(--btn-radius);
    padding: 0.5rem 1.2rem;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    transition: all 0.2s;
}

.btn-dark-soft {
    background-color: #2d3436;
    color: white;
    box-shadow: 0 4px 12px rgba(45, 52, 54, 0.2);
}
.btn-dark-soft:hover {
    background-color: #000;
    color: white;
    transform: scale(1.02);
}

.btn-outline-soft {
    background-color: transparent;
    border: 2px solid #e9ecef;
    color: #6c757d;
}
.btn-outline-soft:hover {
    border-color: #dee2e6;
    background-color: #f8f9fa;
    color: #343a40;
}

/* --- MODALES --- */
.modal-content-modern {
    border-radius: 24px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

/* --- PERSONALIZACIÓN DE TABLAS (Versión Compacta) --- */

/* 1. Encabezado (THEAD) más legible y compacto */
.table thead th {
    background-color: transparent !important;
    border-bottom: 2px solid rgba(0,0,0,0.05) !important; /* Borde un pelín más notable */
    
    /* Tipografía ajustada */
    font-size: 0.75rem;       /* Aumentamos un poco (antes 0.7rem) */
    text-transform: uppercase;
    letter-spacing: 0.05em;   /* Reducimos el espaciado para que entre más texto */
    font-weight: 700;
    color: #6c757d;           /* Gris más oscuro (antes era muy claro #a0aec0) */
    
    /* Espaciado vertical reducido a la mitad */
    padding-top: 0.75rem;      
    padding-bottom: 0.75rem;
    vertical-align: middle;
}

.table thead th a {
    color: inherit;
    text-decoration: none;
    display: block;
}
.table thead th a:hover { color: var(--brand-primary); }

/* 2. Cuerpo (TBODY) - Filas más delgadas */
.table tbody td {
    /* Reducción drástica de padding vertical (antes era 1rem) */
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    
    /* Fuente un poco más chica para ver más filas por pantalla */
    font-size: 0.9rem; /* aprox 14.4px, ideal para administración */
    color: #495057;    /* Un gris sólido y legible */
    border-bottom: 1px solid rgba(0,0,0,0.03) !important;
    
    /* Evitar que el texto se rompa en dos líneas si no es necesario */
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px; /* Límite de seguridad */
}

/* Alineación de columnas extremas */
.table tbody td:last-child, 
.table thead th:last-child {
    text-align: right;
    padding-right: 1.5rem;
}

.table tbody td:first-child, 
.table thead th:first-child {
    padding-left: 1.5rem;
}

/* 3. Ajuste del contenedor de la tarjeta para ganar espacio lateral */
.card-soft .card-body {
    /* Si usas padding p-4 en el HTML, esto lo compacta visualmente */
    padding: 1rem !important; 
}
/* Excepción para cuando necesitas padding grande en otras cards */
.card-soft.p-large .card-body { padding: 2rem !important; }

/* --- BOTONES DE ACCIÓN PARA TABLAS (Soft UI) --- */

.btn-icon-soft {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px; /* Borde suave (Squircle) */
    border: none;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 1rem;
    text-decoration: none !important;
}

/* Variante: Acción Principal (Ver Detalle) */
.btn-soft-dark {
    background-color: #2d3436;
    color: #fff;
    box-shadow: 0 4px 6px rgba(45, 52, 54, 0.15);
}
.btn-soft-dark:hover {
    background-color: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(45, 52, 54, 0.25);
}

/* Variante: Estado Éxito (Vinculado) - No clickeable visualmente */
.btn-soft-success-static {
    background-color: rgba(25, 135, 84, 0.1); /* Verde muy suave */
    color: #198754;
    cursor: default;
}

/* Variante: Estado Inactivo (No vinculado) */
.btn-soft-secondary-static {
    background-color: rgba(108, 117, 125, 0.08); /* Gris muy suave */
    color: #adb
}

/* --- PAGINACIÓN SOFT UI (Django Tables 2) --- */

/* Contenedor centrado y con aire */
.pagination {
    justify-content: center;
    gap: 6px; /* Separación entre botones */
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Estilo base de los botones (inactivos) */
.page-item .page-link {
    color: #6c757d;           /* Gris suave */
    background-color: #fff;   /* Fondo blanco */
    border: 1px solid rgba(0,0,0,0.05); /* Borde casi invisible */
    border-radius: 10px;      /* Bordes muy redondeados (Squircle) */
    padding: 0.5rem 0.9rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* Efecto Hover (al pasar el mouse) */
.page-item .page-link:hover {
    background-color: #fff;
    color: #f5a800; /* Amarillo UTN en el texto */
    transform: translateY(-2px); /* Se levanta un poquito */
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    z-index: 2;
}

/* Botón Activo (Página actual) - Estilo Dark Soft */
.page-item.active .page-link {
    background-color: #2d3436; /* Gris oscuro elegante */
    border-color: #2d3436;
    color: #fff;
    box-shadow: 0 4px 12px rgba(45, 52, 54, 0.3);
    transform: scale(1.05); /* Un poquito más grande */
}

/* Botones deshabilitados (Anterior/Siguiente cuando no hay más) */
.page-item.disabled .page-link {
    background-color: rgba(248, 249, 250, 0.5);
    border-color: transparent;
    color: #adb5bd;
    pointer-events: none;
    box-shadow: none;
}