/* Sistema de Técnicos (/tecnicos): mismo diseño del mockup aprobado.
   Todo va bajo .st-root con prefijo st- para no chocar con Bootstrap/Tailwind. Modo oscuro: html.dark. */
.st-root {
    --st-bg: #f6f5f4; --st-surface: #ffffff; --st-surface-2: #f1efed; --st-line: #e3dfdb; --st-fg: #1f1b19; --st-muted: #6b625d;
    --st-accent: #d0312d; --st-accent-soft: #fbe7e5; --st-accent-fg: #ffffff;
    --st-ok: #1d7a4a; --st-ok-soft: #e1f3e8; --st-warn: #9a6200; --st-warn-soft: #fdf0d5;
    --st-bad: #b4232a; --st-bad-soft: #fbe4e4; --st-info: #2b5c9e; --st-info-soft: #e3ecf8;
    --st-mono: ui-monospace, "JetBrains Mono", Consolas, monospace;
    color: var(--st-fg); font-size: 14px; line-height: 1.5;
    /* Mismo marco que las demás páginas de SIM: ancho completo, p-1, gap-4 */
    min-height: calc(100vh - 150px); padding: 4px; display: flex; flex-direction: column; gap: 16px;
}
html.dark .st-root {
    --st-bg: #171413; --st-surface: #211d1b; --st-surface-2: #2a2523; --st-line: #3a3330; --st-fg: #efe9e5; --st-muted: #a99f99;
    --st-accent: #ef5b55; --st-accent-soft: #3b201f; --st-accent-fg: #1b0f0e;
    --st-ok: #5cc58c; --st-ok-soft: #183325; --st-warn: #e3a94a; --st-warn-soft: #352812;
    --st-bad: #f07a7f; --st-bad-soft: #3a1c1e; --st-info: #7fb0f0; --st-info-soft: #1b2a3f;
}
.st-root *, .st-root *::before, .st-root *::after { box-sizing: border-box; }
.st-root h1, .st-root h2, .st-root h3 { margin: 0; color: var(--st-fg); text-wrap: balance; }
.st-root h1 { font-size: 22px; font-weight: 700; }
.st-root h2 { font-size: 16px; font-weight: 700; }
.st-root h3 { font-size: 14px; font-weight: 600; }
.st-mono { font-family: var(--st-mono); font-variant-numeric: tabular-nums; }
.st-muted { color: var(--st-muted); }
.st-small { font-size: 12px; }
.st-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--st-muted); font-weight: 600; }

.st-top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; }
.st-top p { margin: 4px 0 0; max-width: 62ch; }
.st-controls { display: flex; flex-wrap: wrap; gap: 12px; }
.st-seg { display: inline-flex; border: 1px solid var(--st-line); border-radius: 8px; overflow: hidden; background: var(--st-surface); }
.st-seg button { border: 0; background: transparent; color: var(--st-fg); padding: 7px 12px; font: inherit; cursor: pointer; }
.st-seg button[aria-pressed="true"] { background: var(--st-accent); color: var(--st-accent-fg); font-weight: 600; }

.st-field { display: flex; flex-direction: column; gap: 4px; }
.st-root select, .st-root input:not([type=checkbox]):not([type=radio]), .st-root textarea {
    font: inherit; color: var(--st-fg); background: var(--st-surface); border: 1px solid var(--st-line); border-radius: 7px; padding: 7px 9px; width: 100%;
}
.st-root textarea { min-height: 64px; resize: vertical; }
.st-root input[readonly] { background: var(--st-surface-2); }
.st-root :focus-visible { outline: 2px solid var(--st-accent); outline-offset: 2px; }

.st-btn { font: inherit; border-radius: 7px; padding: 7px 13px; cursor: pointer; border: 1px solid var(--st-line); background: var(--st-surface); color: var(--st-fg); font-weight: 600; line-height: 1.4; }
.st-btn.primary { background: var(--st-accent); border-color: var(--st-accent); color: var(--st-accent-fg); }
.st-btn.ok { background: var(--st-ok); border-color: var(--st-ok); color: var(--st-surface); }
.st-btn.bad { color: var(--st-bad); border-color: var(--st-bad); }
.st-btn:disabled { opacity: .45; cursor: not-allowed; }
.st-link { background: none; border: 0; padding: 0; color: var(--st-accent); font: inherit; font-weight: 600; cursor: pointer; }

