/* =========================================================
   CONFIGURACIÓN GENERAL
   ========================================================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f5f6fa;
    color: #333;
}

a {
    color: #673ab7;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}


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

body.login-page {
    min-height: 100vh;

    background: linear-gradient(
        135deg,
        #4b16a8,
        #6f2bd9
    );

    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    width: 380px;
    text-align: center;
}

.login-logo {
    color: white;
    font-size: 38px;
    font-weight: 300;

    margin-bottom: 35px;

    letter-spacing: 1px;
}

.login-logo span {
    font-weight: bold;
}

.login-box {
    width: 100%;
    background-color: white;

    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);

    text-align: left;
}

.login-title {
    padding: 18px 20px;

    border-bottom: 1px solid #ddd;

    font-size: 16px;
    font-weight: normal;

    color: #444;
}

.login-form {
    padding: 22px 20px 25px;
}

.form-group {
    margin-bottom: 17px;
}

.form-group label {
    display: block;

    font-size: 14px;

    margin-bottom: 7px;

    color: #555;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    height: 42px;

    border: 1px solid #d5dbe5;

    padding: 0 12px;

    font-size: 14px;

    outline: none;
}

.form-group input:focus {
    border-color: #7135d9;

    box-shadow: 0 0 0 2px rgba(113, 53, 217, 0.1);
}

.login-options {
    display: flex;

    justify-content: space-between;
    align-items: center;

    margin-top: 10px;
    margin-bottom: 20px;

    font-size: 13px;
}

.remember {
    display: flex;

    align-items: center;

    gap: 6px;
}

.remember input {
    margin: 0;
}

.login-button {
    width: 100%;
    height: 42px;

    border: none;

    background-color: #7135d9;

    color: white;

    font-size: 14px;

    cursor: pointer;

    transition: background-color 0.2s;
}

.login-button:hover {
    background-color: #5d22c4;
}

.error-message {
    background-color: #ffe5e5;

    color: #b00020;

    border: 1px solid #f1b5b5;

    padding: 10px;

    margin-bottom: 18px;

    font-size: 13px;

    text-align: center;
}

.logout-message {
    background-color: #e7f7e7;

    color: #267326;

    border: 1px solid #b8dfb8;

    padding: 10px;

    margin-bottom: 18px;

    font-size: 13px;

    text-align: center;
}

.login-footer {
    border-top: 1px solid #eee;

    padding: 20px;

    text-align: center;

    color: #777;

    font-size: 12px;
}

.copyright {
    margin-top: 20px;

    color: rgba(255, 255, 255, 0.8);

    font-size: 12px;
}


/* =========================================================
   HEADER / NAVBAR
   ========================================================= */

header {
    background-color: white;

    border-bottom: 1px solid #ddd;

    padding: 0 30px;
}

#navbar {
    max-width: 1200px;

    margin: 0 auto;

    height: 70px;

    display: flex;

    align-items: center;

    justify-content: space-between;
}

.logo {
    margin: 0;

    font-size: 25px;
}

.logo a {
    color: #673ab7;

    text-decoration: none;
}


/* =========================================================
   MENÚ LATERAL (hamburguesa) — solo CSS, sin JS
   ========================================================= */

.menu-toggle-input {
    display: none;
}

.menu-btn {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #673ab7;
    user-select: none;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;

    background-color: white;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);

    padding: 20px;

    transform: translateX(-100%);
    transition: transform 0.25s ease;

    z-index: 1000;
}

.sidebar-close {
    display: block;
    text-align: right;

    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #777;

    margin-bottom: 25px;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-links a {
    color: #444;
    font-size: 15px;

    padding: 10px 12px;
    border-radius: 4px;
}

.sidebar-links a:hover {
    background-color: #f5f6fa;
    text-decoration: none;
}

.sidebar-overlay {
    display: none;

    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.4);

    z-index: 999;
}

.menu-toggle-input:checked ~ .sidebar {
    transform: translateX(0);
}

.menu-toggle-input:checked ~ .sidebar-overlay {
    display: block;
}


/* =========================================================
   CONTENEDOR GENERAL
   ========================================================= */

.page-container {
    max-width: 1200px;

    margin: 35px auto;

    padding: 0 25px;
}


/* =========================================================
   TITULOS
   ========================================================= */

h2 {
    color: #444;

    margin-bottom: 25px;
}

h3 {
    color: #555;
}


/* =========================================================
   BOTONES
   ========================================================= */

button {
    border: none;

    background-color: #673ab7;

    color: white;

    padding: 10px 18px;

    font-size: 14px;

    cursor: pointer;

    border-radius: 4px;
}

