/* estilos.css - NutriaSoft Control de Acceso 2026 */

/* Variables CSS */
:root {
    --primary-color: #801717;
    --primary-dark: #5a1010;
    --primary-light: #a01d1d;
    --gray-900: #1a1a1a;
    --gray-800: #2d2d2d;
    --gray-700: #404040;
    --gray-600: #666666;
    --gray-500: #808080;
    --gray-400: #999999;
    --gray-300: #cccccc;
    --gray-200: #e5e5e5;
    --gray-100: #f5f5f5;
    --white: #ffffff;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    max-width: 150px;
    height: auto;
    border-radius: 8px;
}

.login-box h1 {
    text-align: center;
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 30px;
    font-weight: 600;
}

.footer-text {
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
    margin-top: 30px;
}

/* Navbar */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center; /* Mantiene centrado vertical entre logo y texto */
    gap: 5px; /* Espacio entre logo y título */
}

.nav-logo {
    width: 150px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.nav-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 40px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-user span {
    color: var(--gray-700);
    font-weight: 500;
}

.btn-logout {
    padding: 8px 20px;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: var(--primary-dark);
}

/* Main Menu */
.main-menu {
    background: var(--white);
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.menu-item:hover {
    background: var(--gray-200);
    transform: translateY(-2px);
}

.menu-item.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-dark);
}

.menu-icon {
    font-size: 20px;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    color: var(--primary-color);
    font-weight: 600;
}

/* Card */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 20px;
}

.card-header h2 {
    font-size: 22px;
    font-weight: 600;
}

.card-body {
    padding: 30px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--gray-700);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--gray-500);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-600);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-warning {
    background: var(--warning);
    color: var(--gray-900);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Input Group */
.input-group {
    display: flex;
    gap: 10px;
}

.input-group .form-control {
    flex: 1;
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-error {
    background: #fee;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.alert-success {
    background: #efe;
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-info {
    background: #eff;
    color: var(--info);
    border: 1px solid var(--info);
}

/* Search Form */
.search-form {
    margin-bottom: 20px;
}

/* Resultado Búsqueda */
.resultado-busqueda {
    margin-top: 20px;
    min-height: 100px;
}

.resultado-card {
    background: var(--gray-100);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.resultado-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.perfil-encontrado {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.perfil-info {
    display: flex;
    gap: 20px;
    align-items: start;
}

.perfil-foto {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
}

.perfil-info p {
    margin-bottom: 8px;
    color: var(--gray-700);
}

/* Puestos Grid */
.puestos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.puesto-card {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.puesto-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.puesto-icon {
    font-size: 48px;
}

.puesto-nombre {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    text-align: center;
}

/* Casas Grid */
.casas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.casa-card {
    background: var(--white);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
}

.casa-card:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(1.05);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-large {
    max-width: 1000px;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
}

.modal-body {
    padding: 30px;
}

/* Detalles Casa */
.detalles-casa {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.categoria-section h4 {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-200);
}

/* Perfiles Lista */
.perfiles-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.perfil-item {
    background: var(--gray-100);
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
}

.perfil-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.perfil-mini {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.perfil-mini-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.perfil-nombre {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.perfil-cedula {
    font-size: 14px;
    color: var(--gray-600);
}

/* Autos Lista */
.autos-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.auto-item {
    background: var(--gray-100);
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.auto-icon {
    font-size: 32px;
}

.auto-item p {
    margin-bottom: 4px;
    color: var(--gray-700);
}

/* Observaciones Lista */
.observaciones-lista {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.observacion-item {
    background: var(--gray-100);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 15px;
}

.observacion-texto {
    color: var(--gray-800);
    margin-bottom: 8px;
}

.observacion-meta {
    font-size: 14px;
    color: var(--gray-600);
}

/* Utility Classes */
.text-muted {
    color: var(--gray-500);
}

.text-error {
    color: var(--danger);
}

.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--gray-600);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-300);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.col-2 {
    flex: 1;
    min-width: calc(50% - 10px);
}

.col-3 {
    flex: 1;
    min-width: calc(33.333% - 14px);
}

.col-4 {
    flex: 1;
    min-width: calc(25% - 15px);
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: var(--primary-color);
    color: var(--white);
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
}

table tr:hover {
    background: var(--gray-100);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }

    .nav-user {
        width: 100%;
        justify-content: space-between;
    }

    .main-menu {
        flex-direction: column;
    }

    .menu-item {
        width: 100%;
        justify-content: center;
    }

    .puestos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .casas-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .perfiles-lista {
        grid-template-columns: 1fr;
    }

    .autos-lista {
        grid-template-columns: 1fr;
    }

    .col-2, .col-3, .col-4 {
        min-width: 100%;
    }

    .modal-content {
        max-width: 100%;
        margin: 0;
    }

    .perfil-info {
        flex-direction: column;
    }

    .input-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 30px 20px;
    }

    .card-body {
        padding: 20px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .puestos-grid {
        grid-template-columns: 1fr;
    }
}

/* Integración con Bootstrap */
.menu-item i {
    font-size: 20px;
    margin-right: 5px;
}

.btn i {
    margin-right: 5px;
}

.table-container table {
    width: 100%;
}

.badge {
    padding: 0.35em 0.65em;
    font-size: 0.875em;
    font-weight: 500;
}

.form-check {
    margin-bottom: 0.5rem;
}

.form-check-input {
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    margin-left: 0.25rem;
}