:root {
    --primary: #15124a;
    --secondary: #0c85a6;
    --success: #1f8f4d;
    --danger: #b91c1c;
    --light: #f5f7fb;
    --border: #d8dee9;
    --text: #1f2937;
}

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    background: var(--light);
    color: var(--text);
}

.topbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo {
    height: 64px;
    object-fit: contain;
}

.brand h1 {
    margin: 0;
    color: var(--primary);
    font-size: 28px;
}

.brand p {
    margin: 0;
    color: var(--secondary);
    font-weight: bold;
}

nav a {
    text-decoration: none;
    color: #15124a;
    font-weight: bold;
}

nav a:hover {
    color: var(--secondary);
}

/* .container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 20px;
} */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.card,
.panel,
.form-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

.card a {
    color: var(--primary);
    text-decoration: none;
}

.card h3 {
    margin-top: 0;
    color: var(--primary);
}

.card p {
    font-size: 32px;
    font-weight: bold;
    margin: 0;
    color: var(--secondary);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid var(--border);
}

table a {
    color: #0c85a6;
    text-decoration: none;
}

table a:hover {
    text-decoration: underline;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

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

.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    background: #e5e7eb;
    color: #111827;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

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

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

.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.error {
    background: #fee2e2;
    color: var(--danger);
}

input,
select,
textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

fieldset {
    border: 1px solid var(--border);
    margin-bottom: 18px;
    border-radius: 8px;
}

legend {
    font-weight: bold;
    color: var(--primary);
}

.totals {
    background: white;
    border: 1px solid var(--border);
    padding: 16px;
    margin-top: 16px;
    max-width: 360px;
    margin-left: auto;
}

/* Factura imprimible */
.print-body {
    background: white;
}

.invoice {
    width: 900px;
    margin: 20px auto;
    background: white;
    padding: 30px;
    border: 1px solid var(--border);
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 16px;
}

.invoice-brand {
    display: flex;
    gap: 16px;
}

.invoice-logo {
    width: 180px;
    height: auto;
    object-fit: contain;
}

.invoice-info {
    text-align: right;
}

.invoice-info h2 {
    color: var(--primary);
    margin-top: 0;
}

.client-box {
    margin: 20px 0;
    padding: 14px;
    border: 1px solid var(--border);
    background: #fafafa;
}

.invoice-table th {
    background: var(--primary);
}

.invoice-totals {
    margin-left: auto;
    width: 320px;
    margin-top: 20px;
    border-top: 2px solid var(--primary);
    padding-top: 10px;
}

.grand-total {
    font-size: 22px;
    color: var(--primary);
}

.invoice-footer {
    margin-top: 40px;
    text-align: center;
    color: #666;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

@media print {
    .topbar,
    .btn,
    nav,
    .messages {
        display: none !important;
    }

    body {
        background: white;
    }

    .invoice {
        width: 100%;
        margin: 0;
        border: none;
        box-shadow: none;
    }
}

/* ===== LOGIN CENTRADO ===== */

.login-body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f1f5f9; /* gris claro elegante */
    font-family: Arial, sans-serif;
}

/* Caja central */
.login-box {
    background: white;
    padding: 40px 30px;
    width: 100%;
    max-width: 350px;
    border-radius: 10px;
    border: 1px solid #d8dee9;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    text-align: left;
}

/* Título */
.login-box h2 {
    margin-bottom: 20px;
    color: #1e7397;
}

/* Inputs */
.login-box input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #d8dee9;
    font-size: 14px;
}

/* Focus */
.login-box input:focus {
    outline: none;
    border-color: #0c85a6;
    box-shadow: 0 0 4px rgba(12, 133, 166, 0.3);
}

/* Botón */
.login-box button {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    background: #15124a;
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

/* Hover botón */
.login-box button:hover {
    background: #0c85a6;
}

/* Mensajes error */
.login-box .errorlist {
    color: #b91c1c;
    list-style: none;
    padding: 0;
    margin-bottom: 10px;
    font-size: 14px;
}

/* ===== REPORTES ===== */

.report-filter {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    align-items: end;
}

.report-filter label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: var(--primary);
}

.report-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.report-cards {
    grid-template-columns: repeat(5, 1fr);
}

.card.warning {
    border-left: 5px solid #f59e0b;
}

.card.warning p {
    color: #b45309;
}

.btn.danger {
    background: #b91c1c;
    color: white;
}

.btn.danger:hover {
    background: #991b1b;
}

.btn.success {
    background: #1f8f4d;
    color: white;
}

.btn.success:hover {
    background: #166534;
}

@media (max-width: 900px) {
    .report-filter {
        grid-template-columns: 1fr 1fr;
    }

    .report-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .report-filter {
        grid-template-columns: 1fr;
    }

    .report-actions {
        flex-direction: column;
    }

    .report-cards {
        grid-template-columns: 1fr;
    }
}

