/* Fortaprint · estilos */
:root {
  --magenta: #E80174;
  --magenta-600: #C40062;
  --magenta-50: #FDEFF6;
  --magenta-ring: rgba(232, 1, 116, .16);
  --ink: #121212;
  --text: #1e1e22;
  --muted: #6c6c76;
  --line: #e7e7eb;
  --line-strong: #d3d3da;
  --bg: #f5f5f7;
  --card: #fff;
  --fortaleza: #7A4A2A;
  --fortaleza-50: #F6EEE8;
  --ok: #137333;   --ok-bg: #E8F5EC;   --ok-line: #BFE3CB;
  --warn: #8A5300; --warn-bg: #FFF3DC; --warn-line: #F5D9A4;
  --err: #B42318;  --err-bg: #FDECEA;  --err-line: #F3C3BE;
  --info: #1E4FB8; --info-bg: #EAF0FD; --info-line: #C6D5F7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(18, 18, 24, .04), 0 2px 6px rgba(18, 18, 24, .04);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--magenta-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.2; margin: 0; letter-spacing: -.015em; color: var(--ink); }
h2 { font-size: 15px; margin: 0; color: var(--ink); letter-spacing: -.005em; }
code { background: #f0f0f3; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
[hidden] { display: none !important; }

/* ---------- Cabecera ---------- */
.topbar {
  background: #fff;
  border-top: 3px solid var(--magenta);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar-in {
  max-width: 1360px; margin: 0 auto; padding: 0 24px;
  height: 62px; display: flex; align-items: center; gap: 28px;
}
.brand img { display: block; height: 34px; width: auto; }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a { color: var(--text); padding: 7px 12px; border-radius: 8px; font-weight: 550; font-size: 14px; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { color: var(--magenta-600); background: var(--magenta-50); }
.user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.user form { margin: 0; }
.user-name { color: var(--text); font-weight: 550; }

.rol {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; line-height: 1.5; vertical-align: middle;
}
.rol-admin { color: var(--ink); }
.rol-iparprint { color: var(--magenta-600); }
.rol-fortaleza { color: var(--fortaleza); }
.rol-lectura { color: var(--muted); }

.container { max-width: 1360px; margin: 0 auto; padding: 26px 24px 90px; }
.container-bare { max-width: none; padding: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 15px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { border-color: #b8b8c2; text-decoration: none; background: #fafafb; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--magenta-ring); }
.btn-primary { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.btn-primary:hover { background: var(--magenta-600); border-color: var(--magenta-600); }
.btn-danger { color: var(--err); border-color: var(--err-line); }
.btn-danger:hover { background: var(--err-bg); border-color: var(--err); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #ececf0; border-color: transparent; color: var(--text); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--magenta-600); cursor: pointer; }
.link:hover { text-decoration: underline; }
.icon-btn {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: #fff; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { color: var(--err); border-color: var(--err-line); background: var(--err-bg); }

/* ---------- Formularios ---------- */
label, .label { display: block; font-size: 13px; font-weight: 600; color: #3b3b44; margin-bottom: 6px; }
.req { color: var(--magenta); }
input[type=text], input[type=email], input[type=password], input[type=search],
input[type=date], input[type=number], select, textarea {
  width: 100%; height: 40px; padding: 8px 11px;
  border: 1px solid var(--line-strong); border-radius: 9px; background: #fff;
  font: inherit; color: var(--text); transition: border-color .12s, box-shadow .12s;
}
select { padding-right: 30px; }
textarea { height: auto; min-height: 150px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--magenta); box-shadow: 0 0 0 3px var(--magenta-ring); }
input[type=color] { width: 46px; height: 34px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; color: var(--text); margin: 0; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--magenta); margin: 0; }
.check.small { font-size: 13px; color: var(--muted); }
.check-box { height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; width: 100%; }
.field { min-width: 0; }
.field.is-ro .label { color: var(--muted); }
.ro-value {
  min-height: 40px; padding: 9px 11px; border-radius: 9px;
  background: #f4f4f6; border: 1px solid transparent; color: #2a2a30; word-wrap: break-word;
}
.ro-long { min-height: 80px; }
.form-stack > * + * { margin-top: 16px; }
.input-row { display: flex; gap: 8px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.span-2 { grid-column: 1 / -1; }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.card-body { padding: 20px; }
.card.narrow { max-width: 560px; margin: 40px auto; }
.card-fortaleza .card-head { box-shadow: inset 4px 0 0 var(--fortaleza); border-top-left-radius: var(--radius); }
.card-iparprint .card-head { box-shadow: inset 4px 0 0 var(--magenta); border-top-left-radius: var(--radius); }
.stack > * + * { margin-top: 20px; }

.editan { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.tag, .mini-tag {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; line-height: 1.6;
}
.tag-iparprint { color: var(--magenta-600); background: var(--magenta-50); }
.tag-fortaleza { color: var(--fortaleza); background: var(--fortaleza-50); }
.mini-tag { padding: 0 6px; font-size: 10px; }

/* ---------- Avisos ---------- */
.alert { padding: 11px 15px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-size: 14px; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.alert-error { background: var(--err-bg); color: var(--err); border-color: var(--err-line); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }

/* ---------- Cabecera de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.count {
  display: inline-block; vertical-align: middle; font-size: 13px; font-weight: 700; color: var(--muted);
  background: #e9e9ee; border-radius: 999px; padding: 2px 10px; margin-left: 6px; letter-spacing: 0;
}
.id { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.back { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.pill-closed { font-size: 12px; font-weight: 700; color: var(--ok); background: var(--ok-bg); padding: 4px 12px; border-radius: 999px; }

/* ---------- Filtros y listado ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filters .search { display: flex; gap: 10px; flex: 1 1 100%; }
.filters .search input { flex: 1; min-width: 0; }
.filters select { flex: 0 1 auto; width: auto; max-width: 240px; }
.filters select.is-set { border-color: var(--magenta); color: var(--magenta-600); font-weight: 600; }

.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th {
  text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafafb; white-space: nowrap;
}
.list th a { color: inherit; }
.list th a:hover { color: var(--magenta-600); text-decoration: none; }
.list td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr[data-href] { cursor: pointer; }
.list tbody tr:hover { background: #fdf7fa; }
.list tr.is-off td { color: var(--muted); }
.list tr.is-current { background: var(--magenta-50); }
.t-id { color: var(--muted); font-variant-numeric: tabular-nums; width: 1%; }
.t-nombre { font-weight: 600; color: var(--ink); }
.t-act { color: var(--muted); font-size: 13px; }
/* Trabajos nuevos sin abrir: como un email no leído */
.list tbody tr.is-new { background: #FFF5FA; }
.list tbody tr.is-new:hover { background: #FDEBF4; }
.list tbody tr.is-new td:first-child { box-shadow: inset 4px 0 0 var(--magenta); }
.list tbody tr.is-new .t-nombre { font-weight: 800; color: #000; }
.list tbody tr.is-new .t-id, .list tbody tr.is-new .t-act { color: var(--magenta-600); font-weight: 700; }
.pill-new {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; vertical-align: 1px;
  background: var(--magenta); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.nav-count {
  display: inline-block; min-width: 20px; margin-left: 5px; padding: 0 6px; border-radius: 999px;
  background: var(--magenta); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center;
}
.page-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 760px; }
.pill-warn { font-size: 12px; font-weight: 700; color: var(--warn); background: var(--warn-bg); padding: 4px 12px; border-radius: 999px; }
.section-gap { margin-top: 20px; }
.people { list-style: none; margin: 0; padding: 6px 20px 14px; }
.people li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.steps { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; }
.steps code { word-break: break-all; }
.email-preview { padding: 0; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.t-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.t-pedidos { font-size: 13px; white-space: nowrap; }
.t-pedidos div + div { margin-top: 3px; }
.clip { font-size: 12px; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.paid { display: inline-block; margin-left: 6px; font-size: 11.5px; font-weight: 700; color: var(--ok); background: var(--ok-bg); border-radius: 999px; padding: 1px 8px; }
.date-alert { color: var(--err); font-weight: 700; background: var(--err-bg); padding: 2px 8px; border-radius: 6px; }
.date-warn { color: var(--warn); font-weight: 700; background: var(--warn-bg); padding: 2px 8px; border-radius: 6px; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 650; line-height: 1.45; white-space: nowrap;
}
.yes { color: var(--ok); font-weight: 700; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty p { margin: 0 0 16px; font-size: 16px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; color: var(--muted); font-size: 14px; }

/* ---------- Ficha de trabajo ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.summary { margin: 0; padding: 8px 20px 16px; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; }
.help { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.help li + li { margin-top: 6px; }
.form-actions {
  position: sticky; bottom: 14px; z-index: 10; display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 14px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(18, 18, 24, .10);
}
.danger-zone { margin-top: 20px; }

/* Adjuntos */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.thumb { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fafafa; }
.thumb > a { display: block; }
.thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eee; transition: opacity .12s; }
.thumb > a:hover img { opacity: .88; }
.thumb figcaption { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; font-size: 12px; }
.fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.files li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.files li + li { border-top: 1px solid var(--line); }
.file-ext {
  flex: none; width: 44px; height: 44px; border-radius: 9px; background: var(--magenta-50); color: var(--magenta-600);
  font-size: 11px; font-weight: 800; text-transform: uppercase; display: grid; place-items: center; letter-spacing: .03em;
}
.file-info { flex: 1; min-width: 0; }
.file-info a { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info small { color: var(--muted); }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 18px 16px; margin: 0; border: 2px dashed var(--line-strong); border-radius: 10px;
  background: #fcfcfd; text-align: center; font-weight: 400; color: var(--muted); font-size: 13px;
  transition: border-color .12s, background .12s; cursor: pointer;
}
.dropzone strong { color: var(--magenta-600); font-size: 14px; }
.dropzone:hover, .dropzone.over { border-color: var(--magenta); background: var(--magenta-50); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.selected { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.selected li { padding: 4px 10px; border-radius: 6px; background: var(--ok-bg); color: var(--ok); margin-top: 4px; }
.selected li::before { content: "↑ "; }
.selected li.too-big { background: var(--err-bg); color: var(--err); }

/* Historial */
.timeline { list-style: none; margin: 0; padding: 12px 20px 16px 26px; max-height: 560px; overflow-y: auto; }
.h-item { position: relative; padding: 0 0 16px 18px; border-left: 2px solid var(--line); }
.h-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.h-item::before {
  content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line-strong);
}
.h-estado::before { background: var(--magenta); border-color: var(--magenta); }
.timeline.solo-estados .h-item:not(.h-estado) { display: none; }
.h-when { font-size: 12px; color: var(--muted); line-height: 1.4; }
.h-when strong { color: var(--text); font-weight: 600; }
.h-when .rol { font-size: 9.5px; padding: 0 6px; }
.h-what { font-size: 13.5px; margin-top: 4px; line-height: 1.6; word-wrap: break-word; }
.h-label { font-weight: 600; }
.arrow { color: var(--muted); }
.h-what details { margin-top: 4px; }
.h-what summary { cursor: pointer; color: var(--magenta-600); font-size: 12.5px; }
.diff { display: grid; gap: 6px; margin-top: 6px; }
.diff > div { background: #f6f6f8; border-radius: 6px; padding: 6px 8px; font-size: 12.5px; }
.diff small { display: block; color: var(--muted); font-weight: 600; }

/* ---------- Administración ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--magenta-600); border-bottom-color: var(--magenta); }
.op-row {
  display: grid; grid-template-columns: 84px minmax(160px, 1fr) 80px 70px 180px; gap: 12px; align-items: center;
  padding: 10px 20px; border-bottom: 1px solid var(--line); margin: 0;
}
.op-estados .op-row { grid-template-columns: 84px minmax(160px, 1fr) 60px 150px 80px 70px 180px; }
.op-head { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; background: #fafafb; }
.op-row input[type=text], .op-row input[type=number] { height: 34px; }
.op-row.is-off input[type=text] { color: var(--muted); text-decoration: line-through; }
.op-actions { display: flex; gap: 6px; justify-content: flex-end; }
.op-new { background: #fcfcfd; border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.note { margin-top: 14px; max-width: 900px; }
.roles { display: grid; gap: 8px; }
.role-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; margin: 0; cursor: pointer; font-weight: 400; }
.role-option:has(input:checked) { border-color: var(--magenta); background: var(--magenta-50); }
.role-option input { margin-top: 3px; accent-color: var(--magenta); }
.role-option strong { display: block; font-size: 14px; color: var(--ink); }
.role-option small { display: block; color: var(--muted); font-size: 12.5px; }

/* ---------- Acceso e instalación ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 500px at 50% -10%, var(--magenta-50), transparent 70%), var(--bg);
}
.login-card {
  width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 36px 32px 28px; box-shadow: 0 18px 50px rgba(18, 18, 24, .08);
}
.login-card .field { margin-bottom: 16px; }
.login-logo { display: block; width: 240px; height: auto; margin: 0 auto 14px; }
.login-sub { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 26px; line-height: 1.5; }
.login-sub strong { color: var(--text); font-weight: 600; }
.login-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin: 18px 0 0; }
.install { max-width: 652px; margin: 40px auto; padding: 0 16px 60px; }
.install h1 { text-align: center; margin-bottom: 24px; }
.install .card { margin-bottom: 20px; }
.checks { list-style: none; margin: 0; padding: 10px 20px; font-size: 14px; }
.checks li { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.checks .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.checks .ok .dot { background: var(--ok-bg); color: var(--ok); }
.checks .ko .dot { background: var(--err-bg); color: var(--err); }
.checks .warn .dot { background: var(--warn-bg); color: var(--warn); }

/* ---------- Visor de imágenes ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  padding: 56px 70px; background: rgba(12, 12, 14, .9);
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 12px 40px rgba(0, 0, 0, .45); background: #fff; }
.lb-btn {
  position: absolute; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 26px; line-height: 1;
}
.lb-btn:hover { background: rgba(255, 255, 255, .26); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-caption { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #ddd; font-size: 13px; }

/* ---------- Pantallas pequeñas ---------- */
@media (max-width: 1100px) {
  .hide-md { display: none; }
  .detail { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  /* Ficha en móvil: primero el resumen, luego el formulario y al final el historial */
  .detail { display: flex; flex-direction: column; gap: 20px; }
  .detail > aside { display: contents; }
  .detail > aside > * { margin-top: 0 !important; }
  .detail > aside > .card-resumen { order: -1; }
  .op-row, .op-estados .op-row { grid-template-columns: 70px 1fr; }
  .op-head { display: none; }
  .op-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 720px) {
  .hide-sm { display: none; }
  .topbar-in { height: auto; padding: 10px 14px 0; gap: 6px 12px; flex-wrap: wrap; }
  .brand { order: 1; }
  .brand img { height: 28px; }
  .user { order: 2; margin-left: auto; min-width: 0; }
  .user .rol { display: none; }
  .user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav { order: 3; flex: 1 1 100%; overflow-x: auto; padding-bottom: 8px; }
  .container { padding: 18px 12px 90px; }
  .grid { grid-template-columns: 1fr; }
  .filters select { flex: 1 1 calc(50% - 5px); max-width: none; min-width: 0; font-size: 14px; }
  /* Listado en forma de tarjetas */
  .table-wrap { overflow: hidden; }
  table.list, .list tbody, .list tr, .list td { display: block; }
  .list thead { display: none; }
  .list tbody tr { position: relative; padding: 13px 14px; border-bottom: 1px solid var(--line); }
  .list tbody tr:last-child { border-bottom: 0; }
  .list td { padding: 0; border: 0; }
  .list .hide-sm, .list .hide-md { display: none; }
  .list td.t-id { position: absolute; top: 13px; right: 14px; font-size: 12px; }
  .list tbody tr.is-new { box-shadow: inset 4px 0 0 var(--magenta); }
  .list tbody tr.is-new td:first-child { box-shadow: none; }
  .list td.t-main { padding-right: 36px; }
  .list td[data-label] { display: inline-block; margin: 10px 16px 0 0; vertical-align: top; }
  .list td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 3px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  }
  h1 { font-size: 22px; }
  .lightbox { padding: 56px 8px; }
  .login-card { padding: 28px 20px 22px; }
}
