:root { color-scheme: light;
  --bg: #f3f5f8; --surface: #fff; --surface-soft: #f7f9fc; --surface-hover: #eef3f9;
  --text: #1f2937; --muted: #6b7280; --border: #d9e0e8;
  --header: #1b2433; --header-text: #f8fafc;
  --accent: #2563eb; --accent-soft: #e0eaff; --danger: #b91c1c; --danger-bg: #fdecec;
  --ok: #15803d; --ok-bg: #e7f6ec; --warn: #b45309; --warn-bg: #fdf3e2;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
html[data-theme="dark"] { color-scheme: dark;
    --bg: #0f141d; --surface: #171e2a; --surface-soft: #1d2634; --surface-hover: #263244;
    --text: #e5e7eb; --muted: #aab4c3; --border: #344154; --header: #0b1018;
    --accent: #60a5fa; --accent-soft: #1e3a5f; --danger: #f87171; --danger-bg: #3b1a1a;
    --ok: #4ade80; --ok-bg: #163222; --warn: #fbbf24; --warn-bg: #3a2c12;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }   /* the footer at the bottom of the window */
main { flex: 1 0 auto; width: 100%; }
a { color: var(--accent); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 18px;
  padding-top: max(10px, env(safe-area-inset-top)); background: var(--header); color: var(--header-text); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; }
.brand-title { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #d7deea; text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 7px; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid #ffffff30;
  background: #ffffff10; color: #fff; cursor: pointer; }
.mail-warn { font-weight: 800; font-size: 1.25rem; text-decoration: none; background: #f59e0b; border-color: #f59e0b; color: #1f2937; }
.mail-warn[hidden] { display: none; }
.icon-btn svg, .ibtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.company-select { width: auto; max-width: 220px; background: #ffffff10; color: #fff; border: 1px solid #ffffff30; padding: 8px 10px; }
.company-select:disabled { opacity: 1; cursor: default; }
.company-select option { color: var(--text); background: var(--surface); }
.photos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.photos figure { margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-soft); }
.photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; }
.photos figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 8px; font-size: .82rem; color: var(--muted); }
.pv { position: fixed; inset: 0; z-index: 60; background: #0b0f17; display: flex; flex-direction: column; outline: none; }
.pv-stage { flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; touch-action: none; cursor: zoom-in; user-select: none; }
.pv-stage.zoomed { cursor: grab; }
.pv-stage img { max-width: 100%; max-height: 100%; transform-origin: center; will-change: transform; }
.pv-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #111827; color: #d1d5db; font-size: .85rem; }
.pv-tools { display: flex; gap: 6px; margin-left: auto; }
.pv-btn { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid #374151; border-radius: 8px; background: #1f2937; color: #fff; font: inherit; font-size: 1.15rem; text-decoration: none; cursor: pointer; }
.pv-btn:hover { background: #374151; }
.photo-slots { display: flex; gap: 12px; flex-wrap: wrap; }
.photo-slot { width: 150px; height: 112px; border: 2px dashed var(--border); border-radius: 10px; display: grid; place-items: center; text-align: center; cursor: pointer; color: var(--muted); font-size: .85rem; position: relative; overflow: hidden; background: var(--surface-soft); }
.photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot input { display: none; }
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; border: 1px solid #ffffff30; border-radius: 8px; background: #ffffff10; padding: 9px 12px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 220px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 12px 32px #0003; }
.menu-caption { display: block; padding: 8px 10px; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: none; color: inherit; border-radius: 6px; text-decoration: none; font: inherit; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-hover); }
.menu button { color: var(--danger); }
main { max-width: 1200px; margin: 20px auto; padding: 0 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
h1 { font-size: 1.45rem; margin: 0 0 6px; }
h2 { font-size: 1.12rem; margin: 22px 0 10px; }
.note { color: var(--muted); font-size: .9rem; margin: 0; }
/* the footer as the Portal WGAccess draws it: a thin line across the whole width, the version left, Esitel right */
.credit { display: flex; justify-content: space-between; gap: 12px; padding: 5px 14px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); margin-top: auto; }
.credit-by { margin-left: auto; text-align: right; }
.credit a { color: var(--muted); text-decoration: none; } .credit a:hover { text-decoration: underline; color: var(--text); } .credit a[hidden] { display: none; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-decoration: none; color: inherit; display: block; }
.card:hover { border-color: var(--accent); }
.card b { font-size: 1.05rem; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-hover); margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter.near i { background: #d97706; }
.meter.full i { background: #dc2626; }
.lic-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 14px; align-items: center; margin-bottom: 12px; }
.lic-row label { grid-column: 1 / -1; margin: 0; }
.lic-use .meter { margin-top: 6px; }
.prob-esitel { margin-top: 6px; padding: 6px 8px; border-left: 3px solid #7c3aed; background: #f5f3ff; font-size: .88rem; }
html[data-theme="dark"] .prob-esitel { background: #2e1065; }
@media (max-width: 640px) { .lic-row { grid-template-columns: 1fr; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.toolbar .grow { flex: 1 1 220px; }
.toolbar { position: relative; }
.suggest-wrap { position: relative; }
.suggest-wrap.grow { flex: 1 1 220px; }
.suggest { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px #0002; max-height: 60vh; overflow: auto; }
.suggest a { display: block; padding: 9px 12px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); }
.suggest a:last-child { border-bottom: 0; }
.suggest a:hover, .suggest a.on { background: var(--surface-hover); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.hint { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 8px; padding: 10px 16px; background: var(--accent); color: #fff; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; }
.btn.secondary { background: var(--surface-soft); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); }
.btn.ok { background: var(--ok); color: #fff; } .btn.warn { background: var(--warn); color: #fff; } .btn.repair { background: #6d28d9; color: #fff; }
.act-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 6px 11px; font-size: .88rem; }
.room-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: .88rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: .88rem; cursor: pointer; text-decoration: underline; }
.scan-row { display: flex; gap: 6px; align-items: stretch; } .scan-row input { flex: 1; min-width: 0; } .scan-row .btn { padding: 6px 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-hover); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--surface-hover); color: var(--muted); }
.badge.ACTIVO { background: var(--ok-bg); color: var(--ok); }
.badge.REPARACION { background: var(--warn-bg); color: var(--warn); }
.badge.BAJA { background: var(--danger-bg); color: var(--danger); }
/* The bottom line is an inset shadow (the selected tab covers it) instead of a border the tabs overlap with a
   negative margin: that overflowed 1px and showed a scroll bar. Narrow screens still scroll sideways, without a bar. */
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--border); margin: 18px 0 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: var(--surface-hover); border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; padding: 9px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: inset 0 3px 0 var(--accent); }
.item-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.item-head .qr { width: 132px; height: 132px; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 4px; }
.item-head .qr svg { width: 100%; height: 100%; }
.code-big { font-size: 1.6rem; font-weight: 700; letter-spacing: .02em; }
.meta { display: grid; gap: 10px 18px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-top: 12px; }
.meta span { display: block; font-size: .78rem; color: var(--muted); }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; padding: 20px; width: min(560px, 100%); max-height: 92vh; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.scanner { position: relative; overflow: hidden; border-radius: 10px; }
.scanner video { width: 100%; border-radius: 10px; background: #000; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.scanner.wide video { aspect-ratio: 4 / 3; }
.scanner.wide::after { content: ''; position: absolute; left: 12%; right: 12%; top: 18%; bottom: 18%; border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 8px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); pointer-events: none; }
.cam-controls { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.cam-res { margin-left: auto; font-size: .75rem; }
.cam-controls:empty { display: none; }
.cam-controls .on { background: var(--accent); color: #fff; border-color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--header); color: var(--header-text); padding: 11px 18px; border-radius: 10px; z-index: 60; max-width: calc(100% - 32px); }
.secret { font-family: ui-monospace, monospace; font-size: 1.1rem; background: var(--surface-soft); border: 1px dashed var(--border); padding: 10px; border-radius: 8px; word-break: break-all; }
.login { max-width: 380px; margin: 8vh auto; position: relative; z-index: 1; }
/* 0.5.1 sign-in: the network of esitel.es behind the card (netbg.js), one entrance (card, then its rows 45 ms apart),
   a ring on the focused field, «Entrando…» on the button and a short shake of the password when it fails. */
.netbg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block;
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent); mask-image: linear-gradient(to bottom, #000 82%, transparent); }
.credit { position: relative; z-index: 1; }
.login { --ease-out: cubic-bezier(.23, 1, .32, 1); animation: login-card .32s var(--ease-out) both; }
.login > * { animation: login-rise .36s var(--ease-out) both; }
.login > :nth-child(2) { animation-delay: 45ms; } .login > :nth-child(3) { animation-delay: 90ms; } .login > :nth-child(4) { animation-delay: 135ms; }
.login > :nth-child(5) { animation-delay: 180ms; } .login > :nth-child(6) { animation-delay: 225ms; } .login > :nth-child(7) { animation-delay: 270ms; }
.login .login-lead { margin-bottom: 16px; }
.login input { transition: border-color .12s ease, box-shadow .12s ease; }
.login input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent); }
.login input.shake { animation: login-shake .3s var(--ease-out); }
.login-btn { width: 100%; justify-content: center; transition: transform .12s ease, filter .12s ease; }
@media (hover: hover) and (pointer: fine) { .login-btn:hover:not(:disabled) { filter: brightness(1.07); } }
.login-btn:active:not(:disabled) { transform: scale(.985); }
.login-btn .wait { display: none; width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: login-spin .7s linear infinite; }
.login-btn.busy { opacity: 1; } .login-btn.busy .wait { display: block; }
.login-error { margin-top: 10px; color: var(--danger); } .login-error:empty { display: none; }
@keyframes login-card { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes login-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes login-fade { from { opacity: 0; } }
@keyframes login-spin { to { transform: rotate(1turn); } }
@keyframes login-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) {
  .login, .login > * { animation: login-fade .2s ease both; }
  .login input.shake { animation: none; }
}
.list-cards { display: none; }
@media (max-width: 720px) {
  .topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .brand-title { display: none; }
  .nav { display: none; }
  .company-select { order: 10; flex-basis: 100%; max-width: none; }
  .company-select.single { display: none; }
  main { margin-top: 14px; padding: 0 12px; }
  .panel { padding: 14px; }
  .table-wrap { display: none; }
  .list-cards { display: grid; gap: 10px; }
  .list-cards .card { padding: 13px; }
  .code-big { font-size: 1.3rem; }
  .btn { padding: 11px 15px; }
}
@media print {
  .topbar, .credit, .no-print, .tabs { display: none !important; }
  body { background: #fff; }
  .panel { border: 0; box-shadow: none; }
}
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-weight: 600; }
mark { background: #fde68a; color: #1f2937; border-radius: 3px; padding: 0 1px; }
.search-table tbody tr { cursor: default; }
@media (max-width: 720px) { .search-table thead { display: none; } .search-table td { display: block; border: 0; padding: 4px 0; } .search-table tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; } }
.type-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--accent); vertical-align: middle; flex: none; }
.code-big .type-icon { width: 30px; height: 30px; margin-right: 4px; vertical-align: -4px; }
.icon-cell { width: 34px; padding-right: 0; }
.with-icon { display: inline-flex; align-items: center; gap: 6px; }
.card-icon { display: flex; gap: 12px; align-items: flex-start; }
.card-icon > .type-icon { width: 30px; height: 30px; margin-top: 2px; }
.combo { position: relative; min-width: 150px; }
.combo > select { display: none; }
.combo-input { padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; text-overflow: ellipsis; }
.combo-list { position: absolute; z-index: 70; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px #0003; padding: 4px; min-width: 180px; }
.combo-list [role="option"] { padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.combo-list [role="option"]:hover, .combo-list .on { background: var(--surface-hover); }
.combo-list .sel { font-weight: 650; }
.combo-list .none { padding: 8px 10px; color: var(--muted); }
.combo-list .new { color: var(--accent); font-weight: 600; border-top: 1px solid var(--border); }
.toolbar .combo { flex: 0 1 220px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .82rem; font-weight: 650; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); white-space: nowrap; }
.chip:not(:has(button)) { padding-right: 10px; }
.chip button { border: 0; background: none; color: inherit; font-size: 1rem; line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 50%; }
.chip button:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.tag-editor { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: var(--surface); }
.tag-editor .chips { display: contents; }
.tag-input { position: relative; display: flex; gap: 6px; flex: 1 1 200px; }
.tag-input input { border: 0; padding: 6px; outline: none; }
.upload-box { padding: 14px; background: var(--surface-soft); }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 6px; }
.icon-picker label { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; margin: 0; }
.icon-picker input { display: none; }
.icon-picker label:has(input:checked) { border: 2px solid var(--accent); background: var(--accent-soft); }
.page-size { width: auto; padding: 6px 8px; }
.pager { flex-wrap: wrap; }
.prio { width: auto; padding: 4px 8px; font-weight: 650; }
.prio-ALTA { color: var(--danger); font-weight: 700; }
.prio-MEDIA { color: var(--warn); }
.baja-panel { border-left: 4px solid var(--danger); }
.support-btn { display: inline-flex; align-items: center; gap: 6px; color: #fff; text-decoration: none; font-weight: 650; padding: 8px 12px; border-radius: 8px; border: 1px solid #ffffff30; background: #ffffff10; position: relative; }
.support-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.support-btn[aria-current="page"] { background: rgba(255,255,255,.22); }
.support-count { background: var(--danger); color: #fff; border-radius: 999px; font-size: .72rem; padding: 1px 7px; font-weight: 700; }
.support-count.progress { background: var(--accent); }   /* requests «En trámite» */
.alerts { border-left: 4px solid var(--danger); background: var(--danger-bg); }
.alert-row { display: grid; grid-template-columns: minmax(110px, auto) 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 8px; background: var(--surface); color: inherit; text-decoration: none; margin-top: 8px; border: 1px solid var(--border); }
.alert-row:hover { border-color: var(--danger); }
.system-work { border-left: 4px solid var(--danger); }
details.resolved { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; background: var(--surface-soft); }
details.resolved summary { cursor: pointer; padding: 12px 0; font-weight: 650; color: var(--ok); }
details.resolved[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.home-lists { display: grid; gap: 18px; grid-template-columns: 1fr; margin-top: 18px; }   /* one column: easier to read */
.list-row { display: flex; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-hover); }
.grow-cell { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-counts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: .88rem; }
.type-counts .type-icon { width: 18px; height: 18px; }
@media (max-width: 720px) { .support-btn span:not(.support-count) { display: none; } .alert-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- responsive layout (phone: icons on top, sections at the bottom) ---------- */
.mobile-only { display: none !important; }
.account summary { display: inline-flex; align-items: center; gap: 8px; }
.account summary svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
#who { overflow: hidden; text-overflow: ellipsis; }
.menu { width: 260px; }
/* The menus hang from the sticky top bar (one or two rows): opened, they take the height left below them
   (fitMenu); only a window too short for the whole menu scrolls inside it. */
.menu { max-height: calc(100dvh - 76px); overflow-y: auto; overscroll-behavior: contain; }
.menu-section { display: block; padding: 8px 10px 2px; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.bottom-nav { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 8px; }
.add-btn { white-space: nowrap; }
.add-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.info-btn { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); background: var(--surface); font: italic 700 .85rem Georgia, serif; cursor: pointer; padding: 0; flex: none; }
.info-pop { position: absolute; z-index: 35; top: 100%; left: 0; margin-top: 8px; max-width: min(420px, calc(100vw - 32px)); background: var(--header); color: var(--header-text); font: 400 .88rem/1.45 system-ui, sans-serif; padding: 12px 14px; border-radius: 10px; box-shadow: 0 12px 32px #0004; }
.page-head h1 { position: relative; }
.filters .adv { display: contents; }
.adv-toggle { display: none; padding: 9px 11px; }
.adv-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.adv-toggle.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.deep-toggle.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.panel.deep { margin-bottom: 12px; display: grid; gap: 10px; }
.deep-flags { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; margin: 0; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .9rem; font-weight: 500; white-space: nowrap; cursor: pointer; }
.chip-check:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 650; }
.chip-check input { margin: 0; width: auto; accent-color: var(--accent); }
.cond { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(120px, 1fr) minmax(140px, 1.4fr) auto; gap: 8px; align-items: center; }
.cond .cond-del { padding: 8px 10px; }
.deep-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) { .cond { grid-template-columns: 1fr 1fr; } .cond [data-cv], .cond .cond-none { grid-column: 1 / 2; } .cond .cond-del { grid-column: 2 / 3; justify-self: end; } }
.qr-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tab-select { display: none; width: 100%; margin: 14px 0 12px; font-weight: 650; background: var(--surface-hover); }
.table-scroll { overflow-x: auto; max-width: 100%; }
.login-logo { background: #fff; border-radius: 12px; padding: 14px; margin: -4px -4px 16px; text-align: center; border: 1px solid var(--border); }
.login-logo img { width: 100%; max-width: 300px; height: auto; }
@media (min-width: 721px) {
  .filters { flex-wrap: nowrap; }
  .filters .combo { flex: 1 1 130px; min-width: 120px; max-width: 200px; }
  .filters input[name="q"] { flex: 2 1 180px; min-width: 160px; }
}
@media (max-width: 720px) {
  .mobile-only { display: revert !important; }
  .desktop-only { display: none !important; }
  .tools { gap: 6px; }
  .support-btn { padding: 8px 10px; }
  .support-btn .label, #who { display: none; }
  .account summary { padding: 9px 10px; }
  body.signed-in { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .bottom-nav:not([hidden]) { display: flex; position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border);
    padding: 4px 4px max(4px, env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px #0001; }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: .72rem; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 8px; }
  .bottom-nav a[hidden] { display: none; }
  .bottom-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
  .credit { display: none; }
  .add-btn span { display: none; }
  .add-btn { padding: 9px 12px; }
  .filters { flex-wrap: wrap; }
  .filters input[name="q"] { flex: 1 1 0; min-width: 0; }
  .adv-toggle { display: inline-flex; }
  .filters .adv { display: none; }
  .filters.open .adv { display: grid; gap: 8px; flex-basis: 100%; order: 5; }
  .filters .adv .combo { max-width: none; }
  .tabs { display: none; }
  /* The sheet's section selector: a blue bar the width of the column, unlike the form's fields */
  .tab-select { display: block; -webkit-appearance: none; appearance: none; margin: 18px 0 14px; padding: 14px 44px 14px 16px; font-size: 1.05rem; font-weight: 700; color: #fff; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 20px; }
  .tab-select option { color: var(--text); background: var(--surface); font-weight: 600; }
  .item-head { gap: 12px; flex-direction: column; align-items: stretch; }
  .qr-row { width: 100%; }
  .item-head .meta { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .item-head > div { min-width: 0 !important; }
  .photo-btn { align-self: flex-start; margin: 0 0 0 auto; }   /* top right corner of the sheet, beside the QR */
  #tabpane table, .panel > table { display: block; overflow-x: auto; max-width: 100%; }
  .toolbar .combo { flex: 1 1 100%; }
  .page-head h1 { font-size: 1.3rem; }
  .info-pop { left: 0; right: 0; }
}
@media (max-width: 720px) {
  html[data-theme="dark"] .tab-select { background-color: #2563eb; }   /* the dark theme's light blue is too pale under white text */
}
@media (max-width: 720px) { .icon-btn.mobile-only { display: grid !important; } .dot.mobile-only { display: inline-block !important; } }   /* home: the status is a dot on phones, a label on desktop */
.cam-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
@media (max-width: 720px) { .works-filters > .combo { flex: 1 1 0; min-width: 0; } }
@media (min-width: 721px) { .works-filters { flex-wrap: nowrap; } .works-filters select[name="sort"] { width: auto; flex: 0 1 280px; } .works-filters .combo { flex: 0 1 200px; } }
.with-icon b { white-space: nowrap; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 4px 0 12px; background: var(--surface); }
.segmented a { padding: 8px 18px; text-decoration: none; color: var(--muted); font-weight: 650; }
.segmented a[aria-selected="true"] { background: var(--accent); color: #fff; }
.req-card { margin-bottom: 10px; border-left: 4px solid var(--border); }
.req-card.req-CRITICA { border-left-color: var(--danger); }
.req-card.req-ALTA { border-left-color: var(--warn); }
/* Urgency: a square box of its colour with white letters (status labels are rounded) */
.urg { display: inline-block; padding: 2px 8px; border-radius: 0; color: #fff; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.urg-CRITICA { background: #b91c1c; } .urg-ALTA { background: #ea580c; } .urg-MEDIA { background: #b7791f; } .urg-BAJA { background: #15803d; }
.support-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.support-head h1 { margin: 0; }
.support-head .segmented { margin: 0; }
.co-chip { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .02em;
  background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 60% 28%); border: 1px solid hsl(var(--h) 55% 78%); white-space: nowrap; }
html[data-theme="dark"] .co-chip { background: hsl(var(--h) 35% 22%); color: hsl(var(--h) 70% 82%); border-color: hsl(var(--h) 35% 35%); }
.seg-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.5; }
.resolved-search { margin-bottom: 10px; }
.pane-filter { margin: 0 0 12px; } .pane-filter select { width: auto; }
@media (min-width: 721px) { .works-filters { flex-wrap: wrap; } .works-filters input[name="q"] { flex: 1 1 100%; } .works-filters .combo { flex: 1 1 180px; max-width: 240px; } }
@media (max-width: 720px) { .works-filters input[name="q"] { flex: 1 1 100%; order: -1; } }
.reopened { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); }
.pending-work { cursor: pointer; }
.pending-work:hover { border-color: var(--accent); }
.pending-work.editing { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* Alerts bell (loans that are overdue or due soon) */
.bell { position: relative; }
.bell summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid #ffffff30; background: #ffffff10; color: #fff; position: relative; }
.bell summary::-webkit-details-marker { display: none; }
.bell summary svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bell-count { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; border-radius: 999px; font-size: .72rem; padding: 1px 6px; font-weight: 700; line-height: 1.4; }
.bell-count.soon { background: var(--warn); }
.bell-menu { width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; }
.bell-menu .menu-caption { display: flex; justify-content: space-between; align-items: center; }
.sync-row { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.sync-row:last-child { border-bottom: 0; }
.sync-row p { margin: 0 0 6px; }
.sync-row .hint { margin: 6px 0 0; }
.bell-menu a.alert-item { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; padding: 9px 10px; border-left: 3px solid var(--warn); border-radius: 6px; margin-bottom: 4px; }
.bell-menu a.alert-item.overdue { border-left-color: var(--danger); }
.bell-menu .alert-item .type-icon { grid-row: span 2; }
/* Loans */
.loan-card { border-left: 4px solid var(--accent); }
.loan-card.overdue { border-left-color: var(--danger); }
.loan-card dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; margin: 10px 0; }
.loan-card dt { font-size: .78rem; color: var(--muted); }
.loan-card dd { margin: 0; font-weight: 600; }
.badge.PRESTADO { background: var(--accent-soft); color: var(--accent); }
.badge.VENCIDO { background: var(--danger-bg); color: var(--danger); }
.badge.DISPONIBLE { background: var(--ok-bg); color: var(--ok); }
.state-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.state-chips button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 12px; font: inherit; cursor: pointer; color: var(--text); }
.state-chips button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.state-chips b { margin-left: 4px; }
.person-pick { position: relative; }
.person-pick .chosen { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface-soft); }
.person-pick .combo-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 40; }
.check-line { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 8px; }
.check-line input { width: auto; }
.ext-list { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: .88rem; }
@media (max-width: 720px) { .bell summary { width: 36px; height: 36px; } .bell .bell-menu { position: fixed; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 60px); width: auto; } }
.loan-card strong { font-weight: 650; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.pick-sync { margin-top: 4px; }
.sig-qr { display: grid; place-items: center; margin: 12px 0; }
.sig-qr svg { width: 240px; height: 240px; background: #fff; border-radius: 8px; }
.sign-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--border); }
.sig-img { height: 46px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; }
.perm-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px 12px; margin: 10px 0; }
.perm-box legend { font-weight: 700; padding: 0 6px; }
.alert-pref { padding: 10px 0; border-bottom: 1px solid var(--border); }
.chips-check { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.lock-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; vertical-align: -2px; }
.private-box { border-left: 4px solid var(--warn); margin: 16px 0; }
.badge.sens { background: var(--warn-bg); color: var(--warn); }

/* fields per type */
.tf-title { font-size: 1rem; margin: 6px 0 10px; color: var(--muted); }
.other-fields { margin: 4px 0 14px; font-size: .9rem; }
.other-fields dl { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 6px 0 0; }
.other-fields dt { font-size: .8rem; color: var(--muted); }
.other-fields dd { margin: 0; }
.tf-order { list-style: none; margin: 4px 0 0; padding: 0; counter-reset: tf; }
.tf-order li span:first-child::before { counter-increment: tf; content: counter(tf) ". "; color: var(--muted); }
.tf-order li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.tf-order .tf-actions { display: flex; gap: 4px; }

/* label reader and barcode fields */
.with-scan { display: flex; gap: 6px; }
.with-scan input { flex: 1; min-width: 0; }
.with-scan .scan-field { padding: 0 10px; }
.label-reader { margin: 4px 0 14px; }
.lr-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 8px; background: var(--surface-soft); }
.lr-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.lr-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 200px) 46px; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); }
.lr-row .lr-val { min-width: 0; overflow-wrap: anywhere; }
.lr-row .lr-val small { display: block; color: var(--muted); font-size: .75rem; }
.lr-row .lr-val span { font-weight: 600; }
@media (max-width: 560px) {
  .lr-row { grid-template-columns: minmax(0, 1fr) 46px; gap: 4px 8px; }
  .lr-row .lr-val { grid-column: 1 / -1; }
}
.lr-row select { font-size: .85rem; padding: 6px 8px; }
.lr-row.done .lr-val span { color: var(--ok); }
.lr-done { color: var(--ok); font-weight: 700; }
.lr-end { display: flex; align-items: center; justify-content: flex-start; gap: 6px; }
.lr-drop { border: 0; background: none; color: var(--muted); font-size: 1rem; line-height: 1; padding: 6px; cursor: pointer; border-radius: 6px; }
.lr-drop:hover { color: var(--danger); background: var(--danger-bg); }
.lr-more { margin-top: 8px; }
.lr-more summary { cursor: pointer; color: var(--muted); font-size: .9rem; padding: 4px 0; }
input.filled, select.filled { outline: 2px solid var(--ok); }
.lr-summary { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--ok-bg); border: 1px solid var(--border); }
.lr-sum-row { display: grid; grid-template-columns: minmax(90px, 40%) minmax(0, 1fr) 28px; gap: 8px; align-items: center; padding: 3px 0; }
.lr-sum-row span:nth-child(2) { font-weight: 600; overflow-wrap: anywhere; }

/* Soporte: request inbox and conversation */
.req-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.req-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.btn.tint { background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.req-views { display: flex; gap: 6px; flex-wrap: wrap; }
.req-views button { font: inherit; font-size: .86rem; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.req-views button[aria-selected="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.req-list { padding: 4px 12px; }
.req-row { display: grid; grid-template-columns: 5px 26px minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 4px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; align-items: start; }
.req-row:first-child { border-top: 0; }
.req-row:hover { background: var(--surface-hover); }
.req-ico .type-icon { color: var(--accent); }
/* 0.1.12: the request's urgency as a strip in front of its icon (same colours as the urgency label) */
.req-urg-bar { align-self: stretch; border-radius: 3px; min-height: 26px; }
.req-urg-bar.urg-CRITICA { background: #b91c1c; } .req-urg-bar.urg-ALTA { background: #ea580c; } .req-urg-bar.urg-MEDIA { background: #b7791f; } .req-urg-bar.urg-BAJA { background: #15803d; }
.req-main { min-width: 0; display: grid; gap: 2px; }
.req-main b { overflow-wrap: anywhere; }
.req-side { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; max-width: 340px; }
.req-tags { display: flex; gap: 6px; align-items: center; }
.req-when { text-align: right; }
.req-orphan { color: var(--warn); font-weight: 600; }
.req-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin: 6px 0 12px; }
.req-head h1 { margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
.req-head .eyebrow { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .82rem; margin: 0 0 4px; }
.req-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.req-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 16px; align-items: start; }
@media (max-width: 900px) { .req-detail { grid-template-columns: minmax(0, 1fr); } }
.req-side-panel { display: grid; gap: 12px; min-width: 0; }
/* Gestión: a ribbon right under the conversation (assignment, urgency, approval; the actions on the right) */
.req-main-col { display: grid; gap: 12px; min-width: 0; } .req-main-col > .panel { margin: 0; }
.req-ribbon { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 14px; }
.ribbon-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ribbon-group + .ribbon-group { padding-left: 18px; border-left: 1px solid var(--border); }
.ribbon-label { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; white-space: nowrap; }
.ribbon-group select { width: auto; max-width: 220px; padding: 6px 8px; }
.ribbon-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; padding-top: 12px; border-top: 1px solid var(--border); }
.ribbon-actions .btn:first-child { min-width: 120px; }
@media (max-width: 720px) { .ribbon-group + .ribbon-group { padding-left: 0; border-left: 0; } .ribbon-actions .btn { flex: 1 1 auto; } }
.req-side-panel .panel { margin: 0; }
.req-side-panel h3 { font-size: .9rem; margin: 0 0 8px; color: var(--muted); }
.req-dl { margin: 0; display: grid; gap: 8px; }
.req-dl dt { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.req-dl dd { margin: 0; overflow-wrap: anywhere; }
.field.pick { position: relative; }
.chat { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px 2px; }
.chat-msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; background: var(--surface-soft); border: 1px solid var(--border); justify-self: start; overflow-wrap: anywhere; }
.chat-msg .chat-body { white-space: pre-wrap; }
.chat-msg small { display: block; color: var(--muted); font-size: .74rem; margin-top: 4px; }
.chat-msg.tech { justify-self: end; background: var(--accent-soft); border-color: transparent; }
.chat-msg.internal { justify-self: stretch; max-width: none; background: var(--warn-bg); border: 1px dashed var(--warn); }
.chat-event { justify-self: center; font-size: .78rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; text-align: center; }
.msg-files { margin-top: 6px; font-size: .86rem; }
.composer { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; display: grid; gap: 8px; }
.composer .toggle { display: flex; gap: 14px; font-size: .88rem; }
.composer .toggle label { display: flex; gap: 6px; align-items: center; font-weight: 600; }
.composer-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.danger-text { color: var(--danger) !important; }
.composer .toggle input { width: auto; margin: 0; }
@media (max-width: 640px) {
  .req-row { grid-template-columns: 5px 26px minmax(0, 1fr); }
  .req-urg-bar { grid-row: span 2; }
  .req-side { grid-column: 3; align-items: flex-start; max-width: none; }
  .req-when { text-align: left; }
  .req-toolbar { align-items: stretch; }
}
.esitel-only label { color: var(--warn); } .esitel-only .lock-icon { width: 14px; height: 14px; vertical-align: -2px; }
.lp-list { display: grid; gap: 4px; margin-top: 8px; max-height: 300px; overflow-y: auto; }
.lp-row { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.lp-row:hover, .lp-row:focus { background: var(--surface-hover); }
.lp-row .note { margin-left: auto; text-align: right; }
.hint.lp-error { color: var(--danger); font-weight: 600; }
/* Informes */
.rep-kinds { margin: 4px 0 12px; }
.rep-period { align-items: flex-end; }
.rep-period label { display: flex; flex-direction: column; gap: 2px; }
.rep-period input[type=date] { width: auto; }
.rep-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.rep-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 12px 0 16px; }
.rep-kpi { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; margin: 0; }
.rep-kpi b { font-size: 1.5rem; line-height: 1.1; }
.rep-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 14px; align-items: start; }
.rep-section { margin: 0; min-width: 0; }
.rep-section:not(.chart) { grid-column: 1 / -1; }
.rep-section h2 { margin-top: 0; font-size: 1.05rem; }
.rep-bars { display: flex; flex-direction: column; gap: 7px; }
.rep-bar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; }
.rep-bar .note { grid-column: 2 / -1; margin-top: -4px; }
.rep-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-bar-track { height: 12px; background: var(--surface-hover); border-radius: 6px; overflow: hidden; }
.rep-bar-track i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
@media print { .rep-period, .rep-kinds, .page-head .actions { display: none; } }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); }
.m-fold > summary { display: none; }
.m-fold > summary::-webkit-details-marker { display: none; }
/* .fold-always: the same accordion on every screen */
.m-fold.fold-always { margin: 0 0 10px; }
.m-fold.fold-always > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-weight: 600; }
.m-fold.fold-always > summary::before { content: '▸'; color: var(--muted); }
.m-fold.fold-always[open] > summary::before { content: '▾'; }
.m-fold.fold-always[open] > summary { margin-bottom: 8px; }
.m-fold.fold-always #w-title { display: none; }
@media (max-width: 720px) {
  .m-fold { margin: 0 0 10px; }
  .m-fold > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-weight: 600; }
  .m-fold > summary::before { content: '▸'; color: var(--muted); }
  .m-fold[open] > summary::before { content: '▾'; }
  .m-fold[open] > summary { margin-bottom: 8px; }
  /* Asset sheet on phones: secondary data folded, the form's own title is the accordion's, relations just name + state */
  .item-head .m-fold { margin: 12px 0 0; } .item-head .m-fold .meta { margin-top: 0; }
  .m-fold #w-title { display: none; }
  .rel-table th:nth-child(2), .rel-table th:nth-child(3), .rel-table td:nth-child(2), .rel-table td:nth-child(3), .rel-table td .note.mono { display: none; }
}

