/* ══════════════════════════════════════════════════════════════════════
   OTs · La Troupe — sistema visual
   Monocromo en grises grafito. La jerarquía sale del contraste entre
   superficies (fondo < tarjeta < elemento elevado), de la tipografía y del
   espacio, no del color. El único color es semántico: estados de las OT
   (naranja/rojo/verde) y avisos.
   ══════════════════════════════════════════════════════════════════════ */
:root {
  /* Superficies */
  --bg: #333333;
  --bg-sunken: #2a2a2a;      /* campos de formulario */
  --surface: #3f3f3f;        /* tarjetas */
  --surface2: #4a4a4a;       /* botones secundarios, hover */
  --surface-light: #444444;  /* tarjetas con formulario */
  --surface-hover: #555555;
  --border: #505050;
  --border-strong: #666666;
  /* Texto */
  --text: #f4f4f4;
  --muted: #bcbcbc;
  --faint: #929292;
  --white: #ffffff;
  /* Acento (claro sobre gris) */
  --accent: #ececec;
  --accent-dim: #5a5a5a;
  --on-accent: #161616;
  /* Semánticos */
  --green: #d6d6d6;
  --green-strong: #4ade80;
  --red: #ef4444;
  --red-soft: #f87171;
  --amber: #fb923c;
  /* Forma */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 8px 24px -12px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.7);
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0, "cv11" 1;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ico { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ── Barra superior ───────────────────────────────────────────────────── */
nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 28px; height: 64px;
  background: rgba(51,51,51,.88);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.nav-logo { width: 118px; height: auto; display: block; filter: invert(1) brightness(2); opacity: .95; }
.nav-right { display: flex; align-items: center; gap: 18px; min-width: 0; }
.nav-clock { font-size: 12px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--muted); text-decoration: none;
  padding: 8px 12px; border-radius: 9px;
  font-size: 13px; font-weight: 600;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface2); }
.nav-links a.active { color: var(--white); background: var(--surface2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.nav-links a .ico { opacity: .85; }
.nav-worker {
  display: flex; align-items: center; gap: 10px; margin-left: 10px; padding-left: 14px;
  border-left: 1px solid var(--border); font-size: 13px; color: var(--muted);
}
.nav-worker strong { color: var(--text); font-weight: 600; }
.nav-worker a { color: var(--muted); text-decoration: none; display: inline-flex; padding: 6px; border-radius: 8px; }
.nav-worker a:hover { color: var(--text); background: var(--surface2); }

/* ── Avatar con iniciales ── */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(145deg, #6a6a6a, #4c4c4c);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  color: var(--white); font-size: 11px; font-weight: 700; letter-spacing: .03em;
}
.avatar-lg { width: 44px; height: 44px; font-size: 14px; }

/* ── Estructura ── */
main { max-width: 1040px; margin: 0 auto; padding: 36px 24px 72px; }
.wide main, main.wide { max-width: 1500px; }

h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 6px; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: -.005em; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
h2 .ico { color: var(--muted); }
.subtitle { color: var(--muted); font-size: 14px; margin-bottom: 24px; max-width: 70ch; }
.eyebrow { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
.section-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; margin: 40px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.page-head .subtitle { margin-bottom: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Estadísticas rápidas (listado de OTs) ── */
.stats-row { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-tile {
  display: flex; align-items: baseline; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; text-decoration: none; color: inherit;
  transition: background .15s, border-color .15s;
}
a.stat-tile:hover { background: var(--surface2); border-color: var(--border-strong); }
.stat-num { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-tile-alerta { border-color: rgba(239,68,68,.35); }
.stat-tile-alerta .stat-num { color: var(--red-soft); }

/* ── Tarjetas ─────────────────────────────────────────────────────────────
   Las tarjetas con formulario son apenas más claras y con borde más marcado
   que las de solo lectura: lo que se puede rellenar se distingue sin pesar. */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card:has(form) { background: var(--surface-light); border-color: var(--border-strong); }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 9px 15px; min-height: 38px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; font-family: inherit; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s, transform .1s;
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--white); border-color: var(--white); }
.btn-ghost { background: transparent; border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface2); }
.btn-danger { background: transparent; border-color: rgba(239,68,68,.45); color: var(--red-soft); }
.btn-danger:hover { background: rgba(239,68,68,.12); border-color: var(--red); }
.btn-lg { padding: 15px 20px; font-size: 15px; border-radius: 12px; min-height: 52px; }
.btn-block { width: 100%; }
.btn-xs { padding: 5px 9px; font-size: 11px; border-radius: 7px; min-height: 28px; }
.btn-2xs { padding: 3px 7px; font-size: 10px; border-radius: 6px; min-height: 22px; }
.btn-icon { padding: 0; width: 38px; min-width: 38px; }
.btn-icon.btn-xs { width: 28px; min-width: 28px; }

/* Acción destacada puntual (p.ej. "+ Nueva OT", "Fichar") */
.btn-blue-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); border: 1px solid var(--accent); color: var(--on-accent);
  padding: 9px 15px; min-height: 38px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; font-family: inherit; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .1s;
}
.btn-blue-sm:hover { background: var(--white); border-color: var(--white); }
.btn-blue-sm:active { transform: translateY(1px); }

/* ── Selección de usuario (columna) ── */
.login-wrap { max-width: 340px; margin: 4vh auto 0; }
.login-wrap h1 { margin-bottom: 4px; }
.usuario-lista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 16px 0 14px; }
.usuario-lista form { margin: 0; }
.usuario-btn {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  background: #545454; border: 1px solid #646464; border-radius: 8px;
  padding: 4px 8px; min-height: 30px; gap: 7px; color: var(--text); font-family: inherit; cursor: pointer;
  box-shadow: var(--shadow);
  transition: background .15s, border-color .15s, transform .12s var(--ease);
}
.usuario-btn:hover { background: #606060; border-color: #727272; }
.usuario-btn .avatar { width: 20px; height: 20px; font-size: 8px; background: #6a6a6a; }
.usuario-btn:active { transform: scale(.99); }
.usuario-btn .usuario-nombre { font-size: 12px; font-weight: 650; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario-btn .usuario-rol { font-size: 9px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin-top: 1px; white-space: nowrap; overflow: hidden; }
.usuario-btn .usuario-texto { flex: 1; min-width: 0; }
.usuario-btn > .ico:last-child { color: var(--faint); }
.usuario-seleccionado { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.usuario-seleccionado .usuario-nombre { font-size: 17px; font-weight: 650; }

/* Antiguos picker-btn (se mantienen por compatibilidad) */
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.picker-btn {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 14px; font-size: 15px; font-weight: 700; color: var(--text); cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s;
}
.picker-btn:hover { border-color: var(--border-strong); background: var(--surface2); }
.picker-sub { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 4px; }

.add-user-link { color: var(--muted); text-decoration: underline; font-size: 13px; font-weight: 600; cursor: pointer; }
.add-user-link:hover { color: var(--text); }

.aviso {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.3); color: #fca5a5;
  border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13px; margin-bottom: 16px;
}
.aviso.neutro { background: var(--surface); border-color: var(--border); color: var(--muted); }
.link-discreto { color: var(--muted); font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.link-discreto:hover { color: var(--text); }

/* ── Acceso general ── */
.acceso-wrap { max-width: 400px; margin: 8vh auto 0; }
.acceso-wrap .card { padding: 30px; }
.acceso-icono {
  width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--surface2); border: 1px solid var(--border-strong); margin-bottom: 18px; color: var(--text);
}

/* ── Formularios ── */
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; font-weight: 600; letter-spacing: .01em; }
input, select, textarea {
  width: 100%;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 13px; min-height: 42px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(236,236,236,.12); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; flex-shrink: 0; accent-color: var(--accent); }
input[type="file"] { padding: 8px; }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8a8a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 140px; }
.check-field { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.check-field label { margin: 0; color: var(--text); font-size: 13px; }

/* ── Autocompletado ── */
.ac-wrap { position: relative; }
.ac-box {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  max-height: 300px; overflow-y: auto; z-index: 50; display: none;
  box-shadow: var(--shadow-lg);
}
.ac-item { padding: 11px 14px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--border); }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--surface-hover); }
.ac-item .ac-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ── Tablas ── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; color: var(--faint); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: rgba(0,0,0,.08);
}
td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: rgba(255,255,255,.025); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 0; overflow: hidden; overflow-x: auto; }
.empty-row td { color: var(--muted); text-align: center; padding: 34px; }
tr.row-editing td { background: rgba(255,255,255,.06); box-shadow: inset 3px 0 0 var(--accent); }
.acciones-fila .btn { min-height: 32px; padding: 6px 10px; }

/* ── Bloques plegables (ficha de OT) ── */
details.card { padding: 0; }
details.card > summary {
  list-style: none; cursor: pointer; padding: 18px 22px;
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--radius);
  transition: background .15s;
}
details.card > summary:hover { background: rgba(255,255,255,.02); }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after {
  content: ""; margin-left: auto; width: 8px; height: 8px;
  border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint);
  transform: rotate(-45deg); transition: transform .2s var(--ease);
}
details.card[open] > summary::after { transform: rotate(45deg); }
details.card > summary h2 { margin: 0; }
details.card > summary .details-count {
  color: var(--muted); font-size: 11px; font-weight: 700;
  background: var(--surface2); border-radius: 999px; padding: 2px 9px;
}
details.card > .details-body { padding: 0 22px 22px; }
details.card .table-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.table-wrap-scroll { max-height: 380px; overflow-y: auto; }

/* ── Insignias ── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-open { background: var(--accent-dim); color: var(--text); }
.badge-closed { background: rgba(0,0,0,.2); color: var(--muted); }
.badge-clickable { cursor: pointer; transition: filter .15s; }
.badge-clickable:hover { filter: brightness(1.2); }
.badge-estado-en-proceso { background: rgba(249,115,22,.12); color: var(--amber); border: 1px solid rgba(249,115,22,.3); }
.badge-estado-parada     { background: rgba(239,68,68,.12);  color: var(--red-soft); border: 1px solid rgba(239,68,68,.3); }
.badge-estado-terminada  { background: rgba(34,197,94,.12);  color: #4ade80; border: 1px solid rgba(34,197,94,.3); }

.chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
}
.chip .ico { color: var(--muted); }
.chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; }

.section-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.section-tabs .btn { flex: 1; min-width: 130px; }

.hint { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.5; }

/* ── Indicador de pasos (fichaje) ── */
.steps { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.steps .step { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--faint); font-weight: 600; }
.steps .step.active { color: var(--text); }
.steps .step.done { color: var(--muted); }
.steps .step-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0;
}
.steps .step.active .step-num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.steps .step.done .step-num { background: transparent; color: var(--text); }
.steps .sep { width: 28px; height: 1px; background: var(--border-strong); }

/* ── Tarjetas de apartado ── */
.apartado-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 26px; }
.apartado-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 14px 18px; text-align: center; cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color .15s, background .15s, transform .15s var(--ease);
}
.apartado-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--apartado-color, var(--border)); opacity: .55; }
.apartado-card:hover { background: var(--surface2); transform: translateY(-2px); }
.apartado-card:active { transform: scale(.98); }
.apartado-card .apartado-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 13px; margin-bottom: 12px;
  background: var(--bg-sunken); border: 1px solid var(--border); color: var(--text);
}
.apartado-card .apartado-label { font-size: 14px; font-weight: 650; display: block; }
.apartado-card .apartado-hint { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.apartado-card.selected { border-color: var(--accent); background: var(--surface2); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.apartado-card.selected::before { opacity: 1; background: var(--accent); }
.apartado-card.selected .apartado-icon { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.apartado-fields { background: var(--surface-light); }

/* ── Selector numérico (stepper) ── */
.stepper-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: var(--bg-sunken); }
.stepper-btn {
  background: var(--surface2); border: none; color: var(--text);
  font-size: 20px; font-weight: 600; width: 48px; height: 48px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  transition: background .12s;
}
.stepper-btn:hover { background: var(--surface-hover); }
.stepper-btn:active { background: var(--accent); color: var(--on-accent); }
.stepper-input {
  border: none; background: transparent; text-align: center; width: 70px; min-height: 0;
  font-size: 19px; font-weight: 700; padding: 0; -moz-appearance: textfield; font-variant-numeric: tabular-nums;
}
.stepper-input:focus { outline: none; box-shadow: none; }
.stepper-input::-webkit-outer-spin-button, .stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.stepper-group { display: flex; flex-direction: column; gap: 8px; }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(10,10,10,.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  align-items: center; justify-content: center; z-index: 1000;
  padding: 20px; overflow-y: auto;
}
.modal-overlay.open { display: flex; animation: aparecer .18s var(--ease); }
.modal {
  background: var(--surface-light); border: 1px solid var(--border-strong); border-radius: 18px;
  padding: 26px; width: 440px; max-width: 94vw; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: subir .22s var(--ease);
}
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes subir { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent);
  padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 650;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease);
  z-index: 2000;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: #3a1f1f; border-color: var(--red); color: #fecaca; }

/* ── Visor de PDF ── */
.modal-pdf { width: 92vw; max-width: 940px; height: 86vh; display: flex; flex-direction: column; }
.modal-pdf iframe { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; margin-top: 10px; }

/* ── Inicio: fichaje en un toque ── */
.inicio-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.inicio-ots { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 16px; }
.inicio-ots .card { margin-bottom: 0; }
.ot-rapida { padding: 20px; transition: border-color .15s; }
.ot-rapida:hover { border-color: var(--border-strong); }
.ot-rapida-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-decoration: none; }
.ot-rapida-head strong { font-size: 17px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ot-rapida-head:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.ot-rapida-entrega { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.ot-rapida-entrega.vencida { color: var(--red-soft); font-weight: 700; }
.ot-rapida-titulo { color: var(--muted); font-size: 13px; margin: 6px 0 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ot-rapida-apartados { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ot-rapida-btn {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-height: 78px; padding: 10px 4px; text-align: center; text-decoration: none;
  background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 12px;
  font-size: 11px; font-weight: 650; line-height: 1.2; color: var(--muted);
  transition: background .15s, color .15s, border-color .15s, transform .12s var(--ease);
}
.ot-rapida-btn::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--apartado-color, var(--border)); opacity: .5; }
.ot-rapida-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.ot-rapida-btn:active { transform: scale(.97); background: var(--accent); color: var(--on-accent); }
.ot-rapida-icon { display: inline-flex; color: var(--text); }
.ot-rapida-btn:active .ot-rapida-icon { color: var(--on-accent); }

/* ── Panel de administración ── */
.panel-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.panel-tile {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); transition: border-color .15s, background .15s;
}
a.panel-tile:hover { background: var(--surface2); border-color: var(--border-strong); }
.panel-num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.panel-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; display: flex; align-items: center; gap: 6px; }
.panel-tile.alerta .panel-num { color: var(--red-soft); }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.panel-grid .card { margin-bottom: 0; }
.barra-fila { display: grid; grid-template-columns: minmax(0, max-content) minmax(60px, 1fr) auto; align-items: center; gap: 12px; padding: 8px 0; font-size: 13px; }
.barra-nombre { display: flex; align-items: center; gap: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra { height: 8px; background: var(--bg-sunken); border-radius: 999px; overflow: hidden; }
.barra > span { display: block; height: 100%; background: linear-gradient(90deg, #8a8a8a, var(--accent)); border-radius: 999px; }
.barra-valor { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 650; min-width: 52px; text-align: right; }
.panel-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border); text-decoration: none; font-size: 13px;
}
.panel-item:last-child { border-bottom: none; padding-bottom: 0; }
.panel-item .hint { margin: 0; }
.panel-item:hover strong { text-decoration: underline; text-underline-offset: 3px; }

/* ── Ajustes: tarjetas en rejilla ── */
main.ajustes { max-width: 1100px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 18px; align-items: start; }
main.ajustes > .ajustes-head { grid-column: 1 / -1; }
main.ajustes > .card { max-width: none !important; margin-bottom: 0; }

/* Botón de filtros: solo en móvil (ver más abajo). */
.filtros-toggle { display: none; }

/* ── Tablet ── */
@media (max-width: 1000px) {
  .apartado-grid { grid-template-columns: repeat(3, 1fr); }
  .inicio-ots { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  nav { padding: 0 18px; }
  .nav-clock { display: none; }
  .stepper-row > .field,
  .stepper-row > .stepper-group { flex: 1 1 160px; }
  td { padding: 13px 12px; }
  .btn { min-height: 42px; }
}

/* ── Móvil ────────────────────────────────────────────────────────────────
   Barra superior compacta y no fija, filtros del listado plegados tras un
   botón, y tablas .tabla-tarjetas convertidas en tarjetas apiladas. */
@media (max-width: 640px) {
  nav { position: relative; height: auto; padding: 10px 14px 8px; flex-direction: column; align-items: stretch; gap: 8px; }
  .nav-logo { width: 78px; }
  .nav-right { width: 100%; }
  .nav-links { width: 100%; justify-content: space-between; }
  .nav-links a { flex-direction: column; gap: 3px; padding: 6px 8px; font-size: 10px; min-width: 56px; }
  .nav-worker { position: absolute; top: 8px; right: 12px; margin: 0; padding: 0; border: none; gap: 6px; }
  .nav-worker strong { display: none; }

  main { padding: 22px 14px 56px; }
  h1 { font-size: 22px; }
  .card { padding: 18px; }
  .row > .field { min-width: 100%; }
  .login-wrap, .acceso-wrap { margin-top: 2vh; }

  .apartado-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; margin-bottom: 18px; }
  .apartado-card { padding: 12px 4px 10px; border-radius: 12px; }
  .apartado-card .apartado-icon { width: 36px; height: 36px; border-radius: 10px; margin-bottom: 6px; }
  .apartado-card .apartado-label { font-size: 11px; }
  .apartado-card .apartado-hint { display: none; }
  .stepper-row > .field,
  .stepper-row > .stepper-group { flex: 1 1 100%; }
  .stepper { width: 100%; justify-content: space-between; }
  .stepper-input { flex: 1; }
  .modal { padding: 20px; }
  .modal-pdf { width: 96vw; height: 90vh; }

  .ot-rapida-apartados { grid-template-columns: repeat(3, 1fr); }
  .ot-rapida-btn { min-height: 70px; }

  .filtros-toggle { display: inline-flex; }
  .filtros { gap: 8px; }
  .filtros > .field:not(.filtro-buscar) { display: none; }
  .filtros.filtros-abiertos > .field { display: block; }
  .filtros .filtro-buscar { flex: 1 1 0 !important; min-width: 0 !important; margin-bottom: 0; }
  .filtros-activos .filtros-toggle { border-color: var(--accent); }

  .card.table-wrap:has(.tabla-tarjetas) { background: transparent; border: none; box-shadow: none; overflow: visible; }
  .tabla-tarjetas thead { display: none; }
  .tabla-tarjetas, .tabla-tarjetas tbody { display: block; }
  .tabla-tarjetas tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow);
  }
  .tabla-tarjetas tr:hover td { background: none; }
  .tabla-tarjetas td { display: block; border: none; padding: 0; }
  .tabla-tarjetas td.tt-check { order: -1; }
  .tabla-tarjetas td.tt-titulo { font-size: 16px; }
  .tabla-tarjetas td.tt-estado { margin-left: auto; }
  .tabla-tarjetas td[data-label] { order: 1; width: 100%; display: flex; gap: 8px; font-size: 13px; }
  .tabla-tarjetas td[data-label]::before { content: attr(data-label); color: var(--faint); font-size: 12px; min-width: 62px; }
  .tabla-tarjetas td.tt-acciones { order: 2; width: 100%; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; white-space: normal !important; }
  .tabla-tarjetas td.tt-acciones > * { flex: 1 1 auto; justify-content: center; min-height: 42px; }
  .tabla-tarjetas tr.empty-row { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Pantalla de usuarios: enlace de salida discreto */
.login-salir { font-size: 7px; }
.login-salir .ico { width: 8px; height: 8px; }
.login-salir-hint { font-size: 6px; margin-top: 2px; }

/* Pantalla de contraseña del usuario: tarjeta compacta */
.login-volver { font-size: 11px; margin-bottom: 10px; }
.login-card { padding: 14px; margin-bottom: 10px; max-width: 260px; }
.login-card .usuario-seleccionado { gap: 9px; margin-bottom: 12px; }
.login-card .usuario-seleccionado .usuario-nombre { font-size: 13px; }
.login-card .usuario-seleccionado .hint { font-size: 10px; }
.login-card .avatar { width: 26px; height: 26px; font-size: 9px; }
.login-card label { font-size: 10px; margin-bottom: 4px; }
.login-card .field { margin-bottom: 10px; }
.login-card input[type="password"] { min-height: 30px; padding: 6px 9px; font-size: 12px; border-radius: 7px; }
.login-card .check-field { gap: 7px; margin-bottom: 4px; }
.login-card .check-field label { font-size: 11px; }
.login-card input[type="checkbox"] { width: 13px; height: 13px; }
.login-card .hint { font-size: 9px; }
.login-card .aviso { font-size: 11px; padding: 7px 9px; margin-bottom: 10px; }
.login-card .btn { min-height: 30px; padding: 6px 12px; font-size: 12px; border-radius: 7px; }
.login-olvido { font-size: 9px; max-width: 260px; }

/* ══════════════════════════════════════════════════════════════════════
   Escala compacta para monitor de ordenador (prioridad de uso). Todo más
   pequeño y denso: letra, controles, tarjetas, tablas y espacios. El móvil
   (≤640px) conserva los tamaños táctiles de arriba.
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 641px) {
  body { font-size: 12px; }
  nav { height: 42px; padding: 0 18px; gap: 10px; }
  .nav-logo { width: 78px; }
  .nav-right { gap: 10px; }
  .nav-links a { padding: 4px 8px; font-size: 11px; gap: 5px; border-radius: 6px; }
  .nav-links a .ico { width: 13px; height: 13px; }
  .nav-worker { font-size: 11px; gap: 6px; margin-left: 6px; padding-left: 10px; }
  .nav-worker .ico { width: 13px; height: 13px; }
  .nav-clock { font-size: 10px; }
  .avatar { width: 20px; height: 20px; font-size: 8px; }
  .avatar-lg { width: 26px; height: 26px; font-size: 9px; }

  main { padding: 18px 18px 40px; max-width: 980px; }
  h1 { font-size: 17px; margin-bottom: 2px; }
  h2 { font-size: 12px; margin-bottom: 8px; gap: 6px; }
  h2 .ico { width: 13px; height: 13px; }
  .subtitle { font-size: 11px; margin-bottom: 12px; }
  .eyebrow { font-size: 9px; margin-bottom: 3px; }
  .section-title { font-size: 10px; margin: 20px 0 8px; }
  .hint { font-size: 10px; margin-top: 3px; }
  .page-head { margin-bottom: 12px; gap: 10px; }
  .page-actions { gap: 5px; }
  .ico { max-width: 15px; max-height: 15px; }

  .card { padding: 12px; margin-bottom: 10px; border-radius: 9px; }
  details.card > summary { padding: 9px 12px; border-radius: 9px; }
  details.card > .details-body { padding: 0 12px 12px; }
  details.card > summary .details-count { font-size: 9px; padding: 1px 6px; }

  .btn, .btn-blue-sm { min-height: 26px; padding: 4px 10px; font-size: 11px; border-radius: 6px; gap: 5px; }
  .btn-lg { min-height: 32px; padding: 7px 14px; font-size: 12px; border-radius: 7px; }
  .btn-icon { width: 26px; min-width: 26px; padding: 0; }
  .btn-xs { min-height: 20px; padding: 2px 6px; font-size: 10px; border-radius: 5px; }
  .btn-icon.btn-xs { width: 20px; min-width: 20px; }
  .acciones-fila .btn { min-height: 22px; padding: 2px 7px; }

  label { font-size: 10px; margin-bottom: 3px; }
  input, select, textarea { min-height: 28px; padding: 5px 8px; font-size: 12px; border-radius: 6px; }
  select { padding-right: 26px; background-position: right 8px center; }
  textarea { min-height: 54px; }
  input[type="checkbox"], input[type="radio"] { width: 13px; height: 13px; }
  .field { margin-bottom: 9px; }
  .row { gap: 9px; }
  .row > .field { min-width: 110px; }
  .check-field { gap: 6px; margin-bottom: 8px; }
  .check-field label { font-size: 11px; }

  table { font-size: 11px; }
  th { padding: 6px 9px; font-size: 9px; }
  td { padding: 6px 9px; }
  .empty-row td { padding: 16px; }

  .badge { padding: 2px 7px; font-size: 10px; gap: 4px; }
  .badge::before { width: 5px; height: 5px; }
  .chip { padding: 5px 10px; font-size: 11px; gap: 6px; }
  .stats-row { gap: 6px; margin-bottom: 10px; }
  .stat-tile { padding: 3px 9px; gap: 5px; }
  .stat-num { font-size: 12px; }
  .stat-label { font-size: 10px; }
  .aviso { font-size: 11px; padding: 6px 9px; margin-bottom: 9px; }

  .steps { gap: 8px; margin-bottom: 12px; }
  .steps .step { font-size: 11px; gap: 6px; }
  .steps .step-num { width: 18px; height: 18px; font-size: 10px; }
  .steps .sep { width: 16px; }
  .apartado-grid { gap: 8px; margin-bottom: 12px; }
  .apartado-card { padding: 10px 6px 8px; border-radius: 9px; }
  .apartado-card .apartado-icon { width: 28px; height: 28px; border-radius: 8px; margin-bottom: 5px; }
  .apartado-card .apartado-icon .ico { width: 15px; height: 15px; }
  .apartado-card .apartado-label { font-size: 11px; }
  .apartado-card .apartado-hint { font-size: 9px; margin-top: 1px; }
  .stepper { border-radius: 7px; }
  .stepper-btn { width: 28px; height: 28px; font-size: 14px; }
  .stepper-input { width: 46px; font-size: 13px; }
  .stepper-label { font-size: 9px; }
  .stepper-group { gap: 4px; }
  .stepper-row { gap: 10px; }

  .modal { padding: 14px; border-radius: 11px; width: 380px; }
  .modal-footer { gap: 6px; }
  #toast { padding: 7px 12px; font-size: 11px; border-radius: 8px; bottom: 16px; }

  .inicio-head { margin-bottom: 12px; gap: 10px; }
  .inicio-ots { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
  .ot-rapida { padding: 10px 12px; }
  .ot-rapida-head { gap: 6px; }
  .ot-rapida-head strong { font-size: 13px; }
  .ot-rapida-entrega { font-size: 10px; }
  .ot-rapida-titulo { font-size: 11px; margin: 2px 0 8px; }
  .ot-rapida-apartados { gap: 5px; }
  .ot-rapida-btn { min-height: 40px; padding: 4px 2px; gap: 3px; font-size: 9px; border-radius: 7px; }
  .ot-rapida-btn .ico { width: 14px; height: 14px; }

  .panel-tiles { gap: 8px; margin-bottom: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .panel-tile { padding: 9px 11px; gap: 3px; border-radius: 9px; }
  .panel-num { font-size: 18px; }
  .panel-label { font-size: 9px; }
  .panel-grid { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .barra-fila { padding: 4px 0; font-size: 11px; gap: 8px; }
  .barra { height: 6px; }
  .barra-valor { min-width: 40px; }
  .panel-item { padding: 6px 0; font-size: 11px; gap: 8px; }

  main.ajustes { max-width: 980px; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
}

/* ── Inicio: listado de órdenes ── */
.ordenes-card { padding: 0; overflow: hidden; }
.ordenes-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.ordenes-filtros { display: flex; gap: 6px; align-items: center; flex: 1; justify-content: flex-end; min-width: 280px; }
.ordenes-filtros input[type="search"] { max-width: 300px; }
.ordenes-filtros select { width: auto; min-width: 120px; }
.ordenes-tabla { max-height: 340px; overflow-y: auto; }
.ordenes-tabla thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
@media (max-width: 640px) {
  .ordenes-filtros { flex-wrap: wrap; min-width: 0; }
  .ordenes-filtros input[type="search"] { max-width: none; flex: 1 1 100%; }
}

/* ══════════════════════════════════════════════════════════════════════
   Pantalla de Usuarios: pantalla partida.
   Izquierda, panel de marca de La Troupe Image Lab: degradado gris de
   "mesa de luz", grano fotográfico, marcas de corte y de registro de
   imprenta y una tira de control de color como la de las pruebas de color.
   Derecha, el panel con los usuarios.
   ══════════════════════════════════════════════════════════════════════ */
body.pantalla-login > nav { display: none; }
main.login-main { max-width: none; padding: 0; }
.login-split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr); min-height: 100vh; }

.login-marca {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 60% 55% at 50% 44%, rgba(255,255,255,.16), rgba(255,255,255,0) 70%),
    linear-gradient(160deg, #5a5a5a 0%, #3f3f3f 45%, #2c2c2c 100%);
  border-right: 1px solid var(--border);
}
.login-marca::before {
  content: ""; position: absolute; inset: 0; opacity: .22; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
.login-marca-centro { position: relative; text-align: center; }
.login-logo { width: min(340px, 52%); min-width: 200px; height: auto; filter: invert(1) brightness(2); opacity: .96; display: block; margin: 0 auto; }
.login-lab { margin-top: 14px; font-size: 13px; letter-spacing: .55em; text-transform: uppercase; color: rgba(255,255,255,.78); font-weight: 600; padding-left: .55em; }
.login-servicios { margin-top: 10px; font-size: 11px; color: rgba(255,255,255,.5); letter-spacing: .04em; }
.login-servicios span { margin: 0 6px; opacity: .6; }

.corte { position: absolute; width: 26px; height: 26px; border-color: rgba(255,255,255,.35); border-style: solid; border-width: 0; }
.corte-ti { top: 28px; left: 28px; border-top-width: 1px; border-left-width: 1px; }
.corte-td { top: 28px; right: 28px; border-top-width: 1px; border-right-width: 1px; }
.corte-bi { bottom: 28px; left: 28px; border-bottom-width: 1px; border-left-width: 1px; }
.corte-bd { bottom: 28px; right: 28px; border-bottom-width: 1px; border-right-width: 1px; }
.registro { position: absolute; top: 50%; width: 26px; height: 26px; margin-top: -13px; fill: none; stroke: rgba(255,255,255,.35); stroke-width: 1.2; }
.registro-i { left: 22px; }
.registro-d { right: 22px; }

.tira-control {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0;
  padding: 3px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.12); border-radius: 3px;
}
.tira-control span { width: 16px; height: 10px; display: block; }
.tira-control i { width: 8px; }

