/* ══════════════════════════════════════════════════════════
   Fecha: 2026-04-17
   Ruta: /apps/web/public/css/app.css
   Descripción: Estilos SPA MapFix. Tema dark azul.
   ══════════════════════════════════════════════════════════ */

:root {
  --bg:       #f4f6fa;
  --bg-alt:   #ffffff;
  --bg-2:     #e8edf5;
  --fg:       #1a2236;
  --fg-muted: #6b7280;
  --accent:   #2563eb;
  --accent-2: #1d4ed8;
  --ok:       #16a34a;
  --warn:     #d97706;
  --err:      #dc2626;
  --prio-critical: #dc2626;
  --prio-high:     #ea580c;
  --prio-medium:   #d97706;
  --prio-low:      #16a34a;
  --border:   #d5dde8;
  --shadow:   0 2px 8px rgba(16, 24, 40, .06);
  --shadow-lg:0 12px 40px rgba(16, 24, 40, .15);
  --radius:   10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; height: 100dvh; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* ── Vista general ────────────────────────────────────── */
.view { height: 100vh; height: 100dvh; width: 100vw; }

/* ── Login ───────────────────────────────────────────── */
.view--login {
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.card--auth {
  padding: 2rem;
  width: 100%;
  max-width: 380px;
  display: flex; flex-direction: column; gap: .8rem;
}
.card--auth h1 { font-size: 1.6rem; margin-bottom: .2rem; }
.login-separator {
  display: flex; align-items: center; gap: .6rem;
  margin: .4rem 0; color: var(--fg-muted); font-size: .75rem;
}
.login-separator::before, .login-separator::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.qr-box {
  display: flex; flex-direction: column; align-items: center;
  gap: .6rem; margin: 1rem 0;
}
.qr-box img {
  width: 260px; height: 260px; border-radius: 8px; background: white; padding: .5rem;
}
.qr-pin {
  font-family: monospace; font-size: 2rem; font-weight: 700;
  letter-spacing: .4rem; color: var(--accent);
  padding: .5rem 1rem; background: var(--bg); border-radius: 6px;
  border: 1px solid var(--border);
}
.card--auth .sub { color: var(--fg-muted); font-size: .9rem; margin-bottom: .8rem; }
.card--auth label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--fg-muted); }
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  background: var(--bg-2);
  border-radius: 12px;
  font-size: .7rem;
  align-self: flex-start;
}

/* ── Inputs y botones ─────────────────────────────────── */
input, select, textarea {
  width: 100%;
  padding: .6rem .7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-size: .95rem;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
}
textarea { resize: vertical; }

.btn {
  padding: .6rem 1rem;
  background: var(--bg-2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #d5dde8; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: white; }
.btn--primary:hover { background: var(--accent-2); }
.btn--accent { background: var(--accent); color: white; }
.btn--accent:hover { background: var(--accent-2); }
.btn--sm { padding: .4rem .7rem; font-size: .8rem; }

.msg { padding: .6rem; border-radius: 8px; font-size: .85rem; margin-top: .5rem; display: none; }
.msg--err { background: #fee2e2; color: var(--err); border: 1px solid #fca5a5; display: block; }
.msg--ok  { background: #dcfce7; color: var(--ok); border: 1px solid #86efac; display: block; }

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  height: 52px;
  z-index: 10;
  position: relative;
}
.topbar__brand { font-weight: 700; font-size: 1.1rem; }
.topbar__inst  { color: var(--fg-muted); font-weight: 400; font-size: .85rem; }
.topbar__tabs { display: flex; gap: .2rem; margin-left: 1rem; }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.tab {
  background: transparent; border: none; color: var(--fg-muted);
  padding: .5rem 1rem; cursor: pointer; border-radius: 6px;
  font-size: .9rem;
}
.tab:hover { background: var(--bg-2); color: var(--fg); }
.tab.active { background: var(--accent); color: white; }

/* ── Main / tabs ──────────────────────────────────────── */
.main {
  height: calc(100vh - 52px);
  height: calc(100dvh - 52px);
  overflow: hidden;
  position: relative;
}
.tab-panel {
  display: none;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
}
.tab-panel.active { display: flex; }
/* El mapa necesita sidebar + mapa lado a lado */
#tab-map.active { flex-direction: row; }

/* ── Mapa ────────────────────────────────────────────── */
.sidebar {
  width: 340px;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1rem;
  flex-shrink: 0;
}
.sidebar h3 { margin-bottom: .8rem; font-size: .85rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.map { flex: 1; background: #eaeef3; }

/* Markers Leaflet custom */
.leaflet-container { background: #eaeef3; font-family: inherit; }
.mfx-marker {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: white;
}
.mfx-marker--critical { background: var(--prio-critical); animation: pulse 1.8s ease-in-out infinite; }
.mfx-marker--high     { background: var(--prio-high); }
.mfx-marker--medium   { background: var(--prio-medium); }
.mfx-marker--low      { background: var(--prio-low); }
@keyframes pulse {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(220,38,38,.5); }
  50%      { transform: scale(1.15); box-shadow: 0 0 0 12px rgba(220,38,38,0); }
}
.mfx-marker--property {
  background: white;
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Listas ──────────────────────────────────────────── */
.list { overflow-y: auto; padding: 1rem; flex: 1; }
.list--compact { padding: 0; }

.item {
  background: var(--bg-alt);
  padding: .8rem;
  border-radius: 8px;
  margin-bottom: .5rem;
  cursor: pointer;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  box-shadow: var(--shadow);
  transition: background .1s, border-color .1s;
}
.list--compact .item {
  border-radius: 0;
  margin-bottom: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--border);
  background: transparent;
  box-shadow: none;
}
.item:hover { background: var(--bg-2); }
.item--critical { border-left-color: var(--prio-critical); }
.item--high     { border-left-color: var(--prio-high); }
.item--medium   { border-left-color: var(--prio-medium); }
.item--low      { border-left-color: var(--prio-low); }
.item__title { font-weight: 600; margin-bottom: .2rem; }
.item__meta  { font-size: .75rem; color: var(--fg-muted); display: flex; gap: .6rem; flex-wrap: wrap; }
.chip {
  display: inline-block; padding: .1rem .5rem; border-radius: 10px;
  font-size: .7rem; background: var(--bg-2); color: var(--fg);
}
.chip--abierta    { background: #dbeafe; color: var(--accent); }
.chip--pendiente  { background: #fef3c7; color: var(--warn); }
.chip--en-curso   { background: #dcfce7; color: var(--ok); }
.chip--resuelta   { background: #dcfce7; color: var(--ok); opacity: .7; }
.chip--cerrada    { background: var(--bg-2); color: var(--fg-muted); }

/* ── Filtros ──────────────────────────────────────────── */
.filters {
  display: flex; gap: .5rem; padding: 1rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.filters input, .filters select { width: auto; max-width: 240px; flex: 0 0 auto; }
.filters input[type="search"] { min-width: 220px; }

/* ── Visor de imagen (lightbox) ──────────────────────── */
.modal--image .modal__overlay { background: rgba(0,0,0,.92); }
.modal__image-full {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  z-index: 1001;
}
.modal__close--light {
  color: white;
  font-size: 1.5rem;
  background: rgba(0,0,0,.4);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
}
[data-zoom] { cursor: zoom-in; }

/* ── Modal ────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal__overlay {
  position: absolute; inset: 0;
  background: rgba(16,24,40,.4); backdrop-filter: blur(3px);
}
.modal__card {
  position: relative;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal__close {
  position: absolute; top: .8rem; right: 1rem;
  background: none; border: none; color: var(--fg-muted);
  font-size: 1.2rem; cursor: pointer;
}
.modal__card form { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; }
.modal__card label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--fg-muted); }

/* ── Detalle incidencia ───────────────────────────────── */
.detail__head { margin-bottom: 1rem; }
.detail__ref  { color: var(--fg-muted); font-size: .85rem; font-family: monospace; }
.detail__title { font-size: 1.3rem; font-weight: 600; margin-top: .3rem; }
.detail__meta { display: flex; gap: .5rem; margin: .6rem 0; flex-wrap: wrap; }
.detail__prop { font-size: .85rem; color: var(--fg-muted); }
.property-head {
  display: flex; gap: .7rem; align-items: center;
  margin: .6rem 0 .4rem;
  padding: .4rem;
  background: var(--bg);
  border-radius: 8px;
}
.property-head__cover {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 6px; flex-shrink: 0;
  background: var(--bg-2);
}
.property-head__cover--empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  color: var(--fg-muted);
}
.property-head__info { flex: 1; min-width: 0; }
.property-head__info .detail__prop { color: var(--fg); font-size: .95rem; font-weight: 600; }
.detail__desc { margin-top: 1rem; padding: .8rem; background: var(--bg); border-radius: 6px; white-space: pre-wrap; }
.detail__actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 1rem; }
.nav-actions {
  display: flex; gap: .4rem; align-items: center;
  margin: .5rem 0 .3rem;
  flex-wrap: wrap;
}
.nav-actions .btn { text-decoration: none; }

/* ── Location picker modal ───────────────────────────── */
.loc-picker {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: .8rem;
}
#loc-map {
  width: 100%; height: 380px;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden;
}
.loc-info {
  display: flex; flex-direction: column; gap: .3rem;
  font-size: .9rem;
}
.loc-row { display: flex; gap: .5rem; }
.loc-row span { color: var(--fg-muted); min-width: 90px; }
.loc-row strong { font-family: monospace; }
@media (max-width: 760px) {
  .loc-picker { grid-template-columns: 1fr; }
  #loc-map { height: 260px; }
}
.field-actions {
  margin-top: 1rem; padding: .7rem;
  background: var(--bg); border: 1px dashed var(--border); border-radius: 6px;
}
.field-actions h4 {
  font-size: .7rem; color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: .45rem;
}
.field-actions__row {
  display: flex; gap: .4rem; align-items: center;
}
.field-actions__row .btn {
  flex: 1;
  white-space: nowrap;
  min-width: 0;
  text-align: center;
  padding: .5rem .4rem;
}
.field-upload-label { cursor: pointer; margin: 0; }
.field-upload-label input[type="file"] { display: none; }
.assign-box {
  display: flex; gap: .4rem; margin-top: .8rem;
  padding: .6rem; background: var(--bg); border-radius: 6px;
}
.assign-box select { flex: 1; }

.timeline { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.timeline h4 { margin-bottom: .8rem; color: var(--fg-muted); text-transform: uppercase; font-size: .75rem; letter-spacing: .05em; }
.timeline__entry {
  position: relative;
  padding: .4rem 0 .4rem 1.2rem;
  border-left: 2px solid var(--border);
  margin-left: .4rem;
  font-size: .85rem;
}
.timeline__entry::before {
  content: ''; position: absolute; left: -5px; top: .9rem;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.timeline__when { color: var(--fg-muted); font-size: .7rem; }
.timeline__who  { font-weight: 600; }

.comment-box { display: flex; gap: .4rem; margin-top: .8rem; }
.comment-box input { flex: 1; }

/* ── Toast ────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1rem; right: 1rem;
  background: var(--bg-alt); color: var(--fg);
  padding: .8rem 1.2rem; border-radius: 8px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: slideIn .2s ease-out;
}
@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Panel Ajustes ───────────────────────────────────── */
.settings-box {
  max-width: 640px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.settings-box h3 {
  font-size: .9rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .3rem;
}
.settings-box .settings-hint {
  font-size: .85rem;
  color: var(--fg-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.settings-box .checkbox { padding: .3rem 0; }
.settings-box button { margin-top: .8rem; }

/* ── Activar QR dentro del modal usuario ─────────────── */
.qr-activate {
  padding: .8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; flex-direction: column; gap: .4rem;
}
.qr-activate strong { font-size: .85rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .05em; }
#user-qr-status { font-size: .85rem; }

/* ── Sub-tabs (dentro del panel Admin) ───────────────── */
.subtabs { display: flex; gap: .2rem; }
.subtab {
  background: transparent; border: 1px solid transparent;
  color: var(--fg-muted); padding: .4rem .9rem; border-radius: 6px;
  cursor: pointer; font-size: .85rem;
}
.subtab:hover { background: var(--bg-2); color: var(--fg); }
.subtab.active { background: var(--bg-2); color: var(--fg); border-color: var(--border); font-weight: 600; }

.filters__actions { margin-left: auto; display: flex; gap: .4rem; }

/* ── Admin: tablas ────────────────────────────────────── */
.admin-content { flex: 1; overflow-y: auto; padding: 1rem; }
.admin-section { display: none; }
.admin-section.active { display: block; }

.admin-table {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th, .admin-table td {
  padding: .6rem .8rem; text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.admin-table th {
  background: var(--bg-2);
  color: var(--fg-muted);
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .05em;
  font-weight: 600;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f8fafd; cursor: pointer; }
.admin-table .actions { text-align: right; white-space: nowrap; }
.admin-table button { padding: .25rem .5rem; font-size: .75rem; }

/* ── Grid 2 cols para formularios ────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem .8rem;
}
.modal__card--wide { max-width: 720px; }
.modal__card h3 { margin: 1rem 0 .6rem; font-size: .95rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .05em; }

/* ── Checkbox labels ──────────────────────────────────── */
.checkbox {
  flex-direction: row !important;
  align-items: center !important;
  gap: .5rem !important;
  font-size: .88rem !important;
  color: var(--fg) !important;
  cursor: pointer;
}
.checkbox input { width: auto !important; }

/* ── Códigos de acceso (dentro modal propiedad) ──────── */
.codes-section {
  margin-top: 1.2rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
}
#codes-list { margin-bottom: .6rem; }
.code-row {
  display: grid;
  grid-template-columns: 100px 120px 1fr 1fr auto;
  gap: .4rem;
  padding: .4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: .3rem;
  align-items: center;
  font-size: .85rem;
}
.code-row .chip {
  font-weight: 600;
  text-transform: uppercase;
  font-size: .7rem;
  text-align: center;
}
.code-new {
  display: grid !important;
  grid-template-columns: 100px 140px 1fr 1fr auto !important;
  gap: .4rem !important;
  flex-direction: row !important;
}

/* ── Banner actualización PWA ────────────────────────── */
.update-banner {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--accent); color: white;
  padding: .8rem 1rem;
  display: flex; align-items: center; justify-content: center;
  gap: 1rem;
  z-index: 3000;
  box-shadow: 0 -4px 16px rgba(16,24,40,.18);
  animation: slideUp .25s ease-out;
}
.update-banner .btn {
  background: white; color: var(--accent); border: none;
}
.update-banner .btn:hover { background: #f1f5ff; }
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — breakpoints:
     ≤ 480px  → móvil pequeño (portrait)
     ≤ 760px  → móvil / móvil landscape
     ≤ 1024px → tablet
     > 1024px → desktop (base)
   ══════════════════════════════════════════════════════ */

/* ── Tablet (761 – 1024px) ───────────────────────────── */
@media (min-width: 761px) and (max-width: 1024px) {
  .sidebar { width: 280px; }
  .topbar__brand { font-size: 1.05rem; }
  .topbar__inst { font-size: .8rem; }
  .modal__card { max-width: 90vw; }
  .modal__card--wide { max-width: 92vw; }
  .admin-table th, .admin-table td { padding: .5rem; font-size: .82rem; }
}

/* ── Móvil (≤ 760px) ─────────────────────────────────── */
@media (max-width: 760px) {
  .topbar { gap: .4rem; padding: .5rem .7rem; height: 48px; }
  .topbar__brand { font-size: 1rem; }
  .topbar__inst { display: none; }
  .topbar__tabs { margin-left: 0; overflow-x: auto; }
  .tab { padding: .4rem .7rem; font-size: .85rem; white-space: nowrap; }
  .topbar__user { gap: .3rem; }
  .topbar__user #user-name { display: none; } /* no cabe en móvil */
  .btn--sm { padding: .35rem .6rem; font-size: .75rem; }

  .main { height: calc(100vh - 48px); height: calc(100dvh - 48px); }

  /* El mapa ocupa toda la pantalla en móvil; el listado es un bottom sheet plegable */
  #tab-map.active { flex-direction: column; position: relative; }
  .sidebar {
    position: absolute; left: 0; right: 0; bottom: 0;
    width: 100%; height: 42%;
    max-height: 60vh;
    border-right: none; border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 14px rgba(16,24,40,.12);
    z-index: 400; /* por encima del mapa */
    transform: translateY(calc(100% - 52px));
    transition: transform .3s ease;
  }
  .sidebar::before {
    content: ''; display: block;
    width: 40px; height: 4px; border-radius: 2px;
    background: var(--fg-muted); opacity: .4;
    margin: .3rem auto .5rem;
  }
  .sidebar.expanded { transform: translateY(0); }
  .sidebar h3 { cursor: pointer; user-select: none; }
  .sidebar h3::after { content: ' ▲'; font-size: .7rem; color: var(--accent); }
  .sidebar.expanded h3::after { content: ' ▼'; }
  .map { width: 100%; height: 100%; }

  /* Filtros: un poco más apretados */
  .filters { padding: .6rem; gap: .4rem; }
  .filters input, .filters select { min-width: 0; max-width: 100%; }
  .filters__actions { width: 100%; justify-content: flex-end; }

  /* Modales pantalla completa en móvil */
  .modal__card { max-width: 100%; max-height: 100%; border-radius: 0; padding: 1rem; }
  .modal__card--wide { max-width: 100%; }
  .grid-2 { grid-template-columns: 1fr; }

  /* Tabla admin: scroll horizontal */
  .admin-content { padding: .5rem; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }

  /* Códigos acceso compactos */
  .code-row, .code-new {
    grid-template-columns: 80px 1fr auto !important;
    grid-template-rows: auto auto;
  }

  /* Caja de asignar técnico en detalle */
  .assign-box { flex-direction: column; }
  .assign-box select, .assign-box button { width: 100%; }

  /* Login card ocupa ancho completo móvil */
  .card--auth { max-width: 92vw; padding: 1.4rem 1.2rem; }
  .qr-box img { width: 100%; max-width: 260px; height: auto; }
}

/* ── Móvil pequeño (≤ 480px) ─────────────────────────── */
@media (max-width: 480px) {
  body { font-size: 13px; }
  .topbar { height: 44px; padding: .3rem .5rem; gap: .2rem; }
  .main { height: calc(100vh - 44px); height: calc(100dvh - 44px); }
  .tab { padding: .3rem .55rem; font-size: .8rem; }
  .topbar__user #btn-new-incident { padding: .3rem .5rem; font-size: .75rem; }

  .card--auth { padding: 1rem; }
  .card--auth h1 { font-size: 1.35rem; }
  .card--auth .sub { font-size: .8rem; }

  .modal__card { padding: .8rem; }
  .modal__card h2 { font-size: 1.1rem; }

  .filters { padding: .5rem; }
  .item { padding: .6rem; }
  .item__title { font-size: .9rem; }
  .item__meta { font-size: .7rem; }

  .detail__title { font-size: 1.1rem; }
  .detail__actions .btn { flex: 1 1 calc(50% - .4rem); }

  .qr-pin { font-size: 1.6rem; letter-spacing: .3rem; }
  .qr-box img { max-width: 220px; }
}

/* ── Móvil landscape (altura baja) ───────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .topbar { height: 40px; }
  .main { height: calc(100vh - 40px); height: calc(100dvh - 40px); }
  .sidebar { max-height: 100%; }
  .card--auth { max-height: 96vh; overflow-y: auto; }
}