/* ===== FIX LINKS ===== */

a {
    text-decoration: none;   /* ❌ quitar subrayado */
    color: inherit;          /* usar color normal */
}

a:hover {
    text-decoration: none; 
}

/* ===== MENU PRINCIPAL ===== */

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 25px;
}

/* Links normales */
.main-nav a {
    text-decoration: none;
    color: #15124a;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    transition: 0.2s;
}

/* Hover */
.main-nav a:hover {
    background: rgba(12, 133, 166, 0.1);
    color: #0c85a6;
}

/* Botón destacado */
.btn-nav {
    background: #0c85a6;
    color: white !important;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: bold;
}

.btn-nav:hover {
    background: #0a6f8c;
}

/* Logout a la derecha */
.nav-right {
    margin-left: auto;
}

/* Botón logout */
.logout {
    background: #b91c1c;
    color: white !important;
    padding: 6px 12px;
    border-radius: 6px;
}

.logout:hover {
    background: #991b1b;
}

.main-nav a.active {
    border-bottom: 3px solid #0c85a6;
}

/* ===== LOGOUT BUTTON ===== */

.logout-form-left: auto;.logout-form {
}

.logout-btn {
    background: #b91c1c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.logout-btn:hover {
    background: #991b1b;
}

/* ===== FORMULARIO CLINICA ===== */

/* ===== FONDO GENERAL ===== */
body {
    background: #f5f7fb;
}

/* ===== CONTENEDOR ===== */
.form-container {
    max-width: 900px;
    margin: 40px auto;
}

/* ===== TARJETA PRINCIPAL ===== */
.form-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* ===== TITULO ===== */
.page-header h2 {
    text-align: center;
    color: #15124a;
    font-weight: bold;
    margin-bottom: 20px;
}

/* ===== SECCIÓN ===== */
fieldset {
    border: none;
    margin-bottom: 20px;
}

legend {
    font-weight: bold;
    font-size: 16px;
    color: #0c85a6;
    margin-bottom: 10px;
}

/* ===== GRID ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ===== LABEL ===== */
.form-grid label {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

/* ===== INPUTS ===== */
.form-grid input,
.form-grid textarea,
.form-grid select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #d8dee9;
    font-size: 14px;
    transition: 0.2s;
}

/* ===== INPUT FOCUS ===== */
.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus {
    border-color: #0c85a6;
    outline: none;
    box-shadow: 0 0 6px rgba(12, 133, 166, 0.2);
}

/* ===== LOGO ===== */
.logo-preview img {
    display: block;
    margin: 10px auto;
}

/* ===== BOTONES ===== */
.form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* botón 📥guardar */
.btn-success {
    background: #1f8f4d;
    color: white;
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    font-weight: bold;
}

.btn-success:hover {
    background: #166534;
}

/* botón cancelar */
.btn-cancel {
    background: #ccc;
    padding: 10px 18px;
    border-radius: 6px;
}

.btn-cancel:hover {
    background: #bbb;
}

/* ===== CHECKBOX ALINEADO ===== */

.checkbox-inline {
    display: flex;
    align-items: center;   /* ✅ centra verticalmente */
    justify-content: space-between;  /* ✅ separa texto y checkbox */
    padding-top: 18px;  /* ✅ alinea con inputs */
}

.checkbox-inline .label-text {
    font-size: 13px;
    font-weight: bold;
    color: #333;
}

/* Misión - Visión - Valores */

.about-header{
    text-align:center;
    padding:70px 20px;
    background:#f8fbff;
}

.about-header h1{
    font-size:42px;
    color:#1a4b84;
    margin-bottom:10px;
}

.about-header p{
    font-size:18px;
    color:#666;
}

.historia-section{
    padding:60px 20px;
    max-width:1100px;
    margin:auto;
}

.historia-section h2{
    text-align:center;
    margin-bottom:30px;
    color:#1a4b84;
}

.historia-section p{
    line-height:1.9;
    text-align:justify;
}

.mvv-section{
    display:flex;
    gap:25px;
    flex-wrap:wrap;
    justify-content:center;
    margin:60px auto;
    max-width:1200px;
}

.mvv-card{
    flex:1;
    min-width:280px;
    background:#fff;
    border-radius:20px;
    padding:30px;
    text-align:center;
    box-shadow:0 8px 20px rgba(0,0,0,0.08);
    transition:.3s;
}

.mvv-card:hover{
    transform:translateY(-5px);
}

.mvv-card .icono{
    font-size:50px;
    margin-bottom:15px;
}

.mvv-card h3{
    color:#1a4b84;
    margin-bottom:15px;
}

.frase-final{
    text-align:center;
    padding:70px 20px;
    background:#1a4b84;
    color:white;
    margin-top:50px;
}

@media(max-width:768px){

    .mvv-section{
        flex-direction:column;
    }

    .mvv-card{
        width:100%;
    }

}