/* --- Estilos del Login --- */
.login-body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}
.login-container {
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 300px;
    text-align: left;
}
.login-container h2 {
    text-align: center;
    margin-top: 0;
    color: #333;
}
.login-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}
.login-container input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.login-container button {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
}
.login-container button:hover {
    background-color: #0056b3;
}
.error-msg {
    color: #dc3545;
    text-align: center;
    margin-top: 15px;
}

/* --- Estilos de Navegación --- */
.navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0 20px;
    margin: -20px -20px 20px -20px; 
}
.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}
.nav-brand {
    font-size: 1.3em;
    font-weight: 700;
    color: #0056b3;
}
.nav-links a {
    color: #333;
    text-decoration: none;
    padding: 20px 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.nav-links a:hover {
    background-color: #f8f9fa;
}
.nav-links a.active {
    font-weight: 700;
    color: #007bff;
    box-shadow: inset 0 -2px 0 #007bff;
}
/* --- ¡Estilo para icono de Nav! --- */
.nav-links a i {
    margin-right: 5px;
    opacity: 0.7;
}

/* --- Estilos Generales del Generador --- */
body {
    /* --- ¡NUEVA FUENTE APLICADA! --- */
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f2f5; 
    color: #333;
}
.container {
    display: flex;
    flex-wrap: wrap; 
    gap: 30px;
    max-width: 1400px;
    margin: 20px auto; 
}

/* --- Estilos del Formulario --- */
.formulario {
    flex: 1;
    min-width: 300px;
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    align-self: flex-start;
}
.formulario h2 {
    margin-top: 0;
    color: #0056b3;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}
.formulario div {
    margin-bottom: 15px;
}
.formulario label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    font-size: 0.9em;
}
.formulario input,
.formulario textarea,
.formulario select {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}
.formulario input:focus,
.formulario textarea:focus,
.formulario select:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0,123,255,0.25);
    outline: none;
}
.formulario button {
    background-color: #5a6268; 
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    margin-top: 10px;
    transition: background-color 0.2s ease;
}
.formulario button:hover {
    background-color: #4a4f54;
}
/* --- ¡Estilo para iconos de botón! --- */
.formulario button i {
    margin-right: 8px;
    opacity: 0.9;
}
.btn-primario {
    background-color: #007bff;
}
.btn-primario:hover {
    background-color: #0056b3;
}
#btnExportar {
    display: none; 
    background-color: #28a745;
}
#btnExportar:hover {
    background-color: #218838;
}
#btnVerHistorial {
    background-color: #17a2b8;
}
#btnVerHistorial:hover {
    background-color: #117a8b;
}

/* --- Estilos de la Nota (Leídos por mPDF) --- */
.nota-generada {
    flex: 1.5;
    min-width: 400px;
    background: #ffffff;
    padding: 40px; 
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: none; 
}
.nota-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 25px;
}
.nota-header h1 {
    margin: 0;
    font-size: 2.2em;
    color: #007bff; 
    font-weight: 700;
}
.nota-datos-emisor {
    text-align: right;
    font-size: 0.95em;
    line-height: 1.5;
}
.logo-nota {
    max-width: 180px; 
    margin-bottom: 10px;
    crossorigin: "anonymous"; 
}
.nota-datos-cliente {
    margin-bottom: 30px;
    font-size: 1.1em;
}
.nota-datos-cliente h3 {
    margin: 0;
    font-size: 0.9em;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
}
.nota-datos-cliente p {
    margin: 5px 0 0;
}
.nota-datos-cliente strong {
    font-size: 1.1em;
    color: #000;
    font-weight: 700;
}
.nota-tabla table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.nota-tabla th,
.nota-tabla td {
    border-bottom: 1px solid #eee; 
    padding: 15px;
    text-align: left;
}
.nota-tabla th {
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.5px;
    color: #333;
    border-bottom-width: 2px;
    background-color: #f8f9fa; 
    font-weight: 700;
}
.nota-tabla tr:last-child td {
    border-bottom: none;
}
.nota-totales {
    text-align: right;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}
#total-final {
    font-size: 1.5em;
    font-weight: 700;
    color: #000;
}
#total-final strong {
    color: #007bff; 
    font-weight: 700;
    margin-right: 15px;
}
.nota-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0; 
    font-size: 0.85em;
    color: #777;
    line-height: 1.5;
}
.nota-footer p {
    margin: 5px 0;
}
.nota-footer strong {
    color: #555;
}

/* --- ESTILOS DEL HISTORIAL --- */
.historial-container {
    max-width: 1200px;
    margin: 20px auto;
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.historial-container h2 {
    margin-top: 0;
    color: #0056b3;
}
.filtro-container {
    margin-bottom: 20px;
}
.filtro-container input {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; 
}
#tabla-historial-container {
    width: 100%;
    overflow-x: auto; 
}
.historial-tabla {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.historial-tabla th,
.historial-tabla td {
    border: 1px solid #eee;
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}
.historial-tabla th {
    background-color: #f9f9f9;
    font-weight: 700;
}
.historial-tabla tr:nth-child(even) {
    background-color: #fcfcfc;
}
.historial-tabla .estado {
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    text-transform: capitalize;
}
.estado-pendiente .estado {
    background-color: #fff8e1;
    color: #f57f17;
}
.estado-pagada .estado,
.estado-pagado {
    background-color: #e8f5e9;
    color: #2e7d32;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}
.btn-pagar {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
}
.btn-pagar:hover {
    background-color: #0056b3;
}
.btn-pagar:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}