/* Interfaz web de Actas GLPI. El PDF usa estilos.css y no depende de este archivo. Reglas en DESIGN.md. */
@font-face {
  font-family: "Figtree";
  src: url("/public/fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --ink: #2e1a46;
  --ink-hover: #44286a;
  --ink-soft: #f0ecf5;
  --page: #f8f7fa;
  --surface: #ffffff;
  --line: #e3deea;
  --line-strong: #c9c0d6;
  --muted: #5f5870;
  --green: #3fb075;
  --green-text: #1d6a45;
  --green-soft: #e6f4ec;
  --amber-text: #86470a;
  --amber-soft: #fff3de;
  --amber-line: #e8b765;
  --danger-text: #9b1c1c;
  --danger-soft: #fdecec;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --radius: 8px;
  --radius-lg: 12px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 1rem/1.55 var(--font);
  background: var(--page);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--ink-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--green) 55%, transparent);
}

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: var(--s4); z-index: 100; padding: var(--s3) var(--s4); background: var(--ink); color: #fff; border-radius: var(--radius); }
.skip-link:focus { top: var(--s3); }
.icon { flex: none; }

/* Marco */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--ink); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); max-width: 1600px; margin-inline: auto; padding: var(--s3) var(--s5); }
.brand { display: flex; align-items: center; gap: var(--s4); color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand img { height: 40px; width: auto; }
.brand-product { display: flex; flex-direction: column; gap: 3px; padding-left: var(--s5); border-left: 1px solid #ffffff44; }
.brand-product strong { font-size: clamp(1.25rem, 1rem + .65vw, 1.65rem); line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
.brand-product small { font-size: .75rem; color: #ddd5e8; letter-spacing: .025em; }
.brand-product strong::after { content: ""; display: block; width: 32px; height: 3px; margin-top: 6px; border-radius: 3px; background: var(--green); }
.topbar nav { display: flex; align-items: center; gap: var(--s4); font-size: .875rem; }
.topbar nav a { color: #fff; }
.topbar nav form { margin: 0; }
.topbar .who { color: #ffffffcc; }
main { flex: 1; width: 100%; max-width: 1200px; margin-inline: auto; padding: var(--s6) var(--s5) var(--s7); }
main:focus { outline: none; }
.page-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s5); max-width: 1200px; width: 100%; margin-inline: auto; padding: var(--s4) var(--s5) var(--s5); font-size: .8125rem; color: var(--muted); border-top: 1px solid var(--line); }
.demo-banner { margin: 0 0 var(--s5); padding: var(--s2) var(--s3); background: var(--amber-soft); color: var(--amber-text); border: 1px solid var(--amber-line); border-radius: var(--radius); font-size: .875rem; }
.demo-banner a { color: inherit; }

/* Tipografía */
h1 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; line-height: 1.3; font-weight: 700; }
h3 { font-size: 1rem; line-height: 1.4; font-weight: 600; }
.lede { margin-top: var(--s2); color: var(--muted); max-width: 62ch; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .875rem; margin-top: var(--s2); }

/* Componentes base */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s5); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: var(--s2) var(--s4); border: 2px solid var(--ink); border-radius: var(--radius); background: transparent; color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--ink-soft); color: var(--ink); }
.button.primary { background: var(--ink); color: #fff; }
.button.primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); color: #fff; }
.button:disabled { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.button.small { min-height: 36px; padding: var(--s1) var(--s3); font-size: .875rem; }
.topbar .button { border-color: #ffffff99; color: #fff; }
.topbar .button:hover { background: #ffffff22; color: #fff; }
.button.full-width { width: 100%; }

.field { display: block; }
.field + .field { margin-top: var(--s4); }
.field > .label { display: block; margin-bottom: var(--s1); font-size: .875rem; font-weight: 600; }
.field .optional { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="search"], input[type="password"], input[type="date"], input[type="email"], input[type="number"], select, textarea { width: 100%; min-height: 44px; padding: var(--s2) var(--s3); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); }
textarea { min-height: 72px; resize: vertical; }
input:disabled, input[readonly] { background: var(--page); color: var(--muted); }
input[type="checkbox"] { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--ink); }
.inline-check { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s4); }
.status { min-height: 1.5em; margin-top: var(--s2); font-size: .875rem; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: var(--s1); padding: 2px var(--s2); border-radius: 999px; background: var(--ink-soft); color: var(--ink); font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.badge.success { background: var(--green-soft); color: var(--green-text); }
.badge.success::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.count { display: inline-block; min-width: 24px; padding: 0 var(--s2); border-radius: 999px; background: var(--ink-soft); font-size: .8125rem; font-weight: 700; text-align: center; }

.notice { display: flex; gap: var(--s3); align-items: flex-start; margin: var(--s4) 0 0; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-soft); font-size: .9375rem; }
.notice.error { background: var(--danger-soft); border-color: #e6b3b3; color: var(--danger-text); }
.notice.warn { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber-text); }
.empty { padding: var(--s5); border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); }

