:root {
    --primary-color: #2c3e50; /* Gris oscuro para texto fuerte */
    --secondary-color: #f8f9fa; /* Blanco grisáceo para fondos */
    --accent-color: #28a745; /* Verde Vital Health */
    --success-color: #218838;
    --danger-color: #dc3545;
    --light-bg: #ffffff;
    --white: #ffffff;
    --text-main: #2d3436;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    background-color: var(--secondary-color);
    color: var(--text-main);
}

/* Login Page */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
}

.login-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card img {
    max-width: 180px;
    margin-bottom: 1.5rem;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    color: var(--primary-color);
    border-right: 1px solid #eee;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid #f1f1f1;
}

.sidebar-header img {
    max-width: 150px;
}

.nav-menu {
    list-style: none;
    margin-top: 1.5rem;
    padding: 0 1rem; /* Espacio lateral para las píldoras */
}

.nav-item {
    margin-bottom: 0.5rem; /* Separación entre botones */
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid #eee; /* Línea sutil que rodea la opción */
    border-radius: 10px; /* Bordes redondeados modernos */
    gap: 10px;
}

.nav-item a .icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-item a:hover {
    background: #f0fff4;
    color: var(--accent-color);
    border-color: var(--accent-color); /* Resalta el borde en verde al pasar el mouse */
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
}

.main-content {
    flex: 1;
    overflow-y: auto;
}

.top-nav {
    background: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.container {
    padding: 2rem;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Modern Components */
.card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid #f1f1f1;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #4a5568;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e2e8f0; /* Borde un poco más oscuro por defecto */
    border-radius: 8px;
    outline: none;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: #fdfdfd;
}

.form-control:focus, .form-control:hover {
    border-color: var(--accent-color); /* Borde verde al interactuar */
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
}

/* Resaltado especial para cuadros de búsqueda */
#search-client, #search-prod {
    border-color: #cbd5e0;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--success-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: #218838;
    color: white;
}

.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    border-left: 5px solid;
}

.alert-danger {
    background: #fff5f5;
    color: #c53030;
    border-color: #feb2b2;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border: 1px solid #edf2f7;
    border-radius: 12px;
}

table {
    width: 100%;
    border-spacing: 0;
    background-color: var(--white);
}

th {
    background-color: #f8fafc;
    color: #4a5568;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 1.25rem 1rem;
    border-bottom: 2px solid #edf2f7;
}

td {
    padding: 1rem;
    color: #2d3748;
    border-bottom: 1px solid #e2e8f0; /* Borde base para todas las filas */
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

/* Zebra Stripes - Fondo alterno muy sutil */
tr:nth-child(even) td {
    background-color: #fcfdfc;
}

/* Efecto de resaltado mejorado para cada fila */
tr {
    transition: all 0.2s ease;
}

tr:hover td {
    background-color: #f0fff4 !important;
    border-bottom-color: var(--accent-color); /* El borde inferior se vuelve verde al pasar el mouse */
    color: var(--accent-color);
}

/* Línea lateral verde al hacer hover para resaltar la fila seleccionada */
tr:hover td:first-child {
    border-left: 4px solid var(--accent-color);
}

/* Estilo para los badges dentro de la tabla */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Última fila sin borde */
tr:last-child td {
    border-bottom: none;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none; /* Se activa con JS */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--white);
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #f1f1f1;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

/* Helpers */
.text-right { text-align: right; }
.mb-1 { margin-bottom: 1rem; }
.mt-1 { margin-top: 1rem; }

/* Print Styles */
@media print {
    .sidebar, .top-nav, .module-header button, .module-header input, .manual-card, .manual-footer {
        display: none !important;
    }

    body {
        background: white !important;
        padding: 0;
        margin: 0;
    }

    .wrapper {
        display: block !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .container {
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }

    .table-container {
        max-height: none !important;
        overflow: visible !important;
    }

    table {
        font-size: 8pt !important;
        border-collapse: collapse !important;
        width: 100% !important;
    }

    th, td {
        border: 1px solid #ddd !important;
        padding: 4pt !important;
    }

    th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
    }

    .badge {
        border: 1px solid #000 !important;
        background: transparent !important;
        color: black !important;
        padding: 1pt 3pt !important;
    }

    /* Ocultar scrollbars y otros elementos de UI */
    #pivot-table th {
        writing-mode: horizontal-tb !important;
        transform: none !important;
        font-size: 7pt !important;
    }
}

/* App Manual Styling */
.manual-card h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.manual-section {
    margin-top: 2rem;
}

.manual-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.step {
    background: #f8fafc;
    padding: 1.2rem;
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.2s;
}

.step:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.step strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.step p {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

.module-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.8rem;
}

.module-list li {
    background: #ffffff;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #edf2f7;
    font-size: 0.9rem;
}

.module-list li strong {
    color: var(--accent-color);
    margin-right: 5px;
}

.manual-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f1f1;
    text-align: center;
    color: #94a3b8;
}