.st-panel { background: var(--st-surface); border: 1px solid var(--st-line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.st-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.st-flowcard { background: var(--st-surface); border: 1px solid var(--st-line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.st-flowcard:hover { border-color: var(--st-accent); }
.st-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.st-step { padding: 2px 8px; border-radius: 999px; background: var(--st-surface-2); border: 1px solid var(--st-line); }
.st-step.who { background: var(--st-accent-soft); border-color: transparent; color: var(--st-accent); font-weight: 600; }
.st-arrow { color: var(--st-muted); }

.st-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--st-line); overflow-x: auto; }
.st-tabs button { border: 0; background: none; font: inherit; color: var(--st-muted); padding: 9px 12px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; }
.st-tabs button[aria-selected="true"] { color: var(--st-fg); border-bottom-color: var(--st-accent); }
.st-badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--st-accent); color: var(--st-accent-fg); font-size: 11px; text-align: center; margin-left: 4px; }

.st-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-c-ok { background: var(--st-ok-soft); color: var(--st-ok); }
.st-c-warn { background: var(--st-warn-soft); color: var(--st-warn); }
.st-c-bad { background: var(--st-bad-soft); color: var(--st-bad); }
.st-c-info { background: var(--st-info-soft); color: var(--st-info); }
.st-c-muted { background: var(--st-surface-2); color: var(--st-muted); }

.st-tablewrap { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--st-fg); }
.st-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--st-muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--st-line); white-space: nowrap; }
.st-table td { padding: 9px 10px; border-bottom: 1px solid var(--st-line); vertical-align: top; }
.st-table tr:last-child td { border-bottom: 0; }

.st-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.st-grid2.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.st-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.st-between { justify-content: space-between; }

.st-list { display: flex; flex-direction: column; border: 1px solid var(--st-line); border-radius: 8px; max-height: 300px; overflow: auto; }
.st-li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-bottom: 1px solid var(--st-line); margin: 0; font-weight: 400; }
.st-li:last-child { border-bottom: 0; }
/* Casilla y opción dibujadas aquí: los estilos globales de la app las dejaban como una línea. */
.st-root .st-li input[type=checkbox], .st-root .st-li input[type=radio] {
    -webkit-appearance: none !important; appearance: none !important;
    display: inline-block !important; position: static !important; opacity: 1 !important; visibility: visible !important;
    flex: 0 0 18px; width: 18px !important; height: 18px !important; min-width: 18px; margin: 2px 0 0 !important; padding: 0 !important;
    border: 2px solid var(--st-muted) !important; border-radius: 4px !important; background: var(--st-surface) no-repeat center / 12px 12px !important;
    cursor: pointer; box-shadow: none !important;
}
.st-root .st-li input[type=radio] { border-radius: 50% !important; }
.st-root .st-li input[type=checkbox]:checked {
    border-color: var(--st-accent) !important; background-color: var(--st-accent) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5l3.2 3L13 4.5'/%3E%3C/svg%3E") !important;
}
.st-root .st-li input[type=radio]:checked {
    border-color: var(--st-accent) !important;
    background-image: radial-gradient(circle, var(--st-accent) 0 4px, transparent 4.5px) !important; background-size: 100% 100% !important;
}
.st-root .st-li input:disabled { opacity: .45 !important; cursor: not-allowed; }
.st-li.marcado { background: var(--st-accent-soft); }
.st-search { position: relative; }
.st-search input { padding-left: 32px !important; }
.st-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--st-muted); pointer-events: none; }
label.st-li { cursor: pointer; }
label.st-li.disabled { cursor: not-allowed; opacity: .7; }

.st-note { padding: 10px 12px; border-radius: 8px; font-size: 13px; color: var(--st-fg); }
.st-note.info { background: var(--st-info-soft); border-left: 3px solid var(--st-info); }
.st-note.warn { background: var(--st-warn-soft); border-left: 3px solid var(--st-warn); }
.st-note.ok { background: var(--st-ok-soft); border-left: 3px solid var(--st-ok); }
.st-note.bad { background: var(--st-bad-soft); border-left: 3px solid var(--st-bad); }

.st-req { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--st-line); border-radius: 10px; background: var(--st-surface); }
.st-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; font-size: 13px; margin: 0; }
.st-kv dt { color: var(--st-muted); font-weight: 400; }
.st-kv dd { margin: 0; }
.st-empty { padding: 24px; text-align: center; color: var(--st-muted); }

.st-tr-click { cursor: pointer; }
.st-tr-click:hover td { background: var(--st-surface-2); }
.st-modal-fondo { position: fixed; inset: 0; z-index: 1900; background: rgba(15, 12, 11, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.st-modal { background: var(--st-surface); color: var(--st-fg); border: 1px solid var(--st-line); border-radius: 12px; padding: 18px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }

@media (max-width: 820px) {
    .st-flow, .st-grid2, .st-grid2.wide-left { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
    .st-btn, .st-flowcard { transition: border-color .15s, background .15s; }
}