/* Gestión de empresas: number of locations behind a pin that opens them */
.loc-pin { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.loc-pin:hover { border-color: var(--accent); color: var(--accent); }
.loc-pin svg { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wga-link { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.wga-link:hover { border-color: var(--accent); }
.wga-link svg { width: 17px; height: 17px; fill: none; stroke: var(--accent); stroke-width: 1.8; }

/* Soporte: «En reparación» */
.badge.EN_REPARACION { background: #f3e8ff; color: #7e22ce; }
html[data-theme="dark"] .badge.EN_REPARACION { background: #3b1d5a; color: #d8b4fe; }

/* Iconos de los tipos: the panel and the library; the "+" at the end of a type's icon picker */
.icon-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.icon-tile { display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); text-align: center; font-size: .8rem; }
.icon-tile .type-icon { width: 28px; height: 28px; }
.icon-tile span { line-height: 1.2; overflow-wrap: anywhere; }
.icon-more { display: grid; place-items: center; width: 44px; height: 44px; border: 1px dashed var(--accent); border-radius: 8px; color: var(--accent); font-size: 1.5rem; font-weight: 700; text-decoration: none; }
.icon-more:hover { background: var(--accent-soft); }

/* Soporte › Últimas interacciones: the worker spoke last */
.req-waiting { color: var(--warn); }

/* Soporte › solicitud: the time card above the conversation (technicians only) */
.work-card { padding: 12px 16px; }
.work-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; align-items: center; }
.work-facts dt { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.work-facts dd { margin: 0; }
.work-time { grid-column: 1 / -1; }
.work-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.work-actions { align-items: center; flex-wrap: wrap; }
.work-actions .btn { flex: 1 1 auto; }
.work-why { font-size: .85rem; margin: 0; }
#w-note { margin-top: 10px; }
.work-start { background: var(--ok); border-color: var(--ok); }
.work-clock { font: 700 1.5rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; margin-right: 10px; }
.work-state { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--muted); }
.work-state.on { color: var(--ok); } .work-state.on::before { content: '● '; }
.work-state.paused { color: var(--warn); } .work-state.paused::before { content: '❚❚ '; font-size: .7rem; }
.req-working { color: var(--ok); } .req-paused { color: var(--warn); } .req-idle { color: var(--muted); font-style: italic; }
@media (min-width: 721px) {
  .work-facts { grid-template-columns: auto auto minmax(0, 1fr) auto; }
  .work-time, .work-actions { grid-column: auto; }
  .work-actions .btn { flex: none; }
}
.muted-row td { opacity: .6; }
.room-list { display: grid; gap: 6px; margin-bottom: 10px; }
.room-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.room-row.off { opacity: .65; } .room-main { min-width: 0; } .room-row .row-actions { display: flex; gap: 6px; flex-wrap: nowrap; }
.co-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1000px) { .co-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.co-side h2:first-child { margin-top: 0; }

/* Historial de cambios */
.audit-kv { display: inline-block; margin-right: 8px; }
.audit-kv b { font-weight: 600; color: var(--muted); }
table.audit td { vertical-align: top; }
.nowrap { white-space: nowrap; }

.actor-pick{position:relative;display:inline-block}.actor-pick .combo-list{position:absolute;left:0;top:100%;z-index:30;min-width:320px}

/* Tema (menú de cuenta) */
.theme-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border); margin-top: 4px; font-size: .9rem; }
.theme-row select { width: auto; padding: 4px 8px; }

/* Aviso sin conexión (aplicación instalada) */
.offline-page { max-width: 460px; margin: 12vh auto 0; padding: 24px; text-align: center; }
.offline-page img { border-radius: 16px; }
.offline-page h1 { font-size: 1.4rem; margin: 16px 0 8px; }
.offline-page .btn { display: inline-flex; margin-top: 16px; text-decoration: none; }

/* Rol personalizado (0.1.12): one row per access, name and explanation on the left, the choice on the right */
.perm-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 6px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); font-weight: 400; cursor: default; }
.perm-row > label, .perm-row > span:first-child { display: flex; flex-direction: column; gap: 2px; margin: 0; font-weight: 400; }
.perm-row .note { font-size: .82rem; }
.perm-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.perm-switch input { width: auto; margin: 0; }
#u-custom-bottom .perm-row:last-child { border-bottom: 1px solid var(--border); margin-bottom: 10px; }
@media (max-width: 640px) { .perm-row { grid-template-columns: 1fr; } }
.perm-box.custom .form-grid { display: block; }
.perm-box.custom .form-grid .field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 2px 16px; align-items: center; margin: 0; padding: 10px 0; border-top: 1px solid var(--border); }
.perm-box.custom .form-grid .field > select { grid-column: 2; grid-row: 1 / span 2; }
.perm-box.custom .form-grid .field > .hint { grid-column: 1; font-size: .82rem; }
@media (max-width: 640px) { .perm-box.custom .form-grid .field { grid-template-columns: 1fr; } .perm-box.custom .form-grid .field > select { grid-column: 1; grid-row: auto; } }
/* Página de usuario (0.1.12) */
.user-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.co-side > .panel { margin-bottom: 16px; } .co-side > .panel:last-child { margin-bottom: 0; }
.co-side .perm-box { margin: 0; border: 0; padding: 0; } .co-side .perm-box legend { font-size: 1.25rem; font-weight: 700; padding: 0; margin-bottom: 8px; }
.activity-list { display: grid; } .activity-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.activity-row:first-child { border-top: 0; }
/* Pendientes (0.1.12): a pending computer whose serial is that of an asset registered by hand */
.serial-match { margin-top: 4px; font-size: .82rem; font-weight: 600; color: var(--warn); }
.list-row.candidate.match { background: var(--surface-soft); border-radius: 8px; }
/* Soporte › Avanzado (0.1.12) */
.adv-panel { margin: 0 0 12px; padding: 14px 16px; }
.adv-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.adv-grid .field { margin-bottom: 10px; }
.adv-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.adv-pair > * { min-width: 0; width: 100%; box-sizing: border-box; }
.adv-grid .field.wide { grid-column: span 2; }
@media (max-width: 720px) { .adv-grid { grid-template-columns: 1fr; } .adv-grid .field.wide { grid-column: auto; } }
.adv-panel .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adv-summary { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .9rem; }
/* «Inventario» over the alias already names a client's only company: its fixed selector is not repeated */
.topbar:has(.brand.co-brand) .company-select.single { display: none; }