/* Acceso y contexto */
.login-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: var(--s7); align-items: center; max-width: 960px; margin: var(--s6) auto 0; }
.login-brand img { width: min(100%, 420px); height: auto; }
.login-brand p { margin-top: var(--s4); color: var(--muted); max-width: 40ch; }
.narrow { max-width: 560px; margin-inline: auto; }
.narrow h1, .login h1 { margin-bottom: var(--s2); }
details.token { margin-top: var(--s4); border-top: 1px solid var(--line); padding-top: var(--s3); }
details.token summary { cursor: pointer; font-weight: 600; font-size: .9375rem; }
details.token p { margin: var(--s2) 0; font-size: .875rem; color: var(--muted); }
.login form { margin-top: var(--s4); }
.login .button.primary { margin-top: var(--s5); width: 100%; }
.help { margin-top: var(--s4); font-size: .8125rem; color: var(--muted); }

/* Selección de perfil: tarjetas que funcionan también sin JavaScript. */
.profile-picker { max-width: 880px; margin-inline: auto; }
.profile-picker-heading { margin-bottom: var(--s5); }
.profile-picker-heading h1 { margin-top: var(--s2); }
.profile-picker .eyebrow { color: var(--green-text); font-size: .8125rem; font-weight: 700; }
.profile-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.profile-options form { display: flex; min-width: 0; margin: 0; }
.profile-option { display: flex; flex-direction: column; align-items: stretch; gap: var(--s3); width: 100%; padding: var(--s5); text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); transition: border-color .15s, background .15s; }
.profile-option:hover { border-color: var(--ink); background: var(--ink-soft); }
.profile-option.is-active { border: 2px solid var(--green-text); padding: calc(var(--s5) - 1px); background: var(--green-soft); }
.profile-option-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.profile-option-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); background: var(--ink-soft); }
.profile-option strong { font-size: 1.1875rem; overflow-wrap: anywhere; }
.profile-option-description { color: var(--muted); font-size: .9375rem; }
.profile-option-action { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: auto; padding-top: var(--s4); font-size: .875rem; font-weight: 700; }
@media (max-width: 760px) { .profile-options { grid-template-columns: 1fr; } }

/* Buscador */
.search-section { max-width: 760px; }
.search-form { display: flex; gap: var(--s2); margin-top: var(--s5); }
.search-input { position: relative; flex: 1; }
.search-input .icon { position: absolute; left: var(--s3); top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input input { min-height: 52px; padding-left: 44px; font-size: 1.0625rem; }
.search-form .button { min-height: 52px; padding-inline: var(--s5); }
.results { margin-top: var(--s5); }
.results-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); padding-bottom: var(--s2); border-bottom: 1px solid var(--line-strong); font-size: .875rem; color: var(--muted); }
.person { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: var(--s4); padding: var(--s3) var(--s2); border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.person:hover { background: var(--ink-soft); color: inherit; }
.person strong { display: block; }
.person small { color: var(--muted); font-size: .875rem; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: .9375rem; }
.example { margin-top: var(--s7); max-width: 760px; }
.example h2 { font-size: 1rem; }
.example .person { margin-top: var(--s2); }
.example-links { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s3); font-size: .875rem; }

