/* ==========================================================================
   ESTILOS CORPORATIVOS PERSONALIZADOS - SENTENCIA
   Diseño serio, moderno y profesional.
   ========================================================================== */

:root {
    --primary-color: #0f172a;    /* Slate 900 - Serio, elegante, corporativo */
    --accent-color: #2563eb;     /* Azul royal moderno - Detalles e interacciones */
    --accent-hover: #1d4ed8;     /* Azul royal oscuro */
    --bg-light: #f8fafc;         /* Fondo de página grisáceo suave */
    --border-color: #e2e8f0;     /* Bordes más sutiles y limpios */
    --border-radius-lg: 12px;
    --border-radius-md: 8px;
    --border-radius-sm: 6px;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

/* Modificar tipografía global y fondos */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    background-color: var(--bg-light);
    color: var(--text-main);
}

.content-wrapper {
    background-color: var(--bg-light) !important;
}

/* Encabezados */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color) !important;
    font-weight: 700 !important;
}

/* Tarjetas y Paneles (Cards) */
.card {
    border-radius: var(--border-radius-lg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
    background-color: #ffffff !important;
    overflow: hidden;
}

.card.card-outline {
    border-top-width: 4px !important;
}

.card.card-primary.card-outline {
    border-top-color: var(--accent-color) !important;
}

.card.card-success.card-outline {
    border-top-color: #10b981 !important;
}

.card.card-warning.card-outline {
    border-top-color: #f59e0b !important;
}

.card.card-secondary.card-outline {
    border-top-color: var(--text-muted) !important;
}

.card-header {
    border-bottom: 1px solid var(--border-color) !important;
    background-color: #ffffff !important;
    padding: 1.25rem 1.5rem !important;
}

/* Tablas Modernas */
.table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
}

.table th {
    background-color: #f8fafc !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.75rem !important;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color) !important;
    border-top: none !important;
    padding: 1rem 0.75rem !important;
}

.table td {
    padding: 0.85rem 0.75rem !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #334155 !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #fafafa !important;
}

.table-hover tbody tr:hover {
    background-color: #f1f5f9 !important;
}

/* Badges Modernizados (Soft-styling) */
.badge {
    border-radius: var(--border-radius-sm) !important;
    padding: 0.4em 0.75em !important;
    font-weight: 600 !important;
    font-size: 80% !important;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    box-shadow: none !important;
}

/* Badge Info -> Nuevo Expediente */
.badge-info {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
}

/* Badge Warning -> Reenvío */
.badge-warning {
    background-color: #fef3c7 !important;
    color: #b45309 !important;
}

/* Badge Danger -> Pendiente */
.badge-danger {
    background-color: #ffe4e6 !important;
    color: #b91c1c !important;
}

/* Badge Success -> Sorteado o Realizado */
.badge-success {
    background-color: #dcfce7 !important;
    color: #15803d !important;
}

/* Badge Primary -> Presidente u otros roles principales */
.badge-primary {
    background-color: #dbeafe !important;
    color: #1d4ed8 !important;
}

/* Badge Secondary/Muted */
.badge-secondary {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

/* Modales Modernizados */
.modal-content {
    border-radius: var(--border-radius-lg) !important;
    border: none !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1.25rem 1.5rem !important;
}

.modal-header h5, 
.modal-header h5 i, 
.modal-header .modal-title, 
.modal-header .modal-title i {
    color: #ffffff !important;
}

.modal-header.bg-primary {
    background-color: var(--accent-color) !important;
    color: #ffffff !important;
}

.modal-header.bg-warning {
    background-color: #f59e0b !important;
    color: #ffffff !important;
}

.modal-header.bg-success {
    background-color: #10b981 !important;
    color: #ffffff !important;
}

.modal-body {
    padding: 1.5rem !important;
    background-color: #ffffff;
}

.modal-footer {
    border-top: 1px solid var(--border-color) !important;
    background-color: #f8fafc !important;
    padding: 1rem 1.5rem !important;
}

/* Botones Modernizados */
.btn {
    border-radius: var(--border-radius-md) !important;
    padding: 0.5rem 1.25rem !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    transition: all 0.2s ease-in-out !important;
    box-shadow: none !important;
}

.btn-primary {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: #ffffff !important;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}

.btn-secondary, .btn-default {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

.btn-secondary:hover, .btn-default:hover {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
}

.btn-success {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
}

.btn-success:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
}

.btn-danger {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
}

.btn-danger:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
}

/* Campos de Formulario */
.form-control, 
.select2-container--bootstrap4 .select2-selection {
    border-radius: var(--border-radius-md) !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0.5rem 0.75rem !important;
    height: auto !important;
    font-size: 0.95rem !important;
    transition: all 0.2s ease-in-out !important;
    box-shadow: none !important;
    background-color: #ffffff !important;
    color: var(--text-main) !important;
}

.form-control:focus, 
.select2-container--bootstrap4.select2-container--focus .select2-selection {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.form-control[readonly] {
    background-color: #f1f5f9 !important;
    color: var(--text-muted) !important;
}

/* Input Groups Modernizados (Connected Look) */
.input-group {
    border-radius: var(--border-radius-md) !important;
    transition: all 0.2s ease-in-out !important;
}

.input-group .input-group-text {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--text-muted) !important;
    font-size: 0.95rem !important;
    padding: 0.5rem 0.75rem !important;
    transition: all 0.2s ease-in-out !important;
}

/* Prepend styling */
.input-group > .input-group-prepend > .input-group-text {
    border-top-left-radius: var(--border-radius-md) !important;
    border-bottom-left-radius: var(--border-radius-md) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none !important;
}

/* Form control inside input group with prepend */
.input-group > .input-group-prepend ~ .form-control {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: var(--border-radius-md) !important;
    border-bottom-right-radius: var(--border-radius-md) !important;
}

/* Append styling */
.input-group > .input-group-append > .input-group-text {
    border-top-right-radius: var(--border-radius-md) !important;
    border-bottom-right-radius: var(--border-radius-md) !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-left: none !important;
}

/* Form control inside input group with append */
.input-group > .form-control:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: var(--border-radius-md) !important;
    border-bottom-left-radius: var(--border-radius-md) !important;
}