/* WG-Health (WGAccess 0.1.18): the «Estado del equipo» window and the Software tab */
.modal.wide { width: min(1100px, 100%); }
.hl-head { margin-bottom: 10px; } .hl-head h2 .badge { vertical-align: middle; margin-left: 8px; font-size: .75rem; }
.hl-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.hl-chip { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.hl-chip span { display: block; font-size: .75rem; color: var(--muted); } .hl-chip b { font-size: .95rem; overflow-wrap: anywhere; }
.hl-chip.warn { border-color: var(--warn); } .hl-chip.bad { border-color: var(--danger); }
.hl-title { margin: 16px 0 6px; font-size: 1rem; }
.hl-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .hl-charts { grid-template-columns: 1fr; } }
.hl-chart-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; } .hl-chart-head > div { flex: 1 1 auto; min-width: 0; }
.hl-now { font-size: 22px; color: var(--accent); font-variant-numeric: tabular-nums; } .hl-now.over { color: var(--danger); }
.hl-plot { min-height: 150px; } .hl-svg { display: block; max-width: 100%; }
.hl-grid { stroke: var(--border); } .hl-grid.base { stroke: var(--muted); } .hl-tick { font: 11px system-ui, sans-serif; fill: var(--muted); }
.hl-limit { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 5 4; }
.hl-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; } .hl-line.over { stroke: var(--danger); }
.hl-top { stop-color: var(--accent); stop-opacity: .35; } .hl-bottom { stop-color: var(--accent); stop-opacity: .03; }
.hl-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; } .hl-dot.over { fill: var(--danger); } .hl-hit { fill: transparent; }
.hl-alerts { margin: 0; padding-left: 18px; } .hl-alerts li { margin: 4px 0; } .hl-alerts li.bad b { color: var(--danger); } .hl-alerts li.warn b { color: var(--warn); }
.sw-sub td { background: var(--surface-soft); font-size: .9rem; }

/* Doble factor (0.5.1): the set-up page, the QR and the recovery codes */
.totp { max-width: 460px; }
.totp-qr { display: block; width: 200px; height: 200px; margin: 6px auto 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px; box-sizing: content-box; }
.recovery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; margin-top: 8px; }
.recovery code { font-family: ui-monospace, monospace; font-size: 1rem; letter-spacing: .06em; background: var(--surface-soft); border: 1px dashed var(--border); padding: 7px 10px; border-radius: 8px; text-align: center; }