/* Selección de equipos */
.back-link { display: inline-flex; align-items: center; gap: var(--s2); margin-bottom: var(--s4); font-size: .9375rem; font-weight: 600; }
.page-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s4); }
.page-title .code { color: var(--muted); font-size: .875rem; font-weight: 600; }
.steps { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin: var(--s5) 0; font-size: .875rem; color: var(--muted); }
.steps li { display: flex; align-items: center; gap: var(--s2); }
.steps li span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); font-weight: 700; font-size: .8125rem; }
.steps .done { color: var(--green-text); }
.steps .done span { background: var(--green-soft); border-color: var(--green); }
.steps .current { color: var(--ink); font-weight: 700; }
.steps .current span { background: var(--ink); border-color: var(--ink); color: #fff; }

.profile { display: grid; grid-template-columns: auto 1fr; gap: var(--s4) var(--s5); align-items: center; }
.profile .avatar { width: 56px; height: 56px; font-size: 1.125rem; }
.profile h2 { font-size: 1.375rem; }
.profile-meta { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.profile-meta dt { font-size: .8125rem; color: var(--muted); }
.profile-meta dd { font-weight: 600; overflow-wrap: anywhere; }
.profile .notice { grid-column: 1 / -1; margin: 0; }
.pending { color: var(--amber-text); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s5); align-items: start; margin-top: var(--s5); }
.assets-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); margin-bottom: var(--s4); }
.select-all { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); background: var(--ink-soft); border-radius: var(--radius); font-weight: 600; cursor: pointer; }
.select-module { margin-bottom: var(--s3); font-size: .9375rem; }
.equipment-module { margin-top: var(--s4); border-top: 1px solid var(--line); padding-top: var(--s3); }
.equipment-module > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); cursor: pointer; list-style: none; padding: var(--s1) 0; }
.equipment-module > summary::-webkit-details-marker { display: none; }
.equipment-module > summary::after { content: "+"; font-size: 1.25rem; line-height: 1; color: var(--muted); }
.equipment-module[open] > summary::after { content: "−"; }
.module-title { display: flex; align-items: center; gap: var(--s3); font-weight: 700; flex: 1; }
.module-content { padding-top: var(--s3); display: grid; gap: var(--s3); }
.module-empty { color: var(--muted); font-size: .9375rem; }
.equipment-sheet { padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.equipment-sheet.included { border-color: var(--green); box-shadow: inset 4px 0 0 var(--green); background: color-mix(in srgb, var(--green-soft) 35%, #fff); }
.equipment-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.equipment-title { margin: 0; flex: 1; min-width: 200px; }
.equipment-title label { display: flex; align-items: center; gap: var(--s3); cursor: pointer; min-height: 32px; }
.equipment-data { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3) var(--s4); margin-top: var(--s3); padding-left: 32px; }
.equipment-data dt { font-size: .8125rem; color: var(--muted); }
.equipment-data dd { font-weight: 500; overflow-wrap: anywhere; }
.equipment-data .missing { color: var(--amber-text); font-weight: 500; }
.equipment-notes { display: block; margin-top: var(--s3); padding-left: 32px; font-size: .875rem; font-weight: 600; }
.equipment-notes textarea { margin-top: var(--s1); font-weight: 400; }
.footnote { margin-top: var(--s4); font-size: .875rem; color: var(--muted); }

.summary { position: sticky; top: var(--s4); }
.summary.summary-tall { position: static; }
.summary h2 { margin-bottom: var(--s1); }
.tally { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: var(--s4) 0; }
.tally > div { padding: var(--s3); border: 1px solid var(--line); border-radius: var(--radius); }
.tally dt { font-size: .8125rem; color: var(--muted); }
.tally dd { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.tally .is-missing { background: var(--amber-soft); border-color: var(--amber-line); }
.tally .is-missing dd, .tally .is-missing dt { color: var(--amber-text); }
.tally .is-ready { background: var(--green-soft); border-color: var(--green); }
.tally .is-ready dd, .tally .is-ready dt { color: var(--green-text); }
.delivery { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.delivery h3 { margin-bottom: var(--s3); }
.delivery .field + .field { margin-top: var(--s3); }
.delivery input:placeholder-shown:required { border-color: var(--amber-line); background: var(--amber-soft); }
.delivery input:required:placeholder-shown + .need { display: block; }
.delivery .need { display: none; margin-top: var(--s1); font-size: .8125rem; color: var(--amber-text); }
.operator { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.operator-name { margin-top: var(--s2); font-weight: 600; }
.export-reason { margin: var(--s4) 0 var(--s2); min-height: 1.5em; font-size: .875rem; color: var(--muted); }
.export-reason.ready { color: var(--green-text); font-weight: 600; }

@media (max-width: 1000px) {
  .detail-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 760px) {
  main { padding: var(--s5) var(--s4) var(--s6); }
  .topbar-inner { padding-inline: var(--s4); flex-wrap: wrap; gap: var(--s3); }
  .brand { gap: var(--s3); }
  .brand-product { display: flex; padding-left: var(--s3); }
  .brand-product strong { font-size: 1.2rem; }
  .brand-product small { font-size: .65rem; letter-spacing: 0; }
  .brand-product strong::after { margin-top: 4px; width: 24px; }
  .login-layout { grid-template-columns: 1fr; gap: var(--s5); }
  .login-brand img { width: 220px; }
  .search-form { flex-direction: column; }
  .profile { grid-template-columns: 1fr; }
  .equipment-data, .equipment-notes { padding-left: 0; }
  .equipment-data { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: var(--s4); }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .equipment-sheet.included { outline: 2px solid Highlight; }
}

/* Tipo de acta */
.acta-kind { margin: var(--s5) 0; padding: var(--s5); min-width: 0; }
.acta-kind legend { padding: 0 var(--s2); font-weight: 700; }
.process-field { max-width: 360px; margin-bottom: var(--s4); }
.process-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: var(--s2); }
.process-buttons .button { min-width: 0; }
.process-buttons .button[aria-pressed="true"] { background: var(--green-soft); border-color: var(--green); color: var(--green-text); }
.process-buttons .button[aria-pressed="false"]:hover { background: var(--page); }
.acta-kind-options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.acta-kind-options label { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); cursor: pointer; }
.acta-kind-options label:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.acta-kind-options small { display: block; margin-top: var(--s1); color: var(--muted); }
.acta-kind-options input { margin-top: var(--s1); }
.acta-kind .notice { margin-top: var(--s4); }
.acta-kind .notice[hidden] { display: none; }

/* Disponibilidad y corrección de actas firmadas */
.archive-warning { color: var(--amber-text); }
.document-archive { margin-top: var(--s2); font-size: .875rem; }
.documents-check { margin-bottom: var(--s5); }
.document-void { margin-top: var(--s3); padding: var(--s3); background: var(--danger-soft); border-radius: var(--radius); color: var(--danger-text); overflow-wrap: anywhere; }
.void-notice { display: block; margin-bottom: var(--s5); }
.void-notice p, .void-notice a { margin-top: var(--s2); }
.acta-correction summary { font-weight: 600; cursor: pointer; }
.acta-correction p, .acta-correction form { margin-top: var(--s3); }
.acta-correction .button { margin-top: var(--s3); }
/* Vista previa del PDF */
.pdf-preview { width: min(1200px, 96vw); max-width: 96vw; height: 92vh; max-height: 92vh; padding: var(--s5); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); }
.pdf-preview::backdrop { background: color-mix(in srgb, var(--ink) 75%, transparent); }
.pdf-preview header { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
.pdf-preview header div { display: flex; gap: var(--s3); }
.pdf-preview iframe { width: 100%; height: calc(100% - 105px); margin-top: var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.is-loading::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: var(--s2); border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: pdf-spin .8s linear infinite; }
@keyframes pdf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .is-loading::before { animation: none; } }
@media (max-width: 650px) {
  .acta-kind-options { grid-template-columns: 1fr; }
  .pdf-preview { padding: var(--s3); }
  .pdf-preview header { align-items: flex-start; flex-direction: column; }
  .pdf-preview iframe { height: calc(100% - 150px); }
}

/* Portal personal: documentos firmados sin herramientas de gestión. */
.documents-portal { max-width: 960px; margin-inline: auto; }
.documents-intro { margin-bottom: var(--s6); }
.documents-intro h1 { margin-top: var(--s3); }
.documents-list { display: grid; gap: var(--s5); }
.document-card { display: flex; justify-content: space-between; align-items: center; gap: var(--s5); }
.document-card h2 { margin-top: var(--s3); }
.document-card p { margin-bottom: var(--s2); }
.document-actions { display: flex; flex-wrap: wrap; gap: var(--s3); flex-shrink: 0; }
@media (max-width: 760px) { .document-card { align-items: flex-start; flex-direction: column; } }

@media (max-width: 760px) {
  .topbar nav { width: 100%; flex-wrap: wrap; gap: var(--s3); }
  .topbar .who { flex-basis: 100%; overflow-wrap: anywhere; }
}

/* Navegación de módulos según el perfil GLPI. */
.workspace-layout { display: grid; grid-template-columns: 240px minmax(0,1fr); flex: 1; width: 100%; max-width: 1600px; margin-inline: auto; }
.workspace-layout.without-sidebar { grid-template-columns: minmax(0,1fr); }
.workspace-content { display: flex; flex-direction: column; min-width: 0; }
.app-sidebar { border-right: 1px solid var(--line); background: var(--surface); padding: var(--s5) var(--s3); }
.app-sidebar details { position: sticky; top: var(--s5); }
.app-sidebar summary { display: none; }
.sidebar-caption { padding-inline: var(--s3); margin-bottom: var(--s3); font-size: .875rem; color: var(--muted); font-weight: 600; }
.app-sidebar nav { display: grid; gap: var(--s2); }
.app-sidebar nav a { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); min-height: 44px; border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.app-sidebar nav a:hover { background: var(--ink-soft); }
.app-sidebar nav a[aria-current="page"] { background: var(--green-soft); color: var(--green-text); font-weight: 700; }
.settings-panel { max-width: 820px; margin-inline: auto; }
.settings-panel + .settings-panel { margin-top: var(--s5); }
.settings-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--s4); }
.settings-verify { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
@media (max-width: 1000px) {
  .workspace-layout { grid-template-columns: minmax(0,1fr); }
  .app-sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: var(--s3) var(--s4); }
  .app-sidebar details { position: static; }
  .app-sidebar summary { display: list-item; cursor: pointer; font-weight: 600; padding-block: var(--s2); }
  .app-sidebar nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 600px) { .settings-fields, .app-sidebar nav { grid-template-columns: minmax(0,1fr); } }

.settings-panel h1 { margin-top: var(--s2); margin-bottom: var(--s3); }
.settings-panel h2 { margin-bottom: var(--s2); }
.settings-fields { margin-top: var(--s5); margin-bottom: var(--s3); }
.settings-fields .field + .field { margin-top: 0; }
.settings-panel .hint { margin-bottom: var(--s3); }

/* Encabezado de página, variantes de estado y componentes de gestión */
.page-head { margin-bottom: var(--s5); }
.page-head .badge { margin-bottom: var(--s2); }
.page-head h1 { margin-top: var(--s1); }
.row-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s4); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }
.actions form { margin: 0; }
.stack { display: grid; gap: var(--s5); min-width: 0; }
.badge.warn { background: var(--amber-soft); color: var(--amber-text); }
.badge.danger { background: var(--danger-soft); color: var(--danger-text); }
.badge.info { background: #e8effc; color: #1d3f8a; }
.badge.neutral { background: var(--page); color: var(--muted); border: 1px solid var(--line-strong); }
.button.danger { border-color: var(--danger-text); color: var(--danger-text); }
.button.danger:hover { background: var(--danger-soft); color: var(--danger-text); }
.notice svg { margin-top: 2px; }
.notice.error svg { color: var(--danger-text); }
.empty h2 { font-size: 1.125rem; color: var(--ink); }
.empty p + p { margin-top: var(--s3); }
.actions .button, .empty .button { text-decoration: none; }

/* Lista de filas (historial) */
.rows { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.rows li + li { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 24px; align-items: center; gap: var(--s4); padding: var(--s4); color: inherit; text-decoration: none; }
.row:hover { background: var(--ink-soft); color: inherit; }
.row-main strong { display: block; }
.row-main small, .row-status small { display: block; color: var(--muted); font-size: .875rem; }
.row-status { display: grid; justify-items: end; gap: var(--s1); }
@media (max-width: 760px) {
  .row { grid-template-columns: 44px minmax(0, 1fr) 24px; }
  .row-status { grid-column: 2 / 3; justify-items: start; }
}

/* Detalle de acta */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.detail-layout > * { min-width: 0; }
.acta-detail-head > div { min-width: 0; }
.acta-detail-head .lede { overflow-wrap: anywhere; }
.detail-layout h2 { font-size: 1.125rem; margin-bottom: var(--s3); }
.receipt-form { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); display: grid; gap: var(--s3); justify-items: start; }
.timeline { position: relative; display: grid; gap: var(--s4); padding-left: var(--s5); }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 4px; overflow-wrap: anywhere; }
.timeline li::before { content: ""; position: absolute; left: calc(-1 * var(--s5)); top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); }
.timeline li:last-child::before { background: var(--green); border-color: var(--green); }
.timeline-what { min-width: 0; }
.timeline-what small { display: block; color: var(--muted); }
.timeline-fingerprint { margin: var(--s2) 0 var(--s1); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--page); }
.timeline-fingerprint > span { display: block; margin-bottom: var(--s2); font-size: .75rem; color: var(--muted); }
.timeline-fingerprint code { display: block; font: .75rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--ink); white-space: normal; overflow-wrap: anywhere; word-break: break-all; user-select: all; }
.timeline time { color: var(--muted); font-size: .8125rem; }
@media (max-width: 1000px) { .detail-layout { grid-template-columns: 1fr; } }

