:root {
    --bg-page: #f4f1ea;
    --header-brown: #5d4a3a;
    --text-dark: #3e3326;
    --panel-login: #e8dcc2;
    --panel-reg: #c4bda9;
    --red-urgent: #c0392b;
    --green-ok: #558b2f;
    --btn-brown: #6d5442;
    --shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* === 1. GLOBAL Y SCROLLBAR === */

/* Ocultar barra de scroll pero permitir bajar */
body::-webkit-scrollbar, 
.side-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}
html { scrollbar-width: none; }

body {
    font-family: 'Segoe UI', sans-serif; margin: 0; padding: 0;
    background-color: var(--bg-page); color: var(--text-dark); font-size: 16px;
    display: flex; flex-direction: column; min-height: 100vh;
}

main { flex: 1; } /* Empuja el footer hacia abajo */

/* === 2. HEADER === */
.main-header {
    background-color: var(--header-brown); color: white; padding: 15px 30px;
    display: flex; justify-content: center; align-items: center; text-align: center;
    position: relative;
}
.main-header h1 { margin: 0; font-weight: 700; font-size: 1.8rem; letter-spacing: 1px; }

.pretty-logout { 
    position: absolute; right: 25px; top: 50%; transform: translateY(-50%); 
    background: #ffffff22; border: 1px solid #ddd; padding: 8px 20px; 
    font-size: 1rem; border-radius: 10px; cursor: pointer; color: white; transition: 0.2s; 
}
.pretty-logout:hover { background: #ffffff55; }

/* === 3. LOGIN === */
.container { max-width: 1250px; margin: 40px auto; padding: 0 30px; }

.login-wrapper {
    display: flex; border: 2px solid #3e3326; border-radius: 15px;
    overflow: hidden; height: 380px; box-shadow: var(--shadow); background: white;
}
.panel {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 20px; cursor: pointer; transition: 0.2s; color: var(--text-dark);
}
.panel:hover { filter: brightness(0.95); } 
.panel-left { background-color: var(--panel-login); border-right: 2px solid #3e3326; }
.panel-right { background-color: var(--panel-reg); border-left: 2px solid #3e3326; }
.panel-center { 
    flex: 1.4; background-color: #fffcf5; display: flex; align-items: center; justify-content: center; padding: 10px;
}
.panel-center img { max-height: 100%; max-width: 100%; object-fit: contain; }
.icon-action { font-size: 3rem; margin-bottom: 15px; color: #333; opacity: 0.8; }
.text-action { margin: 0; font-size: 1.1rem; }
.title-action { margin: 5px 0; font-size: 1.4rem; font-weight: 800; text-transform: uppercase; color: #222; }

/* === 4. DASHBOARD GRID Y TARJETAS === */
.dash-grid { 
    display: grid; 
    grid-template-columns: 1.8fr 1fr; 
    gap: 30px; 
    align-items: start; 
    width: 100%;
}
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

.card-main, .card-side { 
    background: white; border-radius: 20px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); 
    overflow: hidden; 
}

.card-header-alert { background: white; border-top: 8px solid var(--red-urgent); padding: 20px 30px; border-bottom: 1px solid #eee; }
.card-body { padding: 30px; }
.card-side { padding: 30px; }

/* Elementos internos Dashboard */
.info-row { display: flex; align-items: center; gap: 25px; }
.logo-big { width: 100px; height: 100px; object-fit: contain; border-radius: 50%; border: 1px solid #eee; padding: 5px; }
.status-text { font-size: 1.2rem; font-weight: bold; color: var(--red-urgent); }
.amount-huge { font-size: 3.5rem; font-weight: 800; color: var(--red-urgent); margin: 10px 0; line-height: 1; }

.btn-pay-big { 
    width: 100%; background-color: var(--green-ok); color: white; border: none; 
    padding: 18px; font-size: 1.3rem; font-weight: bold; border-radius: 12px; 
    cursor: pointer; margin-top: 25px; box-shadow: 0 5px 0 #3e6b1e; transition: 0.2s;
}
.btn-pay-big:hover { filter: brightness(1.1); transform: translateY(-2px); }

/* Listas laterales (Otros servicios / Historial) */
.side-item { 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 15px 0; border-bottom: 1px solid #eee; font-size: 1rem;
}
.btn-modal-action-mini {
    background: white; border: 1px solid var(--header-brown); color: var(--header-brown);
    font-weight: bold; padding: 5px 15px; border-radius: 20px; cursor: pointer; transition: 0.2s;
}
.btn-modal-action-mini:hover { background: var(--header-brown); color: white; }

/* === 5. MODALES === */
.modal-overlay { 
    position: fixed; top:0; left:0; width:100%; height:100%; 
    background: rgba(0,0,0,0.6); z-index: 2000; 
    display: flex; justify-content: center; align-items: center; 
    backdrop-filter: blur(3px); 
}
.hidden { display: none !important; }
.modal-box { background: white; padding: 40px; border-radius: 20px; width: 90%; max-width: 500px; position: relative; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.close-icon { position: absolute; top: 15px; right: 20px; font-size: 2rem; cursor: pointer; color: #888; }
.input-field { width: 100%; padding: 14px; font-size: 1.1rem; border: 2px solid #ddd; border-radius: 8px; margin-bottom: 15px; box-sizing: border-box; outline: none; }
.label-field { display: block; text-align: left; font-weight: bold; margin-bottom: 5px; color: #5a4335; }
.btn-modal-action { background: var(--btn-brown); color: white; width: 100%; padding: 15px; border: none; border-radius: 8px; font-size: 1.1rem; font-weight: bold; cursor: pointer; margin-top: 10px; }
.big-input { font-size: 1.8rem; letter-spacing: 5px; text-align: center; }

/* CHECKBOX CARDS (IMPORTANTE: Estado Selected) */
.check-box-card { 
    display:flex; align-items:center; gap:8px; padding:12px; 
    border:1px solid #ddd; border-radius:8px; cursor:pointer; 
    background: white; transition: 0.2s; 
}
.check-box-card:hover { border-color: var(--header-brown); }

/* ESTA CLASE ES LA QUE HACE QUE SE VEA SELECCIONADO */
.check-box-card.selected { 
    border-color: var(--header-brown); 
    background-color: #fdf6e9; 
    box-shadow: inset 0 0 0 1px var(--header-brown); 
}

/* === 6. TOASTS (Alertas) === */
.toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 10000 !important; 
    display: flex; flex-direction: column; gap: 10px;
}
.toast {
    padding: 15px 20px; border-radius: 8px; font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); background: white;
    display: flex; align-items: center; gap: 10px; min-width: 250px;
}
.toast.success { border-left: 5px solid #4caf50; color: #2e7d32; }
.toast.error { border-left: 5px solid #e53935; color: #c0392b; }

/* === 7. CHATBOT === */
.chat-float-btn { 
    position: fixed; bottom: 30px; right: 30px; 
    background: var(--header-brown); color: white; 
    padding: 15px 30px; border-radius: 50px; cursor: pointer; 
    z-index: 1500; display: flex; gap:10px; align-items:center; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.chat-window { 
    position: fixed; bottom: 100px; right: 30px; 
    width: 350px; height: 500px; background: white; 
    border-radius: 15px; overflow: hidden; 
    box-shadow: 0 10px 50px rgba(0,0,0,0.25); z-index: 1500; 
    display: flex; flex-direction: column; border: 1px solid #ddd; 
}
.chat-header { 
    background: var(--header-brown); color: white; padding: 15px; 
    display:flex; justify-content:space-between; align-items: center; 
    font-weight: bold; font-size: 1.1rem;
}
.chat-messages { flex: 1; padding: 15px; background: #f9f9f9; overflow-y: auto; }

/* Opciones (Chips) */
.chat-options-container {
    display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; justify-content: flex-end;
}
.chat-chip {
    background: white; border: 1px solid var(--header-brown); color: var(--header-brown);
    padding: 8px 15px; border-radius: 20px; cursor: pointer;
    font-size: 0.9rem; font-weight: 600; transition: 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.chat-chip:hover { background: var(--header-brown); color: white; transform: translateY(-2px); }

/* Burbujas y Animación */
.bubble { max-width: 85%; line-height: 1.4; font-size: 0.95rem; box-shadow: 0 1px 2px rgba(0,0,0,0.1); margin-bottom: 10px; padding: 12px 16px; border-radius: 15px;}
.bubble.bot { border-bottom-left-radius: 2px; background: #ffffff; border: 1px solid #e0e0e0; }
.bubble.user { background: #dcf8c6; color: #000; align-self: flex-end; border-bottom-right-radius: 2px; text-align: right; }

.typing { align-items: center; display: flex; height: 15px; }
.typing span { 
    animation: blink 1.5s infinite; height: 5px; width: 5px; 
    background: #3b3b3b; border-radius: 50%; margin: 0 2px; 
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0% { opacity: 0.1; } 20% { opacity: 1; } 100% { opacity: 0.1; } }

/* === 8. FOOTER === */
.footer-corporativo { background: var(--header-brown); padding: 20px 0 10px 0; text-align: center; color: white; margin-top: auto; }
.footer-logos { display: flex; justify-content: center; align-items: center; gap: 20px; margin-bottom: 10px; }
.footer-logos img { height: 40px; opacity: 0.9; transition: 0.2s; }
.footer-logos img.central { height: 60px; }
.footer-logos img:hover { opacity: 1; transform: translateY(-2px); }

/* Pagos */
.payment-opt-btn { cursor:pointer; border:2px solid #eee; padding:10px; border-radius:12px; width:90px; text-align:center; transition:0.2s; font-weight: bold; font-size: 0.9rem; }
.payment-opt-btn:hover { background: #f9f9f9; transform: translateY(-3px); }
.steps { animation: fadeIn 0.3s; }
.step-header { color: white; padding: 10px; border-radius: 8px 8px 0 0; font-weight: bold; margin-bottom: 15px; }
.back-link { margin-top:15px; text-decoration:underline; cursor:pointer; color:#777; font-size: 0.9rem; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }