/* Paleta de colores moderna */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --success-hover: #059669;
    --warning-color: #f59e0b;
    --warning-hover: #d97706;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --dark-bg: #1e293b;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-dark: #0f172a;
    --text-light: #64748b;
}

/* Reset y estilos base */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: url('/static/images/ss-static-01.esmsv.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-dark);
    min-height: 100vh;
}

/* Overlay para mejorar legibilidad */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.65);
    z-index: -1;
}

/* Navbar mejorado */
.navbar {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #334155 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    margin: 0 0.25rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Cards mejorados */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    color: white;
    border: none;
    border-radius: 12px 12px 0 0 !important;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1.25rem;
}

.card-body {
    padding: 2rem;
}

/* Botones mejorados */
.btn {
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    border: none;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.btn:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-success {
    background-color: var(--success-color);
}

.btn-success:hover {
    background-color: var(--success-hover);
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: var(--warning-hover);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
}

/* Inputs y forms mejorados */
.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control,
.form-select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.625rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

/* Secciones del formulario */
h5 {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Tablas mejoradas */
.table {
    background: white;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border-collapse: separate;
    border-spacing: 0;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    color: white;
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.table thead tr:first-child th:first-child {
    border-top-left-radius: 12px;
}

.table thead tr:first-child th:last-child {
    border-top-right-radius: 12px;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f1f5f9;
}

.table tbody td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    border-color: var(--border-color);
    font-size: 0.9rem;
}

.table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.table-responsive {
    border-radius: 12px;
    overflow: visible;
}

@media (max-width: 1200px) {
    .table-responsive {
        overflow-x: auto;
    }
}

.id-col {
    width: 60px;
    text-align: center;
}

.actions-col {
    white-space: nowrap;
    text-align: center;
    width: 180px;
}

/* Jumbotron mejorado */
.jumbotron {
    background-image: url('/static/images/ss-static-01.esmsv.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    color: white;
    padding: 4rem 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.jumbotron::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(51, 65, 85, 0.75) 100%);
    z-index: 0;
}

.jumbotron * {
    position: relative;
    z-index: 1;
}

.jumbotron .display-4 {
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.jumbotron .lead {
    font-size: 1.25rem;
    font-weight: 400;
}

.jumbotron .btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* Contenedor principal */
.container {
    max-width: 1200px;
}

/* Reduced motion: respect user preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Alertas mejoradas */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 500;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
}

/* Responsive */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem;
    }

    .jumbotron {
        padding: 3rem 1.5rem;
    }

    h5 {
        font-size: 1.1rem;
    }
}

/* Badge para ID */
.badge-id {
    background-color: #667eea;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Sección destacada */
.section-highlight {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1.5rem;
}