/* Soporte para input-group-lg (como en el modal de usuarios) */
.input-group-lg > .input-group-prepend > .input-group-text,
.input-group-lg > .input-group-append > .input-group-text {
    padding: 0.75rem 1rem !important;
    font-size: 1.15rem !important;
}

/* Focus States (Unified highlight) */
.input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}
.input-group:focus-within .input-group-text {
    border-color: var(--accent-color) !important;
}
.input-group:focus-within .form-control {
    border-color: var(--accent-color) !important;
    box-shadow: none !important; /* Evitar doble sombra */
}

/* Etiquetas */
label {
    font-size: 0.825rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem !important;
    text-transform: uppercase;
    color: var(--text-muted) !important;
}

/* KPIs / Small boxes (Dashboard) */
.small-box {
    border-radius: var(--border-radius-lg) !important;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out !important;
}

.small-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08) !important;
}

.small-box h3 {
    color: #ffffff !important;
}

.small-box .inner p {
    letter-spacing: 0.03em;
    font-size: 0.8rem !important;
}

.small-box-footer {
    background: rgba(0, 0, 0, 0.12) !important;
    font-weight: 600;
}

/* Barra Lateral (Sidebar) */
.main-sidebar {
    background-color: #0f172a !important; /* Elegant slate background */
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
    background-color: var(--accent-color) !important;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2) !important;
}

.brand-link, .user-panel {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.brand-link .brand-text {
    font-weight: 600 !important;
    letter-spacing: 0.05em;
}

/* Select2 dropdown overrides */
.select2-dropdown {
    border-radius: var(--border-radius-md) !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

/* ==========================================================================
   TABLE ACTION BUTTONS
   ========================================================================== */
.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Individual Action Buttons */
.table-actions .btn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--border-radius-sm) !important;
    font-size: 0.85rem !important;
    border: 1px solid transparent !important;
    margin: 0 !important;
}

/* Info / Print Button (Sky Soft) */
.table-actions .btn-info {
    background-color: #e0f2fe !important;
    border-color: #bae6fd !important;
    color: #0369a1 !important;
}
.table-actions .btn-info:hover {
    background-color: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

/* Warning / Edit Button (Amber Soft) */
.table-actions .btn-warning {
    background-color: #fef3c7 !important;
    border-color: #fde68a !important;
    color: #b45309 !important;
}
.table-actions .btn-warning:hover {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
}

/* Danger / Delete Button (Red Soft) */
.table-actions .btn-danger {
    background-color: #ffe4e6 !important;
    border-color: #fecdd3 !important;
    color: #b91c1c !important;
}
.table-actions .btn-danger:hover {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
}

/* Success / Edit Button (Green Soft - Alternative) */
.table-actions .btn-success,
.table-actions .btn-outline-success {
    background-color: #dcfce7 !important;
    border-color: #bbf7d0 !important;
    color: #15803d !important;
}
.table-actions .btn-success:hover,
.table-actions .btn-outline-success:hover {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

/* Lock / Disabled Button (Slate Soft) */
.table-actions .btn-secondary,
.table-actions .btn-outline-secondary,
.table-actions .btn:disabled {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    opacity: 0.75 !important;
}

/* ==========================================================================
   SELECT2 & FORM SELECT STANDARDIZATION
   ========================================================================== */
.select2-container--bootstrap4 .select2-selection--single {
    height: 40px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    padding-left: 0.75rem !important;
    padding-right: 2rem !important;
    line-height: 38px !important; /* Centrado vertical del texto */
    color: var(--text-main) !important;
    width: 100% !important;
    text-align: left !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    line-height: 38px !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    top: 0 !important;
    right: 0.75rem !important;
    display: flex !important;
    align-items: center !important;
}

/* Altura y padding para selects estándar */
select.form-control {
    height: 40px !important;
    padding: 0.5rem 0.75rem !important;
}

/* Botón remover votante en sorteos */
.btnRemoverVotante {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--border-radius-sm) !important;
    margin: 0 auto !important;
}