.login-panel {
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--bg); padding: 0 48px;
}
.login-panel-cuerpo { margin: auto 0; width: 100%; max-width: 360px; padding: 40px 0; }
.login-panel-cuerpo h1 { font-size: 18px; }
.login-panel .usuario-lista { margin: 14px 0 0; }
.login-panel .login-card { max-width: 280px; }
.login-pie { padding: 0 0 22px; }

@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-marca { min-height: 220px; border-right: none; border-bottom: 1px solid var(--border); }
  .registro, .tira-control { display: none; }
  .login-panel { padding: 0 20px; }
}
.login-pie .login-salir { font-size: 7px; }
.login-pie .login-salir-hint { font-size: 6px; margin-top: 2px; }
/* Botones de usuario un 10 % más grandes */
.login-panel-cuerpo { max-width: 396px; }
.login-panel .usuario-lista { gap: 7px; }
.login-panel .usuario-btn { min-height: 33px; padding: 4px 9px; gap: 8px; border-radius: 9px; }
.login-panel .usuario-btn .avatar { width: 22px; height: 22px; font-size: 9px; }
.login-panel .usuario-btn .usuario-nombre { font-size: 13.2px; }
.login-panel .usuario-btn .usuario-rol { font-size: 10px; }
/* Otro 10 % más */
.login-panel-cuerpo { max-width: 436px; }
.login-panel .usuario-lista { gap: 8px; }
.login-panel .usuario-btn { min-height: 36px; padding: 5px 10px; gap: 9px; border-radius: 10px; }
.login-panel .usuario-btn .avatar { width: 24px; height: 24px; font-size: 10px; }
.login-panel .usuario-btn .usuario-nombre { font-size: 14.5px; }
.login-panel .usuario-btn .usuario-rol { font-size: 11px; }

