* === AJUSTES PARA ESTRUCTURA FLEXIBLE === */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8f9fa;
    position: relative;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #212529;
    font-size: 16px;
}

/* Contenedor principal expansible */
main {
    flex: 1;
}

/* === NAVBAR === */
.navbar {
    background-color: #0d6efd !important;
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.navbar-brand, .navbar-nav .nav-link {
    color: #ffffff !important;
    transition: color 0.3s ease;
}
.navbar-nav .nav-link:hover {
    color: #d9ecff !important;
    text-decoration: underline;
}

/* === FOOTER === */
footer {
    background-color: #0d6efd;
    color: white;
    text-align: center;
    padding: 1rem 0;
    font-size: 0.9rem;
    margin-top: auto;
    width: 100%;
    border-top: none;
}

/* === TITULOS === */
h1, h2, h3, h4, h5, h6 {
    color: #0d6efd;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* === BOTONES === */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}
.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}
.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}
.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* === TABLAS === */
.table {
    background-color: #ffffff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}
.table th, .table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
    border-color: #dee2e6;
    font-size: 15px;
}
.table thead th {
    background-color: #f1f3f5;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 2px solid #dee2e6;
}
.table-hover tbody tr:hover {
    background-color: #f8f9fc;
    transition: background-color 0.2s ease-in-out;
}
.table td a {
    text-decoration: none;
    font-weight: 500;
    color: #0d6efd;
}
.table td a:hover {
    text-decoration: underline;
}

/* === BADGES POR ESTADO === */
.badge.bg-warning { background-color: #ffc107 !important; color: #000 !important; }
.badge.bg-success { background-color: #28a745 !important; }
.badge.bg-danger  { background-color: #dc3545 !important; }
.badge.bg-secondary { background-color: #6c757d !important; }
.badge.bg-dark { background-color: #343a40 !important; }
.badge.bg-light { background-color: #f8f9fa !important; color: #000 !important; }

/* === FORMULARIOS === */
form .form-label {
    font-weight: 500;
}
.form-control, .form-select {
    border-radius: 0.375rem;
    font-size: 15px;
}
.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* === RESPONSIVE PARA TABLAS EN CELULARES === */
@media (max-width: 768px) {
    .table thead {
        display: none;
    }

    .table, .table tbody, .table tr, .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        margin-bottom: 1rem;
        border-bottom: 2px solid #dee2e6;
    }

    .table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
    }

    .table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        top: 0.75rem;
        font-weight: bold;
        text-align: left;
        color: #495057;
    }
}

/* === MARCA DE AGUA === */
body::before {
    content: '';
    position: fixed;
    top: 1rem;
    left: 1rem;
    width: 200px;
    height: auto;
    background-image: url('../img/fondo-sistema.png');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: top left;
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
}
@media (max-width: 768px) {
    body::before {
        width: 120px;
        top: 0.5rem;
        left: 0.5rem;
        opacity: 0.06;
    }
}
