/* Taller 360 web — mismos colores del programa de escritorio. Se adapta a PC, tablet y celular;
   el botón Móvil/Escritorio fuerza la vista de tarjetas aunque la pantalla sea grande. */
:root {
    --p: #0F6E68; --p2: #0A544F; --p-suave: #C4E3DF; --p-claro: #E5F2F0;
    --o: #122628; --o2: #0D1E20; --a: #60BEB2;
    --f: #F3F5F6; --t: #182024; --ts: #626C72; --b: #DCE1E4;
    --ok: #228B4A; --err: #C82C2C; --amb: #C68010; --az: #2563B2;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--f); color: var(--t); font: 15px/1.45 'Segoe UI', Roboto, system-ui, sans-serif; }
h1 { font-family: 'Bahnschrift SemiCondensed', 'Segoe UI', sans-serif; font-size: 26px; margin: 0 0 4px; text-transform: uppercase; letter-spacing: .3px; }
h1:focus { outline: none; }
h2 { font-size: 15px; color: var(--p2); text-transform: uppercase; letter-spacing: .4px; margin: 0 0 10px; }
.sub { color: var(--ts); margin: 0 0 14px; }
.muted { color: var(--ts); font-size: 13px; }
a { color: var(--p); }

/* ---- estructura */
.app { min-height: 100vh; }
.cabecera { position: sticky; top: 0; z-index: 20; }
.barra { background: var(--o); color: #fff; display: flex; align-items: center; gap: 14px; padding: 8px 14px; }
.hamb { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
.marca { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.marca b { display: block; font-family: 'Bahnschrift SemiCondensed', sans-serif; font-size: 20px; letter-spacing: .5px; }
.marca small { display: block; color: var(--a); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; }
/* Logo de Taller 360 (el mismo del escritorio): engranaje metálico con aro de neón; "TALLER" metálico y "360" en neón, inclinados */
.logo { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 0 6px rgba(0, 214, 255, .35)); }
.marca .nombre { display: block; transform: skewX(-8deg); white-space: nowrap; }
.marca .nombre .t { background: linear-gradient(180deg, #ffffff, #b2c4c8); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.marca .nombre .n { color: #6effe6; text-shadow: 0 0 6px rgba(0, 214, 255, .9), 0 0 14px rgba(0, 130, 255, .55); }
.sede { display: flex; align-items: center; gap: 6px; margin-left: 10px; }
.sede label { color: var(--a); font-size: 12px; }
.sede select { background: #1d3b3e; color: #fff; border: 1px solid #3e585a; border-radius: 8px; padding: 6px 8px; font: inherit; }
.sede-fija { color: var(--a); font-weight: 600; }
.acciones { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.acciones .modo, .acciones .salir, .campana { background: #1d3b3e; color: #fff; border: 1px solid #3e585a; border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; text-decoration: none; }
.campana { background: var(--amb); border-color: var(--amb); font-weight: 700; }
.usuario { color: #cfe; font-size: 13px; }
/* Menú horizontal por módulos (como el escritorio y CSA218): cada módulo se despliega al hacer clic */
.menu-h { background: var(--o2); display: flex; flex-wrap: wrap; padding: 0 10px; border-top: 1px solid #1d3b3e; }
.menu-h .grupo { position: relative; }
.menu-h .grupo > button, .menu-h > a.directo { background: none; border: 0; color: #e3ecea; font: inherit; font-size: 14.5px; padding: 11px 13px; cursor: pointer; text-decoration: none; display: flex; align-items: center; gap: 5px; }
.menu-h .grupo > button:hover, .menu-h .grupo.abierto > button, .menu-h > a.directo:hover { background: #1d3b3e; color: #fff; }
.menu-h .grupo.activo > button, .menu-h > a.directo.activo { color: #fff; box-shadow: inset 0 -3px 0 var(--a); }
.menu-h .caret { font-size: 10px; opacity: .8; }
.menu-h .desplegable { position: absolute; top: 100%; left: 0; min-width: 240px; background: #fff; border: 1px solid var(--b); border-radius: 0 0 10px 10px; box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 6px 0; z-index: 30; }
.menu-h .desplegable a { display: block; padding: 8px 18px; color: var(--t); text-decoration: none; white-space: nowrap; }
.menu-h .desplegable a:hover { background: var(--p-claro); }
.menu-h .desplegable a.active { color: var(--p2); font-weight: 700; background: var(--p-claro); }
.menu-h .desplegable hr { border: 0; border-top: 1px solid var(--b); margin: 6px 0; }
.velo { position: fixed; inset: 0; z-index: 15; }
.contenido { padding: 18px 22px 96px; min-width: 0; }   /* abajo: espacio para el botón de NICO */

/* ---- componentes */
.card { background: #fff; border: 1px solid var(--b); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.fila { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.fila > * { flex: 1 1 180px; }
.fila > .auto { flex: 0 0 auto; }
label { display: block; font-weight: 600; color: var(--ts); font-size: 12.5px; margin: 8px 0 4px; }
input, select, textarea { width: 100%; font: inherit; border: 1px solid #C4CCD0; border-radius: 9px; padding: 9px 10px; background: #fff; color: var(--t); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--p-suave); border-color: var(--p); }
input[type=checkbox] { width: auto; }
.chk { display: flex; gap: 8px; align-items: center; font-weight: 400; color: var(--t); }
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--p); color: #fff; border: 0; border-radius: 9px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--p2); }
.btn.sec { background: #fff; color: var(--t); border: 1px solid #C4CCD0; }
.btn.osc { background: var(--o); }
.btn.peligro { background: var(--err); }
.btn.ok { background: var(--ok); }
.btn.mini { padding: 6px 10px; font-size: 13px; }
.btn.ancho { width: 100%; margin-top: 14px; }
.btn:disabled { opacity: .55; cursor: default; }
.aviso { border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-weight: 600; }
.aviso.ok { background: #E6F4EC; color: var(--ok); }
.aviso.err { background: #FBE9E9; color: var(--err); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--b); border-radius: 12px; padding: 14px; }
.kpi b { display: block; font-size: clamp(20px, 2.4vw, 30px); color: var(--p); line-height: 1.1; white-space: nowrap; }
.kpi span { color: var(--ts); font-size: 13px; }
.kpi.amb b { color: var(--amb); }
.pill { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 700; background: var(--p-claro); color: var(--p2); }
.pill.web { background: #FFF3DD; color: #8a5a00; }
.pill.gris { background: #eceff1; color: #555; }
.pill.rojo { background: #FBE9E9; color: var(--err); }
.placa { display: inline-block; background: #F6C431; color: #1d1d1d; border: 2px solid #1d1d1d; border-radius: 6px; font-weight: 800; padding: 0 8px; letter-spacing: 1px; }
.qr { width: 150px; height: 150px; border: 1px solid var(--b); border-radius: 10px; background: #fff; }
.enlace { display: flex; gap: 8px; align-items: center; }
.enlace input { font-family: Consolas, monospace; font-size: 13px; }

/* ---- tablas: en escritorio son tablas; en Móvil (o pantallas pequeñas) se vuelven tarjetas */
table.lista { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--b); }
table.lista th { background: var(--o); color: #fff; text-align: left; padding: 9px 10px; font-weight: 600; font-size: 13px; }
table.lista td { padding: 8px 10px; border-bottom: 1px solid var(--b); vertical-align: middle; }
table.lista tr:hover td { background: #f6faf9; }
table.lista td.r, table.lista th.r { text-align: right; white-space: nowrap; }
table.lista .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.modo-movil table.lista thead { display: none; }
.modo-movil table.lista, .modo-movil table.lista tbody, .modo-movil table.lista tr, .modo-movil table.lista td { display: block; width: 100%; border: 0; background: none; }
.modo-movil table.lista tr { background: #fff; border: 1px solid var(--b); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
.modo-movil table.lista td { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--b); text-align: right; }
.modo-movil table.lista td:last-child { border-bottom: 0; }
.modo-movil table.lista td::before { content: attr(data-label); color: var(--ts); font-size: 12px; font-weight: 600; text-align: left; }

.cuenta { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--o) 0 45%, var(--f) 45%); padding: 16px; }
.cuenta-caja { background: #fff; border-radius: 16px; padding: 26px; width: 100%; max-width: 420px; box-shadow: 0 10px 40px rgba(0,0,0,.15); }
.marca.grande { color: var(--t); margin-bottom: 18px; }
.marca.grande .logo { width: 72px; height: 72px; }
.marca.grande .nombre { font-size: 26px; }
.marca.grande .nombre .t { background: none; color: var(--o); }
.marca.grande .nombre .n { color: #00a9c8; text-shadow: 0 0 8px rgba(0, 214, 255, .45); }
.marca.grande small { color: var(--p); }

@media (max-width: 860px) {
    .hamb { display: block; }
    /* En celular el menú se abre con ☰ y cada módulo se despliega hacia abajo */
    .menu-h { display: none; flex-direction: column; padding: 4px 0; max-height: calc(100vh - 60px); overflow-y: auto; }
    .menu-abierto .menu-h { display: flex; }
    .menu-h .grupo > button, .menu-h > a.directo { width: 100%; padding: 12px 16px; justify-content: space-between; }
    .menu-h .grupo.activo > button, .menu-h > a.directo.activo { box-shadow: inset 3px 0 0 var(--a); }
    .menu-h .desplegable { position: static; border-radius: 0; box-shadow: none; border: 0; background: #16302f; }
    .menu-h .desplegable a { color: #dbe7e6; padding: 10px 28px; white-space: normal; }
    .menu-h .desplegable a.active, .menu-h .desplegable a:hover { background: #1d3b3e; color: #fff; }
    .menu-h .desplegable hr { border-top-color: #2a4a4c; }
    .contenido { padding: 14px 12px 90px; }
    .marca small, .usuario { display: none; }
    .sede label { display: none; }
    table.lista thead { display: none; }
    table.lista, table.lista tbody, table.lista tr, table.lista td { display: block; width: 100%; border: 0; background: none; }
    table.lista tr { background: #fff; border: 1px solid var(--b); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
    table.lista td { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--b); text-align: right; }
    table.lista td::before { content: attr(data-label); color: var(--ts); font-size: 12px; font-weight: 600; text-align: left; }
}
@media (max-width: 560px) {
    .barra { flex-wrap: wrap; gap: 8px; }
    .sede { order: 5; width: 100%; margin: 0; }
    .sede select { width: 100%; }
    .acciones .modo { display: none; }
}

#blazor-error-ui { background: #fff4d6; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.totales { margin: 12px 0 0 auto; max-width: 320px; }
.totales div { display: flex; justify-content: space-between; padding: 3px 0; }
.totales .gran { font-size: 18px; border-top: 2px solid var(--o); padding-top: 6px; }

/* ---- etapa 4: portal del técnico, checklists, fotos y NICO */
.pestanas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pestanas button { background: #fff; border: 1px solid #C4CCD0; border-radius: 99px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; color: var(--t); }
.pestanas button.activa { background: var(--p); border-color: var(--p); color: #fff; }
.trabajos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.trabajo { display: block; background: #fff; border: 1px solid var(--b); border-left: 5px solid var(--p); border-radius: 12px; padding: 12px 14px; color: var(--t); text-decoration: none; }
.trabajo:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.trabajo.listo { border-left-color: var(--ok); opacity: .85; }
.trabajo .cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.estados { display: flex; gap: 6px; flex-wrap: wrap; }
.estados button { flex: 1 1 120px; padding: 12px 8px; border-radius: 10px; border: 1px solid #C4CCD0; background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--t); }
.estados button.activo { background: var(--p); border-color: var(--p); color: #fff; }
.estados button.fin.activo { background: var(--ok); border-color: var(--ok); }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.fotos figure { margin: 0; background: #fff; border: 1px solid var(--b); border-radius: 10px; overflow: hidden; }
.fotos img { width: 100%; height: 120px; object-fit: cover; display: block; }
.fotos figcaption { font-size: 12px; padding: 6px 8px; color: var(--ts); }
.revs { display: flex; flex-direction: column; gap: 8px; }
.rev { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--b); border-radius: 10px; padding: 10px 12px; background: #fff; }
.barra-avance { height: 8px; border-radius: 99px; background: var(--b); overflow: hidden; margin-top: 4px; }
.barra-avance i { display: block; height: 100%; background: var(--p); }
.punto { border-bottom: 1px dashed var(--b); padding: 10px 0; }
.punto .txt { font-weight: 600; margin-bottom: 6px; }
.opciones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.opciones button { padding: 10px 4px; border-radius: 9px; border: 1px solid #C4CCD0; background: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--t); }
.opciones button.e-BIEN { background: var(--ok); border-color: var(--ok); color: #fff; }
.opciones button.e-REVISAR { background: var(--amb); border-color: var(--amb); color: #fff; }
.opciones button.e-CAMBIAR { background: var(--err); border-color: var(--err); color: #fff; }
.opciones button.e-NA { background: #6b7378; border-color: #6b7378; color: #fff; }
.punto input { margin-top: 6px; }
.fija-abajo { position: sticky; bottom: 0; background: var(--f); padding: 10px 76px 10px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.fija-abajo .aviso { margin: 0; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; padding: 4px; }
.burbuja { border-radius: 12px; padding: 9px 12px; white-space: pre-wrap; max-width: 92%; font-size: 14px; }
.burbuja.yo { align-self: flex-end; background: var(--p); color: #fff; }
.burbuja.nico { align-self: flex-start; background: #fff; border: 1px solid var(--b); }
.burbuja small { display: block; opacity: .7; font-size: 11px; margin-bottom: 2px; }
.nico-boton { position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 60px; height: 60px; border-radius: 50%; border: 3px solid var(--a); background: radial-gradient(circle at 35% 30%, #2b5458, #0d2224); color: #fff; font-size: 28px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.nico-panel { position: fixed; right: 18px; bottom: 88px; z-index: 30; width: min(400px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--f); border: 1px solid var(--b); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.25); overflow: hidden; }
.nico-panel header { background: var(--o); color: #fff; padding: 10px 14px; display: flex; align-items: center; gap: 8px; }
.nico-panel header button { margin-left: auto; background: none; border: 0; color: #fff; font-size: 18px; cursor: pointer; }
.nico-panel .chat { flex: 1; max-height: none; padding: 10px; }
.nico-panel form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--b); background: #fff; }
.nico-panel form input { flex: 1; }
@media (max-width: 560px) { .opciones { grid-template-columns: repeat(2, 1fr); } .nico-boton { right: 12px; bottom: 12px; } .nico-panel { right: 16px; bottom: 80px; } }

/* ---- etapa 5: reportes y control financiero */
.leyenda { display: flex; gap: 16px; font-size: 13px; color: var(--ts); margin: 8px 0 4px; }
.leyenda i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.grafico { width: 100%; height: auto; display: block; }
.grafico g:hover rect { fill: rgba(18, 38, 40, .05); }
table.lista tr.total td { background: var(--p-claro); border-top: 2px solid var(--o); }
@media print {
    .cabecera, .velo, .nico-boton, .nico-panel, .no-imprimir, #blazor-error-ui { display: none !important; }
    .app { display: block; }
    .contenido { padding: 0; }
    body, html { background: #fff; }
    .card, .kpi { break-inside: avoid; }
}
