:root {
    --color-dominante: #ffffff;
    --color-secundario: #0f1b44;
    --color-acento: #059669;
    --color-acento-hover: #047857;
    --color-texto: #4b5563;
    --color-texto-mutado: #cbd5e1;
    --color-fondo-footer: #0a1128;
    --color-alerta: #dc2626;
    --color-alerta-hover: #b91c1c;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html, body {
    min-height: 100vh;
    overflow-y: auto;
}

body { 
    font-family: Arial, sans-serif; 
    display: flex;
    flex-direction: column;
    background-image:
        linear-gradient(180deg, rgba(15,27,68,.6) 0%, rgba(15,27,68,.85) 100%),
        url('../img/fondo.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--color-texto);
}

.header-publico-top {
    background: var(--color-dominante) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,.08) !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding: 0px 50px !important;
    border-bottom: 4px solid var(--color-acento) !important; 
    width: 100% !important;
    height: 75px !important; 
    flex-shrink: 0 !important; 
    margin-bottom: 15px !important;
    gap: 16px !important;
}

.header-publico-top h1 {
    color: var(--color-secundario) !important;
    font-size: 19px !important; 
    font-weight: bold !important;
    margin: 0 !important;
}

.logo-nav {
    height: 65px !important; 
    width: 65px !important;
    object-fit: contain !important;
    background: transparent !important; 
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    mix-blend-mode: multiply !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

main { 
    flex: 1 !important; 
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 15px 0 !important;
    width: 100% !important;
}

.container-publico {
    background: #fff;
    max-width: 1200px;
    width: 95%;
    margin: 0 auto !important; 
    padding: 30px 35px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-top: 5px solid var(--color-acento);
    display: flex;
    flex-direction: column;
}

h2 { 
    color: var(--color-secundario); 
    text-align: center; 
    margin-bottom: 2px; 
    font-weight: bold;
    font-size: 22px;
}

.sub { 
    text-align: center; 
    color: #6b7280; 
    font-size: 13px; 
    margin-bottom: 10px; 
}

.grid-agendar { 
    display: flex !important; 
    gap: 30px !important; 
    align-items: stretch !important;
}

.col-izquierda { 
    flex: 0.8 !important; 
    display: flex !important;
    flex-direction: column !important;
    padding-right: 10px;
    max-height: 480px !important;
    overflow-y: auto !important;
}

.col-derecha {
    flex: 1.2 !important;
    display: flex !important;
    flex-direction: column !important;
    padding-right: 5px;
}

.col-izquierda h3, .col-derecha h3 {
    color: var(--color-secundario);
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
}

.medico-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.medico-box h4 { 
    color: var(--color-acento); 
    margin-bottom: 2px; 
    font-weight: bold;
    font-size: 13px;
}

.medico-box p { 
    color: var(--color-texto); 
    font-size: 11.5px; 
}

label { 
    display: block; 
    margin: 4px 0 2px; 
    font-weight: bold; 
    color: #374151; 
    font-size: 12px; 
}

input, select { 
    width: 100%; 
    padding: 6px 10px; 
    border: 1px solid #d1d5db; 
    border-radius: 6px; 
    box-sizing: border-box; 
    background: #fff; 
    font-size: 12px;
    color: var(--color-texto);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--color-acento);
}

.flex-row { 
    display: flex; 
    gap: 12px; 
}

.flex-row > div { 
    flex: 1; 
}

.btn-confirmar { 
    background: var(--color-acento); 
    color: white; 
    border: none; 
    padding: 8px; 
    width: 100%; 
    border-radius: 25px; 
    font-weight: bold; 
    margin-top: 10px; 
    cursor: pointer; 
    font-size: 13px;
    transition: 0.2s; 
}
.btn-confirmar:hover { 
    background: var(--color-acento-hover); 
}

.btn-salir-formulario {
    display: block;
    text-align: center;
    background: var(--color-secundario);
    color: white;
    text-decoration: none;
    padding: 8px;
    width: 100%;
    border-radius: 25px;
    font-weight: bold;
    font-size: 13px;
    margin-top: 6px;
    transition: 0.2s;
}

.btn-salir-formulario:hover {
    background: #1e293b;
}

