/* Portal Unilogix — estilos (manual de marca: naranja #FF5700, carbón #2B2B2B, marfil #F7F7F4) */
:root {
  --orange: #FF5700;
  --orange-light: #FF7A32;
  --orange-dark: #B33E00;
  --orange-pale: #FFF2EA;
  --carbon: #2B2B2B;
  --gray: #5B5B5B;
  --line: #E4E2DC;
  --ivory: #F7F7F4;
  --white: #FFFFFF;
  --ok: #1E7B45;
  --ok-bg: #E8F5EC;
  --warn: #8A5A00;
  --warn-bg: #FFF4D6;
  --bad: #B3261E;
  --bad-bg: #FDECEA;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(43, 43, 43, .06), 0 4px 16px rgba(43, 43, 43, .05);
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--carbon); background: var(--ivory); }
a { color: var(--orange-dark); }
code { font-family: var(--mono); font-size: .9em; background: var(--ivory); padding: 1px 5px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.muted { color: var(--gray); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.danger { color: var(--bad) !important; }
.ok-text { color: var(--ok); font-weight: 600; }
.inline { display: inline; }
[hidden] { display: none !important; }

/* --------------------------------------------------------------- estructura */
.shell { display: flex; min-height: 100vh; }
.side { width: 250px; flex: 0 0 250px; background: var(--carbon); color: #fff; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 8px 18px; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--orange); color: var(--carbon); display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { letter-spacing: .08em; }
.brand-text small { color: #CFCFCF; font-size: .78rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { color: #A8A8A8; text-transform: uppercase; font-size: .7rem; letter-spacing: .1em; margin: 16px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; color: #EDEDED; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .92rem; }
.nav-link:hover { background: rgba(255, 255, 255, .08); }
.nav-link.is-active { background: var(--orange); color: var(--carbon); font-weight: 600; }
.nav-sub { font-size: .85rem; padding-left: 14px; }
.ico { width: 16px; height: 16px; display: inline-block; flex: 0 0 16px; border-radius: 4px; background: currentColor; opacity: .55;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ico-home { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11l9-8 9 8v10a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.ico-clock { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 5v5.4l3.5 2.1-1 1.7L11 13V7z'/%3E%3C/svg%3E"); }
.ico-users { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm-7 10c0-4 3-6 7-6s7 2 7 6zm15-10a3 3 0 1 0 0-6v6zm1 2c3 .4 4 2.6 4 6v2h-4c0-3-1-5-3-6.6z'/%3E%3C/svg%3E"); }
.ico-key { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 14a5 5 0 1 1 4.6-7H22v4h-2v3h-3v-3h-5.4A5 5 0 0 1 7 14zm0-3a2 2 0 1 0 0-4 2 2 0 0 0 0 4z'/%3E%3C/svg%3E"); }
.ico-shield { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l8 3v6c0 5-3.4 9.4-8 11-4.6-1.6-8-6-8-11V5z'/%3E%3C/svg%3E"); }
.ico-grid { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h8v8H3zm10 0h8v8h-8zM3 13h8v8H3zm10 0h8v8h-8z'/%3E%3C/svg%3E"); }
.ico-table { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h18v16H3zm2 2v3h6V6zm8 0v3h6V6zM5 11v3h6v-3zm8 0v3h6v-3zm-8 5v2h6v-2zm8 0v2h6v-2z'/%3E%3C/svg%3E"); }
.ico-eye { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5c5 0 9 4.5 10 7-1 2.5-5 7-10 7S3 14.5 2 12c1-2.5 5-7 10-7zm0 3a4 4 0 1 0 0 8 4 4 0 0 0 0-8z'/%3E%3C/svg%3E"); }
.nav-link.is-active .ico { opacity: .9; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-title { font-size: 1.25rem; flex: 1; }
.menu-btn { display: none; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--carbon); }
.user-box { display: flex; align-items: center; gap: 8px; }
.user-name { display: flex; flex-direction: column; text-align: right; font-weight: 600; font-size: .9rem; line-height: 1.2; margin-right: 6px; }
.user-name small { font-weight: 400; color: var(--gray); }
.content { padding: 24px 28px 48px; max-width: 1280px; width: 100%; }

/* --------------------------------------------------------------- componentes */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card-narrow { max-width: 420px; margin: 0 auto 20px; }
.card-medium { max-width: 720px; margin: 0 auto 20px; }
.card-title { font-size: 1.15rem; margin-bottom: 10px; }
.sub-title { font-size: .95rem; margin: 18px 0 8px; }
.section { margin-bottom: 30px; }
.section-title { font-size: 1.05rem; margin-bottom: 6px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.empty { background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; color: var(--gray); text-align: center; }
.link, .link-btn { color: var(--orange-dark); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover, .link:hover { color: var(--carbon); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; padding: 9px 16px; font: 600 .92rem var(--font); cursor: pointer; text-decoration: none; transition: background .15s; }
.btn-primary { background: var(--orange); color: var(--carbon); }
.btn-primary:hover { background: var(--orange-light); }
.btn-primary:disabled { background: #F0D3C2; color: #8B7B72; cursor: not-allowed; }
.btn-ghost { background: var(--white); color: var(--carbon); border-color: var(--line); }
.btn-ghost:hover { background: var(--ivory); }
.btn-sm { padding: 5px 10px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn:focus-visible, .link-btn:focus-visible, input:focus-visible, select:focus-visible, .dropzone:focus-visible { outline: 3px solid var(--orange-light); outline-offset: 2px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: .88rem; font-weight: 600; }
.field small { font-weight: 400; }
.field input, .field select { font: 400 .95rem var(--font); padding: 9px 11px; border: 1px solid #CFCCC4; border-radius: 8px; background: #fff; color: var(--carbon); min-width: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; font-size: .92rem; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: .92rem; padding: 4px 0; }
.check input { margin-top: 3px; accent-color: var(--orange-dark); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.alert { border-radius: 8px; padding: 11px 14px; margin-bottom: 14px; font-size: .92rem; border: 1px solid transparent; }
.alert-ok { background: var(--ok-bg); border-color: #BFE3CC; color: #14532D; }
.alert-error { background: var(--bad-bg); border-color: #F5C2BE; color: #7F1D1D; }
.alert-info { background: var(--orange-pale); border-color: #FFD3B8; color: #6B2600; }
.temp-pass { display: flex; flex-direction: column; gap: 6px; }
.temp-pass .big { font-size: 1.3rem; padding: 6px 10px; background: #fff; width: max-content; user-select: all; }

.badge { display: inline-block; font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--ivory); color: var(--gray); border: 1px solid var(--line); white-space: nowrap; }
.badge-exitoso { background: var(--ok-bg); color: var(--ok); border-color: #BFE3CC; }
.badge-con_errores { background: var(--warn-bg); color: var(--warn); border-color: #F3DD9B; }
.badge-detenido { background: var(--bad-bg); color: var(--bad); border-color: #F5C2BE; }

.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table thead th { background: #FBFAF7; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gray); }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-compact th, .table-compact td { padding: 6px 10px; font-size: .84rem; }
tr.is-off td, tr.is-off th { opacity: .55; }

.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 18px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; font-size: .82rem; color: var(--gray); min-width: 110px; }
.stat span { display: block; font-size: 1.45rem; font-weight: 700; color: var(--carbon); font-variant-numeric: tabular-nums; }
.stat-ok span { color: var(--ok); }
.stat-warn span { color: var(--warn); }
.stat-bad span { color: var(--bad); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 14px; }
.project-card { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 110px; padding: 18px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: var(--radius); text-decoration: none; color: var(--carbon); box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(43, 43, 43, .1); }
.project-name { font-weight: 700; }
.project-go { color: var(--orange-dark); font-weight: 600; font-size: .88rem; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.filters .field { min-width: 150px; }
.filters-actions { display: flex; gap: 8px; }
.pager { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pager a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; background: #fff; color: var(--carbon); }
.pager a.is-active { background: var(--orange); border-color: var(--orange); }

/* --------------------------------------------------------------- normalizador */
.dropzone { border: 2px dashed #D9C3B4; background: var(--orange-pale); border-radius: var(--radius); padding: 30px 18px; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, background .15s; }
.dropzone strong { font-size: 1.02rem; }
.dropzone span { color: var(--gray); font-size: .88rem; }
.dropzone.is-over, .dropzone:hover { border-color: var(--orange); background: #FFE9DB; }
.file-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.file-list li span { flex: 1; font-weight: 600; word-break: break-all; }
.tables-info { margin-top: 14px; font-size: .86rem; color: var(--gray); }
.tables-info summary, details summary { cursor: pointer; }
.result { border-top: 4px solid var(--line); }
.result.is-ok { border-top-color: var(--ok); }
.result.is-warn { border-top-color: #E0A100; }
.result.is-bad { border-top-color: var(--bad); }
.result-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.downloads { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.crit { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 14px; }
.crit li { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; padding: 3px 0; border-bottom: 1px dotted var(--line); }
.crit li.ok span { color: var(--ok); }
.crit li.bad span { color: var(--bad); font-weight: 700; }
.warn-list, .plain { margin: 0; padding-left: 18px; font-size: .88rem; }
.log-wrap { max-height: 420px; overflow-y: auto; }
.report-raw { margin-top: 16px; }
.report-raw pre { white-space: pre-wrap; background: var(--ivory); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font: .8rem/1.45 var(--mono); max-height: 360px; overflow: auto; }

/* --------------------------------------------------------------- admin */
.matrix th.rot { font-size: .72rem; min-width: 92px; text-transform: none; letter-spacing: 0; vertical-align: bottom; }
.matrix th.sticky { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 200px; }
.matrix thead th.sticky { background: #FBFAF7; }
.matrix input { width: 18px; height: 18px; accent-color: var(--orange-dark); }
.matrix-wrap { max-height: 70vh; }
.sticky-actions { position: sticky; bottom: 0; background: var(--ivory); padding: 12px 0; }
.upload-form { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.file-btn { cursor: pointer; }
.table-meta { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.big-num { font-size: 1.6rem; font-weight: 700; }
.checks { list-style: none; padding: 0; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--bad); font-weight: 600; }

/* --------------------------------------------------------------- público */
body.public { background: var(--carbon); }
.public-wrap { max-width: 760px; margin: 0 auto; padding: 48px 18px; }
.public-brand { display: flex; align-items: center; gap: 12px; justify-content: center; color: #fff; margin-bottom: 26px; }
.public-brand .brand-mark { width: 46px; height: 46px; font-size: 24px; }
.public-brand strong { font-size: 1.3rem; letter-spacing: .1em; }
.public-brand small { color: #CFCFCF; }
.public-foot { text-align: center; color: #A8A8A8; font-size: .8rem; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .result-grid, .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .side { position: fixed; left: -270px; z-index: 20; transition: left .2s; box-shadow: 4px 0 20px rgba(0, 0, 0, .3); }
  body.menu-open .side { left: 0; }
  .menu-btn { display: block; }
  .top { padding: 12px 16px; }
  .content { padding: 18px 14px 40px; }
  .user-name { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .downloads { align-items: stretch; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.matrix .link-btn { text-decoration: none; color: inherit; font-weight: 700; }
.matrix thead .link-btn { color: var(--gray); }
@media (max-width: 820px) { .top-title { font-size: 1rem; } }
.ico-file { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h8l6 6v14H6zm7 1.5V9h5.5zM8 13h8v2H8zm0 4h8v2H8z'/%3E%3C/svg%3E"); }
/* normalizador por pasos */
.steps { display: flex; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--gray); background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 5px 14px 5px 6px; }
.steps li b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ivory); color: var(--gray); font-size: .8rem; }
.steps li.on { border-color: var(--orange); color: var(--carbon); font-weight: 600; }
.steps li.on b { background: var(--orange); color: var(--carbon); }
.steps li.done b { background: var(--ok); color: #fff; }
.card-step[data-step="1"] { max-width: 760px; }
.nz-files { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.nz-files [data-engine-description]:empty { display: none; }
.nz-files [data-engine-description] { margin: 0; }
.hint { display: block; font-weight: 400; font-size: .82rem; color: var(--gray); background: var(--orange-pale); border-radius: 6px; padding: 6px 9px; margin-top: 2px; }
.hint strong { color: var(--orange-dark); }
.req { color: var(--bad); }
.callout { font-size: .85rem; color: var(--gray); margin: 2px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #FBFAF7; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: .86rem; }
.chip small { display: block; color: var(--gray); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.chip.def { border-style: dashed; }
.chips .link-btn { margin-left: auto; }
.result-actions { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.table td.small { white-space: pre-line; }
/* campo de fecha AAAA-MM-DD */
.date-field { position: relative; display: flex; align-items: stretch; }
.date-field .date-text { flex: 1; font: 400 .95rem var(--font); padding: 9px 44px 9px 11px; border: 1px solid #CFCCC4; border-radius: 8px; background: #fff; color: var(--carbon); min-width: 0; font-variant-numeric: tabular-nums; letter-spacing: .02em; width: 100%; }
.date-field .date-text:invalid:not(:placeholder-shown) { border-color: var(--bad); }
.date-btn { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 36px; border: 0; border-radius: 6px; background: var(--ivory); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235B5B5B'%3E%3Cpath d='M7 2h2v2h6V2h2v2h3a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3zM5 9v10h14V9zm2 2h3v3H7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 18px; }
.date-btn:hover { background-color: var(--orange-pale); }
.date-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.filters .date-field { min-width: 150px; }
/* logo */
.brand { flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 10px 18px; }
.brand-logo { display: block; width: 160px; height: auto; }
.brand-sub { color: #BDBDBD; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; padding-left: 4px; }
.public-brand { flex-direction: column; gap: 6px; }
.public-brand .brand-logo { width: 230px; }
.public-brand .brand-sub { font-size: .78rem; }
.ico-columns { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h5v16H3zm6.5 0h5v16h-5zM16 4h5v16h-5z'/%3E%3C/svg%3E"); }
.mapping-note { margin-top: 4px; padding: 4px 8px; background: var(--warn-bg); color: var(--warn); border-radius: 6px; }
/* asistente de columnas y pantalla de encabezados */
.mapper { background: var(--orange-pale); border: 1px solid #FFD3B8; border-radius: var(--radius); padding: 14px 16px; margin: 12px 0 18px; }
.mapper .sub-title { margin-top: 0; }
.mapper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 18px; margin: 10px 0 12px; }
.mapper-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; font-weight: 600; }
.mapper-grid select { font: 400 .9rem var(--font); padding: 7px 9px; border: 1px solid #CFCCC4; border-radius: 8px; background: #fff; }
.mapper-grid .is-missing select { border-color: var(--bad); }
.mapper-grid em { font-weight: 400; color: var(--gray); font-style: normal; font-size: .78rem; }
.tag { display: inline-block; background: var(--ivory); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; margin: 2px 4px 2px 0; font-size: .8rem; }
.tag-added { background: #fff; border-color: var(--orange-light); }
.tag button { border: 0; background: none; color: var(--bad); cursor: pointer; font-weight: 700; padding: 0 0 0 4px; }
.hd-add { display: flex; gap: 6px; }
.hd-add input { font: 400 .85rem var(--font); padding: 5px 8px; border: 1px solid #CFCCC4; border-radius: 6px; min-width: 0; flex: 1; }
.link.strong { font-weight: 700; }
/* pestañas y ficha del proyecto */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.tab { padding: 9px 16px; border: 0; background: none; color: var(--gray); font: 600 .92rem var(--font); border-bottom: 3px solid transparent; cursor: pointer; }
.tab.is-on { color: var(--carbon); border-bottom-color: var(--orange); }
.sheet-head { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.star { color: var(--bad); font-weight: 700; }
.sheet td { vertical-align: top; }
.sheet td:first-child { width: 190px; }
.sheet tr.obl td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
.sheet .code { font: .74rem var(--mono); color: var(--gray); }
.sheet .origin { display: inline-block; font-size: .8rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); background: #fff; white-space: nowrap; }
.sheet .o-col { background: #EAF2FB; border-color: #C9DDF2; color: #1D4F86; }
.sheet .o-fix { background: var(--ivory); }
.sheet .o-rule { background: var(--orange-pale); border-color: #FFD3B8; color: var(--orange-dark); }
.sheet .o-empty { color: var(--gray); }
.sheet .fixed-val { font: .9rem var(--mono); background: var(--ivory); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); }
.sheet .rule-txt { font-size: .86rem; }
.sheet .base { font-size: .8rem; margin-top: 5px; color: var(--gray); }
.sheet .placeholder { color: #9A968C; font-style: italic; }
.sheet .clean { font-size: .84rem; }
.sheet .clean small { display: block; color: var(--gray); }
.sheet .src-block { margin: 2px 0 8px; }
.sheet .src-block.compact { margin: 6px 0 4px; padding-left: 8px; border-left: 2px solid var(--line); }
.sheet .src-title { font-size: .8rem; color: var(--gray); margin-bottom: 2px; }
.sheet .src-names { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.sheet .add-name { font-size: .8rem; margin-left: 4px; }
.sheet .hd-add { display: inline-flex; gap: 6px; align-items: center; margin-left: 4px; }
.sheet .hd-add input { font: 400 .85rem var(--font); padding: 4px 8px; border: 1px solid #CFCCC4; border-radius: 6px; width: 230px; }
/* ficha editable */
.sheet-toolbar { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.sheet-info { display: flex; flex-direction: column; gap: 2px; }
.sheet select, .sheet input[type=text] { font: 400 .86rem var(--font); padding: 6px 8px; border: 1px solid #CFCCC4; border-radius: 7px; background: #fff; max-width: 100%; }
.sheet td:nth-child(2) { width: 190px; }
.sheet td.clean { width: 230px; }
.sheet td.clean select, .sheet td.clean input { width: 100%; margin-bottom: 4px; }
.sheet .src-select { width: 100%; margin-bottom: 6px; }
.sheet .fix-input { width: 100%; max-width: 360px; }
.sheet .name-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 2px 6px 2px 0; margin-right: 6px; }
.sheet .base-groups { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
.sheet .base-groups .name-group + .name-group, .sheet .base-groups .tag-soft + .name-group, .sheet .base-groups .name-group + .tag-soft { border-left: 1px solid var(--line); padding-left: 8px; }
.sheet .tag-soft { background: #fff; border-style: dashed; }
.sheet .tag-warn { background: var(--bad-bg); color: var(--bad); border-color: #F5C2BE; }
.sheet .shared-note { font-size: .76rem; color: var(--gray); margin-left: 4px; }
.sheet tr.bad-row td { background: var(--bad-bg); }
.sheet-save-note { background: var(--orange-pale); border: 1px solid #FFD3B8; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.sheet-test { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; background: #FBFAF7; }
.test-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.test-wrap { max-height: 360px; overflow: auto; }
.test-wrap td, .test-wrap th { white-space: nowrap; font-size: .78rem; }
td.null-cell { color: var(--bad); font-weight: 700; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- reglas configurables (fase 3) ---------- */
.sheet .rule-sum { font-size: .84rem; }
.sheet .rule-pre { margin-bottom: 4px; color: var(--carbon); }
.sheet .rule-list { margin: 0; padding-left: 1.3em; }
.sheet .rule-list li { margin: 1px 0; }
.sheet .rule-list.collapsed li.more { display: none; }
.sheet .rule-list .rule-else { list-style: none; margin-left: -1.3em; color: var(--gray); }
.sheet .null-out { color: var(--bad); }
.sheet tr.rule-edit-row > td { background: var(--ivory); padding: 0; }
.rule-editor { padding: 14px 16px; border-left: 3px solid var(--orange); }
.rule-editor .rule-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.rule-editor .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.rule-editor .seg button { border: 0; background: none; padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.rule-editor .seg button + button { border-left: 1px solid var(--line); }
.rule-editor .seg button.is-on { background: var(--carbon); color: #fff; }
.rule-editor .rule-pre-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.rule-editor .lbl { font-size: .85rem; color: var(--gray); }
.rule-editor .rule-note { font-size: .82rem; margin: 4px 0 8px; }
.rule-editor select, .rule-editor input[type=text] { font-size: .84rem; padding: 4px 6px; }
.rule-editor .rule-ref { max-width: 220px; }
.rule-editor .num-input { width: 80px; }
.rule-editor .col-input { width: 170px; }
.rule-editor .fix-input { width: 130px; }
.rule-editor .log-input { width: 100%; margin-top: 4px; }
.rule-editor .rule-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.rule-editor .rule-table th { font-size: .75rem; color: var(--gray); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); text-transform: none; }
.rule-editor .rule-table td { padding: 8px; border-top: 1px solid var(--line); vertical-align: top; font-size: .85rem; }
.rule-editor .rule-table td.num { width: 26px; color: var(--gray); }
.rule-editor .rule-table tr.rule-else td { background: var(--ivory); }
.rule-editor .cond { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 4px; }
.rule-editor .cond-and { font-size: .75rem; font-weight: 700; color: var(--orange-dark); padding: 0 2px; }
.rule-editor .vchips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.rule-editor .chip-or { font-size: .72rem; color: var(--gray); }
.rule-editor .chip-input { width: 120px; }
.rule-editor .tag-col { background: #FFF3EB; border-color: var(--orange-light); }
.rule-editor .rule-out { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 220px; }
.rule-editor .log-check { font-size: .78rem; color: var(--gray); white-space: nowrap; }
.rule-editor .row-actions { white-space: nowrap; width: 1%; }
.rule-editor .icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 26px; height: 26px; cursor: pointer; font-size: .85rem; line-height: 1; color: var(--carbon); }
.rule-editor .icon-btn:disabled { opacity: .35; cursor: default; }
.rule-editor .icon-btn + .icon-btn { margin-left: 2px; }
.rule-editor .rule-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.rule-editor .rule-foot .rule-cancel { margin-left: auto; }
.rule-editor .rule-pending { font-size: .8rem; color: var(--bad); cursor: help; }
.rule-editor .rule-table { table-layout: fixed; }
.rule-editor .rule-table th:nth-child(1) { width: 30px; }
.rule-editor .rule-table th:nth-child(3) { width: 34%; }
.rule-editor .rule-table th:nth-child(4) { width: 122px; }
.rule-editor .cond { flex-wrap: wrap; }
.rule-editor .log-input { width: 100%; max-width: 320px; }
.rule-editor .rule-out { min-width: 0; }
.brand-ver { font-size: .66rem; letter-spacing: .02em; text-transform: none; color: #8C8C8C; margin-left: 4px; font-weight: 400; }
.rule-editor .rule-checks { margin-top: 10px; padding: 8px 12px; border-radius: 8px; font-size: .84rem; }
.rule-editor .rule-checks ul { margin: 4px 0 0; padding-left: 1.2em; }
.rule-editor .rule-checks.bad { background: var(--bad-bg); color: var(--bad); border: 1px solid #F5C2BE; }
.rule-editor .rule-checks.warn { background: #FFF6E5; color: #8A5300; border: 1px solid #F3D49B; }
.rule-editor .rule-checks.stress { outline: 3px solid var(--orange-light); }
.sheet .rule-flag { display: inline-block; font-size: .78rem; font-weight: 600; border-radius: 6px; padding: 1px 8px; margin-bottom: 4px; cursor: help; }
.sheet .rule-flag.bad { background: var(--bad-bg); color: var(--bad); }
.sheet .rule-flag.warn { background: #FFF6E5; color: #8A5300; }
.sheet .same-as { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sheet .same-as label { white-space: nowrap; }
.sheet .same-as select { max-width: 340px; }
/* ---------- reglas generales del proyecto ---------- */
.general-rules { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; background: #FBFAF7; font-size: .88rem; }
.general-rules .gr-head { margin-bottom: 6px; }
.general-rules .gr-row { display: grid; grid-template-columns: 260px 1fr; gap: 4px 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.general-rules .gr-lbl { color: var(--gray); }
.general-rules .gr-val { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.general-rules .gr-val > .cond { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 4px; }
.general-rules .gr-help { grid-column: 2; font-size: .78rem; }
.general-rules .gr-input { min-width: 280px; font-size: .84rem; padding: 4px 6px; }
.general-rules select, .general-rules input[type=text] { font-size: .84rem; padding: 4px 6px; }
.general-rules .num-input { width: 80px; } .general-rules .chip-input { width: 110px; }
.general-rules .cond-and { font-size: .75rem; font-weight: 700; color: var(--orange-dark); }
.general-rules .chip-or { font-size: .72rem; color: var(--gray); }
.general-rules .icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 26px; height: 26px; cursor: pointer; }
.general-rules .rule-checks { grid-column: 2; padding: 6px 10px; border-radius: 8px; font-size: .82rem; }
.general-rules .rule-checks ul { margin: 0; padding-left: 1.2em; }
.general-rules .rule-checks.bad { background: var(--bad-bg); color: var(--bad); border: 1px solid #F5C2BE; }
.stat .stat-note { display: block; font-size: .72rem; color: var(--gray); margin-top: 2px; }
.badge-portal { background: #FFF3EB; color: var(--orange-dark); border-color: var(--orange-light); }
.page-actions { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.steps-list { margin: 6px 0 0; padding-left: 1.3em; }
.sheet .dane-dept { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.sheet .dane-dept select { max-width: 220px; }
.form-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- Digitalizador (v1.7.0) ---------- */
.ico-scan { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h6v2H5v4H3zm12 0h6v6h-2V5h-4zM3 15h2v4h4v2H3zm16 0h2v6h-6v-2h4zM3 11h18v2H3z'/%3E%3C/svg%3E"); }
.ico-download { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 3h2v9.2l3.3-3.3 1.4 1.4L12 16l-5.7-5.7 1.4-1.4 3.3 3.3zM4 18h16v3H4z'/%3E%3C/svg%3E"); }
.ico-plus { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 4h2v7h7v2h-7v7h-2v-7H4v-2h7z'/%3E%3C/svg%3E"); }
.ico-calendar { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h2v2h6V2h2v2h3a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3zM5 9v10h14V9z'/%3E%3C/svg%3E"); }
.btn .ico { opacity: 1; }
.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: 10px; }
.field textarea { font: 400 .95rem/1.45 var(--font); padding: 9px 11px; border: 1px solid #CFCCC4; border-radius: 8px; background: #fff; color: var(--carbon); resize: vertical; min-height: 110px; }
.field textarea:focus-visible { outline: 3px solid var(--orange-light); outline-offset: 2px; }

.dz { max-width: 1040px; }
.dz-intro { margin: 0; max-width: 640px; }
.dz-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center;
  background: var(--carbon); color: #fff; border-radius: 14px; padding: 30px 32px; margin-bottom: 30px; box-shadow: 0 10px 30px rgba(43, 43, 43, .18); }
.dz-hero::before { content: ""; position: absolute; right: -90px; top: -90px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 87, 0, .35), rgba(255, 87, 0, 0) 70%); pointer-events: none; }
.dz-hero::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--orange); }
.dz-hero-main, .dz-hero-side { position: relative; }
.dz-pill { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--carbon); background: var(--orange); border-radius: 99px; padding: 3px 11px; }
.dz-title { font-size: 1.9rem; margin: 10px 0 4px; font-weight: 800; letter-spacing: -.01em; }
.dz-title span { color: var(--orange-light); font-variant-numeric: tabular-nums; }
.dz-meta { display: flex; align-items: center; gap: 7px; margin: 0; color: #CFCFCF; font-size: .9rem; font-variant-numeric: tabular-nums; }
.dz-meta .ico { opacity: .8; }
.dz-sub { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: #A8A8A8; margin: 20px 0 8px; }
.dz-changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.dz-changes li { position: relative; padding-left: 28px; }
.dz-changes li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 87, 0, .18)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF7A32' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat; }
.dz-hero-side { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.dz-download { min-width: 240px; box-shadow: 0 6px 18px rgba(255, 87, 0, .35); }
.dz-download:hover { transform: translateY(-1px); }
.dz-note { color: #BDBDBD; }
.dz-admin { display: flex; gap: 12px; align-items: center; margin-top: 6px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .12); }
.dz-admin .muted { color: #A8A8A8; }
.dz-admin .link { color: var(--orange-light); }

.dz-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dz-item { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 18px; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; transition: border-color .15s, box-shadow .15s; }
.dz-item:hover { border-color: #FFCDB0; box-shadow: var(--shadow); }
.dz-item.is-off { opacity: .6; }
.dz-item-head { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.dz-ver { font: 700 1.05rem var(--mono); color: var(--carbon); background: var(--orange-pale); border: 1px solid #FFD3B8; border-radius: 7px; padding: 1px 9px; }
.dz-date { font-size: .84rem; color: var(--gray); font-variant-numeric: tabular-nums; }
.dz-changes-sm { gap: 3px; font-size: .9rem; }
.dz-changes-sm li { padding-left: 22px; }
.dz-changes-sm li::before { width: 14px; height: 14px; top: 4px; background-color: var(--orange-pale); background-size: 10px; }
.dz-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.dz-admin-row { display: flex; gap: 10px; align-items: center; }
.dz-danger { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-color: #F5C2BE; }

@media (max-width: 820px) {
  .dz-hero { grid-template-columns: 1fr; padding: 24px 20px; }
  .dz-hero-side { align-items: stretch; }
  .dz-download { min-width: 0; }
  .dz-title { font-size: 1.55rem; }
  .dz-item { grid-template-columns: 1fr; gap: 10px; }
  .dz-item-head { flex-direction: row; align-items: center; gap: 10px; }
  .dz-item-actions { flex-direction: row; justify-content: space-between; align-items: center; }
}
.dz-toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: 380px; display: flex; flex-direction: column; gap: 4px;
  background: var(--carbon); color: #fff; border-left: 4px solid var(--orange); border-radius: 10px; padding: 14px 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  font-size: .9rem; transition: opacity .35s, transform .35s; }
.dz-toast span { color: #D6D6D6; font-size: .84rem; }
.dz-toast.is-out { opacity: 0; transform: translateY(8px); }
@media (max-width: 820px) { .dz-toast { left: 14px; right: 14px; bottom: 14px; max-width: none; } }

/* ---------- Digitalizador: instalador en el servidor (v1.9.0) ---------- */
.dz-upload input[type=file] { margin: 6px 0 4px; }
.dz-file-now { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: var(--ok-bg); border: 1px solid #BFE3CC; border-radius: 8px; padding: 8px 12px; margin: 6px 0; font-size: .88rem; }
.dz-progress { margin-top: 8px; }
.dz-progress .dz-bar { height: 10px; background: #EEE; border-radius: 6px; overflow: hidden; }
.dz-progress .dz-bar span { display: block; height: 100%; width: 0; background: var(--orange); transition: width .2s; }
.dz-progress.is-error small { color: var(--bad); }
.dz-hero-side .link.small { margin-top: 4px; }
.dz-hero-side .dz-alt { margin-top: 4px; color: #FF9A62; text-decoration: underline; text-underline-offset: 3px; }
.dz-hero-side .dz-alt:hover, .dz-hero-side .dz-alt:focus-visible { color: #FFD2B8; text-decoration-thickness: 2px; }

/* ---------- Auditoría */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.field-grow { flex: 1 1 220px; }
.pager-gap { padding: 4px 4px; color: var(--muted, #777); }
.audit-table .ev-col { width: 40px; text-align: center; }
.audit-detail { max-width: 460px; overflow-wrap: anywhere; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 30px; height: 28px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--carbon); }
.icon-btn:hover { border-color: var(--orange); }
.ev-dialog { border: 0; border-radius: 12px; padding: 0; width: min(640px, 94vw); max-height: 84vh; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.ev-dialog::backdrop { background: rgba(20, 20, 20, .45); }
.ev-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.ev-head h2 { margin: 0; font-size: 1.05rem; }
.ev-body { margin: 0; padding: 14px 18px 18px; display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 16px; }
.ev-body dt { font-weight: 600; color: var(--carbon); }
.ev-body dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.badge-pendiente { background: #FFF1D6; color: #8A5A00; }
.badge-activo { background: #E1F5E6; color: #1E6B34; }
.badge-inactivo { background: #EEE; color: #555; }

/* ---------- Equipos del Digitalizador */
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85em; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; min-width: 150px; font: inherit; font-size: .88rem; }
.dz-pending { border: 1px solid #F3DD9B; background: #FFFBEF; border-radius: 10px; padding: 12px 14px; }
.dz-pending .table-wrap + .table-wrap { margin-top: 12px; }
.dz-add-ip { margin: 10px 0 12px; }
.dz-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 6px 0 12px; }
.dz-facts dt { font-weight: 600; }
.dz-facts dd { margin: 0; overflow-wrap: anywhere; }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 12px; flex-wrap: wrap; }
.subtabs a { padding: 8px 14px; text-decoration: none; color: var(--carbon); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subtabs a.is-active { border-bottom-color: var(--orange); font-weight: 600; }
.ev-changes { grid-column: 1 / -1; margin-top: 10px; }
.ev-changes h3 { font-size: .95rem; margin: 0 0 6px; }
.ev-changes table { width: 100%; }
.ev-changes td { vertical-align: top; overflow-wrap: anywhere; white-space: pre-wrap; font-size: .85rem; }
.ev-changes .ev-old { color: #9B2C2C; background: #FFF5F5; }
.ev-changes .ev-new { color: #1E6B34; background: #F0FAF3; }
.ev-dialog { width: min(760px, 94vw); }
.dz-actions form { display: inline; margin-left: 10px; }

/* ---------- Roles y acceso */
.role-project-list.is-off { opacity: .45; }
.check.from-role { color: var(--muted, #777); }
.check.from-role input { accent-color: #9AA0A6; }
.role-note { font-size: .8em; color: var(--muted, #777); }
.user-access [data-access-summary] { font-weight: 600; margin: 0 0 8px; }
.roles-layout { align-items: start; }
tr.is-editing td { background: #FFF6EE; }
.matrix .from-role-cell { color: #9AA0A6; }
.matrix-filter { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; flex-wrap: wrap; }
.roles-layout { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); }
.roles-layout .table td:last-child { white-space: nowrap; }
@media (max-width: 1100px) { .roles-layout { grid-template-columns: 1fr; } }
.ev-changes .ev-note { font-size: .78rem; color: var(--muted, #777); margin-top: 3px; }

/* =============================================================== ASISTENCIA (portal) */
.ico-cal { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h2v2h6V2h2v2h3a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3zM5 9v10h14V9z'/%3E%3C/svg%3E"); }
.ico-check { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 14.2-4.3-4.3 1.4-1.4 2.9 2.9 5.6-5.6 1.4 1.4z'/%3E%3C/svg%3E"); }
.ico-chart { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h2v16h16v2H3zm4 10h3v5H7zm5-5h3v10h-3zm5 3h3v7h-3z'/%3E%3C/svg%3E"); }
.ico-gear { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.5 2l.5 2.6a8 8 0 0 1 2 1.2l2.5-.9 1.5 2.6-2 1.7a8 8 0 0 1 0 2.4l2 1.7-1.5 2.6-2.5-.9a8 8 0 0 1-2 1.2l-.5 2.6h-3l-.5-2.6a8 8 0 0 1-2-1.2l-2.5.9-1.5-2.6 2-1.7a8 8 0 0 1 0-2.4l-2-1.7 1.5-2.6 2.5.9a8 8 0 0 1 2-1.2l.5-2.6zM12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'/%3E%3C/svg%3E"); }
.ico-phone { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 1h10a2 2 0 0 1 2 2v18a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2zm0 3v15h10V4zm5 16a1 1 0 1 0 0 2 1 1 0 0 0 0-2z'/%3E%3C/svg%3E"); }
.nav-badge { margin-left: auto; background: var(--orange); color: var(--carbon); border-radius: 99px; font-size: .72rem; font-weight: 700; padding: 1px 8px; }
.nav-link.is-active .nav-badge { background: var(--carbon); color: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #8f1d17; }

.as-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.as-head p { margin: 0; }
.as-filters { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.as-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--carbon); text-decoration: none; font-size: .86rem; }
.as-chip:hover { background: var(--ivory); }
.as-chip.is-on { background: var(--carbon); border-color: var(--carbon); color: #fff; font-weight: 600; }
.as-chip b { font-weight: 700; }
.as-clear { margin-left: auto; font-size: .86rem; color: var(--orange-dark); }
.as-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.as-fbtn { display: flex; }
.as-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.as-kpis .stat { min-width: 0; }
.as-split { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.as-main-col { flex: 999 1 620px; min-width: 0; }
.as-side-col { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.as-side-col.as-wide { flex: 1 1 380px; }
.as-mini { margin: 0; padding: 16px 18px; }
.as-table td { vertical-align: middle; }
.as-row { cursor: pointer; }
.as-row:hover td { background: #FBFAF7; }
.as-person { font-weight: 700; color: var(--carbon); text-decoration: none; }
.as-pill { display: inline-block; font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--ivory); color: var(--gray); border: 1px solid var(--line); margin: 1px 2px 1px 0; white-space: nowrap; text-decoration: none; }
.as-pill.is-ok { background: var(--ok-bg); color: var(--ok); border-color: #BFE3CC; }
.as-pill.is-warn { background: var(--warn-bg); color: var(--warn); border-color: #F3DD9B; }
.as-pill.is-bad { background: var(--bad-bg); color: var(--bad); border-color: #F5C2BE; }
.as-pill.is-info { background: #E8EEFD; color: #1D4ED8; border-color: #C9D7F7; }
.as-pill.is-soft { background: #fff; }
.as-att { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.as-att a { display: flex; flex-direction: column; text-decoration: none; color: var(--carbon); padding-left: 14px; position: relative; font-size: .88rem; }
.as-att a::before { content: ""; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: #C77700; }
.as-att .as-att-outside a::before, .as-att .as-att-face_fail a::before, .as-att .as-att-no_entry a::before { background: var(--bad); }
.as-att span { color: var(--gray); font-size: .82rem; }
.as-cov { margin-bottom: 10px; }
.as-cov-row { display: flex; justify-content: space-between; font-size: .88rem; }
.as-cov progress { width: 100%; height: 8px; accent-color: var(--orange); }
.as-cta { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--carbon); color: #fff; border-radius: var(--radius); padding: 14px 16px; text-decoration: none; }
.as-cta span { display: flex; flex-direction: column; }
.as-cta small { color: #D8D3CD; }
.as-dialog { border: 0; border-radius: 14px; padding: 22px; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.as-dialog::backdrop { background: rgba(43, 43, 43, .45); }
.as-dayhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.as-dayhead p { margin: 2px 0 0; }
.as-dayplan { display: flex; flex-direction: column; text-align: right; }
.as-thumb { display: block; width: 56px; height: 56px; object-fit: cover; border-radius: 8px; margin-top: 4px; border: 1px solid var(--line); }
.as-thumb-lg { width: 120px; height: 120px; }
.as-inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.as-inline-form input { font: 400 .84rem var(--font); padding: 5px 8px; border: 1px solid #CFCCC4; border-radius: 6px; width: 150px; }
.as-row-form { flex-direction: row; flex-wrap: wrap; align-items: flex-end; margin-top: 10px; }
.as-grow { flex: 1 1 200px; }
.as-details summary { padding: 2px 0; }
.as-list { margin: 0; padding-left: 18px; }
.as-map { position: relative; height: 260px; border-radius: 10px; overflow: hidden; background: #E9EEE6; border: 1px solid var(--line); touch-action: none; user-select: none; }
.as-map-sm { height: 220px; margin: 12px 0; }
.as-map-pick { height: 280px; cursor: crosshair; }
.as-map-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; }
.as-map-svg { position: absolute; inset: 0; pointer-events: none; }
.as-map-svg circle { pointer-events: auto; }
.as-map-circle { fill: rgba(255, 87, 0, .14); stroke: var(--orange); stroke-width: 2; }
.as-map-circle.is-home { fill: rgba(29, 78, 216, .12); stroke: #1D4ED8; }
.as-map-center { fill: var(--carbon); }
.as-map-pt { stroke: #fff; stroke-width: 2.5; fill: var(--ok); }
.as-map-pt.is-bad { fill: var(--orange); }
.as-map-pt.is-ping { fill: #8E877F; }
.as-map-ctl { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; }
.as-map-ctl button { width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 18px; cursor: pointer; }
.as-map-attr { position: absolute; right: 0; bottom: 0; background: rgba(255, 255, 255, .85); font-size: .7rem; padding: 1px 6px; color: var(--carbon); }

/* programación */
.as-weekbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px; }
.as-weekname { font-size: 1rem; padding: 8px 6px; font-variant-numeric: tabular-nums; }
.as-inline { flex-direction: row; align-items: center; gap: 6px; }
.as-sched { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.as-palette { flex: 0 1 240px; display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 14px; }
.as-palette .sub-title { margin: 8px 0 2px; }
.as-tpl { display: flex; gap: 10px; align-items: center; text-align: left; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: grab; font: inherit; }
.as-tpl:hover { border-color: var(--orange); }
.as-tpl span:last-child { display: flex; flex-direction: column; font-size: .84rem; }
.as-tpl small { color: var(--gray); }
.as-tpl-bar { width: 8px; height: 30px; border-radius: 4px; background: var(--c, #4C78E0); flex: 0 0 8px; }
.as-btnrow { display: flex; flex-wrap: wrap; gap: 5px; }
.as-selinfo { margin: 6px 0 0; font-weight: 600; }
.as-grid-col { flex: 999 1 640px; min-width: 0; }
.as-grid-wrap { min-width: 0; }
.as-grid { min-width: 860px; }
.as-grid th, .as-grid td { padding: 4px; vertical-align: middle; }
.as-grid .as-gp { min-width: 190px; text-align: left; }
.as-grid thead th.is-today { background: var(--orange-pale); }
.as-colsel, .as-rowsel { border: 0; background: none; width: 100%; text-align: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 1px; padding: 6px; font: inherit; color: inherit; text-transform: none; letter-spacing: 0; }
.as-colsel { align-items: center; }
.as-colsel small, .as-rowsel small, .as-gp small { color: var(--gray); font-weight: 400; font-size: .74rem; display: block; }
.as-cell { width: 100%; min-height: 46px; border-radius: 8px; border: 1px solid transparent; background: color-mix(in srgb, var(--c, #8E877F) 16%, white); color: var(--carbon); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; font: inherit; font-size: .8rem; position: relative; user-select: none; }
.as-cell b { font-size: .8rem; }
.as-cell small { font-size: .72rem; color: var(--gray); }
.as-cell.is-empty { background: #fff; border: 1px dashed #D6D0C8; color: #8E877F; }
.as-cell.k-rest, .as-cell.k-holiday { background: var(--ivory); color: var(--gray); }
.as-cell.k-leave, .as-cell.k-sick, .as-cell.k-vacation { background: var(--bad-bg); color: var(--bad); }
.as-cell.is-draft::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #E0A100; }
.as-cell.is-sel { outline: 3px solid var(--orange); outline-offset: -1px; }
.as-cell.has-sugg { border: 1px dashed #1D4ED8; }
.as-sugg { font-style: normal; font-size: .66rem; color: #1D4ED8; }
.as-cov-cell { font-weight: 700; }
.as-cov-cell.is-bad { color: var(--bad); }
.as-cov-cell.is-ok { color: var(--ok); }
.as-grid tfoot th, .as-grid tfoot td { background: #FBFAF7; border-top: 2px solid var(--line); }
.as-grid .as-gt { min-width: 104px; padding: 4px 14px 4px 10px; white-space: nowrap; position: sticky; right: 0; z-index: 1; background: #fff; box-shadow: -6px 0 8px -6px rgba(0,0,0,.18); }
.as-grid thead th.as-gt { background: #FBFAF7; }
.as-grid tfoot td.as-gt { background: #FBFAF7; }
.as-grid td.as-gt small { display: block; font-size: .7rem; color: var(--gray); font-weight: 400; }
.as-grid td.as-gt.is-over b, .as-grid td.as-gt.is-over small:last-child { color: var(--bad); }
.as-grid th.as-gt small { display: block; font-size: .7rem; font-weight: 400; color: var(--gray); text-transform: none; letter-spacing: 0; }
.as-grid thead th.is-hol, .as-grid td.is-hol { background: #FDF3E1; }
.as-grid thead th.is-hol.is-today { background: linear-gradient(#FDF3E1, var(--orange-pale)); }
.as-grid thead th.is-hol small { color: #8A5A00; max-width: 110px; white-space: normal; line-height: 1.2; }
.as-hol-tag { display: inline-block; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: #C77700; border-radius: 999px; padding: 1px 7px; margin-bottom: 2px; }
.as-cell.is-empty small { color: #A26A00; }
.as-grid td.is-hol .as-cell.is-empty { background: transparent; border-color: #E7C98F; }
.as-cell.k-holiday { background: #FAE6C3; color: #7A4F00; }
.as-cell.k-holiday small { color: #8A5A00; }
.as-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--c, #4C78E0); margin-right: 6px; vertical-align: -1px; }

/* aprobaciones */
.as-tabs { margin-bottom: 14px; }
.as-inbox { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.as-inbox-list { flex: 1 1 340px; max-width: 460px; padding: 0; overflow: hidden; margin: 0; }
.as-bulk { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.as-item { display: flex; gap: 10px; padding: 11px 14px; border-top: 1px solid #F1EEEA; align-items: flex-start; }
.as-item:first-of-type { border-top: 0; }
.as-item.is-on { background: var(--orange-pale); box-shadow: inset 3px 0 0 var(--orange); }
.as-item input { margin-top: 4px; accent-color: var(--orange-dark); }
.as-item a { flex: 1; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--carbon); min-width: 0; }
.as-item-top { display: flex; justify-content: space-between; gap: 8px; }
.as-item-top small, .as-item-txt { color: var(--gray); font-size: .8rem; }
.as-item-lab { font-size: .86rem; }
.as-item-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-detail { flex: 999 1 480px; min-width: 0; margin: 0; }
.as-quote { background: var(--ivory); border-radius: 8px; padding: 12px 14px; margin: 10px 0; font-size: .92rem; }
.as-tl { position: relative; background: var(--ivory); border-radius: 8px; padding: 8px 0; margin-top: 6px; }
.as-tl-row { position: relative; height: 18px; margin: 4px 0; }
.as-bar { position: absolute; top: 0; height: 18px; border-radius: 4px; }
.b-plan { background: #C9D7F7; }
.b-work { background: var(--carbon); opacity: .85; }
.b-req { background: #FFB98C; }
.as-legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0; }
.as-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.as-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0; font-size: .9rem; }
.as-dl dt { color: var(--gray); }
.as-dl dd { margin: 0; }
.as-photos { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.as-photos img { width: 180px; height: 180px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.as-photos figcaption { font-size: .8rem; color: var(--gray); margin-top: 4px; max-width: 180px; }
.as-photos figure { margin: 0; }
.as-decide { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.as-narrow { max-width: 220px; }

/* reportes */
.as-reports { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 20px; }
.as-rcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.as-rcard.is-on { box-shadow: 0 0 0 2px var(--orange); }
.as-rcard p { margin: 0; flex: 1; }
.as-rname { font-weight: 700; color: var(--carbon); text-decoration: none; }
.table td.is-bad { color: var(--bad); font-weight: 700; }

/* configuración */
.as-cfgtabs { flex-wrap: wrap; }
a.tab { text-decoration: none; }
.as-left { margin-left: 0; }
.as-req { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.as-req input { width: 100%; }
.as-textarea { font: 400 .9rem var(--font); padding: 10px; border: 1px solid #CFCCC4; border-radius: 8px; width: 100%; }
.as-code { display: block; padding: 8px 10px; margin-top: 6px; word-break: break-all; }
.as-import-log { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: .9rem; }
.as-import-line { padding: 8px 10px; border-radius: 8px; background: var(--ivory); }
.as-import-line.is-ok { background: var(--ok-bg); }
.as-import-line.is-bad { background: var(--bad-bg); }
.field textarea { font: 400 .95rem var(--font); padding: 9px 11px; border: 1px solid #CFCCC4; border-radius: 8px; }

/* impresión */
body.as-print { background: #fff; padding: 24px; }
.as-print-bar { margin-bottom: 16px; }
.as-print-head { border-bottom: 2px solid var(--orange); padding-bottom: 10px; margin-bottom: 14px; }
.as-print-head h1 { font-size: 1.5rem; margin: 4px 0; }
.as-print-head p { margin: 0; color: var(--gray); font-size: .85rem; }
.as-eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--orange-dark); }
.as-print-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.as-print-table th { text-align: left; font-size: .7rem; text-transform: uppercase; color: var(--gray); border-bottom: 1px solid #999; padding: 5px 4px; }
.as-print-table td { border-bottom: 1px solid #DDD; padding: 5px 4px; vertical-align: top; }
@media print { .as-print-bar { display: none; } body.as-print { padding: 0; } @page { size: landscape; margin: 12mm; } }
@media (max-width: 820px) { .as-req { grid-template-columns: repeat(4, minmax(0, 1fr)); } .as-inbox-list { max-width: none; } }
td.nowrap > .link + .link, td.nowrap > .link + form.inline { margin-left: 10px; }

/* horario fijo */
.as-fixed { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 8px; align-items: center; margin-bottom: 10px; }
.as-fixed select { padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .88rem; background: #fff; min-width: 0; }
.as-fixed-day { font-size: .88rem; font-weight: 600; }
.as-fixed-from { max-width: 220px; }
.as-fixed-tag { display: inline-block; margin-top: 3px; font-size: .66rem; font-weight: 700; color: #5B3CC4; background: #EEE8FD; border-radius: 999px; padding: 1px 7px; width: fit-content; }
.as-cell.is-auto::before { content: ""; position: absolute; left: 6px; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: #8B6CF0; opacity: .7; }

/* color hexadecimal */
.as-hex { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px 8px 4px 4px; }
.as-hex.is-bad { border-color: var(--bad); }
.as-hex-sw { width: 30px; height: 30px; border-radius: 6px; background: var(--c, #4C78E0); flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.as-hex input { border: 0; outline: 0; padding: 6px 0; font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; width: 100%; min-width: 0; background: transparent; }
.as-hex-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.as-hex-preset { width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); padding: 0; }
.as-hex-preset:hover, .as-hex-preset:focus-visible { outline: 2px solid var(--carbon); outline-offset: 2px; }
.as-hex-more { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 1px dashed #A8A29E; color: var(--gray); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem; line-height: 1; cursor: pointer; background: #fff; }
.as-hex-more:hover { border-color: var(--carbon); color: var(--carbon); }
.as-hex-more input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }

.as-face-dl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 14px; }
.as-face-dl .small { flex: 1 1 260px; }
.warn-text { color: #9A6700; font-weight: 600; }

/* mapa de una marcación: línea con la distancia */
.as-map-line { stroke: #2B2B2B; stroke-width: 2.5; stroke-dasharray: 7 6; stroke-linecap: round; fill: none; }
.as-map-line.is-bad { stroke: #B42318; }
.as-map-dist { font: 700 13px Inter, system-ui, sans-serif; fill: #2B2B2B; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.as-map-dist.is-bad { fill: #B42318; }
.as-map-lg { height: min(62vh, 520px); }
.as-dialog-map { width: min(820px, 94vw); }
.as-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }

/* avisos: una fila por aviso con su valor en frente */
.as-nhead { margin-top: 14px; }
.as-nrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); min-height: 48px; }
.as-nrow .check { margin: 0; flex: 1 1 auto; }
.as-nmin { display: grid; grid-template-columns: 76px 210px; align-items: center; gap: 8px; flex: none; font-size: .86rem; color: var(--gray); }
.as-nmin.small { display: block; width: 294px; }
.as-nmin input { width: 76px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; text-align: right; color: var(--carbon); }
.as-ncontact { margin-top: 16px; max-width: 420px; }
@media (max-width: 640px) { .as-nrow { flex-wrap: wrap; } .as-nmin { margin-left: 26px; grid-template-columns: 76px auto; } .as-nmin.small { width: auto; } }

/* paginación */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 2px; font-size: .86rem; color: var(--gray); }
.pager-pages { display: flex; align-items: center; gap: 4px; }
.pager-btn { min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--carbon); text-decoration: none; font-weight: 600; }
a.pager-btn:hover { border-color: var(--orange); color: var(--orange); }
.pager-btn.is-on { background: var(--carbon); border-color: var(--carbon); color: #fff; }
.pager-btn.is-off { opacity: .35; }
.pager-gap { padding: 0 2px; }
.pager-per a { color: var(--carbon); text-decoration: underline; margin: 0 1px; }
.pager-per b { color: var(--carbon); }
.as-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.as-search input[type=search] { flex: 1 1 260px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

/* --------------------------------------------------------------- v1.13.0: reglas v2 y tablas de apoyo */
.alert-warn { background: var(--warn-bg); border-color: #F3DD9B; color: #5A3B00; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: #F3DD9B; }
.rule-editor .rule-help { font-size: .82rem; color: var(--gray); background: var(--orange-pale); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.rule-editor .rule-read { font-size: .84rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.rule-editor .rule-read b { color: var(--orange-dark); }
.rule-editor select.is-tabla { border-color: var(--orange); font-weight: 600; }
.rule-editor .tabla-edit { flex-basis: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; align-items: center;
  background: #FFF8F3; border: 1px solid #FFD9C2; border-radius: 8px; padding: 8px 10px; margin: 4px 0; }
.rule-editor .tabla-edit .tl-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rule-editor .tabla-edit select { max-width: 100%; }
.rule-editor .tabla-edit .col-select { min-width: 180px; }
.rule-editor .tabla-adv { display: flex; flex-direction: column; gap: 6px; }
.rule-editor .tabla-adv .log-check { white-space: normal; }
.rule-editor .aux-box { background: #FFF8F3; border: 1px solid #FFD9C2; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.rule-editor .aux-box .tabla-edit { background: #fff; }
.rule-editor .aux-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.rule-editor .aux-head .icon-btn { margin-left: auto; }
.rule-editor .aux-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; align-items: center; margin-bottom: 6px; }
.rule-editor .aux-grid .seg { justify-self: start; }
.rule-editor .aux-name { width: 220px; }
.rule-editor .rule-table th:nth-child(2) { width: 34%; }
.rule-editor .rule-table th:nth-child(3) { width: auto; }
.table-picks { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 6px 0; }
.table-pick { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; font-size: .92rem; cursor: pointer; }
.table-pick + .table-pick { border-top: 1px solid var(--line); }
.table-pick.is-on { background: #FFF8F3; }
.table-pick small { display: block; }
.pill { background: var(--ivory); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: .78rem; color: var(--gray); white-space: nowrap; }
.new-table > summary { list-style: none; cursor: pointer; }
.new-table > summary::-webkit-details-marker { display: none; }
.new-table[open] > summary { margin-bottom: 12px; }
.new-table .small-drop { padding: 16px; }
.table-edit { margin: 8px 0; }
.table-edit > summary { cursor: pointer; }
.table-edit .form { margin-top: 10px; }
.table-edit-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.card.is-off { opacity: .75; }
@media (min-width: 760px) {
  .table-card .result-head { flex-wrap: nowrap; }
  .table-card .result-head > div:first-child { flex: 1 1 auto; min-width: 0; }
  .table-card .table-meta { flex: 0 0 auto; }
}

/* --------------------------------------------------------------- v1.14.0: fechas, archivo CSV y reglas generales */
.pf-date-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 8px 0; }
@media (max-width: 760px) { .pf-date-grid { grid-template-columns: minmax(0, 1fr); } }
.pf-date { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.pf-date > strong code { font-size: .78rem; color: var(--gray); font-weight: 400; margin-left: 4px; }
.pf-col { display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.pf-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf-days { width: 80px; }
.pf-output .check { margin-top: 10px; }
.gr-val.gr-stack { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.gr-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gr-line .num-input { width: 90px; }
.gr-add { max-width: 260px; }
.warn-line { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.warn-line .gr-input { min-width: 220px; flex: 1; }
.digits-n { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; margin-top: 4px; }
.digits-n .num-input { width: 64px; }

/* v1.16.1 · Normalizador: mensajes de parada en varias líneas y sugerencia de proyecto */
.nz-msg { white-space: pre-line; color: var(--ink, #2B2B2B); }
.nz-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.nz-suggest p { margin: 0; flex: 1 1 280px; }

/* --------------------------------------------------------------- v1.17.0: proyecto en 4 pestañas */
.cfg-tab:empty { display: none; }
.cfg-sec { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; background: #fff; }
.cfg-sec.general-rules { background: #fff; }
.cfg-title { margin: 0 0 4px; font-size: 1rem; }
.cfg-help { margin: 0 0 10px; }
.cfg-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; margin-top: 8px; }
.cfg-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 22px; margin-top: 8px; }
@media (max-width: 820px) { .cfg-grid2, .cfg-grid3 { grid-template-columns: 1fr; } }
.cfg-lbl { display: block; font-size: .8rem; font-weight: 600; color: var(--gray); margin: 10px 0 4px; }
.cfg-grid2 > div > .cfg-lbl:first-child { margin-top: 0; }
.cfg-lbl2 { font-size: .85rem; color: var(--gray); }
.cfg-opt { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; font-size: .9rem; }
.cfg-opt input[type=radio], .cfg-opt input[type=checkbox] { margin: 0; }
.cfg-opt .num-input { width: 80px; }
.cfg-sub { margin: 6px 0 4px 26px; padding: 10px 12px; background: var(--ivory); border-radius: 8px; display: flex; flex-direction: column; gap: 8px; }
.cfg-sub .field { margin: 0; }
.cfg-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.cfg-card .field { margin: 0; }
.cfg-card-head { margin-bottom: 2px; }
.cfg-fixed { padding: 8px 0; font-size: .9rem; }
.cfg-part { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.cfg-n { width: 24px; height: 24px; border-radius: 50%; background: var(--orange-pale); color: var(--orange-dark); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.cfg-review { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.cfg-rows { width: auto; min-width: 60%; }
.cfg-rows td, .cfg-rows th { padding: 4px 6px; }
.cfg-rows input[type=text], .cfg-rows select { width: 100%; min-width: 120px; font-size: .85rem; padding: 4px 6px; }
.map-table td { vertical-align: top; }
.map-table .map-col { width: 210px; }
.map-table .map-col .code { font-size: .75rem; color: var(--gray); font-family: var(--mono); }
.map-table .map-chk { width: 110px; text-align: center; }
.map-table .map-chk .cfg-opt { justify-content: center; margin: 0; }
.map-table .map-group td { background: var(--ivory); font-size: .8rem; font-weight: 600; color: var(--gray); }
.cols-table td { padding: 4px 8px; vertical-align: middle; }
.cols-table td .cfg-opt { margin: 0; }
.cols-table .n { width: 32px; color: var(--gray); font-size: .8rem; text-align: right; }
.cols-table .code { color: var(--gray); font-size: .78rem; font-family: var(--mono); }
.cols-table .col-off td { color: var(--gray); }
.cfg-sec .arrows { white-space: nowrap; width: 70px; }
.cfg-sec .icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; }
.cfg-sec .icon-btn:disabled { opacity: .35; cursor: default; }
.cfg-sec select:disabled, .cfg-sec input:disabled { background: var(--ivory); color: var(--carbon); }
.cfg-sub:empty { display: none; }
/* v1.17.1 */
.cfg-right { margin-left: auto; display: inline-flex; gap: 4px; }
.cfg-step { display: flex; flex-direction: column; gap: 6px; }
.cfg-step .field { margin: 0; }
.mx-table td input[type=text] { min-width: 80px; }
.fsteps { display: flex; flex-direction: column; gap: 6px; }
.cfg-card .gr-input, .fsteps .gr-input { flex: 1; min-width: 180px; }
/* v1.17.3: pestaña Transformación como el diseño aprobado (lista de campos + detalle) */
.tx-layout { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.tx-list { flex: 1 1 240px; max-width: 280px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; position: sticky; top: 12px; }
.tx-list-title { font-size: .78rem; font-weight: 700; color: var(--gray); padding: 4px 8px 8px; }
.tx-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 6px 8px; font: inherit; font-size: .88rem; color: var(--carbon); cursor: pointer; }
.tx-item:hover { background: var(--ivory); }
.tx-item.is-on { background: var(--orange-pale); font-weight: 700; }
.tx-item.is-bad .tx-name { color: var(--danger, #b42318); }
.tx-kind { font-size: .7rem; font-weight: 700; border-radius: 4px; padding: 1px 6px; background: var(--ivory); color: var(--gray); white-space: nowrap; }
.tx-detail { flex: 999 1 560px; min-width: 0; }
.tx-title { margin: 0; font-size: 1.1rem; }
.tx-title code { font-size: .8rem; color: var(--gray); font-weight: 400; }
.tx-table, .tx-table tbody, .tx-table tr, .tx-table td { display: block; width: 100%; border: 0; padding: 0; }
.tx-table td:first-child { display: none; }
.tx-table td { margin-top: 12px; }
.tx-table td select { max-width: 420px; }
.tx-lbl { margin-top: 0; }
.tx-date { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.tx-block { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 760px) { .tx-list { position: static; max-width: none; } }
.tx-detail select[aria-label="Agregar paso"] { width: auto; max-width: 320px; }
.tx-table td > * + * { margin-top: 6px; }
.tx-table .dane-dept { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tx-detail [data-warns] .gr-lbl { display: none; }
