:root {
  --slate: #455560;
  --slate-dark: #34414a;
  --red: #ee3124;
  --red-soft: #fde3e1;
  --amber: #c77700;
  --amber-soft: #fff4e5;
  --green: #2e7d4f;
  --green-soft: #e3f3e9;
  --blue: #2f7fc1;
  --bg: #f4f6f7;
  --panel: #ffffff;
  --line: #dde2e5;
  --text: #1f2a30;
  --muted: #6b7a84;
  --soft: #e8ecef;
  --radius: 10px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }
a { color: var(--slate); }

/* barra superior */
.topbar { display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: var(--panel); border-bottom: 3px solid var(--slate); flex-wrap: wrap; }
.logo { height: 34px; }
.brand { display: flex; flex-direction: column; line-height: 1.15; border-left: 1px solid var(--line); padding-left: 12px; }
.brand strong { color: var(--slate); }
.brand span { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tab { border: 0; background: transparent; padding: 9px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { background: var(--soft); }
.tab.active { background: var(--slate); color: #fff; }
.count { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; text-align: center; }
.warning { background: var(--amber-soft); border-bottom: 1px solid #f5c983; padding: 8px 16px; font-size: 14px; }

/* botones y campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; font-size: 14px; white-space: nowrap; background: var(--soft); color: var(--text); }
.btn.primary { background: var(--slate); color: #fff; }
.btn.primary:hover { background: var(--slate-dark); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.ok { background: var(--green); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: wait; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 18px; flex: none; }
input[type=text], input[type=url], input[type=search], select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.field > span { font-weight: 600; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; }

/* estructura de las vistas */
.view { flex: 1; display: flex; min-height: 0; }
.side { width: 340px; flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: auto; padding: 18px 22px; gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
h2 { margin: 0; font-size: 17px; color: var(--slate); }
h3 { margin: 0 0 6px; font-size: 15px; }
.seg { display: flex; background: var(--soft); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.subtabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.subtabs button { border: 0; background: transparent; padding: 8px 12px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subtabs button.active { color: var(--text); border-bottom-color: var(--red); }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; }
.drop { border: 2px dashed var(--line); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.drop.over { border-color: var(--slate); background: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 14px; padding: 3px 10px; font-size: 12px; }
.chip button { border: 0; background: transparent; cursor: pointer; padding: 0; color: var(--muted); }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* resumen de conocimiento */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.stat b { display: block; font-size: 20px; color: var(--slate); }
.stat span { font-size: 12px; color: var(--muted); }
.processing { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--amber); }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* conocimientos */
.cat-title { margin: 14px 0 6px; font-size: 14px; color: var(--slate); text-transform: uppercase; letter-spacing: .04em; }
.item { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--slate); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.item.propuesto { border-left-color: var(--amber); }
.item.descartado, .item.sustituido { opacity: .6; border-left-color: var(--muted); }
.item .head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.item .kid { font-weight: 700; color: var(--muted); font-size: 12px; }
.item .t { font-weight: 600; }
.item .s { margin: 5px 0; line-height: 1.45; font-size: 14px; }
.item .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.item .actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; background: var(--soft); color: var(--slate); text-transform: uppercase; letter-spacing: .03em; }
.badge.alta { background: var(--green-soft); color: var(--green); }
.badge.media { background: var(--soft); color: var(--slate); }
.badge.baja, .badge.propuesto { background: var(--amber-soft); color: var(--amber); }
.badge.contradice, .badge.contradiccion, .badge.error { background: var(--red-soft); color: var(--red); }
.badge.complementa { background: #e4effa; color: var(--blue); }
.badge.duplicado { background: #efe7f7; color: #6b3fa0; }
.src-link { cursor: pointer; text-decoration: underline dotted; }

/* dudas */
.query { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.query.contradiccion { border-left: 4px solid var(--red); }
.query.duda { border-left: 4px solid var(--blue); }
.query.duplicado { border-left: 4px solid #6b3fa0; }
.query .q { font-weight: 600; font-size: 15px; margin: 6px 0; }
.query .ctx { color: var(--muted); font-size: 13px; line-height: 1.45; }
.query .involved { margin: 8px 0; }
.query .involved .item { margin-bottom: 6px; }
.query .opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.query .resolution { background: var(--green-soft); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-top: 8px; }
.query .resolution.err { background: var(--red-soft); }

/* fuentes */
.source { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.source:hover { border-color: var(--slate); }
.source .ic { font-size: 22px; }
.source .t { font-weight: 600; }
.source .s { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(20, 28, 33, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-box { background: var(--panel); border-radius: 12px; max-width: 820px; width: 100%; max-height: 90vh; overflow: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-head { display: flex; align-items: center; gap: 10px; }
.modal-head h2 { flex: 1; }

/* experto */
.conv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.conv-list li { padding: 9px 10px; border-radius: 8px; cursor: pointer; border-left: 3px solid transparent; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.conv-list li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-list li:hover { background: var(--bg); }
.conv-list li.active { background: var(--soft); border-left-color: var(--red); }
.conv-list li button { border: 0; background: transparent; cursor: pointer; color: var(--muted); visibility: hidden; }
.conv-list li:hover button { visibility: visible; }
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.messages { flex: 1; overflow: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 860px; line-height: 1.55; font-size: 15px; }
.msg.user { align-self: flex-end; background: var(--slate); color: #fff; padding: 10px 14px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; max-width: 75%; }
.msg.user .chip { background: rgba(255,255,255,.18); color: #fff; }
.msg.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); padding: 12px 16px; border-radius: 14px 14px 14px 4px; width: 100%; }
.msg.note { align-self: center; font-size: 12px; color: var(--muted); }
.msg.assistant table { border-collapse: collapse; margin: 8px 0; font-size: 14px; display: block; overflow-x: auto; }
.msg.assistant th, .msg.assistant td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
.msg.assistant th { background: var(--soft); }
.msg.assistant pre { background: var(--bg); padding: 10px; border-radius: 6px; overflow-x: auto; }
.msg.assistant code { background: var(--bg); padding: 1px 4px; border-radius: 4px; }
.msg .status { color: var(--amber); font-size: 13px; display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.msg .error { color: var(--red); }
.msg .tools { display: flex; gap: 6px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.kref { background: var(--soft); border-radius: 4px; padding: 0 4px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--slate); }
details.thinking { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
details.thinking div { white-space: pre-wrap; padding: 6px 10px; border-left: 2px solid var(--line); margin-top: 4px; max-height: 260px; overflow: auto; }
.composer { border-top: 1px solid var(--line); background: var(--panel); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.composer .row { flex-wrap: nowrap; align-items: flex-end; }
.composer textarea { min-height: 46px; max-height: 220px; }
.welcome { margin: auto; max-width: 620px; text-align: center; padding: 24px; }
.welcome img { height: 64px; }
.welcome h1 { color: var(--slate); font-size: 22px; }
.welcome p { color: var(--muted); line-height: 1.5; }
.examples { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.examples button { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 9px 12px; cursor: pointer; font-size: 14px; }
.examples button:hover { border-color: var(--slate); }

/* crea imágenes */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.gcard:hover { border-color: var(--slate); }
.gcard .pic { aspect-ratio: 4 / 3; background: #fff; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); overflow: hidden; }
.gcard .pic svg { width: 100%; height: 100%; }
.gcard .t { padding: 8px 10px; font-size: 14px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.graphic-view { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.graphic-canvas { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.graphic-canvas svg { width: 100%; height: auto; display: block; }
.legend { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.legend li { display: flex; gap: 8px; }
.legend .n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--slate); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.versions { display: flex; gap: 4px; flex-wrap: wrap; }
.versions button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 9px; cursor: pointer; font-size: 13px; }
.versions button.active { background: var(--slate); color: #fff; border-color: var(--slate); }
.generating { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 50px 10px; color: var(--amber); }
.generating .spinner { width: 28px; height: 28px; border-width: 3px; }

@media (max-width: 900px) {
  .view { flex-direction: column; overflow: auto; }
  .side { width: auto; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .main { overflow: visible; padding: 14px 16px; }
  .graphic-view { grid-template-columns: 1fr; }
  .tabs { margin-left: 0; width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 8px 6px; }
  .tab .lbl { font-size: 13px; }
  #view-expert .side { max-height: 30vh; overflow: auto; }
  #view-expert .chat { min-height: 70vh; }
  .msg.user { max-width: 90%; }
}

/* timeline */
.tl-head { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 10px; }
.tl-items { display: flex; flex-direction: column; gap: 8px; }
.tl-item { display: grid; grid-template-columns: 26px 150px 170px minmax(0, 1fr) auto; gap: 8px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--slate); border-radius: 8px; padding: 10px; }
.tl-item.dragging { opacity: .4; }
.tl-item.drop-before { box-shadow: 0 -3px 0 var(--red); }
.tl-item.drop-after { box-shadow: 0 3px 0 var(--red); }
.tl-item .handle { cursor: grab; color: var(--muted); font-size: 18px; text-align: center; padding-top: 6px; user-select: none; }
.tl-item .num { font-size: 11px; color: var(--muted); text-align: center; }
.tl-item .txt { display: flex; flex-direction: column; gap: 6px; }
.tl-item textarea { min-height: 52px; }
.tl-item .ops { display: flex; flex-direction: column; gap: 4px; }
.tl-item .ops button { width: 32px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.tl-item .ops button:disabled { opacity: .3; cursor: default; }
.tl-preview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; overflow-x: auto; }
.tl-preview svg { width: 100%; min-width: 640px; height: auto; display: block; }
.stale { color: var(--amber); font-size: 13px; }
@media (max-width: 900px) {
  .tl-head { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .tl-item .fecha, .tl-item .tipo, .tl-item .txt { grid-column: 2; }
  .tl-item .ops { grid-column: 3; grid-row: 1 / span 3; }
}

/* informes */
.r-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.r-grid.three { grid-template-columns: repeat(3, 1fr); }
.r-grid .full { grid-column: 1 / -1; }
.lbl-strong { font-weight: 600; font-size: 13px; color: var(--muted); }
.img-edit { display: flex; flex-direction: column; gap: 6px; }
.img-row { display: grid; grid-template-columns: 18px 44px minmax(0, 1fr) auto; gap: 6px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; }
.img-row.off { opacity: .55; }
.img-row.dragging { opacity: .4; }
.img-row.drop-before { box-shadow: 0 -3px 0 var(--red); }
.img-row.drop-after { box-shadow: 0 3px 0 var(--red); }
.img-row .handle { cursor: grab; color: var(--muted); user-select: none; text-align: center; }
.img-row img { width: 44px; height: 34px; object-fit: cover; border-radius: 4px; }
.img-row .ic { width: 44px; text-align: center; font-size: 20px; }
.img-row .nm { min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.img-row .nm > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-row select { width: 100%; padding: 3px 6px; font-size: 12px; }
.img-row input[type=text] { padding: 4px 8px; font-size: 13px; }
.img-row .ops { display: flex; gap: 2px; }
.img-row .ops button { width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; padding: 0; }
.img-row .ops button:disabled { opacity: .3; cursor: default; }
.img-edit > select { font-size: 13px; }
.r-list .source { align-items: center; }
.report-view { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pdf-frame { width: 100%; height: calc(100vh - 170px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.r-questions { border-left: 4px solid var(--blue); max-width: 820px; }
.rec-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px auto; gap: 6px; }
@media (max-width: 900px) {
  .report-view { grid-template-columns: 1fr; }
  .pdf-frame { height: 70vh; }
  .r-grid.three { grid-template-columns: 1fr 1fr; }
}

/* empresa */
.org-sel { width: auto; padding: 5px 8px; font-size: 13px; font-weight: 600; border-color: var(--slate); }

/* clientes */
.odoo-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 13px; text-align: left; }
button.odoo-row { width: 100%; cursor: pointer; }
button.odoo-row:hover { border-color: var(--slate); }
.client-card { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.client-card .full { grid-column: 1 / -1; }
.client-card b { color: var(--muted); font-weight: 600; margin-right: 4px; }
.eq-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.eq-card { cursor: pointer; padding: 10px 12px; }
.eq-card:hover { border-color: var(--slate); }
.conv-list li small { flex: none; }

/* inspección por pantallas */
.wizard { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.steps { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; max-height: calc(100vh - 140px); overflow: auto; }
.st-group { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 10px 0 2px 6px; }
.st { display: flex; gap: 6px; align-items: center; border: 0; background: transparent; text-align: left; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text); border-left: 3px solid transparent; }
.st:hover { background: var(--soft); }
.st.active { background: var(--panel); border-left-color: var(--red); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.st .mk { width: 16px; text-align: center; font-size: 11px; flex: none; }
.st .rd { margin-left: auto; font-size: 11px; }
.steps-m { display: none; }
.screen { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.screen fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.screen h3 { margin: 4px 0 0; }
.nav-btns { border-top: 1px solid var(--line); padding-top: 12px; }
.in-busy { background: var(--amber-soft); border-radius: 8px; padding: 8px 12px; }
.obj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.pt-head { display: flex; gap: 10px; align-items: center; }
.code-b { background: var(--slate); color: #fff; font-weight: 700; border-radius: 6px; padding: 4px 8px; font-size: 14px; }
.st-seg button.active.ok { background: var(--green-soft); color: var(--green); }
.st-seg button.active.atencion { background: var(--amber-soft); color: var(--amber); }
.st-seg button.active.critico { background: var(--red-soft); color: var(--red); }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ph { display: flex; flex-direction: column; gap: 4px; }
.ph img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.ph input { padding: 5px 8px; font-size: 12px; }
.ph-ops { display: flex; gap: 4px; }
.ph-ops button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; padding: 3px 0; }
.ph-ops button:disabled { opacity: .3; }
.ac-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px auto; gap: 6px; }
.ot-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 90px auto; gap: 6px; }
.red-box { border-left: 4px solid var(--blue); background: #f7fafd; }
.red-box .spinner { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; }
.inst-card { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.inst-card .ops { display: flex; gap: 4px; }
.inst-card .ops button { width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.inst-card .ops button:disabled { opacity: .3; }
.table-wrap { overflow-x: auto; }
table.meas { width: 100%; border-collapse: collapse; font-size: 14px; }
table.meas th { text-align: left; font-size: 12px; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.meas td { padding: 4px 6px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
table.meas input { padding: 5px 8px; max-width: 140px; }
table.meas select { padding: 5px 6px; max-width: 130px; }
label.field.inline { flex-direction: row; align-items: center; gap: 10px; }
label.field.inline > span { flex: 1; color: var(--text); font-weight: 500; }
label.field.inline select { width: 220px; }
@media (max-width: 900px) {
  .wizard { grid-template-columns: 1fr; }
  .steps { display: none; }
  .steps-m { display: block; font-weight: 600; }
  .screen { padding: 12px; }
  .obj-grid, .client-card { grid-template-columns: 1fr; }
  .ac-row { grid-template-columns: 1fr auto; }
  .ac-row select { grid-column: 1; }
  .ot-row { grid-template-columns: 1fr 1fr; }
  .nav-btns { position: sticky; bottom: 0; background: var(--panel); }
  .org-sel { order: -1; }
  label.field.inline { flex-direction: column; align-items: stretch; }
  label.field.inline select { width: 100%; }
}

/* inspección: recorrido foto a foto */
.obs-feed { display: flex; flex-direction: column; gap: 10px; }
.obs { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.obs-photo { position: relative; }
.obs-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; display: block; }
.obs-nophoto { width: 100%; aspect-ratio: 3 / 4; border-radius: 6px; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.obs-n { position: absolute; top: 6px; left: 6px; background: rgba(31,42,48,.8); color: #fff; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.obs-body { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.obs-body textarea { min-height: 52px; background: #fff; }
.obs-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.obs-tags select { width: auto; max-width: 100%; padding: 5px 8px; font-weight: 600; font-size: 13px; }
.st-seg.mini { flex: none; }
.st-seg.mini button { padding: 4px 8px; font-size: 12px; flex: none; }
.obs-interp { background: #fff; border-left: 3px solid var(--blue); border-radius: 6px; padding: 6px 9px; font-size: 13px; line-height: 1.45; }
.obs-interp b { color: var(--blue); }
.obs-body input[type=text] { padding: 5px 8px; font-size: 13px; }
.obs-item { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.obs-item span { flex: 1; min-width: 0; }
.obs-item select { width: auto; padding: 3px 6px; font-size: 12px; }
.obs-item button, .obs-ops button { border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; padding: 2px 8px; }
.obs-ops { display: flex; gap: 4px; justify-content: flex-end; }
.obs-ops button:disabled { opacity: .3; }
.obs-q { background: var(--amber-soft); border-radius: 6px; padding: 7px 9px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.obs-composer { position: sticky; bottom: 0; background: var(--panel); border: 2px solid var(--slate); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 -4px 12px rgba(0,0,0,.06); }
.obs-draft-img { position: relative; width: 110px; }
.obs-draft-img img { width: 110px; height: 110px; object-fit: cover; border-radius: 6px; display: block; }
.obs-draft-img button { position: absolute; top: 4px; right: 4px; border: 0; background: rgba(0,0,0,.6); color: #fff; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }
.rev-pt .lbl-strong { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
details.card summary { cursor: pointer; }
@media (max-width: 900px) {
  .obs { grid-template-columns: 96px minmax(0, 1fr); gap: 8px; padding: 8px; }
  .st-seg.mini button { padding: 4px 6px; }
}
.add-inst { border-style: dashed; }
.st:has(.mk) span:nth-child(2) { flex: 1; }
.btn.mic.rec { background: var(--red); color: #fff; border-color: var(--red); animation: micpulse 1.2s ease-in-out infinite; }
@keyframes micpulse { 50% { box-shadow: 0 0 0 5px rgba(238, 49, 36, .25); } }
.obs-thread { display: flex; flex-direction: column; gap: 5px; }
.obs-thread:empty { display: none; }
.msg-t, .msg-e { font-size: 13px; line-height: 1.4; padding: 6px 10px; border-radius: 10px; max-width: 88%; white-space: pre-wrap; }
.msg-t { align-self: flex-end; background: var(--slate); color: #fff; border-bottom-right-radius: 3px; }
.msg-e { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-bottom-left-radius: 3px; }
.obs-reply { display: flex; gap: 6px; align-items: flex-end; }
.obs-reply textarea { flex: 1; min-height: 36px; padding: 6px 9px; font-size: 13px; background: #fff; }
.obs-reply.open textarea { border-color: var(--amber); background: var(--amber-soft); }

/* página de entrada */
.login-page { align-items: center; justify-content: center; padding: 16px; }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.login-box h2 { margin: 0; color: var(--slate); text-align: center; }
.login-logos { display: flex; justify-content: center; align-items: center; gap: 18px; }
.login-logos img { height: 34px; }
input[type=email], input[type=password] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