/* Revisión y firma del acta por el empleado */
.review { max-width: 720px; margin-inline: auto; }
.review-summary h2 { font-size: 1.125rem; margin-bottom: var(--s3); }
.item-list { display: grid; }
.item-list li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--s1) var(--s4); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.item-list li:first-child { border-top: 0; padding-top: 0; }
.item-list small { grid-column: 2; color: var(--muted); }
.flow { counter-reset: paso; display: grid; gap: var(--s4); margin: var(--s5) 0; }
.flow-step { counter-increment: paso; position: relative; padding: var(--s5) var(--s5) var(--s5) 72px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.flow-step::before { content: counter(paso); position: absolute; left: var(--s5); top: var(--s5); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; }
.flow-step h2 { font-size: 1.125rem; margin-bottom: var(--s1); }
.flow-step > p { color: var(--muted); margin-bottom: var(--s3); }
.flow-step form { margin: 0; }
.otp-input { max-width: 240px; font-size: 1.5rem; font-weight: 700; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.otp-input::placeholder { letter-spacing: .4em; color: var(--line-strong); }
.flow-step .inline-check { margin: var(--s4) 0; }
.flow-step .inline-check span { flex: 1; }
.reject h2 { font-size: 1.125rem; }
.reject form { margin-top: var(--s3); }
.outcome h2 { font-size: 1.25rem; margin-bottom: var(--s1); }
.outcome.success { background: var(--green-soft); border-color: var(--green); }
.outcome.danger { background: var(--danger-soft); border-color: #e6b3b3; }
@media (max-width: 760px) {
  .flow-step { padding: 72px var(--s4) var(--s4); }
  .flow-step::before { left: var(--s4); top: var(--s4); }
  .item-list li { grid-template-columns: 1fr; }
  .item-list small { grid-column: 1; }
}

/* Selección: mensajes de datos faltantes, ayuda plegable y salto al resumen */
.delivery .need { display: none; margin-top: var(--s1); font-size: .8125rem; color: var(--amber-text); }
.delivery input:required:placeholder-shown + .need { display: block; }
.delivery input::placeholder { color: #7a5a2c; opacity: 1; }
.delivery input:not(:placeholder-shown)::placeholder { color: transparent; }
.hint-details { margin: var(--s4) 0 var(--s2); font-size: .875rem; color: var(--muted); }
.hint-details summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.hint-details p { margin-top: var(--s2); }
.jump-summary { display: none; font-size: .9375rem; font-weight: 600; }
#return-receipt { margin: var(--s3) 0; }
#return-receipt span { display: flex; gap: var(--s3); align-items: flex-start; font-size: .875rem; }
#register-button { margin-top: var(--s3); }
@media (max-width: 1000px) { .jump-summary { display: inline-block; } }
.equipment-title label, .select-module { min-height: 44px; }
html { scroll-padding-top: var(--s5); }

/* Perfil y ámbito en el menú de la cuenta. */
.account-menu { position: relative; }
.account-menu summary { display: flex; align-items: center; gap: var(--s2); cursor: pointer; list-style: none; border-radius: var(--radius); padding: var(--s2); min-height: 44px; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover, .account-menu[open] summary { background: #ffffff18; }
.account-popover { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 280px; max-width: calc(100vw - 32px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 8px 28px #21133222; padding: var(--s3); }
.account-popover p { font-size: .8125rem; color: var(--muted); padding: var(--s2); }
.topbar .account-popover a { display: flex; align-items: center; gap: var(--s2); padding: var(--s3); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.topbar .account-popover a:hover, .topbar .account-popover a[aria-current=page] { background: var(--green-soft); }
@media(max-width:760px) { .account-popover { left: 0; right: auto; } }

/* Una acción principal en la ficha; descarga y firma después de revisar el PDF. */
.pdf-preview { display: none; padding: var(--s4); }
.pdf-preview[open] { display: grid; grid-template-rows: auto minmax(180px,1fr) auto; gap: var(--s3); }
.pdf-preview header { align-items: flex-start; }
.pdf-preview header > div { display: block; }
.pdf-preview header .hint { margin-top: var(--s1); }
.pdf-preview iframe { height: 100%; min-height: 0; margin-top: 0; }
.pdf-preview [hidden] { display: none !important; }
.preview-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); border-top: 1px solid var(--line); padding-top: var(--s3); }
.preview-confirmation { flex: 1; min-width: 0; }
.preview-confirmation p:empty { display: none; }
.preview-buttons { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.preview-buttons #register-button { margin: 0; }
#return-receipt { margin: 0; }
@media(max-width:650px) {
  .pdf-preview { height: 94dvh; max-height: 94dvh; padding: var(--s3); }
  .pdf-preview header { flex-direction: row; }
  .pdf-preview header h2 { font-size: 1.125rem; }
  .pdf-preview header > button { font-size: .8125rem; padding-inline: var(--s2); flex-shrink: 0; }
  .preview-actions { align-items: stretch; flex-direction: column; gap: var(--s2); }
  .preview-confirmation:has(> [hidden]):not(:has(> :not([hidden]):not(:empty))) { display: none; }
  .preview-buttons { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--s2); }
  .preview-buttons .button { font-size: .8125rem; padding-inline: var(--s2); }
}

/* Resultado de la verificación SMTP */
.smtp-result { margin-top: var(--s4); padding: var(--s4); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); }
.smtp-result[hidden] { display: none; }
.smtp-result.success { border-color: var(--green); }
.smtp-result.error { border-color: #e6b3b3; }
.smtp-result h3 { margin-bottom: var(--s2); }
.smtp-result.success h3, .smtp-state.ok { color: var(--green-text); }
.smtp-result.error h3, .smtp-state.error { color: var(--danger-text); }
.smtp-result-meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s4); font-size: .875rem; }
.smtp-result-meta dt { color: var(--muted); }
.smtp-result-meta dd { overflow-wrap: anywhere; font-weight: 600; }
.smtp-checks { margin-top: var(--s4); }
.smtp-checks li { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding-block: var(--s2); border-bottom: 1px solid var(--line); font-size: .875rem; }
.smtp-state { flex-shrink: 0; }
.smtp-state.pending, .smtp-state.na { color: var(--muted); }
.smtp-next, .smtp-delivery { margin-top: var(--s3); font-size: .875rem; }
.smtp-result .hint { margin-top: var(--s3); margin-bottom: 0; }
@media(max-width:600px) { .smtp-result-meta { grid-template-columns: 1fr; } .smtp-checks li { align-items: flex-start; } }

/* Firma personal, accesible desde el menú de la cuenta. */
.profile-page { max-width: 1040px; margin-inline: auto; }
.profile-identity { display:flex; align-items:center; gap:24px; margin-bottom:24px; }
.profile-identity h2, .profile-identity p { margin:0 0 4px; }
.signature-layout { display:grid; grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr); gap:24px; align-items:start; }
.signature-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:20px; }
.signature-heading h2 { margin:0; }
.signature-current, .signature-empty, .signature-upload-preview { min-height:150px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; display:flex; align-items:center; justify-content:center; padding:20px; margin-bottom:16px; }
.signature-current img, .signature-upload-preview img { display:block; max-width:100%; max-height:135px; object-fit:contain; }
.signature-empty { flex-direction:column; color:var(--muted); background:var(--page); }
.signature-remove { border-top:1px solid var(--line); padding-top:16px; margin-top:24px; }
.signature-remove summary { cursor:pointer; font-size:13px; color:var(--muted); }
.signature-modes { display:flex; gap:8px; margin:20px 0; }
.signature-modes button[aria-pressed=true] { background:#e5f4eb; border-color:#3aaf79; color:#1d6a45; }
.signature-pad { position:relative; margin-top:10px; border:1px solid var(--line-strong); border-radius:var(--radius); overflow:hidden; background:#fff; }
.signature-pad canvas { display:block; width:100%; height:auto; touch-action:none; cursor:crosshair; }
.signature-pad span { position:absolute; bottom:20px; left:24px; right:24px; border-top:1px dashed var(--line-strong); padding-top:6px; color:var(--muted); font-size:12px; pointer-events:none; }
.signature-pad.has-ink span { visibility:hidden; }
.signature-tools { display:flex; gap:8px; justify-content:flex-end; margin-top:10px; }
.operator-signature-status { font-size:13px; margin-top:12px; }
.operator-signature-status a { font-weight:600; }
@media(max-width:760px) { .signature-layout { grid-template-columns:1fr; } .signature-modes { flex-wrap:wrap; } .profile-identity { gap:16px; } }
.profile-page .page-title { margin-bottom:24px; }
.profile-page > .notice { margin-bottom:24px; }
.profile-page > .notice.success { background:var(--green-soft); border-color:var(--green); color:var(--green-text); }

.glpi-setup-guide { margin-top: var(--s4); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4); }
.glpi-setup-guide summary { font-weight: 600; cursor: pointer; }
.glpi-setup-guide ol { padding-left: 1.3em; list-style: decimal; margin-top: var(--s4); }
.glpi-setup-guide li + li { margin-top: var(--s3); }
.glpi-setup-guide .button { margin-top: var(--s3); }

/* Permisos de perfiles administrados desde la app. */
.permissions-panel { margin-block: var(--s5) var(--s6); padding-bottom: var(--s6); border-bottom: 1px solid var(--line); scroll-margin-top: var(--s5); }
.permissions-panel .lede { margin-bottom: var(--s4); }
.permission-head, .permission-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 110px 110px; align-items: center; gap: var(--s2); }
.permission-head { font-size: .8125rem; font-weight: 700; padding: var(--s3); background: var(--ink-soft); border-radius: var(--radius); }
.permission-head span:not(:first-child) { text-align: center; }
.permission-row { padding: var(--s3); border-bottom: 1px solid var(--line); }
.permission-name { display: flex; flex-direction: column; overflow-wrap: anywhere; }
.permission-name small { color: var(--muted); font-size: .75rem; }
.permission-control { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: var(--s2); cursor: pointer; }
.permission-control input, .permission-personal input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.permission-mobile-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.permission-personal { margin-top: var(--s4); }
.permissions-panel .button { margin-top: var(--s4); }
@media (max-width: 760px) {
  .permission-head { display: none; }
  .permission-row { grid-template-columns: 1fr; padding: var(--s4) 0; gap: 0; }
  .permission-control { justify-content: flex-start; }
  .permission-mobile-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
}

/* Configuración por categorías plegables. */
.settings-page { max-width: 960px; margin-inline: auto; }
.settings-heading { margin-bottom: var(--s6); }
.settings-eyebrow { display: block; color: var(--green-text); font-size: .8125rem; font-weight: 700; margin-bottom: var(--s2); }
.settings-notice { margin-bottom: var(--s5); }
.settings-sections { display: grid; gap: var(--s4); }
.settings-section { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); scroll-margin-top: var(--s5); }
.settings-section > summary { display: flex; align-items: center; gap: var(--s4); min-height: 112px; padding: var(--s5); cursor: pointer; list-style: none; border-radius: var(--radius-lg); }
.settings-section > summary::-webkit-details-marker { display: none; }
.settings-section > summary:hover { background: var(--ink-soft); }
.settings-section[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--ink-soft); }
.settings-section-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; background: var(--ink-soft); color: var(--ink); border-radius: var(--radius); }
.settings-section[open] .settings-section-icon { background: var(--surface); }
.settings-section-label { display: flex; flex-direction: column; gap: var(--s1); flex: 1; min-width: 0; }
.settings-section-label strong { font-size: 1.125rem; line-height: 1.35; }
.settings-section-label small { font-size: .875rem; color: var(--muted); }
.settings-section > summary > .badge { text-align: center; max-width: 200px; white-space: normal; }
.settings-chevron { display: grid; place-items: center; flex: none; width: 28px; height: 28px; }
.settings-chevron .icon { transform: rotate(-90deg); transition: transform .15s; }
.settings-section[open] .settings-chevron .icon { transform: rotate(90deg); }
.settings-body { padding: var(--s5); min-width: 0; }
.settings-body > .lede:first-child { margin-top: 0; }
.settings-body .permissions-panel { margin: 0; padding: 0; border: 0; }
.settings-body .permissions-panel > .lede { margin-top: 0; }
.settings-body .settings-fields { margin-top: var(--s5); }
.settings-body > .muted:last-child { font-size: .875rem; margin-top: var(--s4); }
.settings-footnote { display: flex; align-items: flex-start; gap: var(--s2); margin-top: var(--s5); font-size: .8125rem; color: var(--muted); }
@media (max-width: 760px) {
  .settings-section > summary { display: grid; grid-template-columns: 40px minmax(0, 1fr) 24px; gap: var(--s2) var(--s3); padding: var(--s4); }
  .settings-section-icon { width: 40px; height: 40px; }
  .settings-section-label strong { font-size: 1rem; }
  .settings-section > summary > .badge { grid-column: 2; justify-self: start; max-width: 100%; font-size: .75rem; }
  .settings-chevron { grid-column: 3; grid-row: 1; width: 24px; }
  .settings-body { padding: var(--s4); }
}
@media (prefers-reduced-motion: reduce) { .settings-chevron .icon { transition: none; } }