.calendario-js-box {
    position: absolute !important;
    top: calc(100% + 5px) !important;
    left: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    padding: 12px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    border: 1px solid #e5e7eb !important;
    z-index: 100 !important;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cal-controles {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cal-controles button {
    background: var(--color-secundario);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
}

.cal-controles h4 {
    color: var(--color-secundario);
    font-size: 14px;
    font-weight: bold;
    text-transform: capitalize;
}

.cal-cuadrula {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 4px !important;
}

.cal-cuadrula,
.cal-cuadrula div {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.domingo-bloqueado {
    color: #9ca3af !important;
    background-color: #f1f5f9 !important;
    cursor: not-allowed !important;
    font-weight: normal !important;
    border: 1px dashed #cbd5e1 !important;
}

.toast-text {
    font-size: 13px;
    font-weight: bold;
    color: #374151;
    margin: 0;
    font-family: Arial, sans-serif;
    line-height: 1.4;
}

.toast-icon { font-size: 18px; }
.toast-exito { border-left-color: var(--color-acento); background: #f0fdf4; }
.toast-exito .toast-text { color: #166534; }
.toast-error { border-left-color: var(--color-alerta); background: #fef2f2; }
.toast-error .toast-text { color: #991b1b; }

.cal-cuadrula .cal-celda-dia,
.cal-cuadrula div {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px !important;
    font-size: 11px !important;
    font-weight: bold !important;
    border-radius: 6px !important;
    transition: background 0.2s, color 0.2s;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.cal-cuadrula div.dia-ocupado-rojo {
    background-color: #fee2e2 !important; 
    color: var(--color-alerta) !important;            
    border: 1px dashed #ef4444 !important;
}

.cal-cuadrula div.dia-seleccionado-verde {
    background-color: var(--color-acento) !important; 
    color: #ffffff !important;            
    border: 1px solid var(--color-acento-hover) !important;
}

.cal-cuadrula div.dia-pasado {
    color: #cbd5e1 !important;
    background-color: #f8fafc !important;
    cursor: not-allowed !important;
    border: 1px solid #f1f5f9 !important;
    font-weight: normal !important;
}

.cal-cuadrula div:not(.domingo-bloqueado):not(.dia-pasado):hover {
    background-color: #e2e8f0;
    color: var(--color-secundario);
}

select option:disabled {
    color: #94a3b8 !important;
    background-color: #f1f5f9 !important;
    font-style: italic;
}

.col-izquierda::-webkit-scrollbar {
    width: 6px;
}
.col-izquierda::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}
.col-izquierda::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.col-izquierda::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.site-footer {
    background: var(--color-fondo-footer) !important; 
    color: #ffffff !important;
    margin-top: 30px !important;
    border-top: 4px solid var(--color-acento) !important; 
    width: 100% !important;
    font-family: Arial, sans-serif !important;
    flex-shrink: 0 !important;
}

.footer-top {
    max-width: 1100px !important;
    margin: 0 auto !important;
    padding: 10px 30px 6px !important;
    display: grid !important;
    grid-template-columns: 1.2fr 1fr 0.8fr !important; 
    gap: 30px !important; 
    align-items: center !important;
}

.footer-brand { display: flex !important; flex-direction: column !important; gap: 4px !important; }
.footer-logo-wrapper { display: flex !important; align-items: center !important; gap: 10px !important; }
.footer-logo-wrapper img { width: 28px !important; height: 28px !important; object-fit: contain !important; filter: brightness(0) invert(1) !important; }
.footer-logo-wrapper h3 { color: #ffffff !important; font-size: 14px !important; font-weight: bold !important; }
.footer-brand p { font-size: 12px !important; line-height: 1.4 !important; color: #ffffff !important; text-align: justify !important; }
.footer-social { display: flex !important; gap: 6px !important; }
.footer-social a { width: 26px !important; height: 24px !important; border-radius: 50% !important; background: rgba(255, 255, 255, 0.07) !important; display: flex !important; align-items: center !important; justify-content: center !important; color: #ffffff !important; text-decoration: none !important; font-size: 10px !important; font-weight: bold !important; transition: .25s !important; }
.footer-social a:hover { background: var(--color-acento) !important; }
.footer-col h3 { color: #ffffff !important; font-size: 12px !important; margin-bottom: 4px !important; text-transform: uppercase !important; letter-spacing: 0.8px !important; }
.footer-info-list { list-style: none !important; display: flex !important; flex-direction: column !important; gap: 3px !important; padding: 0 !important; }
.footer-info-list li { font-size: 12px !important; color: #ffffff !important; }
.urgencias-tag { color: #ffffff; background: #1e293b; padding: 1px 8px; border-radius: 4px; font-weight: bold; font-size: 11px; display: inline-block; box-shadow: none; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
    max-width: 1100px !important;
    margin: 0 auto !important;
    padding: 6px 40px !important; 
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 12px !important;
    color: #ffffff; 
}

.footer-links-legal a { color: #ffffff; text-decoration: none; }
.footer-links-legal a:hover { color: var(--color-acento); }
.footer-links-legal span { margin: 0 6px; color: rgba(255, 255, 255, 0.04); }

@media(max-width: 900px) {
    html, body { height: auto !important; max-height: none !important; overflow: auto !important; }
    .grid-agendar { flex-direction: column !important; gap: 15px !important; height: auto !important; overflow: visible !important; }
    .col-izquierda, .col-derecha { overflow: visible !important; }
    .col-izquierda { max-height: none !important; overflow: visible !important; }
    .calendario-js-box { position: static !important; box-shadow: none !important; }
    .footer-top { grid-template-columns: 1fr !important; gap: 15px !important; padding: 15px !important; }
    .footer-bottom { flex-direction: column !important; gap: 6px !important; text-align: center !important; }
}