/* Estilo "claro moderno": mismas clases que antes, solo cambia la apariencia.
   Respaldo del estilo anterior en /respaldo_estilo_anterior */
:root {
  --bg-desktop: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --ink: #111827;
  --ink-soft: #4b5563;
  --ink-mute: #8a94a3;
  --accent: #003cb3;
  --accent-hover: #002f8c;
  --accent-soft: #e8eefb;
  --accent-ring: rgba(0,60,179,.25);
  --blue: #003cb3;
  --blue-dark: #002a7a;
  --line: #e2e5ea;
  --line-strong: #cfd4dc;
  --line-soft: #eef0f3;
  --panel: #ffffff;
  --lookup-bg: #f1f5fd;
  --input-bg: #ffffff;
  --grid-alt: #fafbfc;
  --grid-hover: #f2f5fb;
  --grid-sel: #d6e2f8;
  --readonly: #f4f5f7;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow: 0 4px 16px rgba(16,24,40,.08), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 20px 48px rgba(16,24,40,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; font-size: 13px; color: var(--ink);
  background: var(--bg-desktop); overflow: hidden; user-select: none; -webkit-font-smoothing: antialiased;
}
input, select, textarea, button { font: inherit; color: inherit; }
input, textarea, [contenteditable] { user-select: text; }
.hidden { display: none !important; }
button { cursor: pointer; transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3d8df; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #b9c0ca; background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ───────── Login ───────── */
/* Ingreso partido: formulario a la izquierda, panel derecho reservado para accesos (p. ej. solicitud de mantenimiento) */
.login { position: fixed; inset: 0; display: flex; background: var(--surface); }
.login-left { width: 400px; padding: 48px 40px 24px; display: flex; flex-direction: column; gap: 14px; background: var(--surface);
  border-right: 1px solid var(--line); box-shadow: 4px 0 24px rgba(16,24,40,.06); z-index: 1; }
.login-right { flex: 1; display: grid; place-items: center; background-color: var(--bg-desktop);
  background-image: radial-gradient(circle at 20% 15%, #d6e2f8 0, transparent 45%), radial-gradient(circle at 85% 85%, #e4e8f0 0, transparent 50%),
    radial-gradient(#d9dee5 1px, transparent 1px);
  background-size: auto, auto, 22px 22px; }
.login-art { width: min(52%, 520px); opacity: .1; }
.brand-logo { width: 190px; height: auto; margin-bottom: 18px; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-ico { font-size: 22px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); }
.brand b { font-size: 17px; color: var(--ink); display: block; font-weight: 650; }
.brand small { color: var(--ink-mute); font-size: 11.5px; }
.login h2 { margin: 16px 0 2px; font-weight: 650; font-size: 20px; }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.login input { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; font-size: 14px; }
.login input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.login footer { margin-top: 8px; color: var(--ink-mute); font-size: 11px; word-break: break-all; }
.btn-primary { background: var(--accent); color: #fff; border: 0; padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; }
.btn-primary:hover { background: var(--accent-hover); }
.login .btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.login .btn-primary.cargando { cursor: progress; opacity: .92; }
.login .btn-primary.cargando:hover { background: var(--accent); }
.login-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: login-gira .7s linear infinite; }
@keyframes login-gira { to { transform: rotate(360deg); } }
.login input:disabled { background: var(--surface-2, #f3f5f8); color: var(--ink-soft); }
.err { color: var(--danger); min-height: 16px; white-space: pre-line; }

/* ───────── Shell ───────── */
#shell { position: fixed; inset: 0; display: flex; flex-direction: column; }
#menubar { display: flex; align-items: center; gap: 2px; padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 5000; }
.mb-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; letter-spacing: -.01em; padding-right: 18px; margin-right: 8px; border-right: 1px solid var(--line); }
.mb-brand img { height: 22px; width: auto; display: block; }
.mb-brand span { font-weight: 600; font-size: 13px; color: var(--ink-mute); padding-left: 10px; border-left: 1px solid var(--line); }
.mb-grow { flex: 1; }
.mb-user { display: flex; align-items: center; gap: 8px; padding: 0 12px; margin-right: 4px; border-right: 1px solid var(--line); line-height: 1.15; }
.mb-user .av { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.mb-user b { display: block; font-size: 12.5px; }
.mb-user small { color: var(--ink-mute); font-size: 11px; }
.mb-item > button { display: inline-flex; align-items: center; gap: 6px; }
.mb-drop .icon { color: var(--ink-mute); }
.mb-drop button:hover .icon { color: var(--accent); }
.mb-item { position: relative; }
.mb-item > button { background: none; border: 0; padding: 5px 11px; border-radius: var(--radius-sm); color: var(--ink-soft); font-weight: 500; }
.mb-item > button:hover, .mb-item.open > button { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.mb-drop { position: absolute; top: calc(100% + 4px); left: 0; min-width: 230px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 5px; display: none; max-height: 80vh; overflow: auto; border-radius: 10px; }
.mb-item.open .mb-drop { display: block; }
.mb-drop button { display: flex; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; align-items: center; border-radius: var(--radius-sm); }
.mb-drop button:hover { background: var(--accent-soft); color: var(--blue-dark); }
.mb-drop .sep { border-top: 1px solid var(--line-soft); margin: 4px 2px; }
.mb-drop .soon, .side-link.soon { color: #b0b7c2; }
.mb-drop .soon small, .side-link.soon small { margin-left: auto; font-size: 10px; }
#main { flex: 1; display: flex; min-height: 0; }

#sidebar { width: 224px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; padding: 8px 8px; gap: 2px; }
.side-sec > .side-head { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; padding: 8px 10px; font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); background: none; border-radius: var(--radius-sm); }
.side-sec > .side-head::before { content: "›"; display: inline-block; font-size: 15px; line-height: 1; width: 10px; transition: transform .15s; color: var(--ink-mute); }
.side-sec > .side-head:hover { background: var(--surface-2); color: var(--ink-soft); }
.side-sec.open > .side-head { color: var(--blue-dark); background: none; }
.side-sec.open > .side-head::before { transform: rotate(90deg); color: var(--accent); }
.side-body { display: none; padding: 2px 0 6px; overflow-y: auto; }
.side-sec.open { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.side-sec.open .side-body { display: block; flex: 1; }
.side-link { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 7px 10px; text-align: left; color: var(--ink-soft); border-radius: var(--radius-sm); font-size: 13px; line-height: 1.25; }
.side-link .ico { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--ink-mute); }
.side-link .t { text-decoration: none; }
.side-link:hover { background: var(--accent-soft); color: var(--blue-dark); }
.side-link:hover .ico { background: #fff; border-color: #c9d7f3; color: var(--accent); }

#desktop { flex: 1; position: relative; overflow: hidden; background: var(--bg-desktop); }
/* Íconos de línea (icons.js) */
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
#statusbar .icon { width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; }

/* Área de trabajo con pestañas */
#work { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#wtabs { display: flex; align-items: flex-end; gap: 4px; padding: 8px 12px 0; background: var(--bg-desktop); border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; flex: none; scrollbar-width: thin; }
#wtabs::-webkit-scrollbar { height: 4px; }
.wtab { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 8px 0 12px; max-width: 230px; flex: none; border: 1px solid transparent; border-bottom: 0;
  border-radius: 8px 8px 0 0; color: var(--ink-mute); cursor: pointer; position: relative; top: 1px; transition: background-color .12s, color .12s; }
.wtab .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.wtab:hover { background: rgba(255,255,255,.6); color: var(--ink-soft); }
.wtab.active { background: var(--surface); color: var(--ink); border-color: var(--line); }
.wtab.active::before { content: ""; position: absolute; left: 10px; right: 10px; top: -1px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.wtab.active .icon { color: var(--accent); }
.wtab.home { padding-right: 14px; }
.wtab .wx { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; background: none; border-radius: 5px; color: var(--ink-mute); opacity: 0; }
.wtab .wx .icon { width: 13px; height: 13px; }
.wtab:hover .wx, .wtab.active .wx { opacity: 1; }
.wtab .wx:hover { background: #fee2e2; color: var(--danger); }
.mdi > .mdi-title { display: none; }
#statusbar { display: flex; gap: 0; border-top: 1px solid var(--line); background: var(--surface); font-size: 11.5px; color: var(--ink-mute); }
#statusbar span { padding: 5px 14px; border-right: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#statusbar span:last-child { flex: 1; border-right: 0; }

/* ───────── Home / tablero ───────── */
#home { position: absolute; inset: 0; padding: 28px 32px; overflow: auto; }
#home h1 { margin: 0 0 4px; font-size: 22px; color: var(--ink); font-weight: 650; letter-spacing: -.01em; }
#home .sub { color: var(--ink-mute); margin-bottom: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s, transform .12s; }
.kpi:hover { border-color: #b3c7ee; box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi .n { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .l { color: var(--ink-mute); font-size: 12px; }
.kpi.alert .n { color: var(--danger); }
.home-cols { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 12px; font-size: 13px; color: var(--ink); font-weight: 650; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 34px; gap: 10px; align-items: center; margin: 7px 0; }
.bar { height: 8px; border-radius: 99px; background: #eef0f3; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; border: 1px solid rgba(0,0,0,.08); color: #111; }

/* ───────── Ventanas ───────── */
.mdi { position: absolute; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; min-width: 520px; min-height: 300px; resize: both; overflow: hidden; border-radius: 12px; }
.mdi.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; resize: none; border-radius: 0; border: 0; box-shadow: none; }
.mdi.inactive { box-shadow: var(--shadow); }
.mdi.inactive .mdi-title { opacity: .7; }
.mdi-title { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line); cursor: default; }
.mdi-title .t { flex: 1; font-weight: 650; font-size: 13.5px; }
.mdi-title button { width: 28px; height: 24px; border: 0; background: none; border-radius: var(--radius-sm); font-size: 12px; line-height: 1; color: var(--ink-soft); }
.mdi-title button:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.mdi-title button.x:hover { background: #fee2e2; color: var(--danger); box-shadow: none; }
.mdi-body { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); }

.toolbar { display: flex; align-items: center; gap: 3px; padding: 6px 8px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar button { display: inline-flex; align-items: center; gap: 5px; background: none; border: 1px solid transparent; padding: 4px 9px; border-radius: var(--radius-sm); color: var(--ink-soft); }
.toolbar button:hover:not(:disabled) { background: var(--accent-soft); color: var(--blue-dark); }
.toolbar button:disabled { opacity: .35; cursor: default; }
.toolbar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 5px; }
.toolbar input.find { width: 140px; padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.toolbar input.find:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.toolbar .grow { flex: 1; }
.toolbar { flex-wrap: nowrap; }
.toolbar .flabel { padding: 0 4px 0 2px; white-space: nowrap; color: var(--ink-mute); }
.toolbar input.find { flex: 1; min-width: 80px; width: auto; }

/* ───────── Acomodo por renglones ───────── */
.lay { display: flex; flex-direction: column; gap: 7px; padding: 8px 6px; }
.lrow { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; min-height: 28px; }
.lcol { display: flex; flex-direction: column; gap: 7px; }
.lpair { display: inline-flex; align-items: center; gap: 8px; }
.lpair.grow { flex: 1; min-width: 260px; }
.lpair.grow > :last-child { flex: 1; }
.lpair.memo { align-items: flex-start; width: 100%; }
.lpair.memo textarea { width: 100%; }
.lpair.memo .ll { padding-top: 5px; }
.ll { white-space: nowrap; text-align: right; color: var(--ink-soft); font-size: 12.5px; }
.ll.first { min-width: 132px; }
.ll.lk { color: var(--accent); text-decoration: none; font-weight: 600; cursor: pointer; }
.ll.lk:hover { text-decoration: underline; }
.lay input:not([type=checkbox]), .lay select, .lay textarea { padding: 4px 8px; border: 1px solid var(--line-strong); background: #fff; border-radius: var(--radius-sm); min-height: 28px; }
.lay input[readonly] { background: var(--readonly); color: var(--ink-soft); }
.lay input[type=date] { width: 150px; } .lay input[type=datetime-local] { width: 190px; }
.lay input[type=number] { width: 90px; }
.lay textarea { resize: vertical; font-family: inherit; }
.lay input:focus, .lay select:focus, .lay textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.lay .lkw input { width: 150px; flex: none; }
.lay .lkw .desc { flex: none; max-width: 420px; }
.lay .lkw.plain .desc { min-width: 200px; text-align: center; }
.chkpair { gap: 6px; cursor: pointer; }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.lbox { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px 10px; margin: 0; display: flex; flex-direction: column; gap: 7px; background: var(--surface); }
.lbox.v .chkpair { display: flex; }
.lbox.wide { flex: 1; }
.lbox legend { padding: 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-mute); }
.panels.locked .lay input, .panels.locked .lay select, .panels.locked .lay textarea { pointer-events: none; background: var(--readonly) !important; color: #374151; border-color: var(--line); }
.panels.locked .lay .lkw button { visibility: hidden; }

/* Pestañas en dos filas */
.tabs { flex-direction: column; flex-wrap: nowrap; gap: 0; }
.tabrow { display: flex; padding-left: 6px; gap: 2px; }
.tabrow + .tabrow { margin-top: 0; padding-left: 0; }
.tabs button { min-width: 112px; text-align: center; }

/* Detalle: lista + editor */
.cgrid { display: flex; flex-direction: column; gap: 4px; }
.cgrid fieldset { margin: 0; padding: 4px 8px 8px; }
.clist .gwrap { max-height: 260px; min-height: 160px; }
.grid td.c { text-align: center; }
.ceditor .ctools { display: flex; gap: 3px; align-items: center; margin-bottom: 6px; }
.ibtn { border: 1px solid transparent; background: none; padding: 3px 7px; border-radius: var(--radius-sm); font-size: 13px; }
.ibtn:hover:not(:disabled) { background: var(--accent-soft); border-color: #c9d7f3; }
.ibtn:disabled { opacity: .3; }
.ibtn.tgl { font-size: 9px; letter-spacing: -2px; }
.fgrid1 { display: grid; grid-template-columns: max-content 1fr; gap: 6px 10px; align-items: center; max-width: 760px; }
.fgrid1 > label { text-align: right; color: var(--ink-soft); }
.fgrid1 > label.lk { color: var(--accent); font-weight: 600; cursor: pointer; }
.fgrid1 input:not([type=checkbox]), .fgrid1 select { padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); min-height: 28px; width: 160px; }
.fgrid1 input:focus, .fgrid1 select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.fgrid1 .lkw input { width: 140px; flex: none; }
.fgrid1 .long, .fgrid1 .long input, .fgrid1 input.long:not([type=checkbox]) { width: 100%; }
.fgrid1 input:disabled { background: var(--readonly); }

/* Plan anual */
table.plan { border-collapse: separate; border-spacing: 2px; margin: 6px 0; }
.plan th { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px; font-weight: 600; font-size: 11px; color: var(--ink-soft); }
.plan td.pd { width: 22px; height: 20px; border: 1px solid #f1e7a6; border-radius: 4px; background: #fef9c3; text-align: center; padding: 0; }
.plan td.pd.off { background: #e5e7eb; border-color: #e5e7eb; }
.plan td.pd.hoy { outline: 2px solid var(--accent); outline-offset: -2px; }
.pm { display: inline-block; width: 12px; height: 12px; border: 0; border-radius: 3px; vertical-align: middle; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.pm.planif { background: #facc15; } .pm.prog { background: #22c55e; } .pm.late { background: #ef4444; }
.pm.done { background: #374151; } .pm.cancel { background: #2dd4bf; }
.plegend { display: flex; gap: 22px; margin-top: 10px; color: var(--ink-soft); }
.navbar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 5px; }
.toolbar button.act { font-weight: 600; color: var(--accent); background: var(--accent-soft); }
.panels.locked .fgrid input, .panels.locked .fgrid select, .panels.locked .fgrid textarea { pointer-events: none; background: var(--readonly) !important; color: #374151; border-color: var(--line); }
.panels.locked .fgrid .lkw button { visibility: hidden; }
.panels.locked .cell input, .panels.locked .cell select { pointer-events: none; }
.panels.locked .cell .lkw button { visibility: hidden; }

.rec-head { display: grid; grid-template-columns: 170px 1fr auto; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 650; }
.rec-head > div { padding: 8px 14px; border-right: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-head > div:first-child { color: var(--accent); font-variant-numeric: tabular-nums; }
.rec-head > div:last-child { border-right: 0; font-size: 14px; color: var(--ink-soft); }
.rec-head .dirty::after { content: " ●"; color: var(--warn); }

.tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 10px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 7px 14px; margin-right: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; position: relative; top: 1px; color: var(--ink-soft); font-weight: 500; }
.tabs button:hover { color: var(--ink); background: var(--surface-2); }
.tabs button.on { background: none; color: var(--accent); font-weight: 650; border-bottom-color: var(--accent); z-index: 1; }
.tabs button .cnt { font-weight: 500; color: var(--ink-mute); font-size: 10.5px; background: var(--surface-2); border-radius: 99px; padding: 0 6px; margin-left: 2px; }
.panels { flex: 1; min-height: 0; overflow: auto; background: var(--surface-2); border: 0; margin: 0; }
.panel { padding: 14px 16px; display: none; }
.panel.on { display: block; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 6px 0 12px; padding: 8px 12px 12px; background: var(--surface); }
legend { padding: 0 6px; color: var(--ink-mute); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.fgrid { display: grid; grid-template-columns: max-content minmax(150px, 1fr) max-content minmax(150px, 1fr); gap: 7px 10px; align-items: center; }
.fgrid > label { text-align: right; color: var(--ink-soft); white-space: nowrap; font-size: 12.5px; }
.fgrid > label.lk { color: var(--accent); font-weight: 600; cursor: pointer; }
.fgrid > label.lk:hover { text-decoration: underline; }
.fgrid > label.wl { grid-column: 1; }
.fgrid > .wide { grid-column: 2 / span 3; }
.fgrid > label.top { align-self: start; padding-top: 5px; }
.fgrid input:not([type=checkbox]), .fgrid select, .fgrid textarea { width: 100%; padding: 4px 8px; border: 1px solid var(--line-strong); background: var(--input-bg); border-radius: var(--radius-sm); min-height: 28px; }
.fgrid input[readonly], .fgrid input:disabled { background: var(--readonly); color: var(--ink-soft); }
.fgrid textarea { resize: vertical; font-family: inherit; }
.fgrid input:focus, .fgrid select:focus, .fgrid textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.cell input:focus, .cell select:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.chk { display: flex; align-items: center; gap: 6px; justify-self: start; }
.req::after { content: " *"; color: var(--danger); }

.lkw { display: flex; align-items: center; gap: 4px; min-width: 0; }
.lkw input { background: var(--lookup-bg) !important; flex: 0 1 130px; min-width: 64px; }
.lkw .desc.colored { min-width: 100px; }
.lkw button { border: 0; background: none; padding: 2px 4px; font-size: 13px; border-radius: 4px; }
.lkw button:hover { background: var(--accent-soft); }
.lkw .desc { flex: 1; min-width: 0; color: var(--blue-dark); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 8px; border-radius: var(--radius-sm); }
.lkw .desc.bad { color: var(--danger); }
.lkw .desc.colored { color: #111; text-align: center; border: 1px solid rgba(0,0,0,.08); font-weight: 600; border-radius: 99px; }

/* ───────── Grids ───────── */
.gridbar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.gridbar button { border: 1px solid var(--line-strong); background: var(--surface); padding: 4px 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.gridbar button:hover { border-color: var(--accent); color: var(--accent); }
.gridbar input, .gridbar select { padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.gridbar .lkw input { width: 100px; flex: none; }
.gridbar .lkw .desc { max-width: 120px; }
.gridbar .count { margin-left: auto; color: var(--ink-mute); }
.gwrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-height: calc(100vh - 330px); min-height: 120px; }
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.grid th { position: sticky; top: 0; background: var(--surface-2); border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft); padding: 7px 10px; font-weight: 600; font-size: 11.5px; color: var(--ink-soft); text-align: left; white-space: nowrap; z-index: 1; }
.grid td { border-bottom: 1px solid var(--line-soft); padding: 5px 10px; white-space: nowrap; max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.grid tbody tr:nth-child(even) { background: var(--grid-alt); }
.grid tbody tr:hover { background: var(--grid-hover); }
.grid tbody tr.sel { background: var(--grid-sel); box-shadow: inset 3px 0 0 var(--accent); }
.grid.click tbody tr { cursor: pointer; }
.grid td.n, .grid th.n { text-align: right; font-variant-numeric: tabular-nums; }
.grid tfoot td { background: var(--surface-2); font-weight: 700; border-top: 1px solid var(--line-strong); }
.grid td.cell { padding: 0; }
.cell input:not([type=checkbox]), .cell select { border: 0; background: transparent; width: 100%; padding: 5px 8px; min-width: 70px; }
.cell input[type=number] { text-align: right; min-width: 70px; width: 90px; }
.cell input[type=date] { width: 120px; }
.cell input[type=datetime-local] { width: 170px; }
.cell .lkw input { background: var(--lookup-bg) !important; width: 110px; flex: none; }
.cell .lkw .desc { font-weight: 400; color: var(--ink-soft); max-width: 200px; }
.cell.c { text-align: center; }
.empty { color: var(--ink-mute); padding: 24px; text-align: center; }

.navbar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-top: 1px solid var(--line); background: var(--surface); margin-top: 8px; }
.navbar button { background: none; border: 1px solid transparent; padding: 4px 10px; color: var(--ink-soft); border-radius: var(--radius-sm); }
.navbar button:hover { background: var(--accent-soft); color: var(--blue-dark); }
.navbar { flex-wrap: wrap; }

/* Consulta */
.qpanel { flex-direction: column; gap: 6px; }
.qpanel.on { display: flex; }
.qtools { display: flex; gap: 4px; align-items: center; padding: 2px 0 6px; }
.qtools .count { margin-left: auto; color: var(--ink-mute); }
.ibig { width: 36px; height: 34px; font-size: 16px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.ibig:hover { background: var(--accent-soft); border-color: #b3c7ee; }
.gwrap.qgrid table.grid { min-width: 0; }
.gwrap.qgrid td { max-width: 200px; }
.gwrap.qgrid th { min-width: 40px; }
.gwrap.qgrid { max-height: none; height: calc(100vh - 300px); min-height: 260px; }
.grid thead tr.frow th { background: #fff; padding: 0; top: 31px; border-bottom: 1px solid var(--line); }
.grid thead tr.frow input { width: 100%; border: 0; background: transparent; padding: 5px 8px; font: inherit; font-weight: 400; }
.grid thead tr.frow input::placeholder { color: #c0c6cf; }
.grid thead tr.frow input:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.navbar .pos { flex: 1; text-align: center; color: var(--ink-mute); white-space: nowrap; min-width: 150px; }
.navbar button { white-space: nowrap; }

/* ───────── Modales ───────── */
.modal-back { position: fixed; inset: 0; background: rgba(17,24,39,.4); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 9000; }
.modal { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); min-width: 380px; max-width: 90vw; max-height: 88vh; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; }
.modal .mdi-title { border-radius: 0; padding: 12px 12px 12px 18px; }
.modal .mbody { padding: 16px 18px; overflow: auto; white-space: pre-line; }
.modal .mfoot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.modal .mfoot button, .btn { border: 1px solid var(--line-strong); background: var(--surface); padding: 6px 16px; border-radius: var(--radius-sm); min-width: 84px; font-weight: 500; box-shadow: var(--shadow-sm); }
.modal .mfoot button:hover, .btn:hover { background: var(--surface-2); }
.modal .mfoot button.primary, .btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.modal .mfoot button.primary:hover, .btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.danger:hover { background: #b91c1c; }
.btn:disabled { opacity: .5; }
.picker .gwrap { max-height: 55vh; min-width: 640px; }

.toasts, #toast-root { position: fixed; right: 68px; bottom: 40px; display: flex; flex-direction: column; gap: 8px; z-index: 9500; }
.toast { background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 420px; white-space: pre-line; animation: tin .18s ease-out; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--accent); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* ───────── Pantallas especiales ───────── */
.pad { padding: 16px 18px; overflow: auto; flex: 1; background: var(--surface-2); }
.pad h3 { margin: 4px 0 12px; color: var(--ink); font-size: 14px; font-weight: 650; }
.form-simple { display: grid; grid-template-columns: max-content 1fr; gap: 10px 12px; align-items: center; max-width: 640px; }
.form-simple > label { text-align: right; color: var(--ink-soft); }
.form-simple input:not([type=checkbox]), .form-simple select, .form-simple textarea { padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); width: 100%; }
.form-simple input:focus, .form-simple select:focus, .form-simple textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.note { color: var(--ink-mute); font-size: 12px; margin: 8px 0; }
.tag-late { color: var(--danger); font-weight: 700; }
.tag-open { color: var(--warn); }

/* ───────── Árbol de equipos ───────── */
.tree ul { list-style: none; margin: 0; padding-left: 18px; }
.tree ul.troot { padding-left: 0; }
.tree li { margin: 2px 0; }
.tree summary { cursor: pointer; }
.tree .tl { display: inline-block; width: 14px; color: var(--ink-mute); }
.tree .tn { padding: 1px 6px; border-radius: 4px; }
.tree .tn:hover { background: var(--grid-hover); }
.tree .tn.sel { background: var(--grid-sel); font-weight: 650; color: var(--blue-dark); }
.tree .tn.off { color: #b0b7c2; text-decoration: line-through; }
.tree small { color: var(--ink-mute); }

/* ───────── Plan Maestro ───────── */
.grid td.pmcell { background: #fffdf2; min-width: 52px; }

/* ───────── Reportes ───────── */
.replist { flex: 1; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.replist .rg { background: var(--surface-2); font-weight: 600; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-mute); padding: 7px 10px; position: sticky; top: 0; border-bottom: 1px solid var(--line); }
.replist .ri { padding: 5px 10px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.replist .ri:hover { background: var(--grid-hover); }
.replist .ri.sel { background: var(--grid-sel); box-shadow: inset 3px 0 0 var(--accent); }
.replist .ri b { display: inline-block; min-width: 44px; color: var(--ink-mute); font-weight: 600; }

/* ───────── Aviso de solicitudes pendientes ───────── */
.aviso { position: absolute; right: 16px; bottom: 16px; width: 380px; z-index: 4000; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 12px 16px 14px; box-shadow: var(--shadow-lg); }
.aviso .x { position: absolute; right: 8px; top: 8px; border: 0; background: var(--surface-2); border-radius: 6px; width: 22px; height: 22px; line-height: 1; padding: 0; color: var(--ink-soft); }
.aviso .x:hover { background: #fee2e2; color: var(--danger); }
.aviso a { color: var(--accent); font-weight: 700; }

/* Plan Maestro: celda completa del color del estado */
.pmgrid td.pmcell { background: #fff; min-width: 66px; text-align: center; padding: 3px 4px; cursor: default; }
.pmgrid td.pmcell.late { background: #fca5a5; cursor: pointer; }
.pmgrid td.pmcell.prog { background: #86efac; cursor: pointer; }
.pmgrid td.pmcell.done { background: #d1d5db; cursor: pointer; }
.pmgrid td.pmcell.cancel { background: #99f6e4; cursor: pointer; }
.pmgrid .pmico { display: inline-block; width: 13px; height: 13px; line-height: 12px; font-size: 10px; font-style: normal; font-weight: 700; color: #111;
  border: 1px solid rgba(0,0,0,.25); border-radius: 3px; background: #fff; vertical-align: middle; }
.pmgrid td:nth-child(1), .pmgrid td:nth-child(2) { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmbanner { display: flex; gap: 6px; font-weight: 650; }
.pmbanner > div { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-sm); text-align: center; padding: 5px; color: var(--ink-soft); }
.pmbanner > div:first-child { width: 240px; } .pmbanner > div:last-child { flex: 1; }

/* ═════════ Pantallas internas (mismas funciones, presentación amigable) ═════════ */
/* Botones con ícono de línea (icons.js → .with-ico) */
button.with-ico { display: inline-flex; align-items: center; gap: 6px; }
button.with-ico .icon { width: 15px; height: 15px; }
button.ico-only { justify-content: center; }
.mdi-title > span:first-child .icon { width: 17px; height: 17px; color: var(--accent); }

/* Barra de acciones del registro */
.toolbar { gap: 4px; padding: 8px 12px; }
.toolbar button { height: 32px; padding: 0 11px; font-weight: 500; color: var(--ink-soft); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.toolbar button:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
.toolbar button .icon { color: var(--ink-mute); }
.toolbar button:hover:not(:disabled) .icon { color: var(--accent); }
.toolbar button.tb-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.toolbar button.tb-primary .icon { color: #fff; }
.toolbar button.tb-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.toolbar button.tb-primary:hover:not(:disabled) .icon { color: #fff; }
.toolbar button.tb-danger:hover:not(:disabled) { background: #fef2f2; border-color: #fecaca; color: var(--danger); }
.toolbar button.tb-danger:hover:not(:disabled) .icon { color: var(--danger); }
.toolbar .sep { margin: 4px 6px; }
.toolbar .flabel { font-size: 12px; }
.toolbar input.find { height: 32px; max-width: 220px; }
.toolbar input.find + button { width: 32px; padding: 0; justify-content: center; margin-left: -2px; }

/* Encabezado del registro */
.rec-head { margin: 12px 14px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); align-items: center; overflow: hidden; }
.rec-head > div { padding: 12px 16px; border-right: 0; }
.rec-head > div:first-child { display: flex; align-items: center; }
.rec-head > div:nth-child(2) { font-size: 15.5px; font-weight: 650; color: var(--ink); }
.rec-head > div:last-child { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); margin-right: 12px; padding: 4px 10px; border-radius: 99px; }
.tabs { margin-top: 8px; background: transparent; padding: 0 14px; }
.mdi-body > div > .tabs, .tabs { border-bottom: 1px solid var(--line); }
.panel { padding: 14px; }

/* Navegación inferior */
.navbar { gap: 6px; padding: 8px 12px; margin-top: 0; }
.navbar button { height: 30px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); }
.navbar button:hover { border-color: var(--line-strong); }
.navbar button .icon { color: var(--ink-mute); }
.navbar button:hover .icon { color: var(--accent); }
.navbar button.act { background: var(--accent-soft); border-color: #c9d7f3; color: var(--blue-dark); font-weight: 600; }
.navbar button.act .icon { color: var(--accent); }
.navbar button.act:hover { background: #d6e2f8; }
.navbar .pos { font-variant-numeric: tabular-nums; font-weight: 500; }

/* Consulta */
.qtools { gap: 6px; padding: 0 0 8px; }
.ibig { width: 36px; height: 34px; display: inline-grid; place-items: center; color: var(--ink-soft); }
.ibig .icon { width: 17px; height: 17px; }
.ibig:hover { color: var(--accent); }
.qtools .count { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px 12px; font-size: 12px; }

/* Botones pequeños de renglones y búsquedas */
.ibtn { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; color: var(--ink-soft); }
.ibtn .icon { width: 15px; height: 15px; }
.ibtn:hover:not(:disabled) { color: var(--accent); }
.ceditor .ctools { gap: 4px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); margin-bottom: 10px; }
.lkw button { display: inline-grid; place-items: center; width: 24px; height: 24px; color: var(--ink-mute); }
.lkw button .icon { width: 14px; height: 14px; }
.lkw button:hover { color: var(--accent); }
.gridbar button.with-ico .icon { color: var(--accent); }

/* Notas como aviso */
.note { display: flex; gap: 8px; align-items: flex-start; background: #f0f7ff; border: 1px solid #dbe9fb; color: #1e3a5f; border-radius: var(--radius); padding: 9px 12px; line-height: 1.45; }
.note .icon { color: #2563eb; margin-top: 1px; }
.note:not(.with-ico) { background: transparent; border: 0; padding: 0; color: var(--ink-mute); }

/* Diálogos */
.modal .mbody { line-height: 1.5; }
.modal .mfoot button { height: 34px; }

/* Plan Maestro: filtros a su altura natural y compactos */
.pm-filtros { flex: none; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.pm-filtros .tabs { margin-top: 0; padding: 0 10px; }
.pm-filtros .tabs button { padding: 6px 14px; }
.pm-filtros .panels { flex: none; overflow: visible; background: var(--surface); }
.pm-filtros .panel { padding: 8px 6px 10px; }
.pm-filtros .form-simple { gap: 6px 10px; }
.pm-filtros .form-simple input:not([type=checkbox]) { padding: 4px 8px; }
.pmbanner { font-size: 12px; }
.pmbanner > div { padding: 4px; }

/* Accesos de empleados (Campos Definidos por el Usuario) */
.acc { display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: 0; }
.acc-listas { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.acc-col { display: flex; flex-direction: column; gap: 6px; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.acc-head { display: flex; align-items: center; justify-content: space-between; }
.acc-head .count { color: var(--ink-mute); font-size: 12px; }
.acc-col input.find { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.acc-col input.find:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.acc-col .gwrap { flex: 1; min-height: 160px; max-height: none; }
.acc-editor { margin: 0; flex: none; }
.acc-sel { margin-bottom: 10px; color: var(--ink-soft); }
.acc-form { display: grid; grid-template-columns: max-content 1fr; gap: 8px 12px; align-items: start; }
.acc-form > label { color: var(--ink-soft); padding-top: 5px; }
.acc-form select { width: 220px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.acc-chks { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 6px 14px; }
.acc-chks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.acc-chks .acc-todos { grid-column: 1 / -1; font-weight: 600; color: var(--accent); }
.acc-col .tabs { padding: 0; margin: -4px 0 4px; background: transparent; }
.acc-filtros { display: flex; align-items: center; gap: 12px; }
.acc-filtros input.find { flex: 1; }
.acc-filtros label { display: flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.grid tbody tr.acc-on td:nth-child(7) { color: var(--ok); font-weight: 600; }
.acc-form input:not([type=checkbox]) { width: 260px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.acc-form .note { margin: 4px 0 0; }
.acc > .acc-col { flex: 1; }

/* ───────── Usuarios y accesos ───────── */
.ua { display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
.ua-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ua-migas { color: var(--ink-mute); }
.ua-erp { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding: 3px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid; }
.ua-erp i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ua-erp.on { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.ua-erp.off { color: var(--danger); background: #fef2f2; border-color: #fecaca; }
.ua-aviso { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ua-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: var(--shadow-sm); }
.ua-tabs { display: flex; gap: 4px; background: var(--surface-2); border-radius: 10px; padding: 4px; }
.ua-tab { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 16px; border-radius: 8px; color: var(--ink-soft); font-weight: 500; }
.ua-tab b { background: var(--accent-soft); color: var(--accent); font-size: 11px; padding: 1px 8px; border-radius: 99px; }
.ua-tab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.ua-tab.on .icon { color: var(--accent); }
.ua-busq { display: flex; gap: 8px; }
.ua-buscar { width: 280px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; }
.ua-filtro { padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px; min-width: 170px; }
.ua-buscar:focus, .ua-filtro:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.ua-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; }
.ua-card-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--line-soft); }
.ua-card-head b { text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }
.ua-punto { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.ua-total { margin-left: auto; color: var(--ink-mute); font-size: 12.5px; }
.ua-tabla table { width: 100%; border-collapse: collapse; }
.ua-tabla th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-mute); padding: 12px 22px; background: var(--surface-2); border-bottom: 1px solid var(--line-soft); }
.ua-tabla td { padding: 14px 22px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.ua-tabla tbody tr:hover { background: var(--grid-hover); }
.ua-colab { display: flex; align-items: center; gap: 12px; }
.ua-colab b { display: block; font-weight: 600; text-transform: uppercase; }
.ua-colab small { color: var(--ink-mute); font-family: Consolas, monospace; font-size: 11.5px; }
.ua-av { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.ua-av.admin { background: var(--accent); border-color: var(--accent); color: #fff; }
.ua-login { font-family: Consolas, monospace; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; letter-spacing: .03em; }
.ua-rol { display: inline-block; padding: 3px 12px; border-radius: 99px; border: 1px solid #c9d7f3; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12px; }
.ua-rol.admin { background: #eef2ff; }
.ua-alcance { display: flex; gap: 8px; align-items: flex-start; }
.ua-alcance .icon { color: var(--accent); margin-top: 2px; }
.ua-ult span { display: block; }
.ua-ult small { color: var(--ink-mute); font-size: 11.5px; }
.ua-estado { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--ink-mute); background: var(--surface-2); border: 1px solid var(--line); }
.ua-estado i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ua-estado.on { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.ua-gris { color: var(--ink-mute); }
.ua-gest { text-align: right; }
.ua-gest .btn { min-width: 0; }
.ua-dar { color: var(--accent) !important; background: var(--accent-soft) !important; border-color: #c9d7f3 !important; font-weight: 600; }
.ua-pie { padding: 12px 22px; color: var(--ink-mute); font-size: 12.5px; }
.ua-modal { min-width: 460px; }
.ua-modal small { display: block; color: var(--ink-mute); font-family: Consolas, monospace; }
.ua-chks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.ua-chks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.ua-chks .todos { grid-column: 1 / -1; font-weight: 600; color: var(--accent); }
.ua-sec { border: 1px solid #dbe3f0; border-top: 3px solid var(--estral-orange, #f28c1e); border-radius: 8px; padding: 8px 10px; background: #fafcff; }
.ua-sec .ua-sec-t { font-weight: 700; color: #0b3d91; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid #e5eaf3; }
.ua-sec-items { display: flex; flex-direction: column; gap: 5px; padding-left: 18px; }
.ua-sec-items .ico { display: inline-flex; color: var(--estral-orange, #f28c1e); }
.ua-sec-items .ico svg { width: 14px; height: 14px; }
.ua-chks label:has(input:disabled) { opacity: .6; }
.note.ua-aviso { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; padding: 10px 14px; border-radius: var(--radius); }
/* Botón rojo dentro de los diálogos (Quitar acceso, Borrar…) */
.modal .mfoot button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.modal .mfoot button.danger:hover { background: #b91c1c; }

/* ── Pistas visuales: dónde se puede buscar, filtrar o picar ── */
.lkw:not(.plain) input:not([readonly]) { border-color: #b9cbef !important; }
input.buscable {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b6fd8' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 7px center !important; background-size: 14px !important;
  padding-right: 26px !important; border-color: #b9cbef !important;
}
.lkw input:not([readonly]):hover, input.buscable:hover { border-color: var(--accent) !important; }
.lkw button.lk-find { display: inline-flex; align-items: center; white-space: nowrap; flex: none; width: auto; min-width: 26px; height: 26px; padding: 0 6px; gap: 4px; color: var(--accent); font-size: 12px; font-weight: 600; }
.lkw button.lk-find:hover { background: var(--accent-soft); }
.lkw button.est-btn { background: var(--accent-soft); border: 1px solid #c3d3f2; }
.lkw button.lk-find .icon { width: 14px; height: 14px; }
.panels.locked .lkw button.est-btn { visibility: visible; }
label.lk { text-decoration: underline dotted #9fb5e3; text-underline-offset: 3px; }
.grid thead tr.frow th { background: #f1f5fd; }
.grid thead tr.frow input { border: 1px solid #d3def4; border-radius: 4px; margin: 3px 0; background: #fff; }
.grid thead tr.frow th.fico { text-align: center; color: var(--accent); }
.grid thead tr.frow th.fico .icon { width: 15px; height: 15px; vertical-align: middle; }
.ibig.lbl { width: auto; padding: 0 12px; display: inline-flex; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.ibtn.lbl { gap: 5px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); }
.ibtn.tgl { font-size: 12px; letter-spacing: normal; color: var(--accent); }
.qtools .hint { color: var(--ink-mute); font-size: 12px; margin-left: 8px; }
.grid.click tbody tr:hover { background: #e3ecfb; }

/* ── Barra lateral: secciones una tras otra y colores Estral (azul y naranja) ── */
:root { --estral-orange: #f28c1e; --estral-orange-soft: #fff3e6; }
#sidebar { overflow-y: auto; }
.side-sec.open, .side-sec.open .side-body { flex: none; }
.side-sec > .side-head { color: var(--accent); font-weight: 700; font-size: 11.5px; }
.side-sec > .side-head::before { color: var(--estral-orange); font-weight: 700; }
.side-sec > .side-head:hover { background: var(--estral-orange-soft); color: var(--accent); }
.side-sec.open > .side-head { color: var(--accent); }
.side-sec.open > .side-head::before { color: var(--estral-orange); }
.side-link { color: var(--ink); font-weight: 500; }
/* Cada sección con su color, para distinguirlas (Órdenes de Trabajo en el azul de Estral) */
#sidebar .side-sec { --sec: #003cb3; --sec-soft: #eaf0fb; --sec-line: #c9d7f3; }
#sidebar .side-sec[data-sec="Planificación"] { --sec: #0f766e; --sec-soft: #e6f6f4; --sec-line: #b5e3dc; }
#sidebar .side-sec[data-sec="Refacciones"] { --sec: #6d28d9; --sec-soft: #f1ebfd; --sec-line: #d9c9f7; }
#sidebar .side-sec[data-sec="Seguridad"] { --sec: #dc2626; --sec-soft: #fdecec; --sec-line: #f6c4c4; }
#sidebar .side-sec[data-sec="Utilerías"] { --sec: #475569; --sec-soft: #f1f4f8; --sec-line: #d5dce6; }
#sidebar .side-sec > .side-head::before { color: var(--sec); }
#sidebar .side-sec > .side-head:hover { background: var(--sec-soft); }
.side-link .ico { background: var(--sec-soft); border-color: var(--sec-line); color: var(--sec); }
.side-link:hover { background: var(--sec-soft); color: var(--accent); }
.side-link:hover .ico { background: #fff; border-color: var(--sec-line); color: var(--sec); }
.side-link.on { background: var(--accent); color: #fff; font-weight: 600; }
.side-link.on .ico { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; }

/* ── Campana de solicitudes pendientes (barra superior) ── */
.mb-bell { position: relative; margin-right: 6px; }
.mb-bell > .bell-btn { position: relative; width: 38px; height: 34px; justify-content: center; padding: 0; border-radius: 50%; color: var(--accent); }
.mb-bell > .bell-btn .icon { width: 20px; height: 20px; }
.mb-bell > .bell-btn:hover, .mb-bell.open > .bell-btn { background: var(--estral-orange-soft); box-shadow: none; color: var(--accent); }
.bell-badge { position: absolute; top: 1px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--estral-orange); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.mb-bell.ring > .bell-btn .icon { animation: bell-ring 1s ease-in-out 3; transform-origin: 50% 10%; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(18deg); } 30% { transform: rotate(-16deg); } 45% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 75% { transform: rotate(4deg); } }
.mb-drop.bell-panel { left: auto; right: 0; width: 290px; padding: 14px 16px; border-top: 3px solid var(--estral-orange); }
.bell-title { font-weight: 700; color: var(--accent); font-size: 13.5px; margin-bottom: 6px; }
.bell-n { color: var(--ink-soft); margin-bottom: 12px; }
.bell-n b { color: var(--estral-orange); font-size: 18px; margin-left: 2px; }
.mb-drop .bell-open { justify-content: center; background: var(--accent); color: #fff; font-weight: 600; padding: 8px 10px; }
.mb-drop .bell-open:hover { background: var(--accent-hover); color: #fff; }
.mb-drop .bell-open .icon { color: #fff; }
.bell-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--ink-soft); }
.bell-opts label { display: flex; align-items: center; gap: 6px; }
.bell-opts input[type=number] { padding: 3px 6px; }

/* ── Panel de Mantenimiento colorido ── */
#home { background: #f4f6fb; }
.h-head { display: flex; align-items: center; gap: 12px; }
.h-badge { background: #e8eefb; color: var(--accent); border: 1px solid #c9d7f3; border-radius: 99px; padding: 2px 10px; font-size: 11.5px; font-weight: 600; }
.h-upd { color: var(--accent); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.h-upd .icon { color: var(--estral-orange); width: 14px; height: 14px; }
.kpis2 { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi2 { --c: var(--accent); --cs: #e8eefb; background: #fff; border-radius: 12px; border: 1px solid var(--line); border-top: 4px solid var(--c); padding: 14px 16px 16px; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s; }
.kpi2:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi2.k-azul { --c: #0b3d91; --cs: #e6edf9; }
.kpi2.k-naranja { --c: #f28c1e; --cs: #fff1e0; }
.kpi2.k-rojo { --c: #e11d48; --cs: #ffe4ea; }
.kpi2.k-verde { --c: #059669; --cs: #dcf7ec; }
.kpi2.k-morado { --c: #4f46e5; --cs: #e8e7fd; }
.k-top { display: flex; justify-content: space-between; align-items: center; }
.k-lab { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.k-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--cs); color: var(--c); }
.k-ico .icon { width: 15px; height: 15px; }
.k-mid { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 2px; }
.k-n { font-size: 30px; font-weight: 800; color: var(--c); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi2.k-azul .k-n { color: #111827; }
.k-pill { background: var(--cs); color: var(--c); font-size: 11px; font-weight: 700; border-radius: 99px; padding: 3px 9px; white-space: nowrap; }
.k-sub { font-size: 11.5px; color: var(--ink-mute); margin-bottom: 8px; }
.k-bar { height: 6px; border-radius: 99px; background: #eef0f4; overflow: hidden; }
.k-bar i { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.home-cols { grid-template-columns: 340px 1fr; align-items: start; }
.card2 { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-sm); }
.c-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card2 h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.card2 h3 .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; }
.c-sub { color: var(--ink-mute); font-size: 12px; margin: 4px 0 14px; }
.c-tag { background: #eef1f6; color: var(--ink-soft); border-radius: 6px; padding: 3px 8px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.c-tag.rojo { background: #ffe4ea; color: #e11d48; border-radius: 99px; margin-left: 4px; }
.c-tag.fuerte { background: #fff; border: 1px solid var(--line); color: var(--accent); font-weight: 700; }
.e-row { padding: 5px 4px; border-radius: 8px; cursor: pointer; }
.e-row:hover { background: #f5f7fc; }
.e-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.e-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.e-name { flex: 1; color: var(--ink-soft); }
.e-top b { font-variant-numeric: tabular-nums; }
.e-top small { width: 42px; text-align: right; color: var(--ink-mute); font-size: 11px; }
.e-bar { height: 7px; border-radius: 99px; background: #eef0f4; overflow: hidden; }
.e-bar i { display: block; height: 100%; border-radius: 99px; min-width: 6px; }
.c-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--ink-soft); font-size: 12px; }
.u-tools { display: flex; gap: 6px; align-items: center; }
.u-buscar { width: 220px; padding: 6px 10px 6px 30px !important; border-radius: 8px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 9px center / 14px; }
.u-fil { width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 8px; display: grid; place-items: center; color: var(--ink-soft); }
.u-fil:hover { color: var(--accent); border-color: #b3c7ee; }
.u-wrap { border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.u-tab { width: 100%; border-collapse: collapse; }
.u-tab th { background: #f5f7fb; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); padding: 10px 12px; }
.u-tab td { padding: 10px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.u-tab tbody tr { cursor: pointer; }
.u-tab tbody tr:hover { background: #f2f6fd; }
.u-id { font-weight: 700; color: #0b3d91; }
.u-eq { font-family: Consolas, "Cascadia Mono", monospace; font-size: 11.5px; color: var(--ink-soft); }
.u-sin { font-family: inherit; color: var(--ink-mute); }
.u-tab th:last-child, .u-tab td.c { text-align: center; }
.pill2 { display: inline-block; border: 1px solid transparent; border-radius: 99px; padding: 2px 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.u-pie { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--ink-mute); font-size: 12px; }
.u-pgs { display: flex; gap: 4px; }
.u-pg { min-width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 12px; color: var(--ink-soft); }
.u-pg.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.u-pg:disabled { opacity: .4; }
.kpi2.k-verde.baja .k-pill { background: #ffe4ea; color: #e11d48; }
.u-sin { font-family: "Segoe UI", system-ui, sans-serif; font-size: 12px; }

/* ── Pantallas de captura con color: fondo azul grisáceo, tarjetas blancas y botones con ícono de color ── */
.mdi-body { background: #e9eff7; }
.toolbar { box-shadow: 0 1px 0 #dbe3ef; }
.toolbar button { border-color: #d3dceb; }
.toolbar button.tb-primary .icon { color: var(--estral-orange); }
.toolbar button.tb-primary:hover:not(:disabled) .icon { color: var(--estral-orange); }
.toolbar button.tb-new .icon { color: #16a34a; }
.toolbar button.tb-danger .icon { color: #dc2626; }
.toolbar button.tb-dup .icon { color: #0b3d91; }
.toolbar button.tb-undo .icon { color: var(--estral-orange); }
.toolbar button:not(.tb-primary):not(.tb-new):not(.tb-danger):not(.tb-undo) .icon { color: #0b3d91; }
.toolbar button.tb-new:hover:not(:disabled) { background: #ecfdf3; border-color: #a7e3bd; color: #166534; }
.toolbar button.tb-new:hover:not(:disabled) .icon { color: #16a34a; }
.toolbar button.tb-undo:hover:not(:disabled) { background: var(--estral-orange-soft); border-color: #f7c48c; color: #9a4b00; }
.toolbar button.tb-undo:hover:not(:disabled) .icon { color: var(--estral-orange); }
.toolbar button:not(.tb-primary):not(.tb-new):not(.tb-danger):not(.tb-undo):hover:not(:disabled) { background: #eaf1fc; border-color: #b9cdf0; color: #0b3d91; }
.rec-head { border-color: #d3dceb; border-left: 4px solid var(--estral-orange); }
.rec-head > div:first-child { color: #0b3d91; font-weight: 750; }
.rec-head > div:last-child { border: 1px solid #b9cdf0; }
/* Pestañas y contenido en una sola tarjeta blanca */
.tabs.f-tabs { background: #fff; margin: 12px 14px 0; padding: 4px 10px 0; border: 1px solid #d3dceb; border-bottom: 1px solid #e3e9f2; border-radius: 12px 12px 0 0; }
.tabs.f-tabs button { color: #475467; }
.tabs.f-tabs button:hover { color: #0b3d91; background: #f1f5fc; }
.tabs.f-tabs button.on { color: #0b3d91; border-bottom: 3px solid var(--estral-orange); background: #f6f9ff; }
.panels.f-panels { background: #fff; margin: 0 14px 12px; border: 1px solid #d3dceb; border-top: 0; border-radius: 0 0 12px 12px; box-shadow: 0 2px 6px rgba(16,24,40,.05); }
.f-panels fieldset, .f-panels .lbox { border-color: #d9e2ef; background: #fbfcfe; }
.f-panels legend { color: #0b3d91; font-weight: 650; }
/* Campos: borde más visible y foco azul */
.f-panels input:not([type=checkbox]):not([readonly]), .f-panels select, .f-panels textarea { border-color: #c4cfdf; }
.f-panels input:not([type=checkbox]):focus, .f-panels select:focus, .f-panels textarea:focus { outline: none; border-color: #0b3d91; box-shadow: 0 0 0 3px rgba(11,61,145,.15); }
.navbar { background: #fff; border-top: 1px solid #d3dceb; }
/* Menú superior: la sección abierta queda subrayada en naranja */
.mb-item.cur > button { color: #0b3d91; font-weight: 650; box-shadow: inset 0 -3px 0 var(--estral-orange); border-radius: 6px 6px 0 0; }

/* ── Solicitud de trabajo desde la pantalla de acceso ── */
.login-sol { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-strong); display: flex; flex-direction: column; gap: 8px; }
.login-sol span { font-size: 12px; color: var(--ink-mute); }
.login .sol-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--estral-orange); background: var(--estral-orange-soft); color: #9a4b00; font-weight: 650; font-size: 14px; cursor: pointer; }
.login .sol-btn .icon { color: var(--estral-orange); width: 18px; height: 18px; }
.login .sol-btn:hover { background: var(--estral-orange); color: #fff; }
.login .sol-btn:hover .icon { color: #fff; }
.login-right.sol-on { display: block; overflow: auto; padding: 28px 32px; background: #e9eff7; }
.sol-card { max-width: 980px; margin: 0 auto; background: #fff; border: 1px solid #d3dceb; border-top: 4px solid var(--estral-orange); border-radius: 14px;
  box-shadow: 0 6px 24px rgba(16,24,40,.08); padding: 24px 28px; display: flex; flex-direction: column; gap: 14px; user-select: text; }
.sol-top { display: flex; gap: 14px; align-items: center; }
.sol-top h2 { margin: 0; color: #0b3d91; font-size: 22px; }
.sol-top p { margin: 4px 0 0; color: var(--ink-mute); }
.sol-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--estral-orange-soft); color: var(--estral-orange); }
.sol-ico .icon { width: 24px; height: 24px; }
.login .sol-lab { font-size: 12px; max-width: 420px; }
.sol-row { display: flex; gap: 8px; }
.login input.sol-num { flex: 1; font-size: 20px; padding: 10px 14px; letter-spacing: .04em; }
.login .sol-go { display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; border: 0; border-radius: var(--radius-sm); background: #0b3d91; color: #fff; font-weight: 650; font-size: 14px; cursor: pointer; }
.login .sol-go:disabled { opacity: .5; cursor: default; }
.login .sol-go.verde { background: #16a34a; }
.login .sol-go.verde:hover:not(:disabled) { background: #15803d; }
.login .sol-go .icon { color: #fff; }
.sol-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: #0b3d91; cursor: pointer; font-size: 13px; padding: 4px 2px; align-self: flex-start; }
.sol-link:hover { text-decoration: underline; }
.sol-link .icon { width: 14px; height: 14px; color: var(--estral-orange); }
.sol-hint { font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.sol-emps { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.sol-emp { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border: 1px solid #d3dceb; border-radius: 10px; background: #f8fbff; cursor: pointer; text-align: left; }
.sol-emp:hover { border-color: #0b3d91; background: #eef4ff; }
.sol-emp small { color: var(--ink-mute); }
.sol-quien { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #e3e9f2; }
.sol-quien > div { flex: 1; display: flex; flex-direction: column; }
.sol-quien b { font-size: 16px; color: #0b3d91; }
.sol-quien small { color: var(--ink-mute); }
.sol-planta { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: #fff3e4; color: #9a5208; border: 1px solid #f6c48a; font-weight: 600; font-size: 13px; white-space: nowrap; }
.sol-planta svg { width: 15px; height: 15px; }
.mb-planta { margin-right: 6px; }
.ua-nota { font-size: 12px; color: var(--ink-mute); margin-top: 4px; }
.ua-todas { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 600; }
.mb-planta select { border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; padding: 0 2px; cursor: pointer; outline: none; }
.sol-quien .av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #0b3d91; color: #fff; font-weight: 700; font-size: 18px; }
.sol-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e3e9f2; }
.sol-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; background: none; border: 0; border-bottom: 3px solid transparent; color: #475467; font-weight: 600; cursor: pointer; }
.sol-tab .icon { width: 16px; height: 16px; color: var(--estral-orange); }
.sol-tab.on { color: #0b3d91; border-bottom-color: var(--estral-orange); background: #f6f9ff; }
.sol-sec { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #0b3d91; margin-top: 6px; padding-bottom: 4px; border-bottom: 1px solid #e3e9f2; }
.sol-form { display: flex; flex-direction: column; gap: 10px; }
.sol-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.login .sol-f { font-size: 12px; }
.sol-f i { color: #dc2626; font-style: normal; }
.sol-f.span2 { grid-column: span 2; }
.sol-f.span3 { grid-column: 1 / -1; }
.login .sol-form input, .login .sol-form select, .login .sol-form textarea { padding: 8px 10px; border: 1px solid #c4cfdf; border-radius: var(--radius-sm); font-size: 13.5px; font-family: inherit; background: #fff; }
.login .sol-form textarea { resize: vertical; }
.login .sol-form input:focus, .login .sol-form select:focus, .login .sol-form textarea:focus { outline: none; border-color: #0b3d91; box-shadow: 0 0 0 3px rgba(11,61,145,.15); }
.sol-tel { display: grid; grid-template-columns: 1fr 90px; gap: 10px; }
.sol-acc { display: flex; justify-content: flex-end; padding-top: 6px; }
.sol-chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sol-chip { padding: 6px 12px; border: 1px solid #d3dceb; border-radius: 99px; background: #fff; cursor: pointer; color: #475467; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.sol-chip b { background: #eef2f8; border-radius: 99px; padding: 0 7px; font-size: 11px; }
.sol-chip.on { background: #0b3d91; border-color: #0b3d91; color: #fff; }
.sol-chip.on b { background: var(--estral-orange); color: #fff; }
.sol-chips .sol-link { margin-left: auto; align-self: center; }
.sol-tabla { overflow: auto; border: 1px solid #e3e9f2; border-radius: 10px; margin-top: 8px; }
.sol-tabla table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sol-tabla th { background: #f4f7fc; color: #475467; text-align: left; padding: 8px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.sol-tabla td { padding: 8px 10px; border-top: 1px solid #eef2f8; vertical-align: top; }
.sol-tabla td.n { font-weight: 700; color: #0b3d91; }
.sol-tabla td.mono { font-family: Consolas, monospace; font-size: 12px; }
.sol-tabla td.sol-asunto { min-width: 200px; }
.pill2.sol-env { background: var(--estral-orange-soft); color: #9a4b00; border-color: #f7c48c; }
.pill2.sol-errp { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.sol-card { width: 100%; box-sizing: border-box; }
.sol-card > *, .sol-body { min-width: 0; }
.sol-tabla td.mono { white-space: nowrap; }

/* ───────── Seguridad: mantenimiento autónomo ───────── */
.seg-win { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.seg-head { display: flex; align-items: center; gap: 14px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); }
.seg-head h2 { margin: 0; font-size: 16px; flex: 1; }
.seg-cod { font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 10px; border-radius: 99px; font-size: 12px; }
.seg-area { color: var(--ink-soft); font-weight: 600; }
.seg-hoja { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }
.seg-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg-bar > label { font-weight: 600; color: var(--ink-soft); }
.seg-bar input, .seg-bar select { padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.seg-sem { color: var(--ink); }
.seg-estado { margin-left: auto; font-size: 12px; color: var(--ink-mute); }
.seg-estado.ok { color: var(--ok); }
.seg-estado.sucio { color: var(--warn); font-weight: 600; }
.seg-ots { font-size: 12px; font-weight: 600; color: var(--accent); }
.seg-leyenda { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); flex-wrap: wrap; }
.seg-leyenda .seg-c { display: inline-block; min-width: 28px; text-align: center; border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 4px; margin-left: 8px; }
.seg-leyenda em { margin-left: 14px; color: var(--ink-mute); }
.seg-wrap { flex: 1; min-height: 160px; overflow: auto; background: var(--surface); }
.seg-wrap-horo { flex: none; min-height: 0; }
table.seg-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; }
.seg-grid th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft); padding: 4px 2px; font-weight: 600; color: var(--ink-soft); text-align: center; }
.seg-grid thead tr:nth-child(2) th { top: 27px; }
.seg-grid th.seg-act { text-align: left; padding-left: 10px; min-width: 300px; }
.seg-grid th.seg-dia { border-right: 2px solid var(--line-strong); }
.seg-grid th.seg-dia small { display: block; font-weight: 400; color: var(--ink-mute); font-size: 10px; }
.seg-grid th.seg-tur { cursor: pointer; font-size: 11px; width: 30px; }
.seg-grid th.seg-tur:nth-child(3n) { border-right: 2px solid var(--line-strong); }
.seg-grid th.seg-tur:hover { background: var(--accent-soft); color: var(--accent); }
.seg-grid th.hoy { background: var(--accent-soft); color: var(--accent); }
.seg-grid td { border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); }
.seg-grid td.seg-act { padding: 4px 10px; white-space: normal; line-height: 1.3; min-width: 300px; max-width: 420px; }
.seg-grid td.seg-act.sub { padding-left: 26px; color: var(--ink-soft); }
.seg-grid tr.seg-sec td { background: var(--accent); color: #fff; font-weight: 700; padding: 4px 10px; text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
.seg-grid tr.seg-grp td { background: var(--surface-2); font-weight: 600; padding: 4px 10px; }
.seg-grid td.seg-c { cursor: pointer; text-align: center; font-weight: 700; height: 26px; width: 30px; font-size: 12px; }
.seg-grid td.seg-c:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.seg-grid td[data-fin] { border-right: 2px solid var(--line-strong); }
.seg-grid td.seg-c.hoy:not([class*="v-"]) { background: #f5f8ff; }
.seg-c.v-OK { background: #dcfce7; color: #15803d; }
.seg-c.v-X { background: #fee2e2; color: #b91c1c; }
.seg-c.v-NT { background: #e5e7eb; color: #374151; font-size: 10px !important; }
.seg-c.v-NA { background: #fef9c3; color: #854d0e; font-size: 10px !important; }
.seg-horo td.seg-in { padding: 1px; }
.seg-horo td.seg-in:nth-child(3n+1) { border-right: 2px solid var(--line-strong); }
.seg-horo input { width: 100%; min-width: 0; border: 1px solid transparent; padding: 2px; font-size: 11px; text-align: center; background: transparent; }
.seg-horo input:focus { border-color: var(--accent); background: #fff; outline: none; }
.seg-horo td.seg-act { font-weight: 600; }
.seg-obs { display: flex; gap: 8px; align-items: flex-start; }
.seg-obs label { font-weight: 600; color: var(--ink-soft); padding-top: 4px; }
.seg-obs textarea { flex: 1; resize: vertical; }
.seg-grid td.seg-c, .seg-grid th.seg-tur { user-select: none; }
.seg-info { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 8px; }
.seg-imp, .seg-notas { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; line-height: 1.5; }
.seg-imp { border-left: 4px solid var(--warn); }
.seg-imp ul, .seg-notas ul { margin: 6px 0 0 18px; padding: 0; }
.grid td.seg-okn { color: var(--ok); font-weight: 700; }
.grid td.seg-xn { color: var(--danger); font-weight: 700; }

/* Pantalla de acceso: tarjetas de mantenimiento autónomo y hoja del operador */
.aut-home { width: min(860px, 92%); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.aut-logo { width: 220px; opacity: .14; }
.aut-tit { text-align: center; }
.aut-tit h2 { margin: 0; color: #0b3d91; font-size: 24px; }
.aut-tit p { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; }
.aut-cards { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.aut-card { display: flex; align-items: center; gap: 14px; padding: 20px 18px; background: #fff; border: 1px solid #d3dceb; border-left: 5px solid #0b3d91;
  border-radius: 14px; box-shadow: 0 4px 16px rgba(16,24,40,.07); cursor: pointer; text-align: left; transition: transform .12s, box-shadow .12s, border-color .12s; }
.aut-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(16,24,40,.13); border-left-color: var(--estral-orange); }
.aut-ico { width: 52px; height: 52px; flex: none; border-radius: 12px; display: grid; place-items: center; background: #eef4ff; color: #0b3d91; }
.aut-ico .icon { width: 26px; height: 26px; }
.aut-txt { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.aut-txt b { font-size: 16px; color: #0b2a66; }
.aut-txt small { color: var(--ink-mute); font-size: 12px; }
.aut-go .icon { width: 18px; height: 18px; color: var(--estral-orange); }
.sol-card.aut-card-wide { max-width: none; }
.aut-hoja { display: flex; flex-direction: column; gap: 10px; }
.aut-hoja .seg-bar .btn { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
.aut-hoja .seg-bar input, .aut-hoja .seg-bar select { padding: 7px 10px; font-size: 13.5px; }
.aut-eq { width: 460px; max-width: 100%; }
.aut-wrap { flex: none; max-height: none; overflow-x: auto; border: 1px solid #e3e9f2; border-radius: 10px; }
.aut-hoja .seg-wrap-horo { border: 1px solid #e3e9f2; border-radius: 10px; overflow-x: auto; }
.aut-hoja .seg-grid td.seg-c { height: 30px; }
.aut-acc { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.aut-acc .seg-ots { margin-right: auto; }
.login .sol-go.naranja { background: var(--estral-orange); }
.login .sol-go.gris { background: #fff; color: #0b3d91; border: 1px solid #c4cfdf; }
.login .sol-go.gris .icon { color: #0b3d91; }
.aut-cuerpo { min-width: 0; }
.sol-tabla tr.aut-fila { cursor: pointer; }
.sol-tabla tr.aut-fila:hover td { background: #f2f6fd; }
.sol-tabla td.seg-okn { color: var(--ok); font-weight: 700; }
.sol-tabla td.seg-xn { color: var(--danger); font-weight: 700; }
.seg-grid td.seg-c.ro, .seg-grid th.seg-tur.ro { cursor: default; }
.seg-grid td.seg-c.ro:hover { box-shadow: none; }
.aut-ver { width: min(1500px, 90vw); display: flex; flex-direction: column; gap: 8px; white-space: normal; }
.aut-ver .seg-wrap { max-height: 56vh; }
.aut-ver-datos { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; }
.seg-grid tr.seg-horo td.seg-in { padding: 1px; }
.seg-grid tr.seg-horo input { width: 100%; min-width: 0; border: 1px solid transparent; padding: 2px 1px; font-size: 10.5px; text-align: center; background: transparent; }
.seg-grid tr.seg-horo input[type=time] { font-size: 9.5px; }
.seg-grid tr.seg-horo input:focus { border-color: var(--accent); background: #fff; outline: none; }
.seg-grid tr.seg-horo td.seg-act { font-weight: 600; }
.seg-grid tr.seg-horo input::placeholder { color: #c3cad5; font-size: 9px; }

/* Mantenimiento autónomo: lo guardado queda bloqueado; los cambios llevan motivo */
.seg-grid td.seg-c.lock { cursor: help; }
.seg-grid td.seg-c.lock:hover { box-shadow: inset 0 0 0 2px var(--estral-orange); }
.seg-grid td.seg-in.lock input { color: #334155; cursor: help; }
.seg-grid td.cambio { position: relative; }
.seg-grid td.cambio::after { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 9px 9px 0; border-color: transparent var(--estral-orange) transparent transparent; }
.seg-ley-cambio { position: relative; width: 28px; height: 18px; background: #fff; }
.seg-ley-cambio::after { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 9px 9px 0; border-color: transparent var(--estral-orange) transparent transparent; }
.seg-cambio { width: 520px; display: flex; flex-direction: column; gap: 10px; white-space: normal; }
.seg-cambio-et { font-weight: 600; color: #0b2a66; background: #eef4ff; border-radius: 8px; padding: 8px 10px; }
.seg-cambio-lbl { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.seg-cambio-nota { font-size: 12px; color: var(--ink-mute); }
.seg-cambio textarea { font-family: inherit; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); resize: vertical; }
.seg-opcs { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-opc { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 99px; background: #fff; cursor: pointer; font-weight: 600; }
.seg-opc.on { box-shadow: 0 0 0 2px var(--accent); }
.seg-opc.v-OK { background: #dcfce7; color: #15803d; } .seg-opc.v-X { background: #fee2e2; color: #b91c1c; }
.seg-opc.v-NT { background: #e5e7eb; color: #374151; } .seg-opc.v-NA { background: #fef9c3; color: #854d0e; }
.seg-cambios { border: 1px solid #f7c48c; border-radius: 10px; overflow: hidden; }
.seg-cambios-tit { background: var(--estral-orange-soft); color: #9a4b00; font-weight: 700; padding: 6px 10px; }
.seg-cambios table { width: 100%; border-collapse: collapse; font-size: 12px; }
.seg-cambios th { text-align: left; background: #fafafa; padding: 5px 8px; color: var(--ink-soft); }
.seg-cambios td { padding: 5px 8px; border-top: 1px solid #f1f1f1; vertical-align: top; }
.seg-cambios td.c { text-align: center; font-weight: 700; }
.seg-cambios td.mot { white-space: normal; min-width: 220px; }
.grid td.seg-cambn { color: #c2410c; font-weight: 700; }

/* ── Acceso más amigable: saludo, conexión, tarjeta de falla y teclado numérico ── */
.aut-home { gap: 18px; }
.aut-hero { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: #fff; border: 1px solid #d3dceb; border-radius: 14px; box-shadow: var(--shadow-sm); }
.aut-hero .aut-logo { width: 92px; opacity: 1; }
.aut-hero-t { flex: 1; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); padding-left: 14px; }
.aut-hero-t b { font-size: 20px; color: #0b2a66; }
.aut-hero-t small { color: var(--ink-mute); font-size: 12.5px; }
.con-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef1f6; color: var(--ink-soft); white-space: nowrap; }
.con-pill .icon { width: 15px; height: 15px; }
.con-pill.ok { background: #dcf7ec; color: #047857; }
.con-pill.mal { background: #ffe4ea; color: #be123c; }
.con-pill.sin { background: #fff3e6; color: #b45309; }
.aut-falla { width: 100%; display: flex; align-items: center; gap: 16px; padding: 20px 22px; border: 0; border-radius: 14px; background: var(--estral-orange); color: #fff;
  text-align: left; cursor: pointer; box-shadow: 0 6px 18px rgba(242,140,30,.28); transition: transform .12s, box-shadow .12s; }
.aut-falla:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(242,140,30,.36); }
.aut-falla .aut-ico { background: rgba(255,255,255,.2); color: #fff; }
.aut-falla .aut-txt b { color: #fff; font-size: 18px; }
.aut-falla .aut-txt small { color: rgba(255,255,255,.9); font-size: 13px; }
.aut-falla .aut-go .icon { color: #fff; }
.aut-tit { width: 100%; text-align: left; margin-top: 4px; }
.aut-tit h2 { font-size: 18px; }
.aut-tit p { font-size: 13px; }
.aut-card { border-radius: 14px; transition: transform .12s, box-shadow .12s, border-color .12s; }
.teclado { display: grid; grid-template-columns: repeat(3, 76px); gap: 8px; margin: 2px 0 4px; }
.tecla { height: 52px; border: 1px solid #d3dceb; border-radius: 10px; background: #fff; font-size: 20px; font-weight: 600; color: #0b2a66; cursor: pointer;
  display: grid; place-items: center; font-family: inherit; transition: background .1s, transform .05s; }
.tecla:hover { background: #eef4ff; }
.tecla:active { transform: scale(.96); }
.tecla .icon { width: 22px; height: 22px; }
.tecla.gris { background: #f4f6fa; color: var(--ink-soft); }
.tecla.ir { background: #0b3d91; border-color: #0b3d91; color: #fff; font-size: 13px; }
.tecla.ir:hover { background: #002f8c; }

/* ── Tablero: columna izquierda, gráfica de la semana y chips de filtro ── */
.h-izq { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.s-ley { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-mute); }
.s-ley i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.s-ley i.cr, .s-barras i.cr { background: #0b3d91; }
.s-ley i.te, .s-barras i.te { background: #10b981; }
.s-graf { display: flex; gap: 6px; align-items: flex-end; height: 120px; margin-top: 14px; padding-bottom: 2px; border-bottom: 1px solid var(--line-soft); }
.s-dia { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.s-barras { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.s-barras i { width: 40%; max-width: 14px; min-height: 2px; border-radius: 4px 4px 0 0; }
.s-dia small { font-size: 10.5px; color: var(--ink-mute); }
.s-mias { margin-top: 12px; padding: 9px 12px; border-radius: 10px; background: #e8eefb; color: var(--accent); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.s-mias .icon { width: 16px; height: 16px; }
.u-chips { display: flex; gap: 6px; margin: -4px 0 12px; }
.u-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 600; cursor: pointer; }
.u-chip small { background: #eef1f6; border-radius: 99px; padding: 0 7px; font-size: 11px; }
.u-chip:hover { border-color: #b3c7ee; color: var(--accent); }
.u-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.u-chip.on small { background: rgba(255,255,255,.22); color: #fff; }
.u-tab tbody tr:nth-child(even) { background: #fafbfd; }
.u-tab tbody tr:hover { background: #f2f6fd; }
.ua-borra { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 1px 8px; border-radius: 99px; background: #ffe4ea; color: #be123c; font-size: 11px; font-weight: 600; }
.ua-borra .icon { width: 12px; height: 12px; }

/* ── Solicitudes pendientes: campana con lista, aviso grande y apartado para escoger ── */
.mb-drop.bell-panel { width: 360px; }
.bell-n small { color: var(--ink-mute); font-weight: 400; }
.bell-lista { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px; max-height: 330px; overflow: auto; }
.bell-sol { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-family: inherit; }
.bell-sol:hover { border-color: #b3c7ee; background: #f5f8ff; }
.bell-sol small { color: var(--ink-mute); font-size: 11.5px; }
.bs-top { display: flex; align-items: center; gap: 8px; }
.bs-top b { color: var(--accent); }
.bs-top small { margin-left: auto; color: var(--ink-mute); font-size: 11.5px; }
.bs-desc { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-drop .bell-uno { width: 100%; margin-top: 6px; justify-content: center; }
.sp-urg { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: #eef1f6; color: var(--ink-soft); }
.sp-urg.u-alta { background: #ffe4ea; color: #be123c; }
.sp-urg.u-media { background: #fff3e6; color: #b45309; }
.sp-urg.u-baja { background: #dcf7ec; color: #047857; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(18deg); } 40% { transform: rotate(-16deg); } 60% { transform: rotate(10deg); } 80% { transform: rotate(-6deg); } }
.sp-win { display: flex; flex-direction: column; gap: 12px; }
.sp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sp-head h3 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.sp-head .u-buscar { width: 320px; }
.sp-win .u-chips { margin: 0; }
.sp-lista { display: flex; flex-direction: column; gap: 8px; }
.sp-fila { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 10px; cursor: default; }
.sp-fila:hover { border-color: #b3c7ee; box-shadow: var(--shadow-sm); }
.sp-fila.nueva { border-left-color: var(--estral-orange); background: #fffaf3; }
.sp-ot { width: 92px; flex: none; display: flex; flex-direction: column; gap: 2px; }
.sp-ot b { font-size: 16px; color: var(--accent); }
.sp-ot small { color: var(--ink-mute); font-size: 11.5px; }
.sp-nueva { align-self: flex-start; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--estral-orange); border-radius: 99px; padding: 1px 8px; }
.sp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sp-desc { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.sp-msg { font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-soft); }
.sp-meta span { display: inline-flex; align-items: center; gap: 4px; }
.sp-meta .icon { width: 13px; height: 13px; color: var(--ink-mute); }
.sp-gris { color: var(--ink-mute); font-style: italic; }
.sp-atender { flex: none; }
.sp-vacio { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 40px; color: var(--ink-mute); font-size: 14px; }
.sp-vacio .icon { width: 20px; height: 20px; color: var(--ok); }
.mb-drop .bell-sol { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; text-align: left; height: auto; width: 100%; }
.mb-drop .bell-sol > * { text-align: left; }

/* ── Plan Maestro para auditoría: colores por cumplimiento, resumen y ficha de la OT ── */
.pmgrid td.pmcell { cursor: pointer; position: relative; }
/* Colores de los Estados de OT (vienen del catálogo en --pm-*; estos son los de respaldo) */
.pmgrid td.pmcell.done, .pmgrid td.pmcell.tarde { background: color-mix(in srgb, var(--pm-done, #8c8c8c) 50%, white); }
.pmgrid td.pmcell.tarde { box-shadow: inset 0 -4px 0 #f59e0b; }
.pmgrid td.pmcell.late { background: #f87171; }
.pmgrid td.pmcell.prog { background: color-mix(in srgb, var(--pm-prog, #00c000) 50%, white); }
.pmgrid td.pmcell.cancel { background: color-mix(in srgb, var(--pm-cancel, #00c0c0) 50%, white); }
.pmgrid td.pmcell:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.pmgrid .pm-n { position: absolute; right: 3px; top: 1px; font-size: 9.5px; font-weight: 700; color: #334155; }
.pm-resumen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.pm-resumen:empty { display: none; }
.pm-cumpl { display: flex; align-items: center; gap: 10px; margin-right: 8px; }
.pm-cumpl > span { font-weight: 600; color: var(--ink-soft); }
.pm-cumpl > b { font-size: 22px; color: #047857; }
.pm-cumpl small { color: var(--ink-mute); }
.pm-bar { width: 160px; height: 8px; border-radius: 99px; background: #fee2e2; overflow: hidden; display: flex; }
.pm-bar i { display: block; height: 100%; }
.pm-bar i.done { background: #10b981; } .pm-bar i.tarde { background: #f59e0b; }
.pm-ley { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-soft); }
.pm-ley i { width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 700; color: #111; border: 1px solid rgba(0,0,0,.08); }
.pm-ley.done i, .pm-ley.tarde i { background: color-mix(in srgb, var(--pm-done, #8c8c8c) 50%, white); }
.pm-ley.tarde i { box-shadow: inset 0 -3px 0 #f59e0b; } .pm-ley.late i { background: #f87171; }
.pm-ley.prog i { background: color-mix(in srgb, var(--pm-prog, #00c000) 50%, white); }
.pm-ley.cancel i { background: color-mix(in srgb, var(--pm-cancel, #00c0c0) 50%, white); }
.ficha-ot { font-size: 12.5px; color: var(--ink); }
.ficha-ot h3 { font-size: 13px; margin: 14px 0 6px; color: #1e3a8a; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.ficha-ot table { border-collapse: collapse; width: 100%; }
.ficha-ot .kv th { text-align: left; font-weight: 600; width: 16%; padding: 4px 8px; background: #f5f7fa; border: 1px solid var(--line); white-space: nowrap; }
.ficha-ot .kv td { padding: 4px 8px; border: 1px solid var(--line); }
.ficha-ot .g th { background: #eef2f7; border: 1px solid var(--line); padding: 4px 6px; text-align: left; }
.ficha-ot .g td { border: 1px solid var(--line); padding: 4px 6px; }
.ficha-ot pre { white-space: pre-wrap; font-family: inherit; margin: 2px 0; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fafbfc; }
.ficha-ot .firmas { display: none; }
.ficha-ot h4 { font-size: 12.5px; margin: 10px 0 4px; color: var(--ink-soft); }

/* ── Refacciones: almacén por planta, por pedir, necesidades del mes y descuento al terminar la OT ── */
.ref-win { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.ref-win .sp-head h3 .sol-planta { margin-left: 6px; font-size: 13px; }
.ref-resumen { display: flex; gap: 10px; flex-wrap: wrap; }
.ref-resumen:empty { display: none; }
.ref-kpi { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px; min-width: 150px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.ref-kpi small { color: var(--ink-mute); font-size: 11.5px; }
.ref-kpi b { font-size: 20px; color: var(--ink); }
.ref-kpi b.ok { color: #047857; } .ref-kpi b.bajo { color: #b45309; }
.ref-barra { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ref-barra .u-chips { margin: 0; }
.ref-tabla { flex: 1; min-height: 0; }
.ref-tabla td.ref-desc, .ref-cierre td.ref-desc { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-tabla td.ref-ex { font-weight: 700; }
.ref-tabla tr.ref-agotada td.ref-ex { color: #be123c; }
.ref-tabla tr.ref-bajo td.ref-ex { color: #b45309; }
.ref-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.ref-pill.ref-ok { background: #dcf7ec; color: #047857; } .ref-pill.ref-bajo { background: #fef3c7; color: #92400e; } .ref-pill.ref-agotada { background: #ffe4ea; color: #be123c; }
.ref-min { width: 76px; padding: 3px 6px !important; text-align: right; }
.ref-acc { white-space: nowrap; }
.ref-acc .ref-mov { padding: 2px 8px; font-size: 11.5px; margin-right: 3px; }
.ref-pie { display: flex; align-items: center; gap: 10px; color: var(--ink-mute); font-size: 12px; }
.ref-pedir { color: #be123c; }
.ref-cierre { width: 900px; }
.ref-cierre .u-buscar { width: 320px; }
.ref-cierre .ref-usa { width: 80px; text-align: right; }
.ref-cierre tr.sel td { background: #e8f5ee; }
.ref-cierre .ref-cero { color: #be123c; }

/* ───────── Seguridad e higiene ───────── */
.sh-raiz { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sh-raiz > .seg-win { flex: 1; min-height: 0; }
.sh-asistente { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.sh-cuerpo { flex: 1; min-height: 0; overflow: auto; }
.sh-pasos { display: flex; flex-wrap: wrap; gap: 4px; }
.sh-pas { padding: 4px 10px; border-radius: 99px; font-size: 12px; background: var(--surface-2); color: var(--ink-soft); }
.sh-pas.on { background: var(--accent); color: #fff; font-weight: 600; }
.sh-pas.ok { background: var(--accent-soft); color: var(--accent); }
.sh-paso { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.sh-paso h3 { margin: 0; font-size: 18px; }
.sh-paso h4 { margin: 8px 0 6px; font-size: 14px; color: var(--accent); }
.sh-paso > p { margin: -8px 0 0; color: var(--ink-soft); }
.sh-modal { border: 0; padding: 0; min-width: 640px; }
.sh-rej { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 14px; }
.sh-dos, .sh-grupos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.sh-campo { display: flex; flex-direction: column; gap: 4px; }
.sh-campo > span { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.sh-campo input, .sh-campo select, .sh-campo textarea, .sh-firmante input, .sh-eval textarea, .sh-opc input:not([type=checkbox]) { padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); width: 100%; font: inherit; }
.sh-pregunta { display: flex; gap: 14px; align-items: center; }
.sh-opciones { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; }
.sh-opc { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sh-opc > span { flex: 1; }
.sh-opc > input:not([type=checkbox]) { flex: 1; min-width: 80px; }
.sh-grupo { display: flex; flex-direction: column; gap: 3px; }
.sh-grupo-t { background: var(--accent); color: #fff; font-weight: 700; text-align: center; padding: 6px; border-radius: var(--radius-sm); }
.sh-sel { width: 100%; border-collapse: collapse; }
.sh-sel th { background: var(--accent); color: #fff; padding: 6px; }
.sh-sel td { border: 1px solid var(--line); padding: 6px 8px; cursor: pointer; }
.sh-sel td.c { text-align: center; font-weight: 700; width: 36px; }
.sh-sel tr:hover td { background: var(--surface-2); }
.sh-sel tr.on td { background: var(--accent-soft); font-weight: 600; }
.sh-nivel { font-weight: 600; }
.sh-matriz { border-collapse: collapse; width: 100%; }
.sh-matriz th { background: var(--surface-2); border: 1px solid var(--line); padding: 5px 8px; font-weight: 600; }
.sh-matriz td { border: 1px solid var(--line); padding: 6px; text-align: center; }
.sh-matriz td.on { outline: 3px solid var(--ink); outline-offset: -3px; font-weight: 700; }
.sh-enf { display: grid; grid-template-columns: 22px 1.4fr .7fr auto; gap: 10px; align-items: start; }
.sh-aviso { background: var(--accent); color: #fff; font-weight: 700; text-align: center; padding: 8px 12px; border-radius: var(--radius-sm); }
.sh-firmas { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; }
.sh-firmante { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sh-firmante small { color: var(--ink-mute); }
.sh-firma { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.sh-lienzo { width: 100%; max-width: 340px; aspect-ratio: 340 / 110; background: #fff; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); touch-action: none; cursor: crosshair; }
.sh-acc { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.sh-bts { white-space: nowrap; }
.gridbar button.sh-on { background: var(--accent); color: #fff; border-color: var(--accent); }
.sh-vencida { color: var(--danger); font-weight: 700; }
.sh-eval { width: 100%; }
.sh-eval td.c { text-align: center; }
.sh-tema { font-weight: 600; font-size: 11.5px; }
.sh-subir input { display: none; }
.sh-foto img { display: block; max-height: 70px; max-width: 120px; margin-top: 4px; border-radius: var(--radius-sm); }
.sh-foto.grande img { max-height: 200px; max-width: 320px; }
.sh-fotos { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-resultado { display: flex; gap: 28px; padding: 10px 14px; background: var(--accent-soft); border-radius: var(--radius-sm); }
.sh-dato small { color: var(--ink-soft); font-weight: 600; }
.sh-dato div { white-space: pre-wrap; }
.sh-dash { display: flex; flex-direction: column; gap: 12px; }
.sh-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.sh-kpi, .sh-graf { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.sh-kpi h4, .sh-graf h4 { margin: 0; font-size: 14px; }
.sh-kpi p, .sh-graf p { margin: 2px 0 8px; font-size: 12px; color: var(--ink-soft); }
.sh-kpi-n { font-size: 32px; font-weight: 700; }
.sh-kpi-d { display: flex; gap: 22px; }
.sh-kpi-d span { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-soft); }
.sh-kpi-d b { font-size: 16px; color: var(--ink); }
.sh-kpi small { display: block; margin-top: 6px; color: var(--ink-mute); }
.sh-grafs { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 12px; }
.sh-barra { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 44px; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.sh-barra:hover { background: var(--surface-2); }
.sh-barra .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-barra .b { height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; }
.sh-barra .b i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.sh-barra .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.sh-eval td { white-space: normal; overflow: visible; text-overflow: clip; vertical-align: top; }
.sh-eval td.c { vertical-align: middle; }

.sh-otbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 12px; }
.sh-otbar[hidden] { display: none; }
.sh-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.sh-seg button { border: 0; border-right: 1px solid var(--line); background: var(--surface); padding: 3px 10px; cursor: pointer; font: inherit; }
.sh-seg button:last-child { border-right: 0; }
.sh-seg button.on { background: var(--accent); color: #fff; font-weight: 600; }
.sh-otaviso { color: var(--danger); font-weight: 600; }
.bell-sol.sh-urg { border-left: 3px solid var(--danger); }
.sh-eval td.sh-tema { vertical-align: middle; background: var(--surface-2); border-right: 1px solid var(--line); }
.sh-link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; font-weight: 600; }
.sh-link:hover { text-decoration: underline; }
.sh-subir { display: inline-block; cursor: pointer; align-self: flex-start; }
.gridbar button.btn.primary, .sh-acc .btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.gridbar button.btn.primary:hover, .sh-acc .btn.primary:hover { background: var(--accent-hover); color: #fff; }
button.btn.primary .icon, .gridbar button.btn.primary .icon, .gridbar button.btn.primary:hover .icon { color: #fff; stroke: #fff; }
/* Botones dentro de filas y firmas: los mismos del ERP, compactos */
.sh-bts .btn, .sh-lista td .btn, .sh-firma .btn, .sh-eval .btn, .sh-foto .btn { min-width: 0; padding: 3px 10px; font-size: 12px; }
.sh-lista .grid td.sh-bts { white-space: nowrap; }
.sh-bts .btn + .btn { margin-left: 4px; }
/* Listas: el texto se ajusta a la ventana y la columna de botones siempre queda a la vista */
.sh-lista table.grid { width: 100%; min-width: 0; }
.sh-lista .grid td { white-space: normal; max-width: none; overflow: visible; overflow-wrap: break-word; }
.sh-lista .grid td:nth-child(1), .sh-lista .pill { white-space: nowrap; }
.sh-lista .grid th { white-space: normal; }
.sh-lista .grid td:last-child, .sh-lista .grid th:last-child { position: sticky; right: 0; z-index: 1; background: var(--surface); box-shadow: -1px 0 0 var(--line); }
.sh-lista .grid th:last-child { z-index: 2; background: var(--surface-2); }
.sh-lista .grid td.empty:last-child { position: static; box-shadow: none; }
/* Formulario de recorrido: la tabla se ajusta al ancho disponible */
table.grid.sh-eval { width: 100%; min-width: 0; }
.sh-eval th { white-space: normal; padding: 6px 8px; vertical-align: bottom; }
.sh-eval td { padding: 5px 8px; overflow-wrap: break-word; }
.sh-eval td.sh-tema { width: 14%; font-size: 11px; }
.sh-eval td.c { width: 62px; }
.sh-eval textarea { min-width: 0; box-sizing: border-box; display: block; }
.sh-eval td:last-child { width: 66px; }

/* ───────── Predictivos y check list ───────── */
.pc-tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; padding: 6px 2px; align-items: start; }
.pc-tarjeta { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--ok); border-radius: var(--radius); }
.pc-tarjeta.toca { border-top-color: var(--warn); }
.pc-tarjeta.vencido { border-top-color: var(--danger); }
.pc-t-cab { display: flex; align-items: center; gap: 8px; }
.pc-t-cab h3 { margin: 0; font-size: 16px; }
.pc-t-ico svg { width: 22px; height: 22px; }
.pc-t-lin { display: flex; flex-direction: column; gap: 3px; color: var(--ink-soft); }
.pc-t-acc { display: flex; gap: 8px; margin-top: 4px; }
.pc-t-acc .btn.primary { padding: 7px 22px; font-size: 14px; }
.pc-barra { flex-wrap: wrap; align-items: center; }
.pc-ayuda { padding: 2px 2px 8px; color: var(--ink-soft); font-size: 12px; }
.pc-tabla td { padding: 2px 4px; vertical-align: middle; }
.pc-tabla th { text-align: center; }
.pc-eq { white-space: nowrap; }
.pc-eq small { display: block; color: var(--ink-mute); font-size: 11px; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.pc-c { width: 58px; }
.pc-ini { border-left: 2px solid var(--line-strong) !important; }
input.pc-num { width: 54px; text-align: right; padding: 3px 4px; }
input.pc-num::placeholder { color: #b6bec9; }
input.pc-num.pc-mal { background: #fee2e2; border-color: var(--danger); color: #991b1b; font-weight: 700; }
input.pc-obs { width: 100%; min-width: 130px; padding: 3px 4px; }
.pc-nop { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 12px; }
tr.pc-apagada td { background: var(--surface-2); color: var(--ink-mute); }
tr.pc-vencida .pc-eq b { color: var(--danger); }
.pc-seg button { white-space: nowrap; }
.pc-area { margin-bottom: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pc-area-c { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.pc-area-c h4 { margin: 0; font-size: 13px; }
.pc-area-c small { color: var(--ink-soft); }
.pc-luces { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 5px; }
.pc-luz { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius-sm); cursor: pointer; color: #14532d; }
.pc-luz small { font-size: 10px; white-space: nowrap; }
.pc-luz:hover { border-color: var(--ink-mute); }
.pc-luz.mal { background: #fee2e2; border-color: var(--danger); color: #991b1b; }
.pc-res { width: 560px; max-width: 80vw; white-space: normal; display: flex; flex-direction: column; gap: 6px; }
.pc-res p { margin: 0; }
.pc-res h4 { margin: 8px 0 4px; }
.pc-res-f { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; border-top: 1px solid var(--line); }
.pc-res-f small { display: block; color: var(--ink-soft); }
.pc-grafs { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; margin-bottom: 10px; }
.pc-graf { padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pc-graf h4 { margin: 0 0 4px; font-size: 12.5px; }
.pc-lienzo { position: relative; }
.pc-svg { display: block; width: 100%; height: auto; }
.pc-rej { stroke: var(--line); stroke-width: 1; }
.pc-eje { fill: var(--ink-mute); font-size: 10px; }
.pc-lim { stroke: var(--ink-mute); stroke-width: 1; stroke-dasharray: 4 3; }
.pc-linea { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pc-cruz { stroke: var(--ink-mute); stroke-width: 1; }
.pc-punto { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.pc-punto-mal { fill: var(--danger); stroke: #fff; stroke-width: 2; }
.pc-tip { position: absolute; top: 2px; padding: 3px 7px; background: #111827; color: #fff; font-size: 11px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.pc-tip[hidden] { display: none; }

/* ───────── Condiciones inseguras ───────── */
.ci-kpis { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 8px; }
.ci-kpi { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ci-kpi small { color: var(--ink-soft); font-size: 11.5px; }
.ci-kpi b { font-size: 22px; }
.ci-kpi span { color: var(--ink-mute); font-size: 11px; }
.ci-kpi.mal b { color: var(--danger); }
.ci-kpi.acento { border-left: 4px solid var(--accent); }
.ci-hall { max-width: 420px; white-space: normal; }
tr.ci-vencida td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.ci-forma { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.ci-forma .ci-ancho { grid-column: 1 / -1; }
.ci-forma textarea, .ci-forma input, .ci-forma select { width: 100%; }
.ci-galerias { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.ci-galeria { padding: 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.ci-gal-c { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ci-galeria .sh-foto img { cursor: zoom-in; }
.ci-modal { width: 1080px; max-width: 86vw; max-height: 74vh; overflow: auto; white-space: normal; }

/* ───────── Microinteracciones (micro.js) ───────── */
/* Entrar suave: ventanas, pantallas internas y recuadros */
.mdi { animation: mi-entra .16s ease-out; }
.sh-asistente, .seg-win > .gridbar + *, .pc-tarjetas, .ci-kpis { animation: mi-entra .18s ease-out; }
@keyframes mi-entra { from { opacity: 0; transform: translateY(6px); } }
.pc-tarjeta { animation: mi-entra .25s ease-out backwards; transition: transform .12s, box-shadow .12s; }
.pc-tarjeta:nth-child(2) { animation-delay: .05s; }
.pc-tarjeta:nth-child(3) { animation-delay: .1s; }
.pc-tarjeta:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16,24,40,.08); }

/* Efectos de una vez */
.mi-pulso { animation: mi-pulso .3s ease-out; }
@keyframes mi-pulso { 50% { transform: scale(1.04); } }
.mi-pop { animation: mi-pop .22s ease-out; }
@keyframes mi-pop { 0% { transform: scale(.92); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.mi-brinca { animation: mi-brinca .35s ease-out; display: inline-block; }
@keyframes mi-brinca { 30% { transform: translateY(-3px) scale(1.12); } 60% { transform: translateY(1px); } }
.mi-tiembla { animation: mi-tiembla .3s ease-in-out; }
@keyframes mi-tiembla { 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }
.mi-ilumina > td { animation: mi-ilumina 1.6s ease-out; }
@keyframes mi-ilumina { 0%, 30% { background: var(--mi-ilu, #fff4c2); } }

/* Lo urgente late suave mientras no se atienda */
.sh-vencida, .ci-kpi.mal b, .pc-tarjeta.vencido .pc-t-est { animation: mi-late 1.8s ease-in-out infinite; }
@keyframes mi-late { 50% { opacity: .55; } }

/* Barra de avance */
.mi-barra { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); }
.mi-pista { width: 120px; height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.mi-pista i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .25s ease-out, background-color .2s; }
.mi-barra.lleno .mi-pista i { background: var(--ok); }
.mi-barra.lleno .mi-barra-t { color: var(--ok); font-weight: 600; }

/* Botón trabajando / listo */
button.mi-trabajando { opacity: .85; cursor: progress; }
button.mi-trabajando::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 7px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: mi-gira .7s linear infinite; }
@keyframes mi-gira { to { transform: rotate(360deg); } }
button.btn.primary.mi-listo, button.mi-listo { background: var(--ok) !important; border-color: var(--ok) !important; color: #fff !important; }

/* Capturas de predictivos */
tr.pc-ok .pc-eq b::after { content: " ✓"; color: var(--ok); }
.pc-aviso { display: block; color: var(--danger); font-size: 11px; font-weight: 600; }
.pc-aviso:empty { display: none; }
tr.pc-ok:not(.pc-apagada) td { background: #f6fef9; }
.pc-area-c small.mal { color: var(--danger); font-weight: 600; }
.pc-luz { transition: background-color .15s, border-color .15s, color .15s; }

/* Indicadores que filtran */
.ci-kpi.clic { cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.ci-kpi.clic:hover { border-color: var(--accent); transform: translateY(-1px); }
.ci-kpi.on { --k: var(--accent); --kf: var(--accent-soft); border-color: var(--k); box-shadow: inset 0 0 0 1px var(--k); background: var(--kf); }
/* Cada indicador seleccionado lleva el color de su estatus */
.ci-kpi.on[data-f="Completado"] { --k: #16a34a; --kf: #dcfce7; }
.ci-kpi.on[data-f="Proceso"] { --k: #2563eb; --kf: #dbeafe; }
.ci-kpi.on[data-f="Incompleto"] { --k: #d97706; --kf: #fef3c7; }
.ci-kpi.on[data-f="Vencidas"] { --k: #dc2626; --kf: #fee2e2; }
.ci-kpi.clic[data-f="Completado"]:hover { border-color: #16a34a; }
.ci-kpi.clic[data-f="Proceso"]:hover { border-color: #2563eb; }
.ci-kpi.clic[data-f="Incompleto"]:hover { border-color: #d97706; }
.ci-kpi.clic[data-f="Vencidas"]:hover { border-color: #dc2626; }
button.ci-est { border: 0; background: none; padding: 0; cursor: pointer; white-space: nowrap; color: var(--ink-mute); font: inherit; }
button.ci-est:hover .pill { box-shadow: 0 0 0 2px var(--accent-soft); }

/* Vista rápida y menú en el lugar */
.mi-vista { position: fixed; z-index: 5000; max-width: 420px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(16,24,40,.18); pointer-events: none; animation: mi-entra .14s ease-out; white-space: normal; }
.ci-vista { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; }
.ci-vista img { width: 140px; height: 105px; object-fit: cover; border-radius: 6px; flex: none; }
.ci-vista p { margin: 4px 0; }
.mi-menu { position: fixed; z-index: 5000; display: flex; flex-direction: column; min-width: 150px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(16,24,40,.16); animation: mi-entra .12s ease-out; }
.mi-menu button { text-align: left; border: 0; background: none; padding: 6px 10px; border-radius: 6px; font: inherit; }
.mi-menu button:hover { background: var(--surface-2); }
.mi-menu button.on { font-weight: 700; color: var(--accent); }

/* Avisos con botón y salida suave */
.toast { display: flex; align-items: center; gap: 12px; }
.toast-acc { flex: none; border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.14); color: #fff; padding: 4px 10px; border-radius: 6px; font: inherit; font-weight: 600; }
.toast-acc:hover { background: rgba(255,255,255,.28); }
.toast.sale { animation: mi-sale .2s ease-in forwards; }
@keyframes mi-sale { to { opacity: 0; transform: translateY(6px); } }

/* Dashboard: las barras crecen al aparecer */
.sh-barra .b i { animation: mi-crece .5s ease-out; }
@keyframes mi-crece { from { width: 0; } }

/* Windows con "reducir animaciones": nada se mueve */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ───────── Permiso de Seguridad en la OT (semáforo) ───────── */
.sh-otbar { border-left: 4px solid var(--line-strong); }
.sh-otbar .sh-sem { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-mute); flex: none; }
.sh-otbar .sh-esttxt { font-weight: 600; }
.sh-otbar.sh-pend { border-left-color: var(--warn); background: #fffbeb; }
.sh-otbar.sh-pend .sh-sem { background: var(--warn); }
.sh-otbar.sh-espera { border-left-color: var(--danger); background: #fef2f2; }
.sh-otbar.sh-espera .sh-sem { background: var(--danger); animation: mi-late 1.8s ease-in-out infinite; }
.sh-otbar.sh-espera .sh-esttxt { color: #991b1b; }
.sh-otbar.sh-emerg { border-left-color: #7c3aed; background: #f5f3ff; }
.sh-otbar.sh-emerg .sh-sem { background: #7c3aed; }
.sh-otbar.sh-ok { border-left-color: var(--ok); }
.sh-otbar.sh-ok .sh-sem { background: var(--ok); }
.sh-otbar .sh-seg .sh-si { font-weight: 600; }
.sh-hist { width: 760px; max-width: 86vw; max-height: 60vh; overflow: auto; white-space: normal; }

/* ───────── Ayuda: Mis pendientes y ¿Qué me falta? (ayuda.js) ───────── */
.ay-pend .bell-btn { display: inline-flex; align-items: center; gap: 6px; }
.ay-lbl { font-size: 13px; }
.ay-panel { width: 420px; max-height: 70vh; overflow: auto; }
.ay-grupo { margin: 8px 10px 2px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-mute); }
.ay-sec { margin: 4px 8px 8px; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.ay-sec.ok { border-left-color: var(--ok); } .ay-sec.pend { border-left-color: var(--warn); } .ay-sec.espera { border-left-color: var(--danger); }
.ay-sec-t { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: var(--surface-2); }
.ay-n { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); text-align: center; font-size: 11px; font-weight: 700; }
.ay-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; padding: 6px 10px; text-align: left; font: inherit; cursor: pointer; }
.ay-item:hover { background: var(--accent-soft); }
.ay-item small { color: var(--ink-soft); }
.ay-item > span, .ay-item > small { display: block; width: 100%; text-align: left; }
.ay-pop { max-height: 80vh; overflow: auto; }
.ay-mas { padding: 5px 10px; font-size: 11px; color: var(--ink-mute); border-top: 1px solid var(--line); }
.ay-btn { white-space: nowrap; }
.ay-pop { position: fixed; z-index: 5000; width: 400px; max-width: 92vw; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px rgba(16,24,40,.2); animation: mi-entra .14s ease-out; font-size: 12.5px; white-space: normal; }
.ay-pop-t { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ay-pop-t span { color: var(--ink-mute); margin-right: auto; }
.ay-pop-t .x { border: 0; background: none; font-size: 14px; color: var(--ink-mute); }
.ay-sig { margin: 10px 12px; padding: 8px 10px; border-radius: 8px; background: #fffbeb; border: 1px solid #fde68a; }
.ay-sig small { display: block; color: var(--ink-soft); }
.ay-sig div { font-weight: 700; }
.ay-sig.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.ay-pasos { padding: 0 12px 10px; }
.ay-paso { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }
.ay-paso .ay-ic { width: 18px; text-align: center; font-weight: 700; }
.ay-paso.ok .ay-ic { color: var(--ok); } .ay-paso.mal .ay-ic { color: var(--danger); } .ay-paso.info .ay-ic { color: var(--ink-mute); }
.ay-paso.ok .ay-txt { color: var(--ink-soft); }
.ay-paso.sig .ay-txt { font-weight: 700; }
.ay-txt { flex: 1; } .ay-txt small { display: block; color: var(--ink-mute); font-weight: 400; }

/* ───────── OT rápida (ot_rapida.js) ───────── */
.ot-acc { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); border-left: 4px solid var(--accent); }
.ot-acc.trabajo { border-left-color: var(--ok); background: #f6fef9; }
.ot-acc.pausa { border-left-color: var(--warn); background: #fffbeb; }
.ot-acc-est { margin-right: auto; font-weight: 600; color: var(--ink-soft); }
.ot-acc.trabajo .ot-acc-est { color: #166534; } .ot-acc.pausa .ot-acc-est { color: #92400e; }
.ot-acc-est.fin { color: var(--ok); }
.ot-b { min-width: 120px; padding: 8px 18px; font-size: 14px; font-weight: 700; }
.ot-term { width: 620px; max-width: 86vw; display: flex; flex-direction: column; gap: 12px; white-space: normal; }
.ot-term textarea { width: 100%; }
.ot-term-fechas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ot-tecs { display: flex; flex-direction: column; gap: 6px; }
.ot-tec { display: flex; align-items: center; gap: 6px; }
.ot-tec input:first-child { flex: 1; }
.ot-tec .ot-hr { width: 80px; text-align: right; }
.ot-nota { color: var(--ink-mute); }
.f-tabs:not(.ver-todas) .ot-tab-oculta { display: none; }
.ot-tab-mas { border: 1px dashed var(--line-strong); background: none; color: var(--ink-soft); border-radius: 8px; padding: 4px 12px; font: inherit; }

/* ───────── Tarjeta de Seguridad en la OT, más visible ───────── */
.sh-otbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 12px 16px; font-size: 13px; border-left-width: 6px; border-bottom: 1px solid var(--line); }
.sh-otbar .sh-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #e5e7eb; color: #374151; }
.sh-otbar .sh-ico svg { width: 24px; height: 24px; }
.sh-otbar .sh-tit { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--ink-mute); }
.sh-otbar .sh-esttxt { font-size: 16px; font-weight: 800; line-height: 1.25; }
.sh-otbar .sh-sub { color: var(--ink-soft); margin-top: 2px; }
.sh-otbar .sh-links { display: flex; gap: 14px; margin-top: 4px; }
.sh-otbar .sh-links:empty { display: none; }
.sh-otbar .sh-accs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sh-otbar .sh-big { padding: 10px 20px; font-size: 14px; font-weight: 800; border-width: 2px; }
.sh-otbar .sh-no { background: #fff; border-color: #16a34a; color: #166534; }
.sh-otbar .sh-no:hover { background: #dcfce7; }
.sh-otbar .sh-si { background: #d97706; border-color: #d97706; color: #fff; }
.sh-otbar .sh-si:hover { background: #b45309; border-color: #b45309; }
.sh-otbar.sh-pend { background: #fef3c7; border-left-color: #d97706; box-shadow: inset 0 0 0 2px #fcd34d; }
.sh-otbar.sh-pend .sh-ico { background: #d97706; color: #fff; animation: mi-late 1.8s ease-in-out infinite; }
.sh-otbar.sh-pend .sh-esttxt { color: #92400e; }
.sh-otbar.sh-espera { background: #fee2e2; border-left-color: #dc2626; box-shadow: inset 0 0 0 2px #fca5a5; }
.sh-otbar.sh-espera .sh-ico { background: #dc2626; color: #fff; animation: mi-late 1.8s ease-in-out infinite; }
.sh-otbar.sh-espera .sh-esttxt { color: #991b1b; }
.sh-otbar.sh-emerg { background: #ede9fe; border-left-color: #7c3aed; }
.sh-otbar.sh-emerg .sh-ico { background: #7c3aed; color: #fff; }
.sh-otbar.sh-emerg .sh-esttxt { color: #5b21b6; }
.sh-otbar.sh-ok { background: #f0fdf4; border-left-color: #16a34a; }
.sh-otbar.sh-ok .sh-ico { background: #16a34a; color: #fff; }
.sh-otbar.sh-ok .sh-esttxt { color: #166534; }
.sh-otbar.sh-sinred .sh-ico { background: #9ca3af; color: #fff; }
.ot-acc.bloqueada .btn.primary { background: #e5e7eb; border-color: #d1d5db; color: #6b7280; }
.ot-acc.bloqueada .btn.primary::before { content: "🔒 "; }
.ot-acc.bloqueada .ot-acc-est::after { content: " · esperando la decisión o aprobación de Seguridad"; font-weight: 400; color: var(--ink-mute); }

/* ───────── Tendencias de luminarias ───────── */
.pc-lum { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }
.pc-lum-sec { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pc-lum-sec h3 { margin: 0 0 4px; font-size: 14px; }
.pc-lum-lead { margin: 0 0 8px; color: var(--ink-soft); font-size: 12.5px; }
.pc-lum .pc-grafs { margin-bottom: 8px; }
.pc-lum-areas { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.pc-mapa-w { max-height: 460px; overflow: auto; }
.pc-mapa { border-collapse: separate; border-spacing: 2px; font-size: 11.5px; }
.pc-mapa th { position: sticky; top: 0; background: var(--surface); font-weight: 600; color: var(--ink-soft); padding: 3px 6px; white-space: nowrap; }
.pc-mapa td:first-child { position: sticky; left: 0; background: var(--surface); font-weight: 600; padding: 2px 8px; white-space: nowrap; }
.pc-mapa-area td { background: var(--surface-2) !important; font-weight: 700; color: var(--accent); padding: 5px 8px !important; }
.pc-cel { min-width: 38px; height: 22px; text-align: center; border-radius: 4px; background: #f1f5f9; color: var(--ink-mute); display: table-cell; }
span.pc-cel { display: inline-block; min-width: 26px; padding: 0 4px; line-height: 18px; }
.pc-cel.ok { background: #dcfce7; color: #166534; }
.pc-cel.f { background: #fecaca; color: #991b1b; font-weight: 700; }
tr.pc-larga td { background: #fff7ed; }
.pc-ot-cel { vertical-align: middle; text-align: center; border-left: 1px solid var(--line); }
/* "¿Qué me falta?" llamativo: naranja con cuántos pasos faltan; verde cuando está todo */
.btn.ay-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; font-weight: 800; font-size: 13.5px; border: 2px solid #ea580c; background: #ea580c; color: #fff; border-radius: 99px; box-shadow: 0 2px 8px rgba(234,88,12,.35); }
.btn.ay-btn:hover { background: #c2410c; border-color: #c2410c; }
.btn.ay-btn .ay-cuenta { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: #fff; color: #c2410c; font-weight: 800; display: inline-grid; place-items: center; font-size: 12.5px; }
.btn.ay-btn .ay-cuenta:empty { display: none; }
.btn.ay-btn.falta { animation: ay-llama 2.4s ease-in-out infinite; }
@keyframes ay-llama { 0%, 100% { box-shadow: 0 2px 8px rgba(234,88,12,.35); } 50% { box-shadow: 0 0 0 5px rgba(234,88,12,.18), 0 2px 10px rgba(234,88,12,.45); } }
.btn.ay-btn.listo { background: #16a34a; border-color: #16a34a; box-shadow: 0 2px 8px rgba(22,163,74,.3); }
.btn.ay-btn.listo:hover { background: #15803d; }
.btn.ay-btn.listo .ay-cuenta { color: #15803d; }

/* Órdenes de Trabajo: cuadro para buscar por ticket, junto a Buscar Id */
.toolbar input.find.find-tk { flex: none; width: 90px; min-width: 70px; }

/* OT: botón para revisar en ese momento si en la tablet ya llegaron o cerraron */
.rec-head:has(.ot-actualizar) { grid-template-columns: 170px 1fr auto auto; }
.rec-head .ot-actualizar { margin-right: 10px; padding: 5px 12px; font-size: 13px; font-weight: 600; }

/* Solicitudes pendientes: quién la atiende */
.sp-atiende { display: inline-block; margin-top: 2px; padding: 1px 8px; border-radius: 99px; background: #dcf7ec; color: #047857; font-size: 11.5px; font-weight: 600; }
.sp-libre { display: inline-block; margin-top: 2px; padding: 1px 8px; border-radius: 99px; background: #fef2f2; color: #b91c1c; font-size: 11.5px; font-weight: 600; }

.sp-estado { display: inline-block; margin-top: 2px; font-size: 11.5px; }
.sp-hora { color: var(--ink-mute); font-size: 12px; white-space: nowrap; }

/* ───────── Herramentales: mismas pantallas que el sistema de herramentales, con el estilo del ERP ───────── */
.hp { gap: 12px; overflow: auto; }
.hp-mod, .hp-dash { display: flex; flex-direction: column; gap: 12px; }
.hp-mod > .hp-card { display: flex; flex-direction: column; gap: 12px; }
.hp .c-sub { margin: 4px 0 0; }
.hp .u-chips { margin: 0; flex-wrap: wrap; }
/* Recuadros internos: como "Centro de costos" / "Programas" en la pantalla de Equipos */
.hp-card.suave, .hp-dash > .hp-card, .hp-tres > .hp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.hp-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.hp-card h4, .hp-cab h4 { margin: 0; font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: baseline; gap: 8px; }
/* Formularios: etiqueta arriba y campo abajo; las columnas se acomodan solas al ancho (así no se aplastan junto a la foto) */
.hp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; align-items: start; }
.hp-grid > .hp-campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hp-grid > span:empty { display: none; }
.hp-campo > label { color: var(--ink-soft); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-campo > label:empty { display: none; }
.hp-ctl { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hp-grid > .hp-campo.ancho { grid-column: 1 / -1; }
.hp-ctl > input:not([type=checkbox]), .hp-ctl > select, .hp-ctl > textarea { width: 100%; box-sizing: border-box; }
.hp-ctl > small { color: var(--ink-mute); font-size: 11px; }
.hp-ctl > input:disabled { background: var(--surface-2); color: var(--ink-mute); }
.hp-cab .hp-campo, .hp-filtros .hp-campo { display: flex; align-items: center; gap: 6px; }
.hp-cab .hp-campo > label, .hp-filtros .hp-campo > label { padding: 0; }
.hp-cab .hp-ctl > select { min-width: 280px; }
.hp-filtros { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; }
.hp-filtros .hp-ctl > select, .hp-filtros .hp-ctl > input { width: 220px; }
.hp-filtros.der { justify-content: flex-end; }
.hp-check { display: flex; align-items: center; gap: 6px; }
.hp-botones { display: flex; gap: 8px; flex-wrap: wrap; }
.hp-msg { color: var(--accent); font-weight: 600; }
.hp-msg:empty { display: none; }
.hp-nota { color: var(--ink-mute); font-size: 11.5px; }
.hp-foto { width: 64px; height: 44px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 10.5px; color: var(--ink-mute); overflow: hidden; }
.hp-foto img { width: 100%; height: 100%; object-fit: cover; }
.hp-foto.grande { width: 300px; height: 190px; border-radius: var(--radius); font-size: 12px; }
/* Tablas: las del ERP (gwrap + grid) */
.hp-tabla { max-height: calc(100vh - 360px); min-height: 80px; }
.hp-tabla table.grid { width: 100%; }
.hp-tabla td { vertical-align: top; white-space: normal; max-width: 260px; }
.hp-tabla td.n { white-space: nowrap; }
.hp-vacio { text-align: center; color: var(--ink-mute); padding: 16px !important; }
.hp-vacio.caja { background: var(--surface-2); border-radius: var(--radius); }
.hp-largo { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hp-est input, .hp-est select { width: 100%; min-width: 90px; }
.hp-x { border: 0; background: none; font-size: 17px; color: var(--ink-mute); cursor: pointer; }
.hp-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; white-space: nowrap; background: #eef1f6; color: var(--ink-soft); }
.hp-pill.verde { background: #dcf7ec; color: #047857; } .hp-pill.amarillo { background: #fef3c7; color: #92400e; } .hp-pill.rojo { background: #ffe4ea; color: #be123c; } .hp-pill.azul { background: #e0e9fb; color: var(--accent); }
.hp-acc { display: flex; gap: 4px; flex-wrap: wrap; }
.hp-mini { min-width: 0 !important; padding: 2px 8px !important; font-size: 11.5px !important; }
.hp-mini.peligro { color: #be123c; }
/* Tarjetas de resumen: las mismas del Almacén de refacciones */
.hp-kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.hp-kpis > .ref-kpi { flex: 1; min-width: 170px; }
.hp-rojo { color: #be123c !important; }
.hp-kpi.texto b { font-size: 15px; }
.hp-checks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.hp-checks label, .hp-compsel label { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; }
.hp-checks input, .hp-compsel input, .hp-check input { width: auto !important; flex: none; margin: 0; }
.hp-compsel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 190px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.hp-compsel label { align-items: flex-start; }
.hp-compsel small { display: block; color: var(--ink-mute); font-size: 11px; }
.hp-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.hp-chip { display: inline-flex; gap: 8px; align-items: center; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink-soft); font-weight: 600; }
.hp-fila { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-direction: row !important; }
/* Dashboard */
.hp-tres { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 10px; }
.hp-der { margin-left: auto; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-mute); }
.hp-der b { font-size: 15px; color: var(--ink); }
.hp-leyenda { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.hp-leyenda div { display: flex; align-items: center; gap: 8px; }
.hp-leyenda i { width: 10px; height: 10px; border-radius: 50%; }
.hp-leyenda b { margin-left: auto; }
.hp-riesgo { display: flex; flex-direction: column; gap: 9px; font-size: 11.5px; }
.hp-riesgo > div { display: grid; grid-template-columns: 70px 1fr 40px; align-items: center; gap: 8px; }
.hp-barra { height: 7px; border-radius: 99px; background: #eef1f6; overflow: hidden; }
.hp-barra i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.hp-barra.rojo i { background: #e8590c; }
.hp-av { display: flex; align-items: center; gap: 6px; min-width: 110px; }
.hp-av .hp-barra { flex: 1; }
.hp-aviso { display: grid; grid-template-columns: 1fr 1fr; padding: 10px 14px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius); }
.hp-aviso b { font-size: 20px; color: #c2410c; } .hp-aviso small { display: block; color: var(--ink-mute); }
.hp-stock { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hp-stock > div { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.hp-stock small { color: var(--ink-mute); display: block; }
.hp-dlg { width: min(860px, 82vw); white-space: normal; }
/* Herramentales (versión por troquel): recuadros, ficha del troquel y formularios cortos */
.hp-caja { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.hp-caja h4 { margin: 0; font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.hp-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hp-dos .hp-tabla { max-height: 320px; }
.hp-clic { cursor: pointer; }
.hp-acc.grande .btn { padding: 7px 14px; }
.hp-ficha { width: min(1060px, calc(90vw - 60px)); white-space: normal; display: flex; flex-direction: column; gap: 12px; }
.hp-ficha-cab { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.hp-ficha-info { display: flex; flex-direction: column; gap: 8px; }
.hp-ficha-info h3 { margin: 0; font-size: 18px; }
.hp-ficha-info .c-sub { margin: 0; }
.hp-datos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hp-datos > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.hp-datos small, .hp-obs small { color: var(--ink-mute); font-size: 11.5px; }
.hp-obs { margin-top: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.hp-historia { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-height: 420px; overflow: auto; }
.hp-ev { display: grid; grid-template-columns: 100px 1fr; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
.hp-ev:last-child { border-bottom: 0; }
.hp-ev > span { color: var(--ink-mute); }
.hp-ev .c-sub { margin: 2px 0 0; }
.hp-subir { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hp-subir input:not([type=file]) { width: 260px; }
.hp-opciones { display: flex; gap: 6px; flex-wrap: wrap; }
.hp-falla { padding: 8px 12px; border: 1px solid #fde68a; background: #fffbeb; border-radius: var(--radius); }
.hp-dlg .hp-ficha-cab { grid-template-columns: 260px 1fr; }
.hp-dlg .hp-foto.grande { width: 260px; height: 170px; }
.hp-piezas tr.sel td { background: #fffbeb; }
.hp .u-tools .btn { white-space: nowrap; }
/* Editar troquel: el selector de archivo se oculta y se usa un botón del ancho de la foto */
.hp-ficha-cab input[type=file] { display: none; }
.hp-foto-btn { width: 100%; margin-top: 6px; justify-content: center; }
/* Listas principales de Herramentales (Troqueles, Fallas, Refacciones): la tabla crece hasta el borde de abajo */
.hp > .hp-mod { flex: 1 1 auto; min-height: 0; }
.hp-mod > .hp-tabla { flex: 1 1 auto; max-height: none; min-height: 200px; }
/* Formularios de Herramentales redondeados y con más aire (como la referencia): campos de 42 px con esquinas de 10 px,
   opciones tipo píldora, recuadro de piezas suave y botones redondeados */
.hp-dlg .hp-grid { gap: 18px 20px; }
.hp-dlg .hp-campo > label { color: var(--ink); font-size: 13px; font-weight: 600; }
.hp-dlg input:not([type=checkbox]):not([type=file]):not([type=radio]), .hp-dlg select, .hp-dlg textarea {
  border: 1px solid #d5dbe5; border-radius: 10px; padding: 9px 14px; min-height: 42px; font-size: 13.5px; background: #fff; box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s; }
.hp-dlg textarea { min-height: 84px; resize: vertical; }
.hp-dlg input:not([type=checkbox]):focus, .hp-dlg select:focus, .hp-dlg textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.hp-dlg input::placeholder, .hp-dlg textarea::placeholder { color: #9aa3b2; }
.hp-dlg input:disabled, .hp-dlg select:disabled { background: var(--surface-2); color: var(--ink-mute); }
.hp-dlg .hp-ctl > small { font-size: 11.5px; }
.hp-dlg .hp-opciones { gap: 8px; }
.hp-dlg .hp-opciones .u-chip { padding: 8px 18px; font-size: 13px; border-color: #d5dbe5; }
.hp-dlg .hp-opciones .u-chip.on { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.hp-dlg .hp-caja { border-radius: 12px; background: #f8fafc; border-color: #e3e8ef; padding: 16px 18px; }
.hp-dlg .hp-caja h4 { font-size: 13px; }
.hp-dlg .hp-falla { border-radius: 12px; padding: 12px 16px; }
.hp-dlg .gwrap { border-radius: 12px; }
/* Dentro de las tablas: más bajos y del ancho de su columna */
.hp-dlg table.grid td input:not([type=checkbox]):not([type=file]):not([type=radio]), .hp-dlg table.grid td select { min-height: 36px; padding: 6px 10px; width: 100% !important; min-width: 60px; }
/* Los campos cortos (horas, afilado, golpes) ocupan toda su columna, como los demás */
.hp-dlg .hp-ctl > input:not([type=checkbox]):not([type=file]) { width: 100% !important; }
.hp-dlg .btn, .hp-foto-btn { border-radius: 10px; }
.hp-dlg .hp-foto.grande { border-radius: 12px; }
/* Botones de abajo del formulario */
.modal:has(.hp-dlg) .mfoot button { border-radius: 10px; padding: 10px 20px; min-height: 42px; font-weight: 600; }
.modal:has(.hp-dlg) .mfoot button.primary { background: #1d4ed8; border-color: #1d4ed8; }
.modal:has(.hp-dlg) .mfoot button.primary:hover { background: var(--accent-hover); }
/* Tabla de componentes en Editar troquel: columnas con ancho fijo para que quepa completa (con la × de quitar) */
.hp-dlg table.grid.hp-est { table-layout: fixed; width: 100%; min-width: 0; }
.hp-est th:nth-child(1) { width: 17%; } .hp-est th:nth-child(2) { width: 27%; } .hp-est th:nth-child(3) { width: 16%; }
.hp-est th:nth-child(4) { width: 10%; } .hp-est th:nth-child(5) { width: 24%; } .hp-est th:nth-child(6) { width: 6%; }
.hp-dlg .hp-est td input:not([type=checkbox]), .hp-dlg .hp-est td select { min-width: 0; }
/* ── Herramentales: el mismo estilo redondeado de los formularios en las listas, la ficha del troquel y el Dashboard ── */
/* Buscador y campos sueltos (filtros del Dashboard, subir documento en la ficha) */
.hp .u-buscar { border-radius: 10px; min-height: 40px; border: 1px solid #d5dbe5; font-size: 13.5px; box-sizing: border-box; }
.hp .hp-filtros input, .hp .hp-filtros select, .hp-ficha .hp-subir input:not([type=file]), .hp-ficha .hp-subir select {
  border: 1px solid #d5dbe5; border-radius: 10px; padding: 8px 14px; min-height: 40px; font-size: 13.5px; background: #fff; box-sizing: border-box; }
.hp .u-buscar:focus, .hp .hp-filtros input:focus, .hp .hp-filtros select:focus, .hp-ficha .hp-subir input:focus, .hp-ficha .hp-subir select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.hp-ficha .hp-subir input[type=file] { font-size: 13px; }
.hp-ficha .hp-subir input[type=file]::file-selector-button { border: 1px solid #d5dbe5; border-radius: 10px; background: #fff; padding: 8px 14px; margin-right: 10px; cursor: pointer; font: inherit; font-weight: 600; }
/* Botones de arriba (Nuevo troquel, Reportar falla…) y de la ficha */
.hp .u-tools .btn, .hp .hp-cab .btn, .hp .hp-card > div > .btn, .hp-caja > div > .btn, .hp-ficha .hp-acc .btn:not(.hp-mini), .hp-ficha .hp-subir .btn { border-radius: 10px; min-height: 40px; padding: 8px 16px; font-weight: 600; }
.hp .u-tools .btn.primary, .hp-ficha .btn.primary { background: #1d4ed8; border-color: #1d4ed8; }
/* Botones dentro de los renglones (Reparar, Crear OT, Editar) */
.hp .hp-mini, .hp-ficha .hp-mini { border-radius: 8px !important; padding: 5px 12px !important; }
/* Filtros tipo píldora un poco más grandes */
.hp .u-chips .u-chip, .hp-ficha .u-chips .u-chip { padding: 7px 14px; font-size: 12.5px; }
/* Tablas, recuadros e indicadores con esquinas de 12 px */
.hp .gwrap, .hp-ficha .gwrap { border-radius: 12px; border-color: #e3e8ef; }
.hp .ref-kpi, .hp .hp-card, .hp .hp-caja, .hp-ficha .hp-caja { border-radius: 12px; border-color: #e3e8ef; }
.hp .ref-kpi { padding: 12px 16px; }
.hp-ficha .hp-datos > div, .hp-ficha .hp-obs, .hp-ficha .hp-historia, .hp-ficha .hp-falla { border-radius: 12px; border-color: #e3e8ef; }
.hp-ficha .hp-datos > div { padding: 10px 14px; }
/* Fotos */
.hp .hp-foto { border-radius: 8px; }
.hp-ficha .hp-foto.grande { border-radius: 12px; }
/* Botones de abajo de la ficha */
.modal:has(.hp-ficha) .mfoot button { border-radius: 10px; padding: 10px 20px; min-height: 42px; font-weight: 600; }
.modal:has(.hp-ficha) .mfoot button.primary { background: #1d4ed8; border-color: #1d4ed8; }
/* Formularios de Herramentales: 3 columnas que llenan todo el ancho (sin hueco a la derecha); junto a la foto, 2 */
.hp-dlg .hp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hp-dlg .hp-ficha-cab .hp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ══════════ Campos redondeados en todo el programa (como el Planificador de referencia) ══════════
   Campos blancos de 34 px con esquinas de 8 px y borde gris claro; en los campos de búsqueda el botón de
   limpiar (bote) y el de buscar (lupa) quedan DENTRO del campo; recuadros y tablas con esquinas de 12 px. */
:root { --radius-sm: 8px; --lookup-bg: #ffffff; --campo-borde: #dbe1ea; }
/* Cualquier campo que no tenga estilo propio */
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]), select, textarea) { border-radius: 8px; }
/* Campos de las pantallas (renglones, rejillas de formulario, formularios simples, barras de filtros, barra de herramientas) */
.lay input:not([type=checkbox]), .lay select, .lay textarea,
.fgrid input:not([type=checkbox]), .fgrid select, .fgrid textarea,
.fgrid1 input:not([type=checkbox]), .fgrid1 select,
.form-simple input:not([type=checkbox]), .form-simple select, .form-simple textarea,
.gridbar input:not([type=checkbox]), .gridbar select,
fieldset input:not([type=checkbox]):not([type=radio]):not([type=file]), fieldset select, fieldset textarea,
.toolbar input.find {
  border: 1px solid var(--campo-borde); border-radius: 8px; min-height: 34px; padding: 6px 12px; font-size: 13px;
  transition: border-color .15s, box-shadow .15s; }
.lay textarea, .fgrid textarea, .form-simple textarea, fieldset textarea { padding: 8px 12px; }
.lay input:focus, .lay select:focus, .lay textarea:focus, .fgrid input:focus, .fgrid select:focus, .fgrid textarea:focus,
.fgrid1 input:focus, .fgrid1 select:focus, .form-simple input:focus, .form-simple select:focus, .form-simple textarea:focus,
.gridbar input:focus, .gridbar select:focus, fieldset input:focus, fieldset select:focus, fieldset textarea:focus, .toolbar input.find:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.lay input::placeholder, .fgrid input::placeholder, .form-simple input::placeholder, .form-simple textarea::placeholder { color: #9aa3b2; }
/* Las tablas siguen con sus celdas sin borde; los filtros de las columnas, un poco redondeados */
.grid td.cell input:not([type=checkbox]), .grid td.cell select { border: 0; border-radius: 0; min-height: 0; padding: 5px 8px; box-shadow: none; }
.grid thead tr.frow input { border-radius: 6px; border-color: var(--campo-borde); }

/* Campos de búsqueda: el bote y la lupa dentro del campo, a la derecha */
.lkw { gap: 0; }
.lkw:not(.plain) input:not([readonly]) { border-color: var(--campo-borde) !important; }
.lkw input:not([readonly]):hover { border-color: #b9c4d6 !important; }
.lkw input:focus { border-color: var(--accent) !important; }
.lkw > input { flex: 0 1 190px; }
.lay .lkw > input { width: 206px; }
.fgrid1 .lkw > input { width: 196px; }
.gridbar .lkw > input { width: 156px; }
.lkw > input + button:not(.lk-find):not(.est-btn) { margin-left: -60px; }
.lkw > input + button.lk-find:not(.est-btn) { margin-left: -32px; }
.lkw:has(> input + button:not(.lk-find)) > input { padding-right: 62px !important; }
.lkw:has(> input + button.lk-find:not(.est-btn)) > input { padding-right: 34px !important; }
.lkw > button:not(.est-btn) { position: relative; z-index: 1; width: 26px; height: 26px; padding: 0; display: inline-grid; place-items: center; border-radius: 6px; flex: none; }
.lkw > button:not(.lk-find):not(.est-btn) { color: #9aa3b2; margin-right: 2px; }
.lkw > button:not(.lk-find):not(.est-btn):hover { color: var(--danger); background: #fdecec; }
.lkw > button.lk-find:not(.est-btn) { min-width: 26px; margin-right: 4px; }
.lkw > button .icon { width: 15px; height: 15px; }
.lkw .desc { margin-left: 8px; }
.lkw button.est-btn { margin-left: 8px; border-radius: 8px; height: 30px; padding: 0 10px; }
/* Dentro de las tablas el campo de búsqueda sigue compacto */
.cell .lkw > input { padding-right: 30px !important; }
.cell .lkw > input + button:not(.lk-find) { margin-left: -56px; }

/* Recuadros (fieldset) como tarjetas: esquinas de 12 px y el título arriba con una línea */
fieldset { border: 1px solid #e3e8ef; border-radius: 12px; padding: 14px 18px 16px; margin: 8px 0 14px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
fieldset > legend { float: left; width: 100%; display: flex; align-items: center; gap: 12px; padding: 0; margin: 0 0 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b7a90; }
fieldset > legend::after { content: ""; flex: 1; height: 1px; background: #e3e8ef; }
fieldset > legend + * { clear: both; }
.lbox { border-radius: 12px; border-color: #e3e8ef; padding: 10px 14px 12px; }
.lbox > legend { margin-bottom: 4px; }

/* Tablas con esquinas de 12 px */
.gwrap { border-radius: 12px; border-color: #e3e8ef; }

/* Botones con las mismas esquinas */
.btn, .gridbar button, .navbar button, .modal .mfoot button { border-radius: 8px; }
/* Planificador: criterios en dos columnas, cada campo llena su columna */
.plan-crit { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); gap: 10px 18px; align-items: center; }
.plan-crit > label { font-weight: 600; font-size: 12.5px; }
.plan-crit .lkw > input { flex: 1 1 auto; }
.plan-crit .lkw .desc:empty { display: none; }
.plan-crit > input { max-width: calc(50% + 120px); }

/* ══════════ Tarjeta preventiva (RE-SH-119): la tarjeta a la izquierda y la revisión de Seguridad a la derecha ══════════ */
.tp-det { display: grid; grid-template-columns: minmax(0, 660px) minmax(260px, 1fr); gap: 20px; align-items: start; }
.tp-panel { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.tp-revisar { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #f8fafc; display: flex; flex-direction: column; gap: 8px; }
.tp-revisar p { margin: 0; color: var(--ink-soft); }
.tp-revisar .btn, .tp-panel > .btn { border-radius: 10px; min-height: 38px; }
.tp-chips { display: flex; gap: 14px; }
.tp-chip { min-width: 96px; padding: 7px 14px; font-weight: 700; border: 1px solid rgba(0,0,0,.25); border-radius: 10px; background: var(--c); color: var(--t); opacity: .35; }
.tp-chip:hover { opacity: .7; }
.tp-chip.on { opacity: 1; outline: 3px solid #111; outline-offset: 2px; }
@media (max-width: 1000px) { .tp-det { grid-template-columns: 1fr; } }

/* Condiciones inseguras: revisión de Seguridad y regla de cierre */
.ci-revisar { margin: 8px 0; }
.ci-rev-bts { display: flex; gap: 10px; flex-wrap: wrap; }
.ci-falta { background: #fff7ed; border: 1px solid #fdba74; color: #9a3412; border-radius: 10px; padding: 10px 14px; margin: 6px 0; font-weight: 600; }
.ci-regla { color: var(--ink-soft); font-size: 12.5px; margin: 6px 0; }

/* ══════════ Aviso de versión nueva / programa actualizado (actualizacion.js) ══════════ */
.act-barra { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 100000; display: flex; align-items: center; gap: 14px;
  width: min(820px, calc(100vw - 32px)); padding: 14px 18px; border-radius: 16px; color: #fff;
  background: linear-gradient(120deg, #0b2a6b 0%, #1d4ed8 65%, #3b82f6 100%); box-shadow: 0 14px 40px rgba(15, 23, 42, .35); animation: act-entra .35s ease-out; }
.act-barra.ok { background: linear-gradient(120deg, #065f46 0%, #059669 70%, #10b981 100%); }
@keyframes act-entra { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.act-ico { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.act-ico.gira { animation: act-gira 1s linear infinite; }
@keyframes act-gira { to { transform: rotate(360deg); } }
.act-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.act-txt b { font-size: 15px; }
.act-txt span { font-size: 12.5px; opacity: .9; }
.act-notas { font-size: 12px; background: rgba(255,255,255,.14); border-radius: 8px; padding: 5px 9px; margin-top: 4px; white-space: pre-wrap; }
.act-btn { flex: 0 0 auto; background: #fff; color: #0b2a6b; border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 800; font-size: 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.act-btn:hover { background: #fef3c7; }
.act-btn:disabled { opacity: .7; cursor: progress; }
.act-luego { flex: 0 0 auto; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 10px; padding: 9px 14px; cursor: pointer; }
