/* PORTAL NET · JRP Network
   Sistema visual: navy/petróleo corporativo, acento teal, ámbar para lo que requiere atención.
   Archivo único, sin dependencias. Pensado primero para el teléfono del técnico. */

:root {
  --navy: #0C1F2E; --navy-2: #12293B; --petrol: #174A63; --teal: #22C3B5; --teal-d: #0B766D; --teal-l: #E3F6F4;
  --amber: #F0A43A; --amber-d: #9A5B06; --amber-l: #FDF3E3;
  --ink: #15232D; --ink-2: #32434F; --muted: #5E6E78; --line: #DCE3E7; --line-2: #EAF0F2;
  --bg: #F2F5F6; --card: #FFFFFF; --soft: #F7F9FA;
  --red: #B42318; --red-l: #FDECEA; --green: #13773D; --green-l: #E6F4EA; --blue: #1D5FD1; --blue-l: #E8F0FD;
  --purple: #6B3FC9; --purple-l: #F0EBFB; --orange: #B8480C; --orange-l: #FDEEE4;
  --r: 10px; --r-sm: 7px; --shadow: 0 1px 2px rgba(12, 31, 46, .06), 0 1px 1px rgba(12, 31, 46, .04);
  --shadow-lg: 0 10px 30px rgba(12, 31, 46, .16);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --side: 248px; --tabbar: 0px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); font-stretch: 100%; }