/* Descripción de la OT: caja grande, respeta los saltos de línea */
textarea.descripcion-ot { min-height: 260px; line-height: 1.5; white-space: pre-wrap; resize: vertical; }
.modal textarea.descripcion-ot { min-height: 180px; }
/* Botones en línea (p. ej. acciones de una fila): alineados por el centro,
   lleven icono o no — si no, el icono desplaza la línea base y quedan a
   distinta altura. */
.btn, .btn-blue-sm, .badge { vertical-align: middle; }

.importe-negativo { color: var(--red-soft); font-weight: 700; }
.fila-nota-scan td { color: var(--red-soft); font-style: italic; font-weight: 600; white-space: normal; }

/* ── Botones de apartado (Fichar): azul acero poco saturado con el icono
   en naranja empolvado ── */
.apartado-card { background: #4a5866; border-color: #56677a; color: #e6edf3; }
.apartado-card::before { display: none; }
.apartado-card:hover { background: #536373; border-color: #67798e; }
.apartado-card .apartado-icon { background: #3b4754; border-color: #34404c; color: #d9a273; }
.apartado-card .apartado-hint { color: #b9c6d3; }
.apartado-card.selected { background: #56687a; border-color: #ececec; box-shadow: 0 0 0 1px #ececec, var(--shadow); }
.apartado-card.selected .apartado-icon { background: #2e3842; border-color: #2e3842; color: #e8b48a; }

/* Tablas ordenables y autocompletado con teclado */
th.th-ordenable { cursor: pointer; user-select: none; }
th.th-ordenable:hover { color: var(--text); }
th.th-ordenable::after { content: " ↕"; opacity: .35; font-size: 9px; }
th.orden-asc::after { content: " ↑"; opacity: .9; }
th.orden-desc::after { content: " ↓"; opacity: .9; }
.ac-item.activo { background: var(--surface-hover); }
.fila-no-cubierta td { color: var(--red-soft); }
.fila-no-cubierta td strong { color: var(--red-soft); }
