/* Portal · solo lo propio de la pantalla de inicio y la configuración. Colores y tipografía: /comun/plataforma.css */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.4 var(--pd-font); background: var(--fondo); color: var(--tinta);
       -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--pd-font); margin: 0; letter-spacing: .01em; }
h2 { font-size: 1.6rem; } h3 { font-size: 1.25rem; }
.suave { color: var(--tinta-2); } .pequeño { font-size: .85rem; }
input, select, button { font: inherit; color: inherit; }
input:not([type=checkbox]), select { min-height: 44px; border: 1.5px solid var(--linea); border-radius: var(--radio);
                                     background: var(--superficie); padding: 6px 10px; width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--tinta); }

svg { fill: currentColor; }
.error { color: var(--obs); font-weight: 600; margin: 8px 0 0; }

.btn { min-height: 44px; padding: 0 16px; border-radius: var(--radio); border: 1.5px solid var(--tinta);
       background: var(--superficie); font-weight: 600; cursor: pointer; display: inline-flex;
       align-items: center; justify-content: center; gap: 6px; }
.btn-principal { background: var(--pd-blue); border-color: var(--pd-blue); color: var(--pd-on-blue); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-chico { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-texto { background: none; border: 0; text-decoration: underline; padding: 12px 0; cursor: pointer; min-height: 44px; }
.peligro { color: var(--obs); }

/* acceso */
.acceso { min-height: 70vh; display: grid; place-items: center; padding: 24px; }
.acceso-caja { width: min(380px, 100%); }
.acceso-logo { width: 220px; max-width: 70%; display: block; margin-bottom: 18px; }
.acceso-caja form { display: grid; gap: 12px; margin-top: 16px; }
.acceso-caja label, .form-dlg label { display: grid; gap: 4px; font-weight: 500; }

/* inicio */
main { max-width: 960px; margin: 0 auto; padding: 14px 12px; }
main.ancho { max-width: 1080px; }
.saludo { margin: 6px 0 14px; }
.saludo p { margin: 2px 0 0; }
.cuadros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .cuadros { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }

.cuadro { position: relative; text-align: center; min-height: 168px; padding: 22px 14px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center;
          gap: 12px; background: var(--superficie); color: var(--tinta); border: 1px solid var(--pd-line); border-radius: var(--pd-radius-lg); box-shadow: var(--pd-shadow);
          cursor: pointer; transition: border-color .12s, box-shadow .15s, transform .15s; }
.cuadro:hover { border-color: var(--pd-blue); box-shadow: var(--pd-shadow-hover); transform: translateY(-2px); }
.cuadro:active { box-shadow: var(--pd-shadow); transform: none; }
.cuadro-icono { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center;
                background: var(--pd-blue-soft); color: var(--pd-blue-ink); border: 1px solid color-mix(in srgb, var(--pd-blue) 18%, transparent); }
.cuadro-icono svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cuadro-nombre { font-family: var(--pd-font); font-weight: 800; font-size: clamp(.95rem, 3.6vw, 1.1rem); letter-spacing: .05em; text-transform: uppercase; line-height: 1.15; overflow-wrap: anywhere; }
.cuadro-sub { min-height: 18px; }
.cuadro-n { color: var(--tinta-2); font-size: .78rem; font-weight: 600; }

/* en gris: desactivados o sin acceso */
.cuadro.apagado { background: color-mix(in srgb, var(--pd-soft) 70%, var(--pd-card)); border: 1px dashed var(--pd-line-strong); cursor: not-allowed; box-shadow: none; color: var(--tinta-2); }
.cuadro.apagado:hover { border-color: var(--pd-line-strong); box-shadow: none; transform: none; }
.cuadro.apagado .cuadro-icono { background: transparent; color: var(--tinta-2); border-color: var(--pd-line); }
.cuadro.apagado .cuadro-nombre { color: var(--tinta-2); }
.etiqueta { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
            padding: 3px 9px; border-radius: 10px; background: var(--pd-head); color: var(--tinta-2); width: fit-content; border: 1px solid var(--pd-line); }
.cuadro.cargando { opacity: .6; pointer-events: none; }

/* diálogos */
dialog { border: 1px solid var(--pd-line-strong); box-shadow: 0 16px 44px rgba(20, 32, 52, .22); border-radius: var(--pd-radius-lg); padding: 18px; width: min(420px, calc(100% - 24px)); background: var(--superficie); color: var(--tinta); }
dialog::backdrop { background: rgba(18, 24, 30, .6); }
.lista-modulos { display: grid; gap: 10px; margin: 14px 0; }
.modulo-op { text-align: left; padding: 12px 14px; border: 1px solid var(--pd-line-strong); box-shadow: var(--pd-shadow-btn); border-radius: var(--radio); background: var(--superficie);
             cursor: pointer; display: grid; gap: 2px; }
.modulo-op:hover { background: var(--apagado); }
.modulo-op b { font-family: var(--pd-font); font-size: 1.15rem; }
.form-dlg { display: grid; gap: 12px; margin-top: 12px; }
.fila-btn { display: flex; gap: 8px; justify-content: flex-end; }

/* configuración */
.config-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.segmento { display: flex; border: 1px solid var(--pd-line-strong); border-radius: var(--radio); overflow: hidden; background: var(--pd-card); box-shadow: var(--pd-shadow-btn); }
.segmento button { border: 0; background: none; padding: 9px 14px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.segmento button.activo { background: var(--pd-blue); color: var(--pd-on-blue); }
.nota { margin: 0 0 12px; }

.areas-lista { display: grid; gap: 12px; }
@media (min-width: 860px) { .areas-lista { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.area-caja { background: var(--superficie); border: 1px solid var(--pd-line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; min-width: 0; }
.area-caja.sucia { border-color: var(--acento); box-shadow: 0 0 0 2px rgba(201, 162, 39, .30); }
.area-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.area-cab h3 { text-transform: uppercase; letter-spacing: .03em; }
.interruptor { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.interruptor input { appearance: none; width: 46px; height: 26px; min-height: 0; border-radius: 13px; background: var(--linea); position: relative;
                     border: 0; padding: 0; cursor: pointer; transition: background .15s; flex: none; }
.interruptor input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.interruptor input:checked { background: var(--ok); }
.interruptor input:checked::after { left: 23px; }
.sub-tit { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-2); margin: 0 0 6px; }
.marcas { display: grid; gap: 6px; }
.marca { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--pd-line-strong); border-radius: var(--radio); cursor: pointer; }
.marca input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--pd-blue); }
.marca:has(input:checked) { border-color: var(--pd-blue); background: var(--pd-blue-soft); }
.marca small { display: block; color: var(--tinta-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 16px; background: var(--pd-blue-soft); color: var(--pd-blue-ink); font-size: .88rem; }
.chip.fijo { background: var(--apagado); color: var(--tinta-2); padding-right: 10px; }
.chip button { background: none; border: 0; color: inherit; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; font-size: 1.05rem; line-height: 1; }
.chip button:hover { background: rgba(255, 255, 255, .2); }
.agregar { display: flex; gap: 8px; }
.agregar select { flex: 1; min-width: 0; }
.area-pie { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.area-pie .suave { margin-right: auto; }

.tabla-caja { background: var(--superficie); border: 1px solid var(--linea); border-radius: 12px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tinta-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td select { min-height: 36px; width: auto; }
.nuevo-usuario { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; padding: 14px;
                 background: var(--superficie); border: 1px solid var(--linea); border-radius: 12px; margin-bottom: 12px; }
.nuevo-usuario label { display: grid; gap: 4px; font-weight: 500; font-size: .9rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; }
.reg-grid { display: grid; gap: 12px; }
@media (min-width: 960px) { .reg-grid { grid-template-columns: 1fr 1.4fr; align-items: start; } }
.reg-cab { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.reg-cab input { max-width: 220px; }
.etq-ok { color: var(--ok); font-weight: 600; } .etq-mal { color: var(--obs); font-weight: 600; }

#aviso { position: fixed; z-index: 40; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
         background: var(--tinta); color: var(--fondo); padding: 10px 16px; border-radius: 24px; font-weight: 600; transition: all .2s; z-index: 20;
         max-width: calc(100% - 24px); text-align: center; }
#aviso.ver { opacity: 1; transform: translate(-50%, 0); }
#aviso.mal { background: var(--obs); color: #fff; }

/* el pie común queda al final de la pantalla aunque haya poco contenido */
body { display: flex; flex-direction: column; min-height: 100vh; }
#app { flex: 1; display: flex; flex-direction: column; }
#app > main { width: 100%; }
#app + dialog, .pf-pie { margin-top: auto; }
#v-login { flex: 1; }

/* áreas: crear, editar, borrar */
.areas-barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.areas-barra .nota { margin: 0; flex: 1 1 320px; }
.area-cab .area-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.area-cab .area-icono { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
                        background: var(--pd-blue-soft); color: var(--pd-blue-ink); border: 1px solid color-mix(in srgb, var(--pd-blue) 18%, transparent); }
.area-cab .area-icono svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.area-cab h3 { overflow-wrap: anywhere; }
.area-acciones { display: flex; gap: 8px; }
.btn-peligro { color: var(--mal, #b3261e); border-color: color-mix(in srgb, var(--mal, #b3261e) 55%, transparent); background: transparent; }
.btn-peligro:hover { background: color-mix(in srgb, var(--mal, #b3261e) 10%, transparent); }
.dlg-area { width: min(520px, calc(100% - 24px)); }
.iconos-campo { border: 0; padding: 0; margin: 12px 0 4px; min-width: 0; }
.iconos-campo legend { font-weight: 700; font-size: .9rem; padding: 0; margin-bottom: 6px; }
.iconos-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; max-height: 232px; overflow: auto; padding: 2px; }
.icono-op { min-height: 46px; border-radius: 10px; border: 1.5px solid var(--pd-line-strong); background: var(--pd-card); color: var(--tinta-2); cursor: pointer;
            display: grid; place-items: center; padding: 0; }
.icono-op svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icono-op:hover { background: var(--pd-head); color: var(--pd-ink); }
.icono-op[aria-checked="true"] { border-color: var(--pd-blue); background: var(--pd-blue-soft); color: var(--pd-blue-ink); box-shadow: 0 0 0 1px var(--pd-blue); }

/* accesos de usuario (Master) */
.reservado{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 0;border-top:1px solid var(--line2,#e5e7eb)}
.reservado small{display:block;color:var(--muted,#6b7280);font-size:12px}
.reservado select{min-width:130px}
#dlg-accesos .marcas{max-height:260px;overflow:auto}
#dlg-accesos .marca{display:flex;flex-direction:row;align-items:center;gap:10px;padding:7px 10px;margin:0}
#dlg-accesos .marca input{width:auto;min-height:0;margin:0}
#dlg-accesos .marcas{display:grid;gap:6px}

/* --- acceso con Microsoft y solicitudes pendientes --- */
.btn-ms { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; text-decoration: none; background: #fff; color: #2f2f2f; border: 1px solid #8c8c8c; }
.btn-ms:hover { background: #f3f3f3; }
.solicitudes { border: 1px solid var(--borde, #d6dbe3); border-left: 4px solid #d98e04; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; background: rgba(217, 142, 4, .06); }
.solicitudes h3 { margin: 0 0 8px; font-size: 1rem; }
.solicitud { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 1fr) 2fr auto; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--borde, #d6dbe3); }
.solicitud:first-of-type { border-top: 0; }
.solicitud .areas-elegir { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.solicitud .areas-elegir label { display: flex; gap: 5px; align-items: center; font-size: .85rem; }
.solicitud .areas-elegir input { width: auto; min-height: 0; }
.solicitud .acciones { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 800px) { .solicitud { grid-template-columns: 1fr; } }
.etq-aviso { color: #9a6200; font-weight: 600; }
[data-tema="oscuro"] .etq-aviso, .oscuro .etq-aviso { color: #f0b84a; }
.acceso-caja h1 { font-size: 22px; line-height: 1.25; }

/* ---- inicio por funciones: filas con título ---- */
.inicio-fila + .inicio-fila { margin-top: 26px; }
.inicio-tit { margin: 0 0 10px; font: 800 12px var(--pd-font); letter-spacing: .09em; text-transform: uppercase; color: var(--tinta-2); }
.cuadro.alerta .cuadro-icono { color: var(--pd-coral-ink, #8a2a1c); background: var(--pd-coral-soft, #fbeae7); }
.cuadro.alerta:hover { border-color: var(--pd-coral, #c8503b); }
.enlace-equipo { background: none; border: 0; padding: 2px 4px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.enlace-equipo:hover { background: var(--pd-blue-soft); color: var(--pd-blue-ink); }