body.role-tecnico, body.role-cliente { --tabbar: 62px; }
img { max-width: 100%; }
a { color: var(--teal-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-stretch: 108%; letter-spacing: -.01em; margin: 0; color: var(--navy); }
h1 { font-size: 1.55rem; line-height: 1.2; font-weight: 750; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
h3.sub, h2.sub { margin: 18px 0 8px; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
p { margin: 0 0 10px; }
small { font-size: .82em; }
.i { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.break { word-break: break-all; }
.pre { white-space: normal; line-height: 1.55; }
.big { font-size: 1.35rem; font-weight: 750; }
.eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 4px; }
.warn-text { color: var(--red) !important; }
.upper { text-transform: uppercase; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(34, 195, 181, .55); outline-offset: 2px; }

/* ================= Estructura ================= */
.app { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--navy); color: #C9D6DE; display: flex; flex-direction: column; z-index: 40; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; text-decoration: none !important; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.side-brand .mark { width: 38px; height: 38px; color: #fff; }
.side-brand b { font-weight: 800; letter-spacing: .04em; font-stretch: 115%; }
.side-brand em { font-style: normal; color: var(--teal); font-weight: 800; letter-spacing: .04em; font-stretch: 115%; }
.side-brand small { display: block; font-size: .72rem; color: #8FA3B0; letter-spacing: .02em; }
.nav { padding: 10px 10px 20px; flex: 1; }
.nav-group { margin: 16px 10px 6px; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #7890A0; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; margin: 1px 0; border-radius: 8px; color: #C9D6DE; font-weight: 500; font-size: .93rem; text-decoration: none; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: var(--petrol); color: #fff; box-shadow: inset 3px 0 0 var(--teal); }
.nav a .i { opacity: .85; }
.side-foot { padding: 14px 20px; font-size: .72rem; color: #6D8595; border-top: 1px solid rgba(255, 255, 255, .07); margin: 0; }
.scrim { display: none; }
.main { flex: 1; min-width: 0; margin-left: var(--side); display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 26px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); min-height: 60px; }
.menu-btn { display: none; }
.top-search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; color: var(--muted); }
.top-search input { border: 0; background: none; padding: 9px 0; width: 100%; font: inherit; color: var(--ink); outline: none; }
.top-company { flex: 1; margin: 0; font-weight: 700; color: var(--navy); }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--ink-2); cursor: pointer; position: relative; font: inherit; text-decoration: none !important; }
.icon-btn:hover { background: var(--soft); border-color: var(--line); }
.icon-btn.sm { width: 30px; height: 30px; font-size: 1rem; }
.icon-btn.danger { color: var(--red); }
.bell { margin-left: auto; }
.bell b { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--amber); color: var(--navy); font-size: .7rem; line-height: 18px; font-weight: 800; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 6px; border-radius: 10px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--soft); }
.um-name { display: flex; flex-direction: column; line-height: 1.2; font-weight: 600; font-size: .9rem; }
.um-name small { color: var(--muted); font-weight: 500; }
.um-pop { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 190px; padding: 6px; z-index: 50; }
.um-pop a, .um-pop button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 9px 11px; border-radius: 7px; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; text-align: left; text-decoration: none; }
.um-pop a:hover, .um-pop button:hover { background: var(--soft); }
.content { width: 100%; max-width: 1180px; padding: 22px 26px calc(40px + var(--tabbar)); margin: 0 auto; }
.content.wide { max-width: 1480px; }
.tabbar { display: none; }
.bare { background: #0C1F2E; }
.bare-wrap { min-height: 100vh; padding: 20px 16px 40px; background: linear-gradient(160deg, #0C1F2E 0%, #12324A 55%, #174A63 100%); }

/* ================= Encabezado de página ================= */
.ph { margin: 0 0 18px; }
.crumbs { margin: 0 0 6px; font-size: .82rem; color: var(--muted); }
.crumbs span { margin: 0 3px; }
.crumbs .mono { color: var(--ink-2); }
.ph-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 14px; flex-wrap: wrap; }
.ph-main { min-width: 0; flex: 1 1 320px; }
.ph-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ph-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ph-sub { margin: 6px 0 0; color: var(--muted); max-width: 900px; }
.ph-sub a { font-weight: 600; }

/* ================= Botones ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--petrol); background: var(--petrol); color: #fff; font: 600 .92rem/1.2 var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: #1C5877; border-color: #1C5877; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { border-color: #B9C6CD; background: var(--soft); }
.btn.teal { background: var(--teal-d); border-color: var(--teal-d); }
.btn.teal:hover { background: #09655D; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost.danger { background: #fff; color: var(--red); border-color: #F1C8C3; }
.btn.sm { padding: 6px 11px; font-size: .84rem; border-radius: 8px; }
.btn.lg { padding: 12px 20px; font-size: 1rem; }
.btn.xl { padding: 15px 24px; font-size: 1.08rem; border-radius: 12px; min-height: 54px; }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--teal-d); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn.danger { color: var(--red); }
.linkbtn.small { font-size: .78rem; margin-left: 6px; }
.inline-form { display: inline; margin: 0; }

/* ================= Insignias ================= */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 650; line-height: 1.55; white-space: nowrap; border: 1px solid transparent; text-decoration: none !important; }
.t-gray { background: #EEF2F4; color: #43535E; }
.t-blue { background: var(--blue-l); color: var(--blue); }
.t-teal { background: var(--teal-l); color: var(--teal-d); }
.t-amber { background: var(--amber-l); color: var(--amber-d); }
.t-purple { background: var(--purple-l); color: var(--purple); }
.t-red { background: var(--red-l); color: var(--red); }
.t-green { background: var(--green-l); color: var(--green); }
.t-dark { background: var(--navy); color: #fff; }
.t-outline { background: #fff; color: var(--ink-2); border-color: #C5D0D6; }
.t-muted { background: #F1F3F4; color: #87959D; text-decoration: line-through; }
.t-orange { background: var(--orange-l); color: var(--orange); }
.t-light { background: #F4F7F8; color: var(--muted); }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.prio::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #A0AEB6; }
.p-critica { color: var(--red); } .p-critica::before { background: var(--red); box-shadow: 0 0 0 3px var(--red-l); }
.p-alta { color: var(--orange); } .p-alta::before { background: var(--orange); }
.p-media { color: var(--ink-2); } .p-media::before { background: #7D8D96; }
.p-baja { color: var(--muted); } .p-baja::before { background: #C5D0D6; }

/* ================= Formularios ================= */
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld-l { font-size: .82rem; font-weight: 650; color: var(--ink-2); }
.req { color: var(--red); font-style: normal; }
.help { color: var(--muted); font-size: .78rem; }
input, select, textarea { font: inherit; color: var(--ink); }
.fld input, .fld select, .fld textarea, .lines input, .lines select, .qe-row input, .qe-row select, .qe-row textarea, .copy-row input, .qty-in, .in-sm {
  width: 100%; padding: 9px 11px; border: 1px solid #C9D3D9; border-radius: 8px; background: #fff; min-height: 40px; transition: border-color .15s, box-shadow .15s; }
.fld textarea, .qe-row textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .lines input:focus, .lines select:focus, .qe-row input:focus, .qe-row textarea:focus, .qe-row select:focus, .qty-in:focus, .in-sm:focus {
  outline: none; border-color: var(--teal-d); box-shadow: 0 0 0 3px rgba(34, 195, 181, .22); }
.fld input[readonly], .fld textarea[readonly], .lines input[readonly] { background: var(--soft); color: var(--ink-2); }
.fld input[type=file] { padding: 8px; background: var(--soft); border-style: dashed; }
.fld input[type=color] { padding: 3px; height: 40px; }
.qty-in, .in-sm { max-width: 110px; text-align: right; padding: 6px 9px; min-height: 34px; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; padding: 3px 0; line-height: 1.35; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--teal-d); flex: none; }
.check span { display: flex; flex-direction: column; }
.check small { color: var(--muted); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: .82rem; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.checks { display: flex; flex-direction: column; gap: 4px; }
.checks.inline, .checks-row { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; display: flex; }
.checks.cols-2, .checks.cols-3, .checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 16px; }
.tech-check .dot, .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 0; }
.tech-check input:disabled + span { opacity: .45; }
.tech-check > span { display: block; }
.tech-check > span small { display: block; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: start; }
.row.end { align-items: end; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.form-grid.two { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.form-grid.three { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.form-grid .full, .fld.full { grid-column: 1 / -1; }
.form-grid .span2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.actions .check { margin-right: auto; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); position: sticky; bottom: calc(10px + var(--tabbar)); z-index: 5; box-shadow: var(--shadow-lg); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 16px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.filters .fld { flex: 1 1 150px; max-width: 230px; }
.filters .fld.grow { flex: 3 1 240px; max-width: none; }
.filters .check { align-self: center; }
.filters.compact { padding: 10px 12px; }
.inline-qty { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.inline-qty .fld-l { font-weight: 500; }
.qty-wrap { display: flex; align-items: center; gap: 6px; }
.qty-wrap input { width: 96px; text-align: right; padding: 6px 8px; border: 1px solid #C9D3D9; border-radius: 7px; }

/* ================= Tarjetas y bloques ================= */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); margin: 0 0 16px; min-width: 0; }
.card > h2:first-child { margin-bottom: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.card-h h2 small { font-weight: 500; margin-left: 4px; }
details.card > summary { list-style: none; cursor: pointer; margin: 0; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2::after { content: " +"; color: var(--muted); font-weight: 500; }
details.card[open] > summary { margin-bottom: 14px; }
details.card[open] > summary h2::after { content: " −"; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 0 16px; align-items: start; }
.cols > *, .t-main, .t-side, .stack > * { min-width: 0; }
.cols.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0 0 16px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 13px 15px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none !important; box-shadow: var(--shadow); border-top: 3px solid var(--line); transition: transform .12s, box-shadow .12s; }
a.kpi:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(12, 31, 46, .09); }
.kpi b { font-size: 1.45rem; font-weight: 750; font-stretch: 108%; letter-spacing: -.02em; color: var(--navy); line-height: 1.15; }
.kpi span { font-size: .8rem; color: var(--muted); line-height: 1.3; }
.kpi.amber { border-top-color: var(--amber); } .kpi.red { border-top-color: var(--red); } .kpi.red b { color: var(--red); }
.kpi.green { border-top-color: #34A853; } .kpi.blue { border-top-color: var(--blue); } .kpi.purple { border-top-color: var(--purple); } .kpi.teal { border-top-color: var(--teal); }
.empty { text-align: center; padding: 38px 20px; background: #fff; border: 1px dashed #C9D3D9; border-radius: var(--r); margin: 0 0 16px; }
.empty-t, .empty h2 { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin: 0 0 6px; }
.empty .btn { margin-top: 8px; }
.flash { padding: 11px 14px; border-radius: 9px; margin: 0 0 14px; border: 1px solid; font-size: .92rem; white-space: pre-line; }
.flash.ok { background: var(--green-l); border-color: #B7DEC4; color: #0F5A2E; }
.flash.error { background: var(--red-l); border-color: #F2C3BD; color: #8A1C12; }
.flash.warn { background: var(--amber-l); border-color: #F4D29F; color: #7A4705; }
.flash ul { margin: 6px 0; padding-left: 18px; white-space: normal; }
.flash.small { font-size: .84rem; padding: 8px 11px; }
.callout { background: var(--amber-l); border: 1px solid #F4D29F; border-radius: 9px; padding: 11px 14px; margin: 12px 0; }
.callout b { display: flex; align-items: center; gap: 6px; color: var(--amber-d); margin-bottom: 4px; }
.highlight { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-l); }
.note-card { background: var(--teal-l); border-color: #BDE7E2; }
.help-card { background: var(--soft); }
.alerts ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.alerts li a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 13px; border-radius: 9px; font-weight: 600; font-size: .9rem; text-decoration: none; border: 1px solid transparent; }
.alerts li a:hover { filter: brightness(.97); }
.alerts li.t-red a { border-color: #F2C3BD; } .alerts li.t-amber a { border-color: #F4D29F; } .alerts li.t-blue a { border-color: #C4D7F7; } .alerts li.t-teal a { border-color: #BDE7E2; } .alerts li.t-gray a { border-color: var(--line); }
.danger-zone { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); text-align: right; }

/* ================= Tablas ================= */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r); background: #fff; margin: 0 0 14px; }
.card .tbl-wrap { border-radius: 8px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 12px; background: var(--soft); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #FAFCFC; }
.tbl.compact td, .tbl.compact th { padding: 7px 10px; }
.tbl td small { display: block; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.tbl tr.off td { color: #8A989F; }
.tbl tr.grp td { background: var(--soft); font-weight: 700; color: var(--petrol); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.rowlink { font-weight: 600; color: var(--ink); }
.rowlink:hover { color: var(--teal-d); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--navy); border-bottom-color: var(--teal); }
.tabs.compact { border: 0; margin: 0; background: var(--soft); border-radius: 9px; padding: 3px; }
.tabs.compact a { padding: 6px 11px; border: 0; border-radius: 7px; font-size: .84rem; margin: 0; }
.tabs.compact a.on { background: #fff; box-shadow: var(--shadow); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; font-size: .88rem; margin: 6px 0 16px; }
.pager .muted { margin-right: auto; }

/* ================= Datos y listas ================= */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 20px; margin: 12px 0 0; }
.facts.one { grid-template-columns: 1fr; gap: 10px; }
.facts > div { min-width: 0; }
.facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 0 0 2px; }
.facts dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.facts dd small { display: block; color: var(--muted); font-weight: 400; }
.facts dd .quick { margin-top: 6px; }
.mini-list, .list, .doc-list, .notif-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.mini-list li:last-child { border: 0; }
.mini-list a[aria-current] { font-weight: 800; color: var(--navy); }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border: 0; }
.list li > a { display: flex; flex-direction: column; min-width: 0; color: var(--ink); text-decoration: none; }
.list li > a:has(.av) { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.list li > a small { color: var(--muted); display: block; width: 100%; }
.list li > a:hover b { color: var(--teal-d); }
.doc-list li { display: flex; align-items: center; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.doc-list li:last-child { border: 0; }
.doc-list li > a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.notif-list li a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 13px 16px; background: #fff; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.notif-list li a span { grid-column: 1; color: var(--muted); font-size: .88rem; }
.notif-list li a time { grid-column: 2; grid-row: 1; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.notif-list li.unread a { border-left: 4px solid var(--teal); background: #FBFEFE; }
.contact-line { margin: 0 0 10px; }
.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-d), var(--teal)); border-radius: 99px; }
.av { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .02em; flex: none; }
.team { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.team-m { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: .9rem; }
.team-m small { font-weight: 500; }
.who { display: flex; align-items: center; gap: 10px; }
.who small { display: block; }
.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.steps li { position: relative; padding: 0 0 12px 26px; display: flex; flex-direction: column; }
.steps li::before { content: ""; position: absolute; left: 5px; top: 5px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #C5D0D6; background: #fff; z-index: 1; }
.steps li::after { content: ""; position: absolute; left: 10px; top: 16px; bottom: -4px; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.done::before { background: var(--teal-d); border-color: var(--teal-d); }
.steps li b { font-size: .88rem; }
.steps li:not(.done) b { color: var(--muted); font-weight: 600; }
.steps li small { color: var(--muted); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.checklist li { padding-left: 26px; position: relative; }
.checklist li::before { position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 900; }
.checklist li.ok::before { content: "✓"; background: var(--green-l); color: var(--green); }
.checklist li.bad::before { content: "!"; background: var(--red-l); color: var(--red); }
.checklist li.warn::before { content: "!"; background: var(--amber-l); color: var(--amber-d); }
.checklist li.na::before { content: "–"; background: #EEF2F4; color: var(--muted); }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: .86rem; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hb-b { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.hb-b i { display: block; height: 100%; background: var(--petrol); border-radius: 99px; }
.hbars b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.diff { margin-top: 3px; font-family: var(--mono); font-size: .8rem; }
.diff .old { background: var(--red-l); color: #8A1C12; padding: 0 4px; border-radius: 3px; text-decoration: line-through; }
.diff .new { background: var(--green-l); color: #0F5A2E; padding: 0 4px; border-radius: 3px; }
.stars { color: var(--amber); letter-spacing: 2px; font-size: 1.1rem; margin: 2px 0; }
.quote { font-style: italic; color: var(--ink-2); border-left: 3px solid var(--line); padding-left: 10px; }

/* ================= Galería y bitácora ================= */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 8px 0 14px; }
.gallery.small { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.thumb { margin: 0; background: var(--soft); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; display: flex; flex-direction: column; }
.thumb > a { display: block; aspect-ratio: 4 / 3; background: #E8EEF1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .doc { display: grid; place-items: center; height: 100%; font-family: var(--mono); font-weight: 600; color: var(--petrol); font-size: .9rem; }
.thumb figcaption { padding: 7px 9px; display: flex; flex-direction: column; gap: 1px; font-size: .78rem; line-height: 1.35; }
.thumb figcaption b { color: var(--navy); }
.thumb.internal { border-style: dashed; border-color: #C9B38B; }
.fig-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; }
.fig-actions .linkbtn { font-size: .76rem; }
.tl { list-style: none; margin: 0 0 16px; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.tl-i { position: relative; padding: 0 0 16px 12px; }
.tl-i::before { content: ""; position: absolute; left: -23px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #A9B8C0; }
.tl-i.staff::before { border-color: var(--petrol); }
.tl-i.k-cliente::before { border-color: var(--teal); background: var(--teal-l); }
.tl-i.k-problema::before, .tl-i.k-incidencia::before { border-color: var(--red); }
.tl-i.k-validacion::before { border-color: var(--purple); }
.tl-i.k-sistema::before { width: 8px; height: 8px; left: -21px; top: 7px; border-color: #C5D0D6; }
.tl-i.internal .tl-b { background: #FFFBF2; border-color: #F1E0BD; }
.tl-m { font-size: .84rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.tl-m time { color: var(--muted); font-size: .8rem; }
.kind { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 5px; background: #EEF2F4; color: var(--ink-2); }
.kind.int { background: var(--amber-l); color: var(--amber-d); }
.tl-b { margin-top: 6px; padding: 10px 12px; background: var(--soft); border: 1px solid var(--line-2); border-radius: 9px; font-size: .92rem; overflow-wrap: anywhere; }
.tl-sys { margin: 2px 0 0; font-size: .86rem; color: var(--muted); }
.note-form { border-top: 1px solid var(--line); padding-top: 14px; }

/* ================= Orden de trabajo ================= */
.t-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.t-side { position: sticky; top: 76px; }
.t-side .card h2 { margin-bottom: 10px; }
.ot-hero { border-top: 4px solid var(--teal); }
.ot-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 22px; }
.ot-facts > div { display: flex; flex-direction: column; min-width: 0; }
.ot-facts .lbl { display: flex; align-items: center; gap: 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.ot-facts b { font-size: 1.02rem; }
.ot-facts small { color: var(--muted); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.facts .quick { margin-top: 6px; gap: 6px; }
.ot-go { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.ot-go:empty { display: none; }
.ot-go .quick { margin-top: 0; }
.checkin { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.checkin .btn.xl { align-self: flex-start; }
.geo-status { margin: 0; }
.geo-status.ok { color: var(--green); } .geo-status.bad { color: var(--red); } .geo-status.wait { color: var(--amber-d); }
.onsite p { font-size: 1rem; margin: 0 0 4px; }
.pulse { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 1.8s infinite; vertical-align: 0; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.onsite-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--navy); color: #fff; border-radius: var(--r); margin: 0 0 16px; text-decoration: none !important; }
.onsite-banner span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.onsite-banner small { color: #B8C8D2; }
.task-list { list-style: none; margin: 8px 0 0; padding: 0; }
.task-list li { padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.task-list li:last-child { border: 0; }
.task-list .check { padding: 4px 0; }
.task-list .check input { width: 22px; height: 22px; margin-top: 0; }
.task-list .check input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: #A9B8C0; }
.task-list.ro li { display: flex; gap: 8px; align-items: flex-start; }
.task-list.ro li.done { color: var(--muted); }
.task-list.ro .i { color: var(--green); }
.task-list .box { width: 16px; height: 16px; border: 2px solid #C5D0D6; border-radius: 4px; flex: none; margin-top: 3px; display: inline-block; }
.mat-tbl .qty-in { max-width: 96px; margin-left: auto; }
.add-box { border: 1px dashed var(--line); border-radius: 9px; padding: 10px 12px; }
.add-box > summary { cursor: pointer; font-weight: 600; color: var(--teal-d); display: flex; align-items: center; gap: 6px; }
.add-box[open] > summary { margin-bottom: 10px; }
.upload-box { background: var(--soft); border: 1px dashed #C5D0D6; border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.missing { background: var(--amber-l); border: 1px solid #F4D29F; border-radius: 9px; padding: 11px 14px; margin-bottom: 14px; font-size: .9rem; }
.missing ul { margin: 6px 0 0; padding-left: 18px; }
.result-box { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.result-box legend { float: left; width: 100%; margin-bottom: 4px; }
.result-box .checks { gap: 6px; }
.sig-view { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.sig-view img { width: 240px; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; }
.sig-view > div { flex: 1; min-width: 220px; }
.sign-link { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 12px 0; }
.sign-link > .stack { flex: 1; min-width: 220px; gap: 8px; }
.qr { width: 148px; height: 148px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; flex: none; }
.qr svg, .qr img { width: 100%; height: 100%; display: block; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { flex: 1; font-family: var(--mono); font-size: .8rem; min-height: 34px; padding: 6px 9px; }
.action-box { margin: 0; }
.action-box > summary { list-style: none; cursor: pointer; }
.action-box > summary::-webkit-details-marker { display: none; }
.action-box[open] > summary { margin-bottom: 10px; }
.action-box > form { padding: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 9px; }
details.card.action-box > summary { display: inline-flex; }
.validate-card { border-top: 4px solid var(--purple); }
.bill-line { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.bill-line p { margin: 0 0 6px; font-size: .9rem; }
.bill-line p small { display: block; }
.bill-line.locked { opacity: .7; }
.bill-line .row { grid-template-columns: 1fr 1fr; gap: 8px; }
.totals { margin: 12px 0; display: flex; flex-direction: column; gap: 4px; }
.totals > div { display: flex; justify-content: space-between; gap: 10px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; font-size: 1.1rem; }
.totals .grand dt, .totals .grand dd { color: var(--navy); font-weight: 800; }
.totals.small { font-size: .88rem; }
.totals.cost { border-top: 1px dashed var(--line); padding-top: 8px; }
.conflict-box { background: var(--red-l); border: 1px solid #F2C3BD; border-radius: 9px; padding: 11px 14px; font-size: .9rem; color: #7A1A12; }
.conflict-box p { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.conflict-box ul { margin: 0 0 6px; padding-left: 18px; }
.conflict-box.ok { background: var(--green-l); border-color: #B7DEC4; color: #0F5A2E; }

/* Editor de líneas */
.lines { display: flex; flex-direction: column; gap: 8px; }
.lines-rows { display: flex; flex-direction: column; gap: 8px; }
.line { display: grid; grid-template-columns: minmax(200px, 3fr) repeat(auto-fit, minmax(84px, 1fr)) 32px; gap: 8px; align-items: end; padding: 10px; background: var(--soft); border: 1px solid var(--line-2); border-radius: 9px; }
.line.locked { opacity: .75; }
.lc { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lc > span { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.lc input, .lc select { min-height: 36px; padding: 7px 9px; }
.lc > b { padding: 8px 0; font-weight: 650; }
.line .icon-btn { align-self: end; margin-bottom: 3px; }
.lines-add { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.catsearch { position: relative; flex: 1; min-width: 240px; display: flex; align-items: center; gap: 8px; border: 1px solid #C9D3D9; border-radius: 8px; padding: 0 11px; background: #fff; color: var(--muted); }
.catsearch input { border: 0; padding: 9px 0; width: 100%; outline: none; font: inherit; color: var(--ink); background: none; }
.catsearch:focus-within { border-color: var(--teal-d); box-shadow: 0 0 0 3px rgba(34, 195, 181, .22); }
.catsearch-results, .qe-results { position: absolute; left: -1px; right: -1px; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; z-index: 20; }
.catsearch-results button, .qe-results button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; font: inherit; cursor: pointer; color: var(--ink); }
.catsearch-results button:hover, .catsearch-results button.on, .qe-results button:hover, .qe-results button.on { background: var(--teal-l); }
.catsearch-results small, .qe-results small { color: var(--muted); font-family: var(--mono); font-size: .76rem; }
.catsearch-results p, .qe-results p { margin: 0; padding: 10px 12px; color: var(--muted); font-size: .88rem; }

/* Tarjetas de orden (técnico) */
.wo-group { margin: 0 0 20px; }
.wo-group > h2 { margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.wo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.wo-card { display: flex; align-items: stretch; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--ink); text-decoration: none !important; box-shadow: var(--shadow); border-left: 5px solid #A9B8C0; transition: box-shadow .15s, transform .12s; }
.wo-card:hover { box-shadow: 0 8px 20px rgba(12, 31, 46, .1); transform: translateY(-1px); }
.wc-time { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 12px; min-width: 76px; background: var(--soft); border-right: 1px solid var(--line-2); text-align: center; }
.wc-time b { font-size: 1.2rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.wc-time small { color: var(--muted); font-size: .74rem; }
.wc-body { flex: 1; min-width: 0; padding: 11px 12px; display: flex; flex-direction: column; gap: 3px; }
.wc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: .78rem; }
.wc-top .mono { color: var(--muted); }
.wc-title { font-size: .98rem; line-height: 1.3; }
.wc-meta { color: var(--muted); font-size: .84rem; }
.wc-go { align-self: center; margin: 0 12px 0 0; color: #A9B8C0; }
.wo-card > .btn { align-self: center; margin-right: 12px; }
.wo-card.s-programado, .wo-card.s-reprogramado { border-left-color: var(--blue); }
.wo-card.s-en_ruta { border-left-color: var(--teal); }
.wo-card.s-en_ejecucion { border-left-color: var(--amber); }
.wo-card.s-pendiente_validacion { border-left-color: var(--purple); }
.wo-card.s-devuelto, .wo-card.late { border-left-color: var(--red); }
.wo-card.s-validado, .wo-card.s-cerrado { border-left-color: var(--green); opacity: .85; }
.wo-card.s-evento { border-left-color: var(--purple); }
.wo-card.crit .wc-title { color: var(--red); }
.quick-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.quick-tiles a { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); color: var(--navy); font-weight: 650; text-decoration: none; box-shadow: var(--shadow); }
.quick-tiles a .i { width: 22px; height: 22px; color: var(--teal-d); }
.quick-tiles small { display: block; color: var(--amber-d); font-weight: 600; }

/* ================= Cotización (vista de documento) ================= */
.doc-sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 28px 30px; box-shadow: var(--shadow); margin: 0 0 16px; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.doc-brand { display: flex; gap: 12px; align-items: center; }
.doc-brand .mark { width: 54px; height: 54px; color: var(--navy); }
.doc-brand b { display: block; font-size: 1.2rem; color: var(--navy); font-stretch: 110%; }
.doc-brand small { display: block; color: var(--muted); }
.doc-meta h2 { text-align: right; font-size: 1.3rem; letter-spacing: .06em; margin-bottom: 8px; }
.doc-meta dl { margin: 0; display: grid; grid-template-columns: auto auto; gap: 3px 10px; }
.doc-meta dl div { display: contents; }
.doc-meta dt { text-align: right; color: var(--muted); font-size: .76rem; text-transform: uppercase; align-self: center; }
.doc-meta dd { margin: 0; border: 1px solid var(--line); padding: 3px 10px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.doc-bar { display: inline-block; background: var(--navy); color: #fff; font-size: .74rem; font-weight: 700; letter-spacing: .08em; padding: 3px 12px; margin-bottom: 8px; }
.doc-client { margin-bottom: 16px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.doc-table th { background: var(--navy); color: #fff; padding: 8px 10px; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; text-align: left; }
.doc-table th.num, .doc-table td.num { text-align: right; }
.doc-table td { padding: 8px 10px; border: 1px solid var(--line); vertical-align: top; }
.doc-table .sat { display: block; color: var(--muted); font-family: var(--mono); font-size: .76rem; margin-top: 3px; }
.doc-group td { background: var(--petrol); color: #fff; font-weight: 700; text-align: center; letter-spacing: .03em; }
.doc-gtotal td { background: var(--soft); font-weight: 700; text-align: right; color: var(--teal-d); }
.doc-foot { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; margin-top: 18px; }
.doc-terms p { font-size: .88rem; }
.doc-accept { margin-top: 12px; }
.doc-accept img { max-width: 220px; border-bottom: 1px solid var(--line); display: block; margin-bottom: 6px; }
.doc-totals { margin: 0; }
.doc-totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.doc-totals dt { color: var(--muted); }
.doc-totals dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.doc-totals .grand { background: var(--navy); color: #fff; padding: 8px 10px; margin-top: 4px; }
.doc-totals .grand dt, .doc-totals .grand dd { color: #fff; font-weight: 800; }
.reject-box, .convert-box { margin-top: 12px; }
.reject-box > summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.convert-box { background: var(--teal-l); border: 1px solid #BDE7E2; border-radius: 10px; padding: 12px; }

/* Editor de cotización */
.quote-editor .card-h { align-items: flex-start; }
.qe-search { position: relative; flex: 1; max-width: 520px; min-width: 240px; display: flex; align-items: center; gap: 8px; border: 1px solid #C9D3D9; border-radius: 8px; padding: 0 11px; background: #fff; color: var(--muted); }
.qe-search input { border: 0; padding: 9px 0; width: 100%; outline: none; font: inherit; color: var(--ink); }
.qe-rows { display: flex; flex-direction: column; gap: 8px; }
.qe-row { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.qe-row.group { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: var(--navy); border-color: var(--navy); margin-top: 8px; }
.qe-row.group label span { color: #B8C8D2; }
.qe-row.group input { background: #fff; }
.qe-gname { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 3px; }
.qe-gtotal { color: #fff; font-size: 1rem; padding: 0 8px 8px; font-variant-numeric: tabular-nums; }
.qe-row.group .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.qe-row.group .icon-btn { color: #fff; }
.qe-row.item { padding: 10px 12px; }
.qe-main { display: grid; grid-template-columns: 80px 100px minmax(200px, 1fr) 110px 76px 110px auto; gap: 8px; align-items: end; }
.qe-main label, .qe-fiscal label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.qe-main label span, .qe-fiscal label span, .qe-amt span, .qe-gname span { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.qe-amt { display: flex; flex-direction: column; gap: 3px; text-align: right; padding-bottom: 9px; }
.qe-amt b { font-variant-numeric: tabular-nums; }
.qe-tools { display: flex; gap: 2px; padding-bottom: 4px; }
.qe-fiscal { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.qe-row input, .qe-row select, .qe-row textarea { min-height: 36px; padding: 7px 9px; }
.qe-add { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.totals-card { position: sticky; top: 76px; }

/* ================= Firma ================= */
.sigpad { border: 2px dashed #B9C6CD; border-radius: 12px; background: #fff; overflow: hidden; }
.sigpad canvas { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; background: repeating-linear-gradient(0deg, transparent 0 149px, #E3E9EC 149px 150px); }
.sigpad.signed { border-style: solid; border-color: var(--teal-d); }
.sig-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 11px; background: var(--soft); border-top: 1px solid var(--line); }
.sign-wrap { max-width: 760px; margin: 0 auto; }
.sign-wrap.narrow { max-width: 520px; }
.sign-brand { display: flex; align-items: center; gap: 12px; color: #fff; margin: 6px 0 16px; }
.content .sign-brand { color: var(--navy); }
.sign-brand .mark { width: 44px; height: 44px; color: currentColor; }
.sign-brand b { display: block; font-size: 1.15rem; font-stretch: 110%; }
.sign-brand small { display: block; opacity: .75; }
.sign-summary h1 { font-size: 1.35rem; margin-bottom: 4px; }
.sign-form h2 { font-size: 1.15rem; }
.rating { display: flex; flex-direction: column; gap: 4px; }
.stars-in { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.stars-in input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars-in label { font-size: 2rem; line-height: 1; color: #D4DCE0; cursor: pointer; padding: 2px; transition: color .1s; }
.stars-in input:checked ~ label, .stars-in label:hover, .stars-in label:hover ~ label { color: var(--amber); }
.stars-in input:focus-visible + label { outline: 3px solid rgba(34, 195, 181, .55); border-radius: 4px; }

/* ================= Calendario ================= */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav h2 { margin-left: 8px; font-size: 1.15rem; }
.cal-chip { --c: #64748B; display: block; position: relative; padding: 5px 8px 5px 10px; margin: 0 0 5px; border-radius: 7px; background: #F1F5F7; background: color-mix(in srgb, var(--c) 11%, #fff); border-left: 3px solid var(--c); color: var(--ink); font-size: .8rem; line-height: 1.3; text-decoration: none !important; overflow: hidden; }
.cal-chip:hover { background: #E7EEF1; background: color-mix(in srgb, var(--c) 20%, #fff); }
.cal-chip b { font-variant-numeric: tabular-nums; color: var(--navy); }
.cal-chip .mono { color: var(--muted); font-size: .74rem; }
.cal-chip .t { font-weight: 600; }
.cal-chip small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.k-evento { border-left-style: dashed; }
.cal-chip.s-en_ejecucion { box-shadow: inset 0 0 0 1px var(--amber); }
.cal-chip.s-pendiente_validacion { opacity: .9; }
.cal-chip.s-validado, .cal-chip.s-cerrado { opacity: .65; }
.cal-chip.s-validado .t, .cal-chip.s-cerrado .t { text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
.cal-chip.conflict { box-shadow: inset 0 0 0 2px var(--red); }
.cal-chip .cf { position: absolute; right: 5px; top: 5px; width: 14px; height: 14px; color: var(--red); }
.cal-chip.crit .t { color: var(--red); }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { background: var(--soft); padding: 7px 8px; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.cal-cell { background: #fff; min-height: 118px; padding: 5px 6px; min-width: 0; }
.cal-cell.other { background: #FAFBFC; }
.cal-cell.other .cal-dnum { color: #B0BCC3; }
.cal-cell.today { background: #F5FCFB; }
.cal-dnum { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; font-weight: 700; font-size: .84rem; color: var(--ink-2); margin-bottom: 3px; text-decoration: none !important; }
.cal-cell.today .cal-dnum { background: var(--teal-d); color: #fff; }
.cal-cell .cal-chip { padding: 3px 6px; font-size: .74rem; white-space: nowrap; }
.cal-more { font-size: .76rem; font-weight: 600; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.cal-col { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; min-height: 180px; display: flex; flex-direction: column; }
.cal-col.today { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-l); }
.cal-col h3 { font-size: .86rem; margin-bottom: 8px; text-transform: capitalize; }
.cal-col h3 a { color: var(--navy); }
.cal-add { margin-top: auto; padding-top: 6px; font-size: .8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.cal-add:hover { color: var(--teal-d); }
.cal-add .i { width: 14px; height: 14px; }
.cal-add.sm { margin: 0; padding: 0; float: right; }
.cal-res { display: flex; border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow: auto; max-height: 76vh; }
.cal-hours { flex: none; width: 58px; border-right: 1px solid var(--line); background: var(--soft); position: sticky; left: 0; z-index: 3; }
.cal-rh { height: 52px; position: sticky; top: 0; background: #fff; z-index: 2; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 0 10px; font-weight: 650; font-size: .86rem; }
.cal-hours .cal-rh { background: var(--soft); }
.cal-rh small { display: block; color: var(--muted); font-weight: 500; }
.cal-hour { height: var(--px); font-size: .74rem; color: var(--muted); padding: 2px 6px; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.cal-rcols { display: flex; flex: 1; min-width: 0; }
.cal-rcol { flex: 1 0 170px; border-right: 1px solid var(--line-2); min-width: 170px; }
.cal-rbody { position: relative; height: calc(var(--rows) * var(--px)); background: repeating-linear-gradient(180deg, #fff 0 calc(var(--px) - 1px), var(--line-2) calc(var(--px) - 1px) var(--px)); }
.cal-slot { position: absolute; left: 0; right: 0; height: var(--px); display: block; }
.cal-slot:hover { background: rgba(34, 195, 181, .08); }
.cal-block { position: absolute; padding: 1px 3px; z-index: 1; }
.cal-block .cal-chip { height: 100%; margin: 0; }
.cal-matrix { border-collapse: collapse; width: 100%; min-width: 900px; background: #fff; font-size: .82rem; }
.cal-matrix th, .cal-matrix td { border: 1px solid var(--line); padding: 6px; vertical-align: top; }
.cal-matrix thead th { background: var(--soft); font-size: .76rem; text-transform: capitalize; }
.cal-matrix thead th.today { background: var(--teal-l); }
.cal-matrix tbody th { text-align: left; white-space: nowrap; font-weight: 650; background: #fff; position: sticky; left: 0; z-index: 1; }
.cal-matrix td { min-width: 118px; }
.cal-matrix td.today { background: #F7FDFC; }
.cal-matrix td.heavy { background: var(--amber-l); }
.cal-matrix .cal-chip { padding: 3px 6px; font-size: .74rem; }
.cal-matrix .load { color: var(--muted); font-weight: 600; }
.cal-agenda .cal-aday { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0 0 10px; }
.cal-agenda .cal-aday.today { border-color: var(--teal); }
.cal-agenda h3 { margin-bottom: 8px; }
.cal-agenda .cal-chip { padding: 8px 10px 8px 12px; font-size: .88rem; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 12px; }
.cal-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend .lg::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: #E3E9EC; border-left: 3px solid #64748B; }
.cal-legend .lg.s-en_ejecucion::before { box-shadow: inset 0 0 0 1px var(--amber); }
.cal-legend .lg.s-validado::before { opacity: .5; }
.cal-legend .lg.k-evento::before { border-left-style: dashed; border-left-color: var(--purple); }
.cal-legend .lg.conflict::before { display: none; }
.cal-legend .lg.conflict { color: var(--red); }

/* ================= Facturación ================= */
.bill-group { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; background: #fff; }
.bill-group-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.bill-group-h b { font-size: 1.1rem; color: var(--navy); font-variant-numeric: tabular-nums; }

/* ================= Acceso (login e instalación) ================= */
.login { min-height: calc(100vh - 60px); display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; max-width: 1060px; margin: 0 auto; align-items: center; padding: 20px 8px; }
.login-brand { color: #D5E1E8; }
.login-logo { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none !important; margin-bottom: 26px; }
.login-logo .mark { width: 52px; height: 52px; color: #fff; }
.login-logo span { font-size: 1.5rem; font-weight: 800; letter-spacing: .05em; font-stretch: 118%; }
.login-logo em { font-style: normal; color: var(--teal); }
.login-brand h1 { color: #fff; font-size: 2.1rem; line-height: 1.12; margin-bottom: 12px; font-stretch: 112%; }
.login-points { list-style: none; padding: 0; margin: 22px 0; display: flex; flex-direction: column; gap: 12px; }
.login-points li { display: flex; gap: 11px; align-items: center; }
.login-points .i { color: var(--teal); width: 22px; height: 22px; }
.login-help { color: #9FB2BE; font-size: .9rem; }
.login-help a { color: var(--amber); font-weight: 700; }
.login-form { padding: 28px; box-shadow: var(--shadow-lg); border: 0; }
.login-form h2 { font-size: 1.35rem; }
.narrow-page { max-width: 560px; margin: 30px auto; }
.narrow-page .card { box-shadow: var(--shadow-lg); }
.narrow-card { max-width: 640px; }

/* ================= Utilidades de interacción ================= */
.file-info { display: block; margin-top: 2px; }
.file-prev { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.file-prev img { width: 64px; height: 64px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.btn.busy, button.busy { opacity: .7; cursor: progress; }
.net-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--tabbar)); z-index: 60; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: .86rem; box-shadow: var(--shadow-lg); max-width: calc(100% - 24px); text-align: center; }
.net-bar::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-right: 8px; vertical-align: 1px; }

/* ================= Barra inferior (técnico y cliente) ================= */
@media (max-width: 1100px) {
  .t-grid { grid-template-columns: minmax(0, 1fr); }
  .t-side { position: static; }
  .cols.wide-left { grid-template-columns: minmax(0, 1fr); }
  .qe-main { grid-template-columns: 70px 90px minmax(160px, 1fr) 100px 70px 100px; }
  .qe-main .qe-tools { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 860px) {
  :root { --side: 270px; }
  .side { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(12, 31, 46, .45); z-index: 35; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .top { padding: 8px 12px; gap: 8px; }
  .top-search { min-width: 0; }
  .um-name { display: none; }
  .content { padding: 16px 14px calc(30px + var(--tabbar)); }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: 1fr; gap: 20px; }
  .login-brand h1 { font-size: 1.6rem; }
  .login-points { display: none; }
  .doc-sheet { padding: 18px 14px; }
  .doc-foot { grid-template-columns: 1fr; }
  .form-foot { flex-direction: column; align-items: stretch; }
  .form-foot .actions { justify-content: stretch; }
  .form-foot .actions .btn { flex: 1; }
  .cal-week { grid-template-columns: 1fr; }
  .cal-col { min-height: 0; }
  .cal-cell { min-height: 76px; padding: 3px; }
  .cal-cell .cal-chip { padding: 2px 4px; font-size: .68rem; }
  .cal-cell .cal-chip b { display: none; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); z-index: 30; box-shadow: 0 -4px 16px rgba(12, 31, 46, .06); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .68rem; font-weight: 650; color: var(--muted); text-decoration: none; }
  .tabbar a .i { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--teal-d); }
  .line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .line .lc-description { grid-column: 1 / -1; }
  .line .icon-btn { grid-column: 2; justify-self: end; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  h1 { font-size: 1.3rem; }
  .ph-actions { width: 100%; }
  .ph-actions .btn { flex: 1 1 auto; }
  .card { padding: 15px 14px; border-radius: 9px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 11px 12px; }
  .kpi b { font-size: 1.2rem; }
  .filters .fld { max-width: none; flex-basis: 45%; }
  .wo-cards { grid-template-columns: 1fr; }
  .btn.xl { width: 100%; }
  .checkin .btn.xl { align-self: stretch; }
  .quick .btn { flex: 1 1 auto; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qe-main { grid-template-columns: 1fr 1fr; }
  .qe-main .qe-desc { grid-column: 1 / -1; order: -1; }
  .qe-amt { text-align: left; }
  .sig-view img { width: 100%; }
  .qr { width: 128px; height: 128px; }
  .alerts ul { grid-template-columns: 1fr; }
  .hbars li { grid-template-columns: 1fr auto; }
  .hbars .hb-b { grid-column: 1 / -1; grid-row: 2; }
  .tbl { font-size: .86rem; }
  .doc-meta h2 { text-align: left; }
}
@media print {
  .side, .top, .tabbar, .ph-actions, .note-form, .actions, .filters, form .btn, .action-box, .quick { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
  .card, .doc-sheet { box-shadow: none; break-inside: avoid; }
}

/* Instalación sobre fondo oscuro */
.bare .narrow-page > h1 { color: #fff; margin: 18px 0 8px; }
.bare .narrow-page > p { color: #C9D6DE; }
.bare .narrow-page > .flash { color: inherit; }
.bare .narrow-page code { font-family: var(--mono); font-size: .8rem; word-break: break-all; }