button:hover {
    background-color: #542ca0;
}

button.secondary {
    background-color: #777;
}

button.secondary:hover {
    background-color: #5f5f5f;
}

button.danger {
    background-color: #d32f2f;
}

button.danger:hover {
    background-color: #b71c1c;
}


/* =========================================================
   FORMULARIOS
   ========================================================= */

.form-container {
    background-color: white;

    padding: 25px;

    border: 1px solid #ddd;

    max-width: 700px;
}

.form-group-general {
    margin-bottom: 18px;
}

.form-group-general label {
    display: block;

    margin-bottom: 7px;

    font-weight: bold;

    color: #555;
}

input[type="text"],
input[type="date"],
input[type="datetime-local"],
input[type="password"],
textarea,
select {
    width: 100%;

    padding: 10px;

    border: 1px solid #ccc;

    border-radius: 4px;

    font-family: Arial, Helvetica, sans-serif;

    font-size: 14px;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;

    border-color: #673ab7;

    box-shadow: 0 0 0 2px rgba(103, 58, 183, 0.1);
}


/* =========================================================
   TABLAS
   ========================================================= */

table {
    width: 100%;

    border-collapse: collapse;

    background-color: white;
}

th {
    background-color: #673ab7;

    color: white;

    padding: 12px;

    text-align: left;
}

td {
    padding: 11px;

    border-bottom: 1px solid #ddd;
}

tr:hover {
    background-color: #f7f5fb;
}


/* =========================================================
   TARJETAS
   ========================================================= */

.card {
    background-color: white;

    border: 1px solid #ddd;

    padding: 20px;

    margin-bottom: 20px;

    border-radius: 5px;
}

.card-title {
    font-size: 18px;

    font-weight: bold;

    margin-bottom: 15px;

    color: #444;
}


/* =========================================================
   MENSAJES
   ========================================================= */

.message-error {
    background-color: #ffe5e5;

    border: 1px solid #f1b5b5;

    color: #b00020;

    padding: 12px;

    margin-bottom: 20px;

    border-radius: 4px;
}

.message-success {
    background-color: #e7f7e7;

    border: 1px solid #b8dfb8;

    color: #267326;

    padding: 12px;

    margin-bottom: 20px;

    border-radius: 4px;
}


/* =========================================================
   ESTADOS DE TURNOS
   ========================================================= */

.estado {
    display: inline-block;

    padding: 5px 10px;

    border-radius: 12px;

    font-size: 12px;

    font-weight: bold;
}

.estado-pendiente {
    background-color: #fff3cd;

    color: #856404;
}

.estado-esperando {
    background-color: #cfe2ff;

    color: #084298;
}

.estado-atencion {
    background-color: #d1e7dd;

    color: #0f5132;
}

.estado-atendido {
    background-color: #d1e7dd;

    color: #0f5132;
}

.estado-cancelado {
    background-color: #f8d7da;

    color: #842029;
}

.estado-no-asistio {
    background-color: #e2e3e5;

    color: #41464b;
}


/* =========================================================
   HISTORIA CLÍNICA
   ========================================================= */

.historia-card {
    background-color: white;

    border: 1px solid #ddd;

    padding: 20px;

    margin-bottom: 20px;

    border-left: 4px solid #673ab7;
}

.historia-card p {
    line-height: 1.5;
}

.historia-editada {
    color: #a15c00;

    font-size: 13px;
}


/* =========================================================
   PANTALLA DEL DOCTOR
   ========================================================= */

.doctor-container {
    max-width: 1000px;

    margin: 35px auto;

    padding: 0 25px;
}

.doctor-title {
    color: #673ab7;

    margin-bottom: 10px;
}

.doctor-info {
    color: #777;

    margin-bottom: 25px;
}


/* =========================================================
   ACCIONES
   ========================================================= */

.actions {
    display: flex;

    gap: 8px;

    flex-wrap: wrap;

    align-items: center;
}

.actions form {
    display: inline;
}


/* =========================================================
   ENLACES
   ========================================================= */

.back-link {
    display: inline-block;

    margin-top: 20px;

    color: #673ab7;
}

.back-link:hover {
    text-decoration: underline;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 700px) {

    #navbar {
        padding: 0 15px;
    }

    .page-container {
        margin: 20px auto;

        padding: 0 15px;
    }

    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 8px;
    }

    .actions {
        flex-direction: column;

        align-items: stretch;
    }

}

@media (max-width: 500px) {

    .login-container {
        width: calc(100% - 40px);
    }

    .login-logo {
        font-size: 32px;
    }

    .sidebar {
        width: 210px;
    }

}