:root {
  /* Paleta de Inspectial 1 (Flux, fondo #25253C, tarjetas blancas al 10 %, degradado celeste a azul) */
  --bg: #25253C; --panel: #2D2D45; --card: #3B3B50; --card2: #46475C; --sel: #4C4E68;
  --line: #4D4E62; --line2: #5A5B70; --line3: #6E6F84;
  --text: #FFFFFF; --text2: #E4E4E7; --muted: #A1A1AA;
  --accent: #00A9F2; --accent2: #30D9FF; --ink: #0B1220; --on-accent: #FFFFFF; --aes-a: #00A9F2; --aes-b: #172D9D; --aes-g: #00A63E;
  --grad: linear-gradient(90deg, #00A9F2, #172D9D); --grad-cyan: linear-gradient(90deg, #00E2E0, #00A9F2);
  --side-grad: linear-gradient(180deg, #00A9F2 0%, #14142B 100%); --band: #3B3B50; --hr: #5E5F73; --track: #E4E4E7;
  --a: #FB2C36; --a-bg: #4A2A36; --a-fg: #FFA2A2;
  --m: #F0B100; --m-bg: #4A4128; --m-fg: #FFDF20;
  --b: #00C950; --b-bg: #234536; --b-fg: #7BF1A8;
  --violet: #787CFE; --violet-fg: #C6C8FF; --orange: #FF8904; --lime: #9AE600;
  --r: 12px; --r-sm: 8px;
  --hover: #46475C; --hover2: #505061; --topbar: #25253C; --glass: rgba(37,37,60,.86); --photo: #2D2D45; --avatar: #DBEAFE;
  --v-bg: #3F3F6A; --s-bg: #23435A; --s-line: #2F6A86; --s-fg: #D5F3FF; --w-bg: #4A4128; --w-line: #6B5A26; --w-fg: #F5E2A6;
  --a-line: #7A3440; --b-line: #2E6B4C; --link-hover: #8BF0FF; --toast-bg: #FFFFFF; --toast-fg: #18181B;
  --nv-bg: #3F3F6A; --nv-fg: #C6C8FF; --as-bg: #1F4566; --as-fg: #7FD8FF;
  --lv-i-bg: #45305E; --lv-i-fg: #DAB2FF; --lv-a-bg: #4A2A36; --lv-a-fg: #FFA2A2; --lv-m-bg: #4A4128; --lv-m-fg: #FFDF20; --lv-b-bg: #234536; --lv-b-fg: #7BF1A8;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
/* tema claro */
:root[data-theme="light"] {
  --bg: #E9ECEF; --panel: #FFFFFF; --card: #FFFFFF; --card2: #F2F4F7; --sel: #E0F4FD;
  --line: #D9E1EC; --line2: #C9D3E1; --line3: #A9B5C7;
  --text: #18181B; --text2: #3F3F46; --muted: #71717A;
  --accent: #0089D2; --accent2: #0E7490;
  --side-grad: linear-gradient(180deg, #00A9F2 0%, #172D9D 100%); --band: #FFFFFF; --hr: #CBD5E1; --track: #E4E4E7;
  --a: #E7000B; --a-bg: #FFE2E2; --a-fg: #C10007; --m: #D08700; --m-bg: #FEF9C2; --m-fg: #894B00; --b: #00A63E; --b-bg: #DCFCE7; --b-fg: #016630;
  --violet-fg: #4F39F6;
  --hover: #F2F4F7; --hover2: #E9ECEF; --topbar: #F8FAFC; --glass: rgba(255,255,255,.9); --photo: #DDE3EE; --avatar: #DBEAFE;
  --v-bg: #E0E7FF; --s-bg: #E0F4FD; --s-line: #B8E3F8; --s-fg: #0C4A6E; --w-bg: #FEF9C2; --w-line: #F5D77A; --w-fg: #6B4E00;
  --a-line: #FFC9C9; --b-line: #B9F8CF; --link-hover: #0E7490; --toast-bg: #18181B; --toast-fg: #FFFFFF;
  --nv-bg: #E0E7FF; --nv-fg: #3730A3; --as-bg: #DFF2FE; --as-fg: #0069A8;
  --lv-i-bg: #F3E8FF; --lv-i-fg: #8200DB; --lv-a-bg: #FFE2E2; --lv-a-fg: #C10007; --lv-m-bg: #FEF9C2; --lv-m-fg: #894B00; --lv-b-bg: #DCFCE7; --lv-b-fg: #016630;
}
:root[data-theme="light"] .side, :root[data-theme="light"] .topbar { border-color: var(--line); }
:root[data-theme="light"] .lift:hover, :root[data-theme="light"] .tile:hover { box-shadow: 0 10px 26px rgba(20,30,70,.12); }
:root[data-theme="light"] .card, :root[data-theme="light"] .kpi, :root[data-theme="light"] .kpi-aes { box-shadow: 0 1px 2px rgba(20,30,70,.05); }
:root[data-theme="light"] .photo .tag { color: var(--text); }
:root[data-theme="light"] .hk-b { background: #23845A; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: Figtree, system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--link-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, .t { transition: background-color .18s, color .18s, border-color .18s, transform .18s, box-shadow .18s, opacity .2s; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 10px; border: 2px solid var(--bg); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-weight: 500; }
.muted { color: var(--muted); } .text2 { color: var(--text2); }
.small { font-size: 13px; } .xs { font-size: 12px; } .xxs { font-size: 11px; }
.b6 { font-weight: 600; } .b7 { font-weight: 700; } .b8 { font-weight: 800; }
.num { font-variant-numeric: tabular-nums; }
.upper { text-transform: uppercase; letter-spacing: .07em; font-size: 11px; font-weight: 700; color: var(--muted); }
.row { display: flex; align-items: center; } .col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .start { align-items: flex-start; } .end { align-items: flex-end; } .center { justify-content: center; }
.g4 { gap: 4px; } .g6 { gap: 6px; } .g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; } .g14 { gap: 14px; } .g16 { gap: 16px; } .g18 { gap: 18px; } .g20 { gap: 20px; } .g24 { gap: 24px; }
.grow { flex: 1; min-width: 0; } .ml-auto { margin-left: auto; } .none { display: none !important; }
.grid { display: grid; gap: 16px; }
.cols-auto { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }

/* ---------- layout ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--topbar); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .logo { height: 26px; width: auto; display: block; }
.body { display: flex; flex: 1; min-height: 0; }
.side { flex: 0 0 240px; background: var(--panel); border-right: 1px solid var(--line); padding: 14px 12px 20px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 61px; height: calc(100vh - 61px); overflow-y: auto; transition: flex-basis .2s; }
.app.rail .side { flex-basis: 76px; }
.app.rail .side .lbl, .app.rail .side .sec, .app.rail .side .badge-n { display: none; }
.app.rail .side .nav { justify-content: center; }
.side .sec { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 14px 6px; }
.side .divider { display: none; height: 1px; background: var(--line); margin: 8px 10px; }
.app.rail .side .divider { display: block; }
.nav { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 14px; border-radius: 12px; color: var(--text2); border: 0; background: transparent; width: 100%; text-align: left; font-size: 14px; }
.nav:hover { background: var(--hover); color: var(--text); }
.nav.on { background: linear-gradient(90deg, var(--aes-a), var(--aes-b)); color: var(--on-accent); font-weight: 700; }
.nav svg { flex: none; }
.nav .badge-n { margin-left: auto; font-size: 12px; font-weight: 700; background: var(--a-bg); color: var(--a-fg); border-radius: 999px; padding: 1px 8px; }
.nav.on .badge-n { background: rgba(255,255,255,.22); color: #fff; }
.side-foot { margin-top: auto; padding: 16px 14px 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.side-foot img { width: 22px; height: 22px; }
.app.rail .side-foot span { display: none; }
.main { flex: 1; min-width: 0; padding: 26px 30px 60px; display: flex; flex-direction: column; gap: 20px; }
.page-h { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-h .sub { color: var(--muted); margin-top: 4px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.crumb a { color: var(--muted); } .crumb a:hover { color: var(--text); }
.role-banner { background: var(--card2); border: 1px dashed var(--line3); border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; color: var(--text2); font-size: 13px; }

/* ---------- controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card2); color: var(--text); font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--hover2); }
.btn.primary { background: linear-gradient(90deg, var(--aes-a), var(--aes-b)); border-color: transparent; color: var(--on-accent); font-weight: 800; }
.btn.primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 10px 26px rgba(84,104,255,.3); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { background: var(--a-bg); border-color: var(--a-line); color: var(--a-fg); }
.btn.ok { background: var(--b-bg); border-color: var(--b-line); color: var(--b-fg); }
.btn.sm { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn.icon { width: 42px; padding: 0; }
.btn.sm.icon { width: 34px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.link { background: none; border: 0; color: var(--accent2); font-weight: 700; padding: 0; min-height: 30px; }
.link:hover { color: var(--link-hover); }
.input, .select, .textarea { height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 0 12px; outline: none; }
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239EA4C4' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--text2); font-weight: 600; }
.search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; }
.kbd { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line2); border-radius: 6px; padding: 1px 6px; }
.seg { display: inline-flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 4px; flex-wrap: wrap; }
.seg button { min-height: 34px; padding: 0 14px; border-radius: 9px; border: 0; background: transparent; color: var(--text2); font-weight: 700; }
.seg button:hover { color: var(--text); background: var(--hover); }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; }
.chip.on { background: var(--card); color: var(--text); border-color: var(--line2); }
.chip:hover { color: var(--text); }
.chip .d { width: 9px; height: 9px; border-radius: 50%; }
.switch { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; color: var(--text2); font-weight: 600; font-size: 13px; min-height: 34px; }
.switch .tr { width: 38px; height: 22px; border-radius: 999px; background: var(--line3); position: relative; transition: background .2s; flex: none; }
.switch .tr::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: left .2s; }
.switch.on .tr { background: var(--accent); }
.switch.on .tr::after { left: 19px; }

/* ---------- tarjetas y piezas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card.p0 { padding: 0; gap: 0; overflow: hidden; }
.card.tight { padding: 16px; gap: 12px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card-h p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.sub-card { background: var(--card2); border-radius: 14px; padding: 14px 16px; }
.lift:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,.35); }
.rowh:hover { background: var(--hover); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pill.a { background: var(--a-bg); color: var(--a-fg); } .pill.m { background: var(--m-bg); color: var(--m-fg); } .pill.b { background: var(--b-bg); color: var(--b-fg); }
.pill.n { background: var(--card2); color: var(--text2); } .pill.v { background: var(--v-bg); color: var(--violet-fg); } .pill.s { background: var(--s-bg); color: var(--accent2); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.avatar { width: 36px; height: 36px; border-radius: 12px; background: var(--avatar); color: var(--accent2); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 18px 10px; display: flex; flex-direction: column; gap: 6px; }
.kpi .v { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat { background: var(--card2); border-radius: 14px; padding: 12px 14px; }
.stat .v { font-size: 22px; font-weight: 800; }
.bar { height: 10px; border-radius: 999px; background: var(--card2); overflow: hidden; display: flex; gap: 2px; }
.bar > span { display: block; height: 100%; transition: width .45s cubic-bezier(.2,.8,.2,1); }
.progress { height: 8px; border-radius: 999px; background: var(--card2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: transparent; border: 0; width: 100%; text-align: left; color: var(--text); }
button.li:hover, a.li:hover { background: var(--hover); color: var(--text); }
.li.sel { background: var(--sel); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 14px; white-space: nowrap; }
.tbl td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl-wrap { overflow-x: auto; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { min-height: 44px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .n { font-size: 12px; color: var(--muted); font-weight: 600; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.alert { display: flex; align-items: center; gap: 12px; background: var(--w-bg); border: 1px solid var(--w-line); border-radius: 16px; padding: 14px 16px; color: var(--text); text-align: left; }
.alert .t2 { font-size: 12px; color: var(--w-fg); }
.info { display: flex; gap: 12px; align-items: flex-start; background: var(--s-bg); border: 1px solid var(--s-line); border-radius: 14px; padding: 14px; color: var(--s-fg); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 13px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; }
.datebox { flex: none; width: 46px; height: 50px; border-radius: 12px; background: var(--card2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.datebox b { font-size: 18px; } .datebox span { font-size: 10px; color: var(--muted); text-transform: uppercase; }

/* ---------- fotos ---------- */
.photo { position: relative; border-radius: 14px; overflow: hidden; background-color: var(--photo); background-repeat: no-repeat; }
.photo .tag { position: absolute; left: 10px; bottom: 10px; font-size: 12px; font-weight: 700; background: var(--glass); border-radius: 8px; padding: 3px 9px; }
.det { position: absolute; border: 2.5px solid; border-radius: 8px; animation: scan .35s ease both; }
.det-l { position: absolute; font-size: 12px; font-weight: 800; color: var(--ink); border-radius: 6px; padding: 2px 8px; white-space: nowrap; animation: fade .35s ease both; transform: translateY(calc(-100% - 4px)); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.thumb { position: relative; height: 64px; border-radius: 10px; border: 2px solid transparent; padding: 0; background-color: var(--photo); background-repeat: no-repeat; opacity: .7; }
.thumb.on { border-color: var(--accent); opacity: 1; }
.thumb .tdot { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--card); }

/* ---------- capas flotantes ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8,10,20,.55); z-index: 60; animation: fade .2s ease both; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); border-left: 1px solid var(--line); z-index: 61; display: flex; flex-direction: column; animation: slideIn .25s cubic-bezier(.2,.8,.2,1) both; }
.drawer-h { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.drawer-b { padding: 20px 22px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; flex: 1; }
.drawer-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 20px; z-index: 61; padding: 24px; display: flex; flex-direction: column; gap: 16px; animation: pop .22s ease both; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.modal.wide { width: min(720px, calc(100vw - 32px)); }
.menu { position: absolute; z-index: 50; min-width: 240px; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; padding: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.45); animation: pop .16s ease both; }
.menu .mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 0; background: transparent; color: var(--text2); text-align: left; }
.menu .mi:hover { background: var(--hover); color: var(--text); }
.menu .mh { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--toast-bg); color: var(--toast-fg); border-radius: 12px; padding: 11px 16px; font-weight: 600; box-shadow: 0 16px 40px rgba(0,0,0,.45); display: flex; align-items: center; gap: 10px; animation: pop .2s ease both; }
.palette { position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; z-index: 61; box-shadow: 0 30px 80px rgba(0,0,0,.5); overflow: hidden; animation: pop .18s ease both; }
.palette input { width: 100%; height: 56px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 0 20px; font-size: 16px; outline: none; }
.palette .res { max-height: 50vh; overflow-y: auto; padding: 8px; }

/* ---------- mapa ---------- */
.map { position: relative; height: 520px; background: #18202F; }
.leaflet-container { background: #121826 !important; font-family: inherit !important; }
.leaflet-tooltip.tt { background: var(--toast-bg); color: var(--toast-fg); border: 0; border-radius: 10px; padding: 6px 10px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.leaflet-tooltip.tt::before { display: none; }
.leaflet-popup-content-wrapper { background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: 14px; }
.leaflet-popup-tip { background: var(--panel); }
.leaflet-popup-content { margin: 14px 16px; font-size: 13px; line-height: 1.45; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-control-zoom a { background: var(--card) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: var(--glass) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--text2) !important; }
.map-legend { position: absolute; left: 14px; bottom: 14px; z-index: 500; display: flex; gap: 12px; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 12px; color: var(--text2); }
.strip { display: flex; gap: 2px; align-items: center; height: 22px; }
.strip button { flex: 1; min-width: 0; height: 14px; border: 0; border-radius: 3px; padding: 0; transition: height .2s, background-color .3s, opacity .2s; }
.strip button:hover { height: 20px; }
.strip button.on { height: 22px; box-shadow: 0 0 0 2px var(--text); }

/* ---------- kanban / calendario ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; align-items: start; }
.kcol { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 12px; min-height: 200px; }
.kcol.over { border-color: var(--accent); background: var(--hover); }
.kcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--text); width: 100%; }
.kcard:hover { border-color: var(--line3); transform: translateY(-1px); }
.kcard.dragging { opacity: .4; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dh { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.cal .day { min-height: 104px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cal .day.out { opacity: .35; }
.cal .day.today { border-color: var(--accent); }
.cal .day .dn { font-size: 12px; font-weight: 700; color: var(--text2); }
.cal .ev { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 6px; border: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline { position: relative; height: 56px; background: var(--card2); border-radius: 12px; }
.timeline .seg-b { position: absolute; top: 12px; bottom: 12px; border-radius: 6px; }
.timeline .mk { position: absolute; top: 4px; bottom: 4px; width: 2px; background: var(--text); }

/* ---------- login ---------- */
.login { min-height: 100vh; background: url('../assets/bg-login.jpg') center / cover no-repeat; display: flex; align-items: center; justify-content: flex-end; padding: 40px 8vw; }
.login-card { width: min(440px, 100%); background: rgba(20,24,46,.86); backdrop-filter: blur(6px); border-radius: 22px; padding: 40px 36px 30px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.login-card .input { background: #fff; color: #111827; border: 0; height: 48px; }
.login-card .btn.primary { height: 50px; background: linear-gradient(90deg, var(--aes-a), var(--aes-b)); border: 0; color: #fff; letter-spacing: .04em; }

/* ---------- animaciones ---------- */
.fade-in { animation: fadeUp .3s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.menu, .toast { animation-name: fadeUp; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes scan { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(238,240,248,.55); } 100% { box-shadow: 0 0 0 14px rgba(238,240,248,0); } }

@media (max-width: 900px) {
  .side { position: fixed; z-index: 40; left: 0; top: 61px; transform: translateX(-100%); transition: transform .2s; }
  .app.mobile-open .side { transform: none; }
  .main { padding: 20px 16px 50px; }
  .hide-sm { display: none !important; }
}

.leaflet-control-layers { background: var(--card) !important; color: var(--text) !important; border: 1px solid var(--line) !important; border-radius: 12px !important; }
.leaflet-control-layers-toggle { filter: invert(1) brightness(1.4); }
.leaflet-control-layers-expanded { padding: 8px 12px !important; }

/* ---------- formato AES ---------- */
.prio { display: inline-flex; align-items: center; justify-content: center; min-width: 74px; font-size: 12px; font-weight: 800; border-radius: 8px; padding: 4px 10px; color: #10121F; white-space: nowrap; }
.sem { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.kpi-aes { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; text-align: center; color: var(--text); padding: 0; }
.kpi-aes .v { font-size: 38px; font-weight: 800; padding: 18px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-aes .l { color: var(--text2); padding-bottom: 14px; }
.kpi-aes .f { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; font-weight: 800; font-size: 14px; }
.kpi-aes.on { box-shadow: 0 0 0 2px var(--text); }
.prio-bar { border-radius: 12px; padding: 12px 16px; text-align: center; font-weight: 800; font-size: 17px; color: #10121F; }
.ans { display: grid; grid-template-columns: minmax(200px, 1.4fr) minmax(0, 2fr); border-top: 1px solid var(--line); }
.ans:first-child { border-top: 0; }
.ans > span { padding: 10px 14px; color: var(--text2); display: flex; align-items: center; }
.ans .opts { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; align-items: center; }
.ans .op { min-width: 70px; text-align: center; padding: 6px 10px; border-radius: 8px; background: var(--card2); color: var(--muted); font-size: 13px; }
.ans .op.on { background: var(--accent); color: #fff; font-weight: 700; }
.ans .op.on.bad { background: #8F2D3A; }
.ans .val { padding: 10px 14px; font-weight: 700; }
.ans-box { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.ans-box > .hd { background: var(--card2); padding: 10px 14px; font-weight: 700; text-align: center; }
.mini-grid { display: grid; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; }
.mini-grid > div { background: var(--card); padding: 8px 10px; text-align: center; font-size: 13px; }
.mini-grid > .h { background: var(--card2); color: var(--muted); font-weight: 700; font-size: 12px; }
.pager { display: flex; gap: 4px; background: var(--card2); border-radius: 12px; padding: 4px; }
.pager button { flex: 1; min-height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--text2); font-weight: 700; }
.pager button.on { background: var(--line3); color: var(--text); }
/* informe en papel */
.paper { background: #fff; color: #1F2937; border-radius: 6px; padding: 28px 30px; font-size: 11.5px; line-height: 1.35; font-family: Arial, Helvetica, sans-serif; box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.paper + .paper { margin-top: 16px; }
.paper .ph { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid #9CA3AF; padding-bottom: 6px; margin-bottom: 12px; font-size: 11px; }
.paper .pf { border-top: 1px solid #9CA3AF; margin-top: 16px; padding-top: 6px; font-size: 10.5px; display: flex; justify-content: space-between; }
.paper table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.paper th.sec { background: #1E88E5; color: #fff; padding: 7px; font-size: 11.5px; text-align: center; }
.paper th.sec.dk { background: #0E6BA8; }
.paper th.sub { background: #9E9E9E; color: #fff; padding: 5px; font-size: 11px; text-align: center; }
.paper td { padding: 6px 8px; border: 1px solid #E5E7EB; text-align: center; }
.paper td.k { background: #F1F1F1; font-weight: 700; text-align: center; }
.paper td.sel { background: #1F9FB4; color: #fff; }
.paper td.bad { background: #B54848; color: #fff; }
.paper .ph-photo { background-size: cover; background-position: center; border: 1px solid #D1D5DB; }

/* ---------- grilla de estado de líneas ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.tile { position: relative; height: 86px; border-radius: 12px; border: 1.5px solid var(--c); box-shadow: inset 0 -7px 0 var(--c); color: var(--text); font-weight: 800; font-size: 18px; display: grid; place-items: center; padding: 0 6px 6px; font-variant-numeric: tabular-nums; }
.tile:hover { transform: translateY(-2px); box-shadow: inset 0 -7px 0 var(--c), 0 10px 24px rgba(0,0,0,.35); }
.tile.on { outline: 2.5px solid var(--text); outline-offset: 2px; }
.tile .xs { font-size: 13px; }
.tile-ok { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: #3B82F6; color: #fff; display: inline-grid; place-items: center; box-shadow: 0 0 0 2px var(--card); flex: none; }

/* ---------- hallazgos, formato del sistema de gestión de hallazgos de AES ---------- */
.pill.nv { background: var(--nv-bg); color: var(--nv-fg); } .pill.as { background: var(--as-bg); color: var(--as-fg); }
.hk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.hk { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 0 18px; border-radius: 14px; border: 0; font-weight: 700; text-align: left; }
.hk b { font-size: 24px; font-variant-numeric: tabular-nums; }
.hk-b { background: #1F6B4A; color: #fff; } .hk-as { background: #3563D6; color: #fff; }
.hk-nv { background: #B9C3FF; color: #10121F; } .hk-m { background: #FFD629; color: #10121F; }
button.hk:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hk.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.tbl.static tbody tr { cursor: default; }
.tbl.static tbody tr:hover td { background: transparent; }
.tbl.static td { vertical-align: top; }
@media (max-width: 520px) {
  .topbar { gap: 6px; padding: 10px 12px; }
  .topbar .logo { height: 24px !important; }
  .topbar .btn.icon { width: 38px; }
}

/* =====================================================================
   Diseño y componentes de Inspectial 1
   Encabezado oscuro con el logo de Inspectial, menú lateral angosto con
   degradado celeste a azul, banda de título con migas, tarjetas con
   título y separador, botones con degradado y barras cian.
   ===================================================================== */
h1 { font-size: 26px; font-weight: 500; letter-spacing: -0.01em; }
h2 { font-weight: 500; }
h3 { font-weight: 600; }

/* encabezado */
.topbar { height: 72px; padding: 0 28px; background: var(--topbar); backdrop-filter: none; border-bottom: 1px solid var(--line); gap: 18px; }
.topbar .logo { height: 34px !important; }
.topbar .search { height: 38px; border-radius: 8px; background: var(--card); border-color: transparent; }
.topbar .btn.ghost.icon { width: 40px; min-height: 40px; border-radius: 8px; color: var(--text); }
.topbar .btn.ghost.icon:hover { background: var(--hover2); }
.avatar { border-radius: 50%; background: var(--avatar); color: #0089D2; font-weight: 600; }
.avatar.sm { border-radius: 50%; }
.topbar [data-act="usuario"] .avatar { width: 34px; height: 34px; font-size: 12px; }

/* menú lateral */
.side { flex-basis: 288px; top: 72px; height: calc(100vh - 72px); padding: 16px 10px 18px; background: var(--side-grad); border-right: 0; gap: 2px; overflow-x: hidden; }
.app.rail .side { flex-basis: 72px; padding: 16px 8px 18px; }
.side .nav { color: #fff; min-height: 46px; border-radius: 8px; padding: 0 14px; font-weight: 500; }
.side .nav:hover { background: rgba(255,255,255,.2); color: #fff; }
.side .nav.on { background: rgba(255,255,255,.24); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #fff; }
.side .sec { color: rgba(255,255,255,.85); font-size: 12px; font-weight: 300; text-transform: none; letter-spacing: 0; padding: 16px 14px 6px; }
.side .divider { background: rgba(255,255,255,.65); margin: 10px auto; width: 36px; }
.side .nav .badge-n { background: rgba(255,255,255,.22); color: #fff; }
.side-foot { color: rgba(255,255,255,.9); }
.app.rail .side-foot { justify-content: center; padding: 16px 0 0; }
.side-tg { position: fixed; top: 86px; left: 272px; z-index: 35; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #0089D2; color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0,0,0,.3); transition: left .2s, background-color .18s; }
.side-tg:hover { background: #00A9F2; }
.app.rail .side-tg { left: 56px; }

/* contenido y banda de título */
.main { padding: 0 24px 60px; gap: 18px; }
.page-h.band { margin: 0 -24px 4px; padding: 18px 32px 18px 40px; background: var(--band); align-items: center; }
.page-h.band > div:first-child { display: flex; flex-direction: column; }
.page-h.band .crumb { order: 2; margin: 6px 0 0; color: var(--text); font-size: 14px; }
.page-h.band .crumb a, .page-h.band .crumb span { color: var(--text); }
.page-h.band .crumb a:hover { color: var(--accent2); }
.page-h.band > div:first-child > .row, .page-h.band > div:first-child > h1 { order: 1; }
.page-h.band .sub { order: 3; margin-top: 6px; font-size: 13px; }
.role-banner { border-radius: 8px; }

/* tarjetas */
.card { border: 0; border-radius: 12px; padding: 24px; }
.card.tight { padding: 18px; }
.card > .card-h:first-child, .card > h2:first-child { padding-bottom: 18px; margin-bottom: 4px; border-bottom: 1px solid var(--hr); }
.card > .card-h:first-child h2, .card > h2:first-child { font-size: 20px; font-weight: 400; }
.card.p0 > .card-h:first-child { margin-bottom: 0; }
.sub-card, .stat { border-radius: 8px; }
.kpi { border: 0; border-radius: 12px; }
.kpi .v { font-weight: 500; }

/* controles */
.btn { min-height: 40px; border-radius: 6px; border: 1px solid var(--line2); background: var(--card2); font-weight: 500; box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.btn:active { transform: translateY(1px); }
.btn:hover { background: var(--hover2); }
.btn.primary { background: var(--grad); font-weight: 500; letter-spacing: .02em; }
.btn.primary:hover { filter: brightness(1.12); transform: none; box-shadow: 0 6px 18px rgba(0,137,210,.35); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.sm { min-height: 32px; border-radius: 6px; }
.btn.icon { width: 40px; }
.btn.danger { border-color: transparent; background: #E7000B; color: #fff; }
.btn.ok { border-color: transparent; background: #00A63E; color: #fff; }
.input, .select, .textarea, .search { border-radius: 8px; border: 1px solid var(--line); background: var(--card2); height: 40px; }
.textarea { height: auto; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,169,242,.18); }
.field > span { font-weight: 500; }
.upper { font-weight: 500; letter-spacing: .04em; }
.seg { background: var(--card2); border: 1px solid var(--line2); padding: 3px; gap: 3px; border-radius: 9px; }
.seg button { border-radius: 6px; font-weight: 500; color: var(--text2); min-height: 34px; padding: 0 16px; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover:not(.on) { color: var(--text); background: var(--hover2); }
.seg button.on { background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(0,137,210,.3); }
.chip { border-radius: 6px; font-weight: 500; }
.chip.on { background: var(--card2); }
.link { font-weight: 600; }
.tabs button { font-weight: 500; }

/* tablas al estilo de los listados de Inspectial 1 */
.tbl th { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); font-weight: 600; padding: 16px; }
.tbl td { padding: 14px 16px; }

/* etiquetas y prioridades */
.pill { border-radius: 6px; font-weight: 600; padding: 4px 10px; }
.pill.a { background: #E7000B; color: #fff; } .pill.m { background: #F0B100; color: #18181B; } .pill.b { background: #00A63E; color: #fff; }
.prio { border-radius: 6px; font-weight: 600; }
.prio-bar { border-radius: 8px; font-weight: 600; }

/* barras de avance: riel claro y relleno cian */
.progress { height: 8px; background: var(--track); }
.progress > span { background: var(--grad-cyan); }
.bar { border-radius: 4px; }

/* tarjetas de indicador con banda de filtro, como en Inspecciones de Inspectial 1 */
.kpi-aes { border: 0; border-radius: 12px; }
.kpi-aes .v { font-weight: 500; font-size: 40px; }
.kpi-aes .f { font-weight: 500; font-size: 16px; min-height: 40px; }
.hk { flex-direction: column-reverse; justify-content: center; align-items: center; text-align: center; gap: 2px; min-height: 104px; padding: 14px 16px 18px; border-radius: 12px; color: var(--text); font-weight: 400; font-size: 15px; box-shadow: inset 0 -8px 0 var(--hk); }
.hk b { font-size: 36px; font-weight: 500; }
.hk-b, .hk-as, .hk-nv, .hk-m, :root[data-theme="light"] .hk-b { background: var(--card); color: var(--text); }
.hk-b { --hk: #00A63E; } .hk-as { --hk: #00A9F2; } .hk-nv { --hk: #787CFE; } .hk-m { --hk: #F0B100; }
.hk.on { box-shadow: inset 0 -8px 0 var(--hk), 0 0 0 2px var(--accent); }

/* capas */
.modal { border-radius: 12px; }
.menu { border-radius: 10px; }
.menu .mi { border-radius: 6px; }
.toast { border-radius: 8px; }
.ans-box, .mini-grid, .photo, .thumb { border-radius: 8px; }
.ans .op { border-radius: 6px; }
.ans .op.on.bad { background: #E7000B; }
.tile { border-radius: 8px; }
.tile-ok { background: #00A9F2; }
.cal .day, .kcol, .kcard, .datebox, .timeline { border-radius: 8px; }

/* inicio de sesión de Inspectial 1 */
.login { padding: 40px 10vw; }
.login-card { width: min(490px, 100%); background: rgba(37,37,60,.86); border-radius: 6px; padding: 40px 36px 36px; gap: 16px; backdrop-filter: none; }
.login-card .input { border-radius: 6px; height: 46px; background: #fff; color: #111827; border: 0; }
.login-card .btn.primary { height: 48px; border-radius: 6px; background: var(--grad); letter-spacing: .1em; font-weight: 500; }

@media (max-width: 900px) {
  .side { top: 72px; height: calc(100vh - 72px); }
  .side-tg { display: none; }
  .main { padding: 0 16px 50px; }
  .page-h.band { margin: 0 -16px 4px; padding: 16px; }
}
@media (max-width: 520px) {
  .topbar { height: 64px; padding: 0 12px; }
  .topbar .logo { height: 26px !important; }
}
/* calendario: cada día se puede abrir para ver sus trabajos */
.cal .day { cursor: pointer; transition: background-color .18s, border-color .18s; }
.cal .day:hover { background: var(--hover); border-color: var(--accent); }
.cal .cal-n { min-width: 20px; height: 20px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; padding: 0 6px; }
@media (max-width: 520px) {
  .topbar { gap: 4px; }
  .topbar .logo { height: 22px !important; }
  .topbar .row.g6 { gap: 2px; }
  .topbar .btn.ghost.icon { width: 36px; min-height: 36px; }
}
.cal .ev { display: block; pointer-events: none; }

/* Listado de estructuras (formato lista de Activos) */
.tbl.lst { width: 100%; }
.tbl.lst td, .tbl.lst th { white-space: nowrap; padding: 9px 10px; }
.tbl.lst td.wrap-c { white-space: normal; min-width: 90px; line-height: 1.3; }
.tbl.lst th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.tbl.lst tbody tr:hover { background: var(--card2); }

/* ===== Informes con formato Inspectial (vista previa y PDF) ===== */
.inf-render { position: fixed; left: -12000px; top: 0; width: 794px; z-index: -1; }
.inf-page { width: 794px; height: 1123px; position: relative; background: #fff; color: #111827; font-family: 'Figtree', Arial, sans-serif; overflow: hidden; box-sizing: border-box; text-align: left; line-height: 1.3; }
.inf-page * { box-sizing: border-box; }
.inf-page .inf-logo { position: absolute; top: 22px; left: 32px; width: 217px; height: 28px; }
.inf-band { position: absolute; top: 66px; left: 0; right: 0; height: 50px; background: linear-gradient(90deg, #4A7CC4 0%, #2B4F96 45%, #0D1F5E 100%); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 23px; font-weight: 700; }
.inf-band .num { color: #D6DAE3; }
.inf-body { position: absolute; top: 130px; left: 30px; right: 30px; bottom: 88px; display: flex; flex-direction: column; gap: 11px; }
.inf-foot { position: absolute; bottom: 0; left: 0; right: 0; height: 74px; background: #2D5DA1; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; }
.inf-card { background: #EEF0F6; border-radius: 12px; padding: 14px 24px 16px; }
.inf-card h3 { color: #1B2470; font-size: 13.5px; font-weight: 700; display: flex; gap: 8px; align-items: center; margin: 0 0 11px; }
.inf-grid { display: grid; gap: 11px 16px; }
.inf-grid .l { font-size: 10px; color: #111827; margin-bottom: 2px; }
.inf-grid .v { font-size: 13px; font-weight: 700; color: #0B0F19; }
.inf-p { margin: 0; font-size: 12px; color: #1F2937; line-height: 1.45; }
.inf-prio { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.inf-prio > div { background: #fff; border: 1px solid #E3E6EE; border-radius: 9px; padding: 9px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.inf-prio .sig { font-size: 11px; font-weight: 800; color: #1B2470; }
.inf-prio .nm { font-size: 10px; color: #6B7280; min-height: 13px; }
.inf-pill { display: inline-flex; align-items: center; justify-content: center; height: 19px; line-height: 1; border-radius: 999px; padding: 0 10px; font-size: 10.5px; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.inf-pill.pi { background: #EFE3FF; color: #6B21A8; } .inf-pill.pa { background: #FBE1E1; color: #B42318; } .inf-pill.pm { background: #FBEFD6; color: #A86412; }
.inf-pill.pb { background: #DCF1E5; color: #23734A; } .inf-pill.pn { background: #ECEEF2; color: #4B5563; } .inf-pill.pv { background: #E4E6FF; color: #3B3FB6; }
.inf-ph .img { border-radius: 8px; background-color: #E5E7EB; }
.inf-ph .cap { text-align: center; font-size: 11px; font-weight: 700; color: #1B2470; margin-top: 4px; }
.inf-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.inf-fotos { display: grid; gap: 14px 18px; padding: 0 30px; }
.inf-fotos .cap-t { text-align: center; font-size: 12.5px; font-weight: 700; color: #1B2470; margin-bottom: 6px; }
.inf-fotos .img { border-radius: 8px; background-color: #E5E7EB; }
.inf-tbl { width: 100%; border-collapse: collapse; font-size: 10px; table-layout: fixed; }
.inf-tbl th, .inf-tbl td { border: 1px solid #D9D9D9; text-align: center; padding: 4px 6px; color: #111827; text-transform: none; letter-spacing: 0; font-size: 10px; }
.inf-tbl th.h1 { background: #2D5DA1; color: #fff; font-size: 13.5px; font-weight: 700; height: 46px; border-color: #2D5DA1; }
.inf-tbl th.h2 { background: #A9A9A9; color: #fff; font-size: 9.5px; font-weight: 700; height: 22px; border-color: #A9A9A9; }
.inf-tbl td { height: 22px; background: #fff; }
.inf-tbl td.izq { text-align: left; }
.inf-tbl td.muted { color: #6B7280; }
.inf-tbl td.bad { background: #F6D5D5; color: #B42318; font-weight: 700; }
.inf-eval td.q { text-align: left; width: 44%; background: #F4F4F4; }
.inf-eval td.ops { padding: 0; }
.inf-eval .ops-r { display: flex; height: 100%; min-height: 22px; }
.inf-eval .ops-r span { flex: 1; display: flex; align-items: center; justify-content: center; border-left: 1px solid #D9D9D9; padding: 3px 4px; }
.inf-eval .ops-r span:first-child { border-left: 0; }
.inf-eval .ops-r span.on { background: #E2E2E2; font-weight: 700; }
.inf-eval .ops-r span.bad { background: #F6D5D5; color: #B42318; font-weight: 700; }
.inf-firma { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: #374151; }
.inf-cover { background-size: cover; background-position: center; color: #fff; }
.inf-cover-sh { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,40,110,.78) 0%, rgba(20,60,140,.45) 45%, rgba(0,0,0,0) 70%); }
.inf-cover-in { position: absolute; top: 76px; left: 74px; right: 300px; display: flex; flex-direction: column; gap: 22px; }
.inf-cover h1 { font-size: 38px; line-height: 1.55; font-weight: 800; margin: 18px 0 2px; color: #fff; }
.inf-ci { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.inf-ci > span { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: #1E3A6E; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.inf-cover hr { border: 0; border-top: 1px solid rgba(255,255,255,.45); width: 300px; margin: 6px 0; }
.inf-cn { display: flex; gap: 46px; }
.inf-cn > div { display: flex; flex-direction: column; align-items: center; text-align: center; }
.inf-cn b { font-size: 34px; font-weight: 800; }
.inf-cn span { font-size: 10.5px; font-weight: 700; line-height: 1.35; }
.inf-cover-foot { position: absolute; bottom: 0; left: 0; right: 0; height: 74px; background: linear-gradient(90deg, #2D5DA1, #10235F); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; }
.inf-previa { max-height: 66vh; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 6px 0; }
.inf-escala { width: 635px; height: 898px; flex: 0 0 auto; overflow: hidden; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.inf-escala > .inf-page { transform: scale(.8); transform-origin: 0 0; }

/* ===== Modo presentación ===== */
#tour { position: fixed; left: 24px; bottom: 24px; width: 390px; max-width: calc(100vw - 32px); z-index: 100000; background: var(--card); color: var(--text); border: 1px solid var(--line2); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.5); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; animation: tourIn .25s ease; }
#tour h3 { font-size: 18px; margin: 0; }
#tour p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text2); }
#tour .tour-k { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--accent2); text-transform: uppercase; letter-spacing: .04em; }
#tour .tour-bar { display: flex; gap: 4px; }
#tour .tour-bar button { flex: 1; height: 6px; border: 0; border-radius: 99px; background: var(--line2); padding: 0; cursor: pointer; }
#tour .tour-bar button.ok { background: color-mix(in srgb, var(--accent2) 45%, var(--line2)); }
#tour .tour-bar button.on { background: var(--accent2); }
.tour-foco { outline: 3px solid #38BDF8 !important; outline-offset: 5px; border-radius: 14px; animation: tourPulso 1.6s ease-in-out infinite; }
.drawer.tour-foco { outline-offset: -3px; border-radius: 0; }
.modal.tour-foco { outline-offset: 3px; border-radius: 20px; }
@keyframes tourPulso { 0%, 100% { box-shadow: 0 0 0 0 rgba(56,189,248,.45); } 50% { box-shadow: 0 0 0 10px rgba(56,189,248,0); } }
@keyframes tourIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
#tour[popover] { inset: auto auto 24px 24px; margin: 0; height: auto; overflow: visible; }
/* Durante la presentación los informes se corren a la derecha para no quedar bajo el panel */
@media (min-width: 900px) {
  body.en-tour #capas .modal { left: auto; right: 24px; transform: translateY(-50%); width: min(720px, max(680px, calc(100vw - 460px))); animation: none; }
}

/* ===== Visor de imágenes ===== */
.photo[style*="background-image"], .ph-photo[style*="background-image"], .inf-ph .img[style*="background-image"], .inf-fotos .img[style*="background-image"] { cursor: zoom-in; }
#visor { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0; border: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: transparent; }
#visor .visor-fondo { position: absolute; inset: 0; background: rgba(5,7,15,.88); }
#visor figure { position: relative; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: calc(100vw - 140px); }
#visor img { max-width: calc(100vw - 140px); max-height: calc(100vh - 110px); object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.6); background: #111; }
#visor figcaption { display: flex; gap: 14px; color: #fff; font-size: 14px; font-weight: 600; }
#visor figcaption .muted { color: rgba(255,255,255,.6); }
#visor .visor-x, #visor .visor-nav { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; border-radius: 50%; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
#visor .visor-x:hover, #visor .visor-nav:hover { background: rgba(255,255,255,.24); }
#visor .visor-x { top: 18px; right: 18px; }
#visor .visor-nav.izq { left: 18px; top: 50%; transform: translateY(-50%); }
#visor .visor-nav.der { right: 18px; top: 50%; transform: translateY(-50%); }
@media (max-width: 700px) { #visor figure, #visor img { max-width: calc(100vw - 24px); } #visor .visor-nav { top: auto; bottom: 18px; transform: none; } }

/* Mantenimiento preventivo vencido: marca en la casilla, la lista, el panel y la leyenda */
.tile-pv { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; border-radius: 50%; background: #FF8904; color: #1A1A2E; display: inline-grid; place-items: center; box-shadow: 0 0 0 2px var(--card); flex: none; }
.tile-pv.static { position: static; }

/* Buscador general: no usa la animación de los modales centrados (los subía la mitad de su alto) */
.palette { top: 12vh; display: flex; flex-direction: column; max-height: calc(100dvh - 24vh); animation: palIn .18s ease both; }
.palette input { flex: none; color: var(--text); }
.palette .res { max-height: none; flex: 1 1 auto; min-height: 0; }
.palette .li { min-width: 0; }
@keyframes palIn { from { opacity: 0; transform: translate(-50%, -8px) scale(.98); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
#btn-buscar-movil { display: none !important; }
@media (max-width: 900px) {
  #btn-buscar-movil { display: inline-flex !important; }
}
@media (max-width: 600px) {
  .palette { top: 10px; width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 14px; }
  .palette input { height: 52px; padding: 0 14px; font-size: 16px; }
  .palette .res { padding: 6px; }
  .palette .li { gap: 10px; padding: 10px; }
}
@media (max-width: 520px) {
  .topbar [data-act="tour-iniciar"] { display: none; }
}

/* Avances por línea: cada actividad en su columna, con el porcentaje sobre su barra */
.tbl-av th.av-col, .tbl-av td.av-col { width: 15%; border-left: 1px solid var(--line); padding-left: 18px; padding-right: 18px; }
.tbl-av th.av-col span { display: block; font-size: 11px; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; margin-top: 2px; }
.av-celda { display: flex; flex-direction: column; gap: 6px; min-width: 120px; }
.av-celda .av-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.av-celda .av-top b { font-size: 15px; }
.av-celda .progress { width: 100%; height: 8px; }
.av-celda.vacia { justify-content: center; min-height: 34px; }

/* Activos críticos en celular: nombre arriba y semáforo con el total abajo */
@media (max-width: 700px) {
  .crit-row { display: flex !important; flex-wrap: wrap; align-items: center; column-gap: 10px !important; row-gap: 8px; }
  .crit-row > :nth-child(1) { flex: 1 1 100%; min-width: 0; }
  .crit-row > :nth-child(2), .crit-row > :nth-child(5) { display: none; }
  .crit-row > :nth-child(4) { margin-left: auto; }
  .crit-h > :nth-child(1), .crit-h > :nth-child(4) { display: none; }
}
/* Buscador del encabezado: una sola línea a cualquier ancho */
.topbar .search { min-width: 0; overflow: hidden; }
.topbar .search .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 1180px) { .topbar .search .kbd { display: none; } }
@media (max-width: 1100px) { .topbar [data-act="tour-iniciar"] span { display: none; } }

/* Listado de jornadas: columnas de ancho fijo para que calcen entre filas */
.jor-row { display: grid; grid-template-columns: 50px minmax(0, 1.1fr) minmax(0, 1.5fr) minmax(0, .9fr) minmax(0, .8fr) 130px 150px; gap: 16px; align-items: center; text-align: left; }
.jor-row > * { min-width: 0; }
.jor-row > :nth-child(6) { justify-self: start; }
.jor-row > :nth-child(7) { justify-self: end; }
.jor-row .ellipsis { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Listado de jornadas en pantallas angostas: fecha a la izquierda, contratista y estado arriba,
   línea y tramo al medio, horas y evento climático abajo. El responsable AES se ve en el detalle. */
@media (max-width: 900px) {
  .jor-row { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 6px 12px; align-items: start; }
  .jor-row > :nth-child(1) { grid-column: 1; grid-row: 1 / span 3; }
  .jor-row > :nth-child(2) { grid-column: 2; grid-row: 1; }
  .jor-row > :nth-child(7) { grid-column: 3; grid-row: 1; }
  .jor-row > :nth-child(3) { grid-column: 2 / 4; grid-row: 2; }
  .jor-row > :nth-child(4) { display: none; }
  .jor-row > :nth-child(5) { grid-column: 2; grid-row: 3; flex-direction: row; gap: 6px; flex-wrap: wrap; }
  .jor-row > :nth-child(6) { grid-column: 3; grid-row: 3; justify-self: end; }
  .jor-row .pill { white-space: nowrap; }
}
/* Indicadores de Jornadas en celular: dos por fila y más bajos */
@media (max-width: 600px) {
  .kpi-compacto { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-compacto > .kpi { padding: 12px 14px !important; border-radius: 12px; }
  .kpi-compacto > .kpi .v, .kpi-compacto > .kpi [style*="font-size"] { font-size: 22px !important; }
  .kpi-compacto > .kpi span:first-child { font-size: 13px; }
}

/* Mantenimiento y ficha del activo en pantallas angostas */
.ficha-acc { flex-wrap: wrap; }
@media (max-width: 700px) {
  .man-prog { grid-template-columns: minmax(0, 1fr) 42px !important; gap: 8px 12px !important; }
  .man-prog > :nth-child(1), .man-prog > :nth-child(4) { grid-column: 1 / -1; }
  .man-prog > :nth-child(4) { justify-content: flex-start !important; flex-wrap: wrap; white-space: normal !important; }
  .man-prog > :nth-child(5) { display: none; }
  .man-act { grid-template-columns: minmax(0, 1fr) auto !important; gap: 6px 12px !important; }
  .man-act > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .ficha-acc { width: 100%; }
  .ficha-acc > .btn:not(.icon) { flex: 1 1 160px; justify-content: center; }
  .fila-trab { grid-template-columns: minmax(0, 1fr) auto !important; gap: 6px 12px !important; }
  .fila-trab > :nth-child(1) { grid-column: 1; grid-row: 1; min-width: 0; }
  .fila-trab > :nth-child(3) { grid-column: 2; grid-row: 1; align-self: start; }
  .fila-trab > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .fila-insp { grid-template-columns: minmax(0, 1fr) auto !important; gap: 8px 12px !important; }
  .fila-insp > :nth-child(1) { grid-column: 1; grid-row: 1; min-width: 0; }
  .fila-insp > :nth-child(2) { grid-column: 2; grid-row: 1; justify-self: end; }
  .fila-insp > :nth-child(3) { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; }
  .fila-insp > :nth-child(4) { grid-column: 1; grid-row: 3; }
  .fila-insp > :nth-child(5) { grid-column: 2; grid-row: 3; }
}
