/* V79: Portal cliente — misma distribución que el sistema anterior, colores de EasyControl, letra grande. */
:root { --fondo: #eef2f6; --lateral: #1f2430; --lateral2: #2a3040; --acento: #16a34a; --azul: #2563eb; --borde: #e2e8f0;
        --texto: #1e293b; --suave: #64748b; --sombra: 0 6px 20px rgba(15,23,42,.08); }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: 17px; color: var(--texto); background: var(--fondo); }
a { color: var(--azul); }
.p-layout { display: flex; min-height: 100vh; }
.p-lateral { width: 270px; background: var(--lateral); color: #cbd5e1; flex-shrink: 0; }
.p-perfil { padding: 22px 18px; background: linear-gradient(160deg, #334155, #1e293b); }
.p-avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, #f472b6, #a855f7); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; }
.p-perfil b { display: block; color: #fff; margin-top: 10px; font-size: 18px; }
.p-menu-titulo { padding: 14px 18px 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; }
.p-menu a { display: flex; gap: 12px; align-items: center; padding: 11px 18px; color: #e2e8f0; text-decoration: none; font-size: 17px; }
.p-menu a:hover { background: var(--lateral2); }
.p-menu a.activo { background: var(--acento); color: #fff; font-weight: 700; }
.p-menu .ic { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.p-menu .sub a { padding-left: 62px; font-size: 16px; color: #cbd5e1; }
.c1{background:#2563eb}.c2{background:#6366f1}.c3{background:#a855f7}.c4{background:#f59e0b}.c5{background:#22c55e}.c6{background:#64748b}.c7{background:#475569}
.p-principal { flex: 1; min-width: 0; }
.p-arriba { height: 64px; background: #fff; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 0 20px; box-shadow: var(--sombra); }
.p-arriba .boton-admin { background: linear-gradient(90deg, #f97316, #fb923c); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 800; text-decoration: none; }
.p-arriba .nombre { font-weight: 700; }
.p-boton-menu { display: none; margin-right: auto; font-size: 26px; background: none; border: 0; cursor: pointer; }
.p-contenido { padding: 22px; }
.p-mensajes div { padding: 12px 16px; border-radius: 12px; margin-bottom: 12px; font-size: 17px; }
.p-mensajes .success { background: #dcfce7; color: #166534; } .p-mensajes .error { background: #fee2e2; color: #991b1b; } .p-mensajes .info, .p-mensajes .warning { background: #e0f2fe; color: #075985; }
.p-tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 18px; }
.p-tarjeta { background: #fff; border-radius: 16px; box-shadow: var(--sombra); padding: 18px; position: relative; }
.p-tarjeta .t { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); }
.p-tarjeta .n { font-size: 32px; font-weight: 800; margin: 6px 0 14px; }
.p-tarjeta .ico { position: absolute; top: 16px; right: 16px; width: 54px; height: 54px; border-radius: 14px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; background: var(--azul); }
.p-tarjeta .ver { display: block; text-align: right; border-top: 1px solid var(--borde); padding-top: 10px; font-size: 15px; text-decoration: none; }
.p-caja { background: #fff; border-radius: 16px; box-shadow: var(--sombra); margin-bottom: 18px; overflow: hidden; }
.p-caja-titulo { background: linear-gradient(90deg, #2563eb, #3b82f6); color: #fff; padding: 14px 18px; font-weight: 800; font-size: 17px; text-transform: uppercase; display: flex; justify-content: space-between; align-items: center; }
.p-caja-cuerpo { padding: 18px; }
.p-solapas { display: flex; gap: 6px; margin-bottom: 10px; }
.p-solapas button { border: 0; background: #f1f5f9; padding: 9px 14px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.p-solapas button.activa { background: var(--acento); color: #fff; }
table.p-tabla { width: 100%; border-collapse: collapse; font-size: 16px; }
.p-tabla th { text-align: left; font-size: 13px; text-transform: uppercase; color: var(--suave); padding: 10px; border-bottom: 2px solid var(--borde); background: #f8fafc; }
.p-tabla td { padding: 11px 10px; border-bottom: 1px solid var(--borde); }
.p-scroll { overflow-x: auto; }
.pildora { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #fff; }
.pildora.verde { background: #16a34a; } .pildora.rojo { background: #dc2626; } .pildora.naranja { background: #f59e0b; } .pildora.gris { background: #94a3b8; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 12px; border: 0; background: var(--azul); color: #fff; font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.verde { background: linear-gradient(90deg, #16a34a, #22c55e); } .btn.blanco { background: #fff; color: var(--texto); border: 1px solid var(--borde); }
.btn.mp { background: linear-gradient(90deg, #009ee3, #00b1ea); font-size: 18px; padding: 14px 22px; }
.campo { margin-bottom: 14px; } .campo label { display: block; font-weight: 700; margin-bottom: 6px; }
.campo input, .campo select, .campo textarea { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 12px; font-size: 17px; font-family: inherit; }
.campo .error { color: #b91c1c; font-size: 15px; }
.p-factura-cab { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; background: #f8fafc; padding: 18px; border-radius: 12px; margin: 14px 0; }
.p-factura-cab small { color: var(--suave); text-transform: uppercase; }
.p-total { display: flex; justify-content: space-between; align-items: center; background: #f1f5f9; border-radius: 12px; margin-top: 14px; overflow: hidden; }
.p-total div { padding: 14px 18px; } .p-total .final { background: #111827; color: #fff; font-size: 24px; font-weight: 800; }
.p-departamentos { display: grid; gap: 12px; }
.p-departamentos button { text-align: left; border: 0; border-radius: 14px; padding: 16px 18px; cursor: pointer; font-size: 16px; color: #0f172a; }
.p-departamentos button b { font-size: 20px; display: block; margin-bottom: 4px; }
.dep0 { background: #bae6fd; } .dep1 { background: #bbf7d0; } .dep2 { background: #fed7aa; } .dep3 { background: #e9d5ff; }
.p-modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 12px; z-index: 50; overflow-y: auto; }
.p-modal.oculto { display: none; }
.p-modal .caja { background: #fff; border-radius: 16px; width: min(720px, 100%); padding: 20px; }
.p-hilo { display: flex; flex-direction: column; gap: 12px; }
.p-msj { max-width: 85%; padding: 12px 16px; border-radius: 16px; }
.p-msj.cliente { background: #dcfce7; align-self: flex-end; } .p-msj.empresa { background: #e0e7ff; align-self: flex-start; }
.p-msj small { display: block; color: var(--suave); margin-bottom: 4px; }
.p-entrar { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e293b, #2563eb); padding: 16px; }
.p-entrar .caja { background: #fff; border-radius: 20px; width: min(420px, 100%); padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.p-entrar h1 { margin-top: 0; font-size: 26px; }
@media (max-width: 860px) {
    .p-lateral { position: fixed; left: -280px; top: 0; bottom: 0; z-index: 60; transition: left .2s; overflow-y: auto; }
    .p-lateral.abierto { left: 0; }
    .p-boton-menu { display: block; }
    .p-contenido { padding: 14px; }
}
@media print { .p-lateral, .p-arriba, .no-imprimir { display: none !important; } .p-contenido { padding: 0; } body { background: #fff; } }

/* V121: logo de la empresa, app del celular, ingreso directo y QR para pagar */
.p-logo-grande { text-align: center; margin-bottom: 10px; }
.p-logo-grande img { max-width: 100%; max-height: 150px; }
.p-logo-arriba { margin-right: auto; display: flex; align-items: center; }
.p-logo-arriba img { max-height: 44px; max-width: 160px; display: block; }
.btn.app { background: linear-gradient(90deg, #7c3aed, #a855f7); width: 100%; justify-content: center; margin-top: 10px; }
.p-arriba .btn.app { width: auto; margin-top: 0; padding: 8px 12px; font-size: 15px; }
.p-app-ayuda { display: none; background: #f5f3ff; border-radius: 12px; padding: 12px 14px; margin-top: 10px; font-size: 16px; }
.p-app-ayuda.visible { display: block; }
.p-monto { font-size: 36px; font-weight: 800; margin: 8px 0 14px; }
.p-pagada { background: #dcfce7; color: #166534; border-radius: 14px; padding: 14px; font-size: 20px; font-weight: 800; }
@media (max-width: 900px) { .p-logo-arriba img { max-height: 36px; max-width: 120px; } .p-arriba .btn.app span.txt { display: none; } }
[hidden] { display: none !important; }

/* ---------- V151q: subir archivos con el MISMO diseño en todo el sistema (lo arma panel/archivos.js) ---------- */
.ec-archivo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; max-width: 520px; padding: 8px;
              border: 2px dashed #d8d2f5; border-radius: 14px; background: #faf9ff; cursor: pointer; position: relative; box-sizing: border-box; }
.ec-archivo:hover, .ec-archivo.arrastrando { border-color: #7c4ddc; background: #f5f3ff; }
.ec-archivo.con-archivo { border-style: solid; border-color: #bbf7d0; background: #f0fdf4; }
.ec-archivo input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ec-archivo:focus-within { outline: 3px solid #c4b5fd; outline-offset: 2px; }
.ec-archivo-boton { background: linear-gradient(90deg, #7c4ddc, #a57cf0); color: #fff; border-radius: 10px; padding: 8px 14px;
                    font-weight: 800; font-size: 14.5px; white-space: nowrap; flex: none; }
.ec-archivo-nombre { font-size: 14px; color: #64748b; min-width: 0; overflow-wrap: anywhere; flex: 1 1 160px; }
.ec-archivo.con-archivo .ec-archivo-nombre { color: #166534; font-weight: 700; }
.ec-archivo-actual { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; font-size: 14px; color: #475569; margin-bottom: 6px; }
.ec-archivo-actual a { font-weight: 700; overflow-wrap: anywhere; }
.ec-archivo-quitar { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #b91c1c; cursor: pointer; font-size: 13.5px; }
.ec-archivo-quitar input { width: auto; }

/* V151v: aviso chico mientras se instala una versión nueva (no bloquea nada) */
.p-aviso-actualizando { background: #fef3c7; color: #78350f; border-bottom: 1px solid #fde68a; padding: 9px 16px;
    font-size: 14px; text-align: center; line-height: 1.4; }

/* V151w: 🩺 autodiagnóstico y ⏻ reiniciar mi equipo */
.diag-pasos { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.diag-paso { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: #f0fdf4; border: 1px solid #bbf7d0; }
.diag-paso.mal { background: #fef2f2; border-color: #fecaca; }
.diag-paso.aviso { background: #fffbeb; border-color: #fde68a; }
.diag-paso b { font-size: 17px; }
.diag-paso p { margin: 4px 0 8px; line-height: 1.45; }
.diag-icono { font-size: 24px; line-height: 1.2; }
.diag-servicio { margin: 18px 0 8px; }
.diag-reclamo, .diag-aviso { background: #fff7ed; color: #9a3412; border-radius: 12px; padding: 12px 14px; font-size: 16px; }
.diag-pie { color: var(--suave); margin-top: 12px; }
.btn.reiniciar-grande { background: linear-gradient(90deg, #ea580c, #f97316); font-size: 20px; padding: 16px 26px; width: 100%; justify-content: center; max-width: 420px; }


/* V151w: 📢 cartel de mantenimiento / corte (Comunicados) */
.p-cartel-com { background: #fef3c7; color: #92400e; border: 1.5px solid #f59e0b; border-radius: 14px; padding: 12px 14px;
    margin: 0 0 14px; line-height: 1.45; }
.p-cartel-com.corte { background: #fee2e2; color: #991b1b; border-color: #f87171; }
/* V152a: 📅 pedir la próxima factura */
.p-adelantar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 12px; padding: 14px 16px; margin: 14px 18px 0; }
.p-adelantar div { flex: 1 1 260px; font-size: 16px; color: #065f46; } .p-adelantar span { font-size: 14.5px; }
.p-adelantar-nota { margin: 14px 18px 0; font-size: 14.5px; color: #475569; }
/* V152c: el ícono ya no tapa el título ni el número (cada uno le deja su lugar),
   los textos largos bajan de renglón y las tarjetas van de a 3 por fila en la PC (6 = dos filas parejas), de a 2 en
   la tablet y de a 1 en el celular. */
.p-tarjetas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.p-tarjeta { display: flex; flex-direction: column; min-width: 0; }
.p-tarjeta .t, .p-tarjeta .n { padding-right: 66px; overflow-wrap: anywhere; }
.p-tarjeta .n { font-size: clamp(22px, 2.2vw, 32px); line-height: 1.15; flex: 1; }
.p-tarjeta .n.chico { font-size: clamp(19px, 1.6vw, 22px); }
.p-tarjeta .n small { white-space: nowrap; }
@media (max-width: 1100px) { .p-tarjetas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
    .p-tarjetas { grid-template-columns: 1fr; gap: 12px; }
    .p-tarjeta { padding: 14px 16px; }
    .p-tarjeta .ico { width: 46px; height: 46px; font-size: 22px; top: 14px; right: 14px; }
    .p-tarjeta .t, .p-tarjeta .n { padding-right: 56px; }
    .p-tarjeta .n { font-size: 26px; margin-bottom: 10px; }
    .p-tarjeta .n.chico { font-size: 21px; }
}
/* V152c: el gráfico de Inicio con un alto fijo (en el celular quedaba de 3 cm) */
.p-grafico { position: relative; height: 380px; }
@media (max-width: 600px) { .p-grafico { height: 260px; } }
/* V152c: en el celular las tablas pasan a tarjetas: cada fila una tarjeta y cada dato «Título: valor» */
@media (max-width: 600px) {
    table.p-tabla, .p-tabla tbody, .p-tabla tr, .p-tabla td { display: block; width: 100%; }
    .p-tabla thead { display: none; }
    .p-tabla tr { border: 1px solid var(--borde); border-radius: 12px; padding: 6px 12px; margin: 0 0 10px; background: #fff; }
    .p-tabla td { border: 0; padding: 6px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    .p-tabla td[data-titulo]::before { content: attr(data-titulo); font-weight: 700; color: var(--suave); text-align: left; font-size: 14px; }
    .p-tabla td:not([data-titulo]) { justify-content: flex-end; }
    .p-tabla td[colspan] { display: block; text-align: left; }
    .p-caja-titulo { flex-wrap: wrap; gap: 8px; }
}
