:root {
      --brand-red: #db2418;
      --brand-charcoal: #414247;
      --brand-charcoal-dark: #2f3033;
      --bg: #f7f7f7;
      --card: #fff;
      --primary: #db2418;
      --primary-light: #fdecea;
      --sidebar: #414247;
      --sidebar-dark: #2f3033;
      --sidebar-text: #f0f0f0;
      --sidebar-active: rgba(219, 36, 24, 0.22);
      --border: #e3e4e6;
      --warn: #e65100;
      --err: #b71c1c;
      --ok: #2e7d32;
      --sidebar-width: 208px;
      --hub-link: #db2418;
      --text: #414247;
      --muted: #6b7280;
      --bg-soft: #f8fafc;
      --space-1: 4px;
      --space-2: 6px;
      --space-4: 14px;
      --radius-sm: 6px;
      --radius-md: 8px;
      --btn-py: 3px;
      --btn-px: 8px;
      --btn-fs: 11px;
      --table-py: 3px;
      --table-px: 5px;
      --table-fs: 11px;
      --space-3: 8px;
    }
    * { box-sizing: border-box; }
    body { font-family: system-ui, sans-serif; margin: 0; background: var(--bg); color: var(--text); }
    .app-shell { display: flex; min-height: 100vh; }
    .sidebar {
      width: var(--sidebar-width);
      flex-shrink: 0;
      background: var(--sidebar);
      color: var(--sidebar-text);
      display: flex;
      flex-direction: column;
      position: sticky;
      top: 0;
      height: 100vh;
      overflow-y: auto;
      overflow-x: hidden;
      border-right: 1px solid var(--brand-charcoal-dark);
    }
    .sidebar-brand {
      padding: 12px 10px 10px;
      border-bottom: 1px solid rgba(255,255,255,.12);
      text-align: center;
    }
    .sidebar-brand img {
      display: block;
      width: 100%;
      max-width: 196px;
      height: auto;
      margin: 0 auto;
      border-radius: 0;
      background: transparent;
      image-rendering: -webkit-optimize-contrast;
    }
    .sidebar-brand .brand-caption {
      display: block;
      margin-top: 10px;
      font-size: 10px;
      font-weight: 600;
      letter-spacing: .08em;
      text-transform: uppercase;
      color: rgba(255,255,255,.5);
    }
    .sidebar-brand strong,
    .sidebar-brand span:not(.brand-caption) { display: none; }
    .sidebar-nav { flex: 1; padding: 8px 0; }
    .nav-item--mensajes {
      flex-shrink: 0;
      margin: 0 8px 8px;
      width: calc(100% - 16px);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-left: 1px solid rgba(255, 255, 255, 0.14);
      font-weight: 600;
      padding: 10px 12px;
    }
    .nav-item--mensajes:hover {
      background: rgba(255, 255, 255, 0.14);
    }
    .nav-item--mensajes.active {
      background: var(--sidebar-active);
      border-color: var(--primary);
      color: #fff;
    }
    .nav-item--mensajes .nav-ico--mensajes {
      width: 18px;
      height: 18px;
    }
    .nav-item--mensajes .nav-mensajes-label {
      flex: 1;
      text-align: left;
    }
    .nav-item--mensajes .nav-badge {
      margin-left: auto;
    }
    .nav-item {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 8px;
      padding: 8px 12px;
      border: none;
      background: transparent;
      color: var(--sidebar-text);
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      text-align: left;
      border-left: 3px solid transparent;
      transition: background .12s ease, color .12s ease;
    }
    .nav-item.nav-item--mensajes { width: calc(100% - 16px); }
    .nav-item .nav-badge { margin-left: auto; }
    .nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
    .nav-item.active {
      background: var(--sidebar-active);
      color: #fff;
      font-weight: 600;
      border-left-color: var(--primary);
    }
    .nav-divider {
      height: 1px;
      background: rgba(255,255,255,.14);
      margin: 8px 12px;
    }
    .sidebar-footer {
      border-top: 1px solid rgba(255,255,255,.12);
      padding: 8px 0;
    }
    .footer-label {
      margin: 8px 16px 4px;
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      color: rgba(255,255,255,.55);
      letter-spacing: .04em;
    }
    .btn-mobile-menu {
      display: none;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      padding: 0;
      font-size: 22px;
      line-height: 1;
      background: #fff;
      color: var(--brand-charcoal);
      border: 1px solid var(--border);
      border-radius: 8px;
      flex-shrink: 0;
      transition: background .12s ease, border-color .12s ease, color .12s ease;
    }
    .btn-mobile-menu:hover {
      border-color: var(--primary);
      color: var(--primary);
      background: var(--primary-light);
    }
    .btn-mobile-menu-ico {
      width: 22px;
      height: 22px;
      display: block;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
    }
    .header-actions .btn-sm,
    .header-actions button.secondary {
      min-height: 32px;
      align-items: center;
    }
    .content-header-logo {
      height: 32px;
      width: auto;
      object-fit: contain;
    }
    #consultaPickerBody [data-consulta-tab]:disabled {
      opacity: .55;
      cursor: wait;
    }
    .sidebar-backdrop {
      display: none;
    }
    .main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .content-header {
      background: #fff;
      border-bottom: 1px solid var(--border);
      padding: 2px 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      min-height: 32px;
    }
    .content-header--compact .content-header-titles h1 {
      font-size: 0.85rem;
      font-weight: 700;
    }
    .content-header--compact .breadcrumb-nav,
    .content-header--compact #pageSubtitle {
      display: none !important;
    }
    .content-header--compact .session-user-header {
      display: none !important;
    }
    .content-header-left {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .content-header-logo { display: none !important; }
    .content-header h1 { margin: 0; font-size: 0.92rem; color: var(--brand-charcoal); line-height: 1.2; }
    .content-header .muted { margin: 1px 0 0; font-size: 11px; }
    .header-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
    #status { max-width: 320px; text-align: right; font-size: 11px; }
    .btn-icon {
      background: #fff;
      color: var(--primary);
      border: 1px solid var(--border);
      padding: var(--btn-py) var(--btn-px);
      font-size: var(--btn-fs);
    }
    main.content { padding: 4px 8px; flex: 1; }
    .breadcrumb-nav { font-size: 11px; margin-bottom: 2px; min-height: 14px; }
    .breadcrumb-nav a { color: var(--primary); text-decoration: none; }
    .content-header .muted#pageSubtitle {
      display: block;
      margin: 0;
      font-size: 12px;
      line-height: 1.35;
      max-width: 52ch;
    }
    .nav-ico {
      display: inline-flex;
      width: 1.35em;
      justify-content: center;
      margin-right: 2px;
      flex: 0 0 auto;
    }
    .consulta-tabs-wrap button:focus-visible,
    .nav-item:focus-visible,
    .tabs button:focus-visible {
      outline: 2px solid rgba(219, 36, 24, 0.55);
      outline-offset: 1px;
    }
    #msgConsulta.consulta-busy::before {
      content: '';
      display: inline-block;
      width: 10px;
      height: 10px;
      margin-right: 6px;
      border: 2px solid #cfd8dc;
      border-top-color: var(--primary);
      border-radius: 50%;
      vertical-align: -1px;
      animation: consulta-spin .7s linear infinite;
    }
    @keyframes consulta-spin { to { transform: rotate(360deg); } }
    #digitacionSubmodulos.tabs button,
    #validacionSubmodulos.tabs button { font-size: 11px; padding: 3px 8px; }
    .panel {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: var(--space-3);
      margin-bottom: var(--space-3);
    }
    label { display: block; font-size: 11px; font-weight: 600; margin-bottom: 2px; color: #546e7a; }
    input, select, textarea, button {
      font: inherit;
      padding: var(--btn-py) var(--btn-px);
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      box-sizing: border-box;
      font-size: var(--btn-fs);
    }
    textarea { width: 100%; min-height: 56px; resize: vertical; }
    button {
      background: var(--primary);
      color: #fff;
      border: 1px solid var(--primary);
      cursor: pointer;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1.2;
      white-space: nowrap;
      vertical-align: middle;
      flex: 0 0 auto;
    }
    button.secondary {
      background: #fff;
      color: #546e7a;
      border-color: var(--border);
    }
    button.secondary:hover { background: #f5f6f7; }
    button.danger { background: #fff; color: var(--err); border-color: #ffcdd2; }
    button.danger:hover { background: #ffebee; }
    button.primary, button:not(.secondary):not(.danger):not(.btn-text):not(.btn-link):not(.nav-item):not(.btn-icon) {
      box-shadow: none;
    }
    button:disabled { opacity: 0.45; cursor: not-allowed; }
    .btn-sm { padding: 3px 8px !important; font-size: 11px !important; }
    .btn-text {
      background: transparent !important;
      border: none !important;
      color: var(--hub-link) !important;
      padding: 2px 4px !important;
      font-size: 12px !important;
      font-weight: 600 !important;
      text-decoration: underline;
      box-shadow: none !important;
    }
    .btn-text:hover { color: #a81a12 !important; background: transparent !important; }
    .btn-text.danger { color: var(--err) !important; }
    .tabs { display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 4px; align-items: center; }
    .tabs button {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: #fff;
      color: #444 !important;
      border: 1px solid var(--border);
      padding: 3px 10px;
      font-size: 11px;
      font-weight: 600;
      transition: border-color .12s ease, color .12s ease, background .12s ease;
    }
    .tabs button:hover:not(.active) {
      border-color: var(--primary);
      color: var(--primary) !important;
    }
    .tabs button.active {
      background: var(--primary);
      color: #fff !important;
      border-color: var(--primary);
    }
    .tabs button .tab-ico {
      display: inline-flex;
      width: 14px;
      height: 14px;
      flex: 0 0 14px;
    }
    .tabs button .tab-ico svg {
      width: 14px;
      height: 14px;
      display: block;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.25;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    .tabs button .tab-count {
      display: inline-block;
      min-width: 1.2em;
      margin-left: 4px;
      padding: 0 5px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 700;
      background: rgba(0,0,0,.12);
      color: inherit;
      vertical-align: middle;
    }
    .tabs button.active .tab-count {
      background: rgba(255,255,255,.28);
    }
    .tabs button .tab-count[data-urgent]:not([hidden]) {
      background: #ffe0b2;
      color: #e65100;
    }
    .tabs button.active .tab-count[data-urgent]:not([hidden]) {
      background: #fff3e0;
      color: #bf360c;
    }
    .th-obs-devolucion { min-width: 220px; }
    .devolucion-obs {
      max-width: 420px;
      white-space: pre-wrap;
      word-break: break-word;
      font-size: 12px;
      line-height: 1.4;
      color: #333;
    }
    .devolucion-obs-estado {
      font-weight: 600;
      color: #e65100;
      display: block;
      margin-bottom: 4px;
    }
    .devolucion-obs-motivo {
      display: block;
      padding: 5px 8px;
      background: #fff8e1;
      border-left: 3px solid #f9a825;
      border-radius: 0 4px 4px 0;
      color: #4e342e;
      font-weight: 500;
    }
    .devolucion-obs-motivo-label {
      display: inline-block;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      color: #f57f17;
      margin-right: 4px;
    }
    .devolucion-pdf-flag {
      display: inline-block;
      margin-top: 6px;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 600;
    }
    .devolucion-pdf-flag.ok {
      background: #e8f5e9;
      color: #1b5e20;
    }
    .devolucion-pdf-flag.warn {
      background: #ffebee;
      color: #b71c1c;
    }
    .fila-acciones-rapidas {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      align-items: center;
      min-width: 140px;
    }
    .btn-fila-rapida {
      font-size: 11px !important;
      padding: 3px 8px !important;
      white-space: nowrap;
      line-height: 1.2;
    }
    .btn-fila-rapida.danger {
      background: #ffebee;
      color: var(--err) !important;
      border-color: #ef9a9a;
    }
    .fila-acciones-salto {
      flex-basis: 100%;
      height: 0;
    }
    .btn-fila-rapida.btn-dar-baja-correccion {
      background: #eceff1;
      color: #37474f !important;
      border-color: #b0bec5;
    }
    .detail-devolucion-experto {
      background: #fff;
      border: 1px solid #ffcc80;
      border-radius: 10px;
      padding: 12px 14px;
      margin: 4px 0 10px;
      box-shadow: 0 2px 10px rgba(0,0,0,.06);
    }
    .detail-devolucion-experto .dev-motivo-highlight {
      background: #fff8e1;
      border-left: 4px solid #f9a825;
      padding: 8px 10px;
      border-radius: 0 6px 6px 0;
      font-size: 13px;
      line-height: 1.35;
    }
    .dev-experto-visores {
      display: grid;
      gap: 12px;
    }
    @media (min-width: 1100px) {
      .dev-experto-visores {
        grid-template-columns: 1fr 1fr;
      }
      .dev-experto-visor-block:only-child {
        grid-column: 1 / -1;
      }
    }
    .dev-experto-visor-block h4 {
      font-size: 13px;
      color: #bf360c;
    }
    table { width: 100%; border-collapse: collapse; font-size: var(--table-fs); }
    th, td { text-align: left; padding: var(--table-py) var(--table-px); border-bottom: 1px solid var(--border); vertical-align: middle; }
    th { font-size: 11px; font-weight: 700; color: #546e7a; background: #fafbfc; }
    tr:hover { background: #fef3f1; }
    tr.fila-doble-click:hover,
    tr.consulta-row:hover,
    tr.devolucion-row:hover,
    tr.consulta-val-row:hover,
    tbody tr[data-id].fila-doble-click:hover {
      cursor: default;
    }
    tr.fila-doble-click td,
    tr.consulta-row td,
    tr.devolucion-row td,
    tr.consulta-val-row td,
    #section-digitacion .panel > table tbody tr[data-id] td,
    #section-validacion .panel > .table-scroll table tbody tr[data-id] td {
      user-select: text;
      -webkit-user-select: text;
    }
    tr.selected { background: #f9c9c5; }
    .badge { display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; vertical-align: middle; }
    .badge-pendiente { background: #fff3e0; color: #e65100; }
    .badge-eje-fotos { background: #e3f2fd; color: #1565c0; font-weight: 600; }
    .badge-eje-informe { background: #e8f5e9; color: #2e7d32; font-weight: 600; }
    .badge-eje-digitacion { background: #fff3e0; color: #e65100; font-weight: 600; }
    .badge-revision { background: #eceff1; color: #455a64; }
    .badge-propuesto { background: #fff3e0; color: #e65100; }
    .badge-aprobada { background: #fdecea; color: var(--ok); }
    .badge-rechazada { background: #ffebee; color: var(--err); }
    .muted { color: #666; font-size: 13px; }
    .error { color: var(--err); }
    .ok { color: var(--ok); font-weight: 600; }
    .hidden { display: none !important; }
    .split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    @media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
    .dig-seccion { margin-bottom: 6px; padding: 8px 10px; border: 1px solid var(--border,#d8dee6); border-radius: 8px; background: #fafbfd; }
    .dig-seccion h3 { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--primary); }
    .dig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 10px; }
    .dig-campo--ancho { grid-column: 1 / -1; }
    .dig-campo-label { font-size: 10px; color: #666; margin-bottom: 1px; line-height: 1.2; }
    .dig-campo-valor { font-size: 13px; font-weight: 600; word-break: break-word; padding: 4px 8px; background: #fff; border: 1px dashed #ccd3dc; border-radius: 4px; min-height: 26px; line-height: 1.25; }
    .dig-campo-valor-multilinea { white-space: pre-wrap; overflow-wrap: anywhere; }
    .dig-copiable { position: relative; padding-right: 28px !important; }
    .dig-copiar {
      position: absolute; top: 50%; right: 3px; transform: translateY(-50%);
      display: inline-flex; align-items: center; justify-content: center;
      width: 22px; height: 22px; padding: 0; margin: 0;
      border: 1px solid transparent; border-radius: 4px;
      background: transparent; color: #8a94a3; cursor: pointer; box-shadow: none;
    }
    .dig-campo-valor-multilinea.dig-copiable .dig-copiar { top: 4px; transform: none; }
    .dig-copiar:hover { color: #c62828; background: #fdecea; border-color: #f5c2bd; }
    .dig-copiar:focus-visible { outline: 2px solid #c62828; outline-offset: 1px; }
    .dig-copiar.copiado { color: #2e7d32; background: #e8f5e9; border-color: #a5d6a7; }
    .dig-copiar.copiado svg { display: none; }
    .dig-copiar.copiado::after { content: '✓'; font-size: 13px; font-weight: 700; line-height: 1; }
    .dig-defectos-wrap { margin-top: 6px; }
    .dig-defectos-toggle {
      display: flex;
      align-items: baseline;
      gap: 8px;
      width: 100%;
      text-align: left;
      background: #fff;
      border: 1px dashed #ccd3dc;
      border-radius: 4px;
      padding: 6px 8px;
      cursor: pointer;
      font: inherit;
      color: inherit;
    }
    .dig-defectos-toggle:hover { background: #fdf6f5; border-color: #c62828; }
    .dig-defectos-toggle-icon { color: var(--primary, #c62828); font-size: 11px; flex-shrink: 0; }
    .dig-defectos-resumen { font-size: 12px; font-weight: 600; color: #333; flex: 1; min-width: 0; }
    .dig-defectos-body { margin-top: 4px; }
    .dig-defectos-body .dig-campo-valor { max-height: 240px; overflow: auto; }
    .dig-tabla { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 2px; }
    .dig-tabla th, .dig-tabla td { border: 1px solid var(--border,#d8dee6); padding: 4px 8px; text-align: left; }
    .dig-tabla th { background: #f0f3f7; font-size: 10px; color: #555; font-weight: 600; }
    .dig-tabla td { background: #fff; font-weight: 600; }
    #digitacionCamposBox.split { display: block; }
    #section-digitacion .panel > table td,
    #section-digitacion .panel > table th { padding: 5px 8px; font-size: 12px; vertical-align: middle; }
    #section-digitacion .panel > table tbody tr[data-id] { cursor: default; }
    #section-digitacion .panel > table tbody tr[data-id]:hover { background: #fdf6f5; }
    tr.dig-ficha-row > td { padding: 0 !important; background: #fff; border-top: none; }
    tr.dig-ficha-row.selected-expand { background: transparent; }
    tr.inline-ficha-row > td { padding: 0 !important; background: #fff; border-top: none; vertical-align: top; }
    tr.inline-ficha-row { background: transparent; }
    .inline-ficha-cell { padding: 0 !important; }
    .inline-ficha-panel { margin: 0 !important; border-top: 3px solid var(--primary); border-radius: 0 0 8px 8px; }
    .inline-ficha-panel.panel { min-height: unset !important; padding: 10px 12px 12px; }
    #detailPanel.inline-ficha-panel .detail-split {
      height: min(68vh, 620px) !important;
      min-height: 320px;
    }
    #detailInforme.inline-ficha-panel .val-doc-visor iframe { height: 220px !important; }
    #section-consultas .panel table tbody tr.consulta-row,
    #section-validacion .panel > .table-scroll table tbody tr[data-id],
    #section-validacion #subval-informe .panel > .table-scroll table tbody tr[data-id] { cursor: default; }
    #section-consultas .panel table tbody tr.consulta-row:hover,
    #section-validacion .panel > .table-scroll table tbody tr[data-id]:hover,
    #section-validacion #subval-informe .panel > .table-scroll table tbody tr[data-id]:hover { background: #fdf6f5; }
    #section-consultas .panel table tbody tr.consulta-row.selected,
    #section-validacion .panel > .table-scroll table tbody tr[data-id].selected,
    #section-validacion #subval-informe .panel > .table-scroll table tbody tr[data-id].selected { background: #fdecea; }
    .dig-ficha-inline { padding: 8px 10px 10px; background: #fff; border-top: 2px solid var(--primary); }
    .dig-ficha-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
    .dig-ficha-head h4 { margin: 0; font-size: 13px; color: var(--primary); }
    .dig-ficha-head .muted { font-size: 11px; margin: 2px 0 0; }
    .dig-ficha-cerrar { background: transparent; border: none; color: #888; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
    .dig-ficha-cerrar:hover { color: var(--primary); }
    .dig-ficha-notas label { display: block; font-size: 11px; margin: 6px 0 3px; color: #555; }
    .dig-ficha-notas textarea { width: 100%; min-height: 44px; padding: 6px 8px; font-size: 12px; resize: vertical; }
    .dig-ficha-acciones { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
    .dig-ficha-acciones button { font-size: 12px; padding: 6px 12px; }
    .dig-ficha-alertas { margin: 0 0 8px; padding: 8px 10px; background: #fff8e1; border: 1px solid #f0c36d; border-radius: 4px; font-size: 12px; }
    .dig-ficha-alertas strong { display: block; margin-bottom: 4px; color: #8a5a00; }
    .dig-ficha-alertas ul { margin: 0; padding-left: 18px; }
    .dig-ficha-alertas li { margin: 2px 0; }
    .dig-ficha-alertas--alta { background: #fff3e0; border-color: #ef6c00; }
    .dig-ficha-alertas--alta strong { color: #bf360c; }
    .dig-alerta-certificado {
      margin: 0 0 8px; padding: 8px 10px; background: #ffebee; border: 1px solid #e57373;
      border-radius: 4px; font-size: 12px; color: #b71c1c;
    }
    .dig-alerta-certificado strong { display: block; margin-bottom: 4px; }
    .dig-alerta-certificado p { margin: 0; line-height: 1.35; }
    .dig-alerta-certificado code { font-size: 12px; background: #fff; padding: 1px 4px; border-radius: 3px; }
    .dashboard-alertas-experto { margin: 0; }
    #avisosExpertoPanel .dashboard-alertas-experto { margin: 0; }
    #avisosExpertoPanel .dev-alerta-experto { margin: 0; }
    .dev-alerta-experto {
      display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
      background: #f5f7fb; border: 1px solid #d7dde8; border-radius: 10px; padding: 12px 14px;
    }
    .dev-alerta-experto--urgent { background: #fff3e0; border-color: #ffcc80; }
    .dev-alerta-experto .badge { margin-right: 6px; }
    .dev-alerta-equipo { margin: 8px 0 0; font-size: 12px; color: #6d4c41; }
    .dev-alerta-experto-dropdown {
      background: #fff3e0; border: 1px solid #ffcc80; border-radius: 10px;
      margin: 0 0 12px; overflow: hidden;
    }
    .dev-alerta-experto-dropdown:not(.dev-alerta-experto-dropdown--urgent) {
      background: #f5f7fb; border-color: #d7dde8;
    }
    .dev-alerta-experto-dropdown > summary {
      list-style: none; cursor: pointer; user-select: none;
      display: flex; align-items: center; justify-content: space-between; gap: 10px;
      padding: 10px 14px; font-weight: 700; font-size: 13px; color: #5d4037;
    }
    .dev-alerta-experto-dropdown > summary::-webkit-details-marker { display: none; }
    .dev-alerta-experto-dropdown > summary::after {
      content: '▾'; font-weight: 400; color: #8d6e63; transition: transform .15s ease;
    }
    .dev-alerta-experto-dropdown[open] > summary::after { transform: rotate(180deg); }
    .dev-alerta-exp-title { flex: 1; }
    .dev-alerta-experto-dropdown .nav-calidad-badge { margin-left: 0; }
    .dev-alerta-experto-body { padding: 0 14px 12px; border-top: 1px solid rgba(0,0,0,.06); }
    .nav-calidad-badge {
      display: inline-flex; align-items: center; justify-content: center;
      min-width: 18px; height: 18px; margin-left: 8px; padding: 0 5px;
      border-radius: 9px; background: #e65100; color: #fff;
      font-size: 11px; font-weight: 700; line-height: 1;
    }
    /* Nunca badge en el menú lateral CALIDAD */
    .nav-group[data-group="calidad"] > .nav-group-label > .nav-calidad-badge { display: none !important; }
    .insp-dia-nombre { margin-right: 6px; }
    .insp-alertas {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      vertical-align: middle;
      margin-left: 2px;
    }
    .insp-alerta-pill {
      display: inline-flex;
      align-items: center;
      gap: 2px;
      border: 1px solid #ffcc80;
      background: #fff3e0;
      color: #e65100;
      border-radius: 999px;
      padding: 1px 6px 1px 5px;
      font-size: 11px;
      font-weight: 700;
      line-height: 1.3;
      cursor: pointer;
    }
    .insp-alerta-pill--corr {
      border-color: #90caf9;
      background: #e3f2fd;
      color: #1565c0;
    }
    .insp-alerta-pill--prop {
      border-color: #ffcc80;
      background: #fff3e0;
      color: #e65100;
    }
    .insp-alerta-pill--foto-pend {
      border-color: #ffe082;
      background: #fffde7;
      color: #f9a825;
    }
    .insp-alerta-pill--foto-prop {
      border-color: #ffab91;
      background: #fbe9e7;
      color: #e64a19;
    }
    .insp-alerta-pill--foto-corr {
      border-color: #90caf9;
      background: #e3f2fd;
      color: #1565c0;
    }
    .insp-alerta-pill--foto-rech {
      border-color: #ef9a9a;
      background: #ffebee;
      color: #c62828;
    }
    .insp-alerta-pill--dev-pdf {
      border-color: #ef9a9a;
      background: #ffebee;
      color: #b71c1c;
    }
    .insp-alerta-pill--jornada {
      border-color: #ce93d8;
      background: #f3e5f5;
      color: #6a1b9a;
    }
    .insp-alerta-pill--sol {
      border-color: #a5d6a7;
      background: #e8f5e9;
      color: #2e7d32;
    }
    .insp-alerta-pill--jor {
      border-color: #ce93d8;
      background: #f3e5f5;
      color: #6a1b9a;
    }
    .insp-alerta-pill:hover { filter: brightness(0.97); }
    .insp-alerta-n { font-variant-numeric: tabular-nums; }
    .dashboard-sol-sin-insp {
      margin: 0 0 12px;
      padding: 10px 12px;
      border: 1px solid #a5d6a7;
      background: #e8f5e9;
    }
    .dashboard-sol-sin-insp-inner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      font-size: 13px;
      color: #1b5e20;
    }
    .admin-dialog-overlay {
      position: fixed;
      inset: 0;
      z-index: 10040;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(33, 37, 41, 0.55);
    }
    .admin-dialog-overlay.open { display: flex; }
    .admin-dialog {
      width: min(960px, 96vw);
      max-height: 88vh;
      overflow: auto;
      background: #fff;
      border-radius: 10px;
      box-shadow: 0 16px 48px rgba(0,0,0,.28);
      padding: 14px 16px 16px;
    }
    .admin-dialog-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }
    .admin-dialog-pin { padding: 8px 10px; background: #f8fafc; border-radius: 6px; }
    .chip-cuenta-pdf {
      display: inline-block; margin-left: 4px; padding: 1px 6px; font-size: 10px; font-weight: 600;
      border-radius: 3px; background: #e3f2fd; color: #1565c0; vertical-align: middle; white-space: nowrap;
    }
    #section-digitacion #subdig-cola .panel,
    #section-digitacion #subdig-mias .panel { padding: 12px; margin-bottom: 10px; }
    #section-digitacion .tabs { margin-bottom: 8px; }
    .val-informe-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0; }
    @media (max-width: 960px) { .val-informe-split { grid-template-columns: 1fr; } }
    .val-doc-col { border: 2px solid var(--border,#d8dee6); border-radius: 8px; padding: 10px 12px; background: #fafbfd; }
    .val-doc-col--condiciones { border-top: 4px solid #1565c0; }
    .val-doc-col--informe { border-top: 4px solid var(--primary,#db2418); }
    .val-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
    .val-doc-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
    .val-doc-sub { font-size: 11px; color: #666; margin: -4px 0 8px; line-height: 1.3; }
    .val-doc-visor iframe { height: 260px !important; }
    .val-decision-box { background: #fff; border: 1px solid var(--border,#d8dee6); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
    .val-obs-compact { width: 100%; min-height: 52px; margin: 4px 0 6px; padding: 6px 8px; font-size: 12px; resize: vertical; }
    .val-obs-solo-lectura { background: #f8fafc; color: #1e293b; border-color: #cbd5e1; cursor: default; }
    .val-hint { font-size: 12px; margin: 4px 0 8px; line-height: 1.45; }
    .val-acciones-compact { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
    .val-acciones-compact button { font-size: 12px; padding: 6px 10px; }
    .val-hint { font-size: 11px; margin: 4px 0 0; line-height: 1.3; }
    .val-resumen-ejes { font-size: 12px; margin: 0 0 8px; padding: 6px 10px; background: #f5f5f5; border-radius: 6px; }
    .badge-espera {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: 999px;
      white-space: nowrap;
      border: none;
      line-height: 1.25;
      min-width: 0;
      vertical-align: middle;
    }
    .badge-espera::before { display: none; }
    .badge-espera-ok {
      background: #16a34a;
      color: #fff;
    }
    .badge-espera-warn {
      background: #eab308;
      color: #422006;
    }
    .badge-espera-crit {
      background: #dc2626;
      color: #fff;
    }
    .badge-espera-done {
      background: #90a4ae;
      color: #fff;
      font-weight: 600;
    }
    .espera-leyenda {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 10px;
      font-weight: 500;
      color: var(--muted);
      white-space: nowrap;
      line-height: 1;
    }
    .espera-leyenda-item {
      display: inline-flex;
      align-items: center;
      gap: 3px;
    }
    .espera-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      flex-shrink: 0;
    }
    .espera-dot.ok { background: #22c55e; }
    .espera-dot.warn { background: #eab308; }
    .espera-dot.crit { background: #ef4444; }
    #detailInforme .split iframe { height: 320px !important; }
    #detailInforme label { font-size: 12px; margin-top: 4px; }
    /* Validación fotos: 50% informe | 50% foto, altura útil del viewport */
    #detailPanel.panel {
      display: flex;
      flex-direction: column;
      min-height: calc(100dvh - 150px);
    }
    #detailPanel .detail-panel-meta { flex-shrink: 0; padding: 4px 0; }
    #detailPanel .detail-split {
      flex: 1 1 auto;
      height: calc(100dvh - 210px);
      min-height: 420px;
      align-items: stretch;
      overflow: hidden;
      gap: 8px;
    }
    #detailPanel .detail-split-col {
      display: flex;
      flex-direction: column;
      min-height: 0;
      height: 100%;
      overflow: hidden;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 10px;
      background: #fafafa;
    }
    #detailPanel .detail-split-col > h3 {
      flex-shrink: 0;
      margin: 0 0 2px;
      font-size: 0.9rem;
    }
    #detailPanel .detail-split-col > .muted { flex-shrink: 0; margin: 0 0 6px; }
    /* Más espacio a la foto al ampliar: ocultar texto de ayuda */
    #detailPanel .detail-split-col:has(.showing-foto) > .muted { display: none; }
    #detailPanel .detail-split-body {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding-right: 2px;
    }
    #detailPanel .detail-informe-visor {
      display: flex;
      flex-direction: column;
      height: 100%;
      min-height: 0;
      flex: 1 1 auto;
    }
    #detailPanel .detail-split-col:has(#informeVisorFotos) .detail-split-body {
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    #detailPanel .detail-informe-visor iframe {
      flex: 1 1 auto;
      width: 100%;
      height: 100%;
      min-height: 360px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fff;
    }
    #detailPanel .detail-informe-visor .detail-informe-fallback {
      padding: 12px 4px;
      overflow-y: auto;
    }
    #detailPanel .foto-split-body {
      display: flex;
      flex-direction: column;
      position: relative;
      height: 100%;
      min-height: 0;
    }
    #detailPanel .foto-panel-viewer {
      display: none;
      flex-direction: column;
      flex: 1 1 auto;
      min-height: 0;
      height: 100%;
      gap: 6px;
    }
    #detailPanel .foto-split-body.showing-foto .foto-panel-viewer {
      display: flex;
    }
    #detailPanel .foto-split-body.showing-foto .fotos {
      display: none;
    }
    #detailPanel .foto-panel-viewer-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      flex-shrink: 0;
    }
    #detailPanel .foto-panel-viewer-bar span {
      font-size: 12px;
      font-weight: 600;
      color: #414247;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    #detailPanel .foto-panel-viewer-bar button {
      flex-shrink: 0;
      font-size: 12px;
      padding: 4px 10px;
    }
    #detailPanel .foto-panel-viewer-img-wrap {
      flex: 1 1 auto;
      min-height: 420px;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      background: #111;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 4px;
    }
    #detailPanel .foto-panel-nav {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      z-index: 2;
      width: 40px;
      height: 40px;
      padding: 0;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.92);
      color: #1f2937;
      font-size: 22px;
      line-height: 1;
      cursor: pointer;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    }
    #detailPanel .foto-panel-nav.prev { left: 8px; }
    #detailPanel .foto-panel-nav.next { right: 8px; }
    #detailPanel .foto-panel-nav:hover:not(:disabled) {
      background: #fff;
    }
    #detailPanel .foto-panel-nav:disabled {
      opacity: 0.35;
      cursor: not-allowed;
    }
    #detailPanel .foto-panel-viewer-img-wrap img {
      width: 100%;
      height: 100%;
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
      object-position: center;
      border-radius: 2px;
    }
    #detailPanel .foto-panel-revision {
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
      padding: 2px 0 0;
    }
    #detailPanel .foto-panel-revision[hidden] {
      display: none;
    }
    #detailPanel .foto-panel-revision-row {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    #detailPanel .foto-panel-revision label {
      font-size: 12px;
      font-weight: 600;
      color: #414247;
      margin-bottom: 0;
    }
    #detailPanel .foto-panel-revision .btn-foto-rev {
      font-size: 13px;
      padding: 6px 12px;
    }
    #detailPanel .foto-panel-obs {
      width: 100%;
      min-height: 40px;
      max-height: 64px;
      font-size: 13px;
      padding: 6px 8px;
      resize: vertical;
    }
    #detailPanel .detail-panel-footer {
      flex-shrink: 0;
      margin-top: 6px;
      padding-top: 6px;
      border-top: 1px solid var(--border);
      background: var(--card);
    }
    #detailPanel .detail-panel-footer .acciones { margin-top: 0; }
    #detailPanel .rechazo-informe-fotos {
      margin-top: 8px;
      padding: 8px 10px;
      border: 1px solid #ffcdd2;
      border-radius: 6px;
      background: #fff8f8;
    }
    #detailPanel .rechazo-informe-fotos textarea { min-height: 60px; }
    #detailPanel .rechazo-informe-fotos .acciones { margin-top: 6px; }
    @media (max-width: 900px) {
      #detailPanel.panel { min-height: 0; }
      #detailPanel .detail-split {
        height: auto;
        min-height: 0;
        overflow: visible;
      }
      #detailPanel .detail-split-col {
        height: auto;
        max-height: none;
      }
      #detailPanel .foto-panel-viewer-img-wrap {
        min-height: 55vh;
      }
      #detailPanel .detail-informe-visor iframe {
        min-height: 50vh;
      }
    }
    .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    @media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
    .dato-grid { display: grid; grid-template-columns: 140px 1fr; gap: 6px 10px; font-size: 13px; }
    .dato-grid dt { font-weight: 600; color: #444; }
    /* Desplegables: un clic selecciona/copia; doble clic abre o cierra */
    details > summary {
      user-select: text !important;
      -webkit-user-select: text !important;
      cursor: default !important;
    }
    .dato-seccion { border: 1px solid var(--border); border-radius: 8px; padding: 0; margin-bottom: 10px; background: #fafafa; }
    .dato-seccion > summary {
      font-weight: 600;
      font-size: 13px;
      padding: 8px 10px;
      list-style: none;
    }
    .dato-seccion > summary::-webkit-details-marker { display: none; }
    .dato-seccion > summary::before { content: '▸ '; color: #888; }
    .dato-seccion[open] > summary::before { content: '▾ '; }
    .mapa-visitas-leyenda {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 16px;
      align-items: center;
    }
    .mapa-visitas-leyenda .leyenda-item {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .mapa-visitas-leyenda .leyenda-dot {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      border: 2px solid #fff;
      box-shadow: 0 0 0 1px rgba(0,0,0,.2);
      flex-shrink: 0;
    }
    .mapa-visitas-marker span {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      border: 2px solid #fff;
      box-shadow: 0 1px 4px rgba(0,0,0,.35);
    }
    #seguimientoMapa.leaflet-container,
    #consultaMapa.leaflet-container,
    .mapa-visitas.leaflet-container {
      background: #f4f6f8;
      min-height: 320px;
    }
    #seguimientoMapa:not(.empty),
    #consultaMapa:not(.empty) {
      display: block;
      background: #fff;
    }
    .seguimiento-filtros {
      flex: none;
      width: 100%;
      min-width: 0;
      margin: 0;
      border: none;
      padding: 0;
    }
    .seguimiento-filtros > summary {
      list-style: none;
      cursor: pointer;
      user-select: none;
      display: flex;
      align-items: baseline;
      gap: 8px;
      flex-wrap: wrap;
    }
    .seguimiento-filtros > summary::-webkit-details-marker { display: none; }
    .seguimiento-filtros > summary::marker { content: ''; }
    .seguimiento-filtros > summary::before {
      content: '▸';
      color: #888;
      font-size: 12px;
    }
    .seguimiento-filtros[open] > summary::before { content: '▾'; }
    .seguimiento-filtros-title {
      margin: 0;
      font-size: 1rem;
      font-weight: 700;
    }
    .seguimiento-filtros-hint { font-size: 12px; }
    .seguimiento-filtros-body { margin-top: 12px; }
    .seguimiento-head {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      width: 100%;
    }
    .seguimiento-acciones {
      margin-top: 12px;
      width: 100%;
    }
    .seguimiento-visual-totales {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 10px;
      margin-bottom: 14px;
    }
    .seguimiento-visual-totales .kpi {
      border: 1px solid #e0e0e0;
      border-radius: 8px;
      padding: 10px 12px;
      background: #fafafa;
    }
    .seguimiento-visual-totales .kpi strong {
      display: block;
      font-size: 1.35rem;
      line-height: 1.2;
    }
    .seguimiento-visual-totales .kpi span {
      font-size: 12px;
      color: #666;
    }
    .seguimiento-visual-totales .kpi small {
      display: block;
      font-size: 11px;
      margin-top: 4px;
      color: #888;
    }
    .seguimiento-visual-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 12px;
    }
    .seguimiento-visual-card {
      border: 1px solid #e0e0e0;
      border-radius: 10px;
      padding: 12px;
      background: #fff;
    }
    .seguimiento-visual-card h3 {
      margin: 0 0 4px;
      font-size: 0.95rem;
    }
    .seguimiento-visual-card .codigo {
      font-size: 12px;
      color: #666;
      margin-bottom: 10px;
    }
    .seguimiento-visual-card .metricas {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      text-align: center;
    }
    .seguimiento-visual-card .metrica {
      border-radius: 6px;
      padding: 8px 4px;
      background: #f5f5f5;
    }
    .seguimiento-visual-card .metrica strong {
      display: block;
      font-size: 1.2rem;
    }
    .seguimiento-visual-card .metrica span {
      font-size: 11px;
      color: #555;
    }
    .seguimiento-visual-card .metrica.efectiva { background: #e8f5e9; }
    .seguimiento-visual-card .metrica.no-efectiva { background: #efebe9; }
    .seguimiento-visual-card .metrica.pendiente { background: #fff3e0; }
    .seguimiento-visual-card.sin-visitas { opacity: 0.72; }
    .seguimiento-visual-card .detalle {
      margin-top: 8px;
      font-size: 11px;
      color: #666;
    }
    .fecha-filtros-hint {
      grid-column: 1 / -1;
      margin: 4px 0 0;
      font-size: 12px;
    }
    .mapa-visitas-panel {
      margin: 12px 0 0;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fff;
      padding: 0;
    }
    .mapa-visitas-panel > summary {
      list-style: none;
      cursor: pointer;
      user-select: none;
      display: flex;
      align-items: baseline;
      gap: 8px;
      flex-wrap: wrap;
      padding: 10px 12px;
    }
    .mapa-visitas-panel > summary::-webkit-details-marker { display: none; }
    .mapa-visitas-panel > summary::marker { content: ''; }
    .mapa-visitas-panel > summary::before {
      content: '▸';
      color: #888;
      font-size: 12px;
    }
    .mapa-visitas-panel[open] > summary::before { content: '▾'; }
    .mapa-visitas-panel-title {
      margin: 0;
      font-size: .95rem;
      font-weight: 700;
    }
    .mapa-visitas-panel-hint { font-size: 12px; }
    .mapa-visitas-panel-body { padding: 0 12px 12px; }
    .panel-desplegable {
      margin: 0;
      border: none;
      padding: 0;
      background: transparent;
    }
    .panel-desplegable > summary {
      list-style: none;
      cursor: pointer;
      user-select: none;
      display: flex;
      align-items: baseline;
      gap: 8px;
      flex-wrap: wrap;
      padding: 0 0 8px;
    }
    .panel-desplegable > summary::-webkit-details-marker { display: none; }
    .panel-desplegable > summary::marker { content: ''; }
    .panel-desplegable > summary::before {
      content: '▸';
      color: #888;
      font-size: 12px;
      flex-shrink: 0;
    }
    .panel-desplegable[open] > summary::before { content: '▾'; }
    tr.prod-detalle-grupo td {
      background: #f3f4f6;
      cursor: default;
      user-select: text;
      -webkit-user-select: text;
      font-size: 13px;
      padding: 10px 8px;
    }
    tr.prod-detalle-grupo:hover td { background: #e9ecef; }
    tr.prod-detalle-grupo.open td { background: #fde8e8; }
    tr.prod-detalle-grupo .prod-chevron {
      display: inline-block;
      width: 1.1em;
      color: #888;
      margin-right: 4px;
    }
    tr.prod-detalle-item td { font-size: 12px; }
    tr.prod-detalle-item.hidden { display: none; }
    #section-productividad textarea#productividadTiposRevision {
      pointer-events: auto !important;
      user-select: text !important;
      -webkit-user-select: text !important;
      background: #fff !important;
      color: #212121 !important;
      cursor: text !important;
      min-height: 180px;
      resize: vertical;
    }
    .panel-desplegable-title {
      margin: 0;
      font-size: 1rem;
      font-weight: 700;
    }
    .panel-desplegable-hint {
      font-size: 12px;
      flex: 1 1 180px;
      min-width: 0;
    }
    .panel-desplegable-body { margin-top: 4px; }
    .ficha-seccion-desplegable {
      margin: 12px 0;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fff;
      padding: 0;
    }
    .ficha-seccion-desplegable > summary {
      list-style: none;
      cursor: pointer;
      user-select: none;
      display: flex;
      align-items: baseline;
      gap: 8px;
      flex-wrap: wrap;
      padding: 10px 12px;
      font-weight: 700;
      font-size: .95rem;
    }
    .ficha-seccion-desplegable > summary::-webkit-details-marker { display: none; }
    .ficha-seccion-desplegable > summary::marker { content: ''; }
    .ficha-seccion-desplegable > summary::before {
      content: '▸';
      color: #888;
      font-size: 12px;
    }
    .ficha-seccion-desplegable[open] > summary::before { content: '▾'; }
    .ficha-seccion-desplegable-body { padding: 0 12px 12px; }
    .dato-seccion-body { padding: 0 10px 10px; }
    #panelFichaConsulta .split {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: flex-start;
    }
    #panelFichaConsulta .split > .ficha-seccion-desplegable,
    #panelFichaConsulta .split > div {
      flex: 1 1 280px;
    }
    .dato-lista { margin: 4px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.45; }
    .dato-lista li { margin-bottom: 4px; }
    .consulta-row { cursor: default; }
    .consulta-row:hover { background: #fdecea; }
    .consulta-row.selected { background: var(--primary-light); }
    .btn-visita-id {
      background: none;
      border: none;
      padding: 0;
      color: var(--hub-link);
      font-weight: 600;
      cursor: pointer;
      font-family: ui-monospace, monospace;
      font-size: 12px;
    }
    .btn-visita-id:hover { text-decoration: underline; }
    .visita-id-wrap {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      max-width: 100%;
    }
    .btn-visita-id-nueva {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 4px;
      border: 1px solid #d7dde5;
      background: #f7f9fb;
      color: #4a5568;
      font-size: 11px;
      line-height: 1;
      text-decoration: none;
      flex: 0 0 auto;
    }
    .btn-visita-id-nueva:hover {
      background: #eef3f8;
      border-color: #b8c4d4;
      color: var(--hub-link, #c0392b);
    }
    .entregas-cliente-panel {
      margin: 6px 0;
      border: 1px solid var(--border, #d8dee6);
      border-radius: 8px;
      background: #fafbfc;
      padding: 0 10px 2px;
    }
    .entregas-cliente-panel > summary {
      cursor: pointer;
      padding: 8px 4px;
      list-style: none;
      font-size: 13px;
    }
    .entregas-cliente-panel > summary::-webkit-details-marker { display: none; }
    .entregas-cliente-panel > summary::before {
      content: '▶';
      display: inline-block;
      width: 1.1em;
      font-size: 10px;
      color: #666;
      margin-right: 4px;
    }
    .entregas-cliente-panel[open] > summary::before { content: '▾'; }
    .visita-id-plain {
      font-family: ui-monospace, monospace;
      font-size: 12px;
      font-weight: 600;
      color: #333;
    }
    th.th-sortable {
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
    }
    th.th-sortable:hover { color: var(--hub-link, #b71c1c); background: #fdecea; }
    th.th-sortable.sort-asc::after { content: ' ▲'; font-size: 10px; opacity: 0.75; }
    th.th-sortable.sort-desc::after { content: ' ▼'; font-size: 10px; opacity: 0.75; }
    .ficha-trazabilidad { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
    .ficha-trazabilidad li { position: relative; padding: 0 0 14px 16px; font-size: 13px; }
    .ficha-trazabilidad li::before { content: ''; position: absolute; left: -5px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
    .ficha-trazabilidad .traza-fecha { font-size: 11px; color: #666; margin-top: 2px; }
    .ficha-ubicacion-mapa { height: 220px; border-radius: 8px; border: 1px solid var(--border); margin-top: 8px; }
    .alerta-ubicacion { background: #fff3e0; border: 1px solid #ffcc80; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }
    .aviso-no-efectiva {
      background: #fce4ec;
      border: 1px solid #f48fb1;
      border-left: 4px solid #c62828;
      border-radius: 8px;
      padding: 12px 14px;
      font-size: 13px;
      margin: 12px 0;
    }
    .aviso-no-efectiva strong { color: #b71c1c; display: block; margin-bottom: 2px; }
    .aviso-no-efectiva .dato-grid { margin-top: 8px; }
    .consulta-ne-resumen { display: block; font-size: 11px; color: #6d4c41; margin-top: 4px; line-height: 1.35; max-width: 220px; }
    .alertas { list-style: none; padding: 0; margin: 0; }
    .alertas li { padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
    .alerta-critica { background: #ffebee; border-left: 4px solid var(--err); }
    .alerta-advertencia { background: #fff3e0; border-left: 4px solid var(--warn); }
    .alerta-info { background: #e3f2fd; border-left: 4px solid #1565c0; }
    .fotos { display: flex; flex-wrap: wrap; gap: 10px; }
    .fotos figure { margin: 0; width: 160px; }
    .fotos img { width: 160px; height: 120px; object-fit: cover; border-radius: 8px; border: 2px solid var(--border); }
    .fotos button.foto-thumb {
      display: block;
      padding: 0;
      border: none;
      background: transparent;
      cursor: zoom-in;
      width: 160px;
    }
    .fotos button.foto-thumb img { display: block; pointer-events: none; }
    .fotos figure.foto-revision { position: relative; }
    .foto-lightbox {
      position: fixed;
      inset: 0;
      z-index: 10050;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
      background: rgba(47, 48, 51, 0.88);
    }
    .foto-lightbox.open { display: flex; }
    .foto-lightbox-inner {
      position: relative;
      max-width: min(960px, 96vw);
      max-height: 92vh;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
    }
    .foto-lightbox-inner img {
      display: block;
      max-width: 100%;
      max-height: calc(92vh - 48px);
      width: auto;
      height: auto;
      object-fit: contain;
      border-radius: 10px;
      background: #111;
      box-shadow: 0 12px 40px rgba(0,0,0,.45);
    }
    .foto-lightbox-caption {
      color: #fff;
      font-size: 13px;
      text-align: center;
      font-weight: 600;
    }
    .foto-lightbox-close {
      position: absolute;
      top: -8px;
      right: -8px;
      width: 36px;
      height: 36px;
      border: none;
      border-radius: 50%;
      background: #fff;
      color: #414247;
      font-size: 20px;
      font-weight: 700;
      cursor: pointer;
      line-height: 1;
      box-shadow: 0 2px 10px rgba(0,0,0,.25);
    }
    .foto-lightbox-close:hover { background: #fdecea; color: #db2418; }
    .fotos figure.foto-revision.cumple img { border-color: #2e7d32; box-shadow: 0 0 0 2px #a5d6a7; }
    .fotos figure.foto-revision.no_cumple img { border-color: #c62828; box-shadow: 0 0 0 2px #ef9a9a; }
    .fotos figcaption { font-size: 11px; margin-top: 4px; }
    .foto-revision-badge {
      display: inline-block;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.02em;
      padding: 2px 7px;
      border-radius: 999px;
      margin-bottom: 4px;
      border: 1px solid transparent;
    }
    .foto-revision-badge.pendiente { background: #eceff1; color: #546e7a; border-color: #cfd8dc; }
    .foto-revision-badge.cumple { background: #e8f5e9; color: #1b5e20; border-color: #a5d6a7; }
    .foto-revision-badge.no-cumple { background: #ffebee; color: #b71c1c; border-color: #ef9a9a; }
    .foto-revision-acciones { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
    .foto-revision-obs { width: 160px; margin-top: 6px; font-size: 11px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; resize: vertical; font-family: inherit; }
    .foto-revision-obs:focus { outline: none; border-color: var(--primary); }
    .fotos figure.foto-faltante {
      background: #fff8e1;
      border: 1px dashed #ffb300;
      border-radius: 8px;
      padding: 6px;
    }
    .foto-faltante-placeholder {
      width: 160px;
      height: 120px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 36px;
      background: #fffde7;
      border-radius: 6px;
      color: #f9a825;
    }
    .btn-foto-rev {
      font-size: 10px;
      padding: 3px 6px;
      border-radius: 6px;
      border: 1px solid var(--border);
      background: #fff;
      cursor: pointer;
    }
    .btn-foto-rev.cumple {
      background: #f1f8e9;
      border-color: #a5d6a7;
      color: #2e7d32;
    }
    .btn-foto-rev.no-cumple {
      background: #fcebee;
      border-color: #ef9a9a;
      color: #c62828;
    }
    .btn-foto-rev.cumple.active { background: #e8f5e9; border-color: #2e7d32; color: #1b5e20; font-weight: 700; box-shadow: inset 0 0 0 1px #2e7d32; }
    .btn-foto-rev.no-cumple.active { background: #ffebee; border-color: #c62828; color: #b71c1c; font-weight: 700; box-shadow: inset 0 0 0 1px #c62828; }
    .acciones {
      display: flex;
      gap: 6px;
      row-gap: 4px;
      flex-wrap: wrap;
      align-items: center;
      margin-top: 6px;
    }
    .acciones > span { flex: 1 1 120px; min-width: 0; font-size: 11px; }
    .acciones .muted { font-size: 11px !important; }
    .editar-acciones-top {
      position: sticky;
      top: 0;
      z-index: 6;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 8px;
      margin: 8px 0;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    }
    .editar-acciones-top .btn-primary-action {
      font-weight: 600;
      min-width: unset;
    }
    .module-help {
      margin-top: 16px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: #fafafa;
      overflow: hidden;
    }
    .module-help summary {
      cursor: pointer;
      padding: 12px 14px;
      font-size: 13px;
      font-weight: 600;
      color: #546e7a;
      list-style: none;
    }
    .module-help summary::-webkit-details-marker { display: none; }
    .module-help summary::before {
      content: '▸ ';
      display: inline-block;
      transition: transform 0.15s ease;
    }
    .module-help[open] summary::before { transform: rotate(90deg); }
    .module-help-body {
      padding: 0 14px 14px;
      font-size: 13px;
      color: #546e7a;
      line-height: 1.45;
    }
    .module-help-body p { margin: 0 0 10px; }
    .module-help-body p:last-child { margin-bottom: 0; }
    .informes-panel { background: #f0f7ff; border: 1px solid #b3d4ff; border-radius: 8px; padding: 12px; }
    .btn-link {
      display: inline;
      padding: 0 2px;
      background: transparent;
      color: #1565c0 !important;
      border: none;
      border-radius: 0;
      text-decoration: underline;
      font-size: 12px;
      font-weight: 600;
    }
    .btn-link:hover { background: transparent; color: #0d47a1 !important; }
    button.btn-link {
      border: none;
      cursor: pointer;
      font: inherit;
      box-shadow: none;
    }
    .ruta-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 0; }
    .ruta-card h3 { margin: 0; font-size: .9rem; }
    .ruta-auto-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 10px;
      margin-top: 8px;
    }
    .geo-rutas-panel {
      border: 1px solid var(--border, #e0e0e0);
      border-radius: 8px;
      background: #fafafa;
    }
    .geo-semaforo {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 88px;
      padding: 3px 10px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.02em;
      border: 1px solid transparent;
      line-height: 1.3;
    }
    .geo-semaforo--verde {
      background: #e8f5e9;
      color: #1b5e20;
      border-color: #a5d6a7;
    }
    .geo-semaforo--amarillo {
      background: #fff8e1;
      color: #e65100;
      border-color: #ffcc80;
    }
    .geo-semaforo--rojo {
      background: #ffebee;
      color: #b71c1c;
      border-color: #ef9a9a;
    }
    .geo-semaforo--gris {
      background: #f5f5f5;
      color: #757575;
      border-color: #e0e0e0;
    }
    .geo-rutas-kpis {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
    }
    .geo-rutas-kpis .geo-kpi {
      border: 1px solid #e8e8e8;
      border-radius: 6px;
      padding: 6px 8px;
      background: #fff;
      text-align: center;
    }
    .geo-rutas-kpis .geo-kpi strong {
      display: block;
      font-size: 1.1rem;
      line-height: 1.2;
    }
    .geo-rutas-kpis .geo-kpi span {
      font-size: 10px;
      color: #666;
    }
    @media (max-width: 520px) {
      .geo-rutas-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    .ruta-card-compact .ruta-card-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
    }
    .ruta-card-stats { font-size: 11px; white-space: nowrap; }
    .ruta-card-compact .ruta-inspector-select { width: 100%; font-size: 12px; margin-bottom: 6px; }
    .ruta-inspector-sugerido { border-color: var(--primary); background: var(--primary-light); }
    .ruta-drop-list-compact {
      margin: 0;
      padding: 4px 0;
      list-style: none;
      min-height: 48px;
      max-height: 320px;
      overflow-y: auto;
    }
    .ruta-drop-empty {
      display: block;
      padding: 12px 8px;
      text-align: center;
      color: #888;
      font-size: 11px;
      border: 1px dashed #ccc;
      border-radius: 6px;
      list-style: none;
    }
    .ruta-visita-item {
      display: flex;
      align-items: flex-start;
      gap: 4px;
      margin-bottom: 4px;
      padding: 5px 6px;
      border: 1px solid #e8e8e8;
      border-radius: 6px;
      background: #fff;
      font-size: 11px;
      line-height: 1.35;
      cursor: grab;
      user-select: none;
    }
    .ruta-visita-item:last-child { margin-bottom: 0; }
    .ruta-visita-meta {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: 4px 6px;
    }
    .ruta-visita-orden { font-weight: 700; color: var(--primary); min-width: 1.2em; }
    .ruta-visita-cuenta { font-size: 11px; }
    .ruta-visita-loc { font-size: 10px; color: #666; }
    .ruta-visita-jornada {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 1.7em;
      padding: 0 4px;
      border-radius: 4px;
      font-size: 9px;
      font-weight: 700;
      letter-spacing: 0.02em;
      line-height: 1.5;
      flex-shrink: 0;
    }
    .ruta-visita-jornada--am {
      background: #fff8e1;
      color: #e65100;
      border: 1px solid #ffcc80;
    }
    .ruta-visita-jornada--pm {
      background: #e8eaf6;
      color: #283593;
      border: 1px solid #9fa8da;
    }
    .ruta-visita-dir {
      display: block;
      width: 100%;
      font-size: 10px;
      color: #555;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .ruta-visita-badges { display: inline-flex; flex-wrap: wrap; gap: 2px; flex-shrink: 0; }
    .ruta-card.ruta-drop-over { outline: 2px dashed var(--primary); background: #f0faf0; }
    .ruta-card-inspector-0 { border-left: 4px solid #2e7d32; }
    .ruta-card-inspector-1 { border-left: 4px solid #1565c0; }
    .ruta-card-inspector-2 { border-left: 4px solid #ef6c00; }
    .ruta-card-inspector-3 { border-left: 4px solid #6a1b9a; }
    .ruta-chip { display: inline-block; background: #fdecea; border-radius: 999px; padding: 2px 8px; font-size: 10px; margin: 2px 4px 2px 0; }
    .ruta-alt-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
    .ruta-alt-tab {
      background: #fff;
      color: #333;
      border: 2px solid var(--border);
      border-radius: 10px;
      padding: 10px 12px;
      min-width: 160px;
      text-align: left;
      cursor: pointer;
    }
    .ruta-alt-tab.active { border-color: var(--primary); background: #fdecea; }
    .ruta-alt-tab .alt-score { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
    .ruta-alt-tab .alt-name { display: block; font-weight: 600; margin-top: 4px; }
    .ruta-alt-tab .alt-meta { display: block; font-size: 11px; color: #666; margin-top: 2px; }
    .ruta-compare-table { width: 100%; margin: 12px 0; font-size: 13px; }
    .ruta-compare-table th { background: #f5f5f5; }
    .ruta-map-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
    .ruta-map-filter {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 12px;
      border: 2px solid var(--border);
      border-radius: 12px;
      background: #fff;
      color: #202124;
      cursor: pointer;
      font-size: 13px;
      text-align: left;
      line-height: 1.25;
      max-width: 220px;
    }
    .ruta-map-filter.active { border-color: var(--primary); background: #fdecea; color: var(--primary); font-weight: 600; }
    .ruta-map-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
    .ruta-map-filter-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
    .ruta-map-filter-title { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ruta-map-filter-meta { font-size: 11px; font-weight: 500; color: #5f6368; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ruta-map-filter.active .ruta-map-filter-meta { color: #a33; }
    .ruta-card-selected { box-shadow: 0 0 0 2px var(--primary); background: #f8fcf8; }
    .ruta-card-dimmed { opacity: 0.45; }
    .ruta-card-clickable { cursor: pointer; transition: opacity 0.15s ease, box-shadow 0.15s ease; }
    .ruta-card-pendientes { border-left: 4px solid #b45309; background: #fff8e1; margin-bottom: 10px; }
    .ruta-visita-item.ruta-visita-dragging { opacity: 0.45; cursor: grabbing; }
    .ruta-drop-list.ruta-drop-over,
    .ruta-card.ruta-drop-over .ruta-drop-list-compact { outline: 2px dashed var(--primary); background: #f0faf0; border-radius: 8px; }
    .ruta-drag-handle { color: #888; cursor: grab; flex-shrink: 0; line-height: 1; }
    .ruta-visita-sin-geo { background: #fffde7; border-radius: 6px; padding: 4px 6px; margin-left: -6px; }
    .ruta-localidad-editor { margin-top: 6px; padding: 8px; background: #fff3e0; border-radius: 6px; border: 1px solid #ffcc80; }
    .ruta-localidad-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
    .ruta-localidad-row select { max-width: 160px; font-size: 12px; }
    .ruta-localidad-row button { font-size: 12px; padding: 4px 8px; }
    .preview-localidad-edit { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
    .preview-localidad-edit select { font-size: 12px; width: 100%; }
    .preview-row-coords-invalida { background: #ffebee; }
    .ruta-map-marker { background: transparent; border: none; }
    .ruta-map-marker-dragging span { cursor: grabbing !important; opacity: 0.85; transform: scale(1.08); }
    .map-mover-ruta-box select, .map-mover-ruta-box button { box-sizing: border-box; }
    .preview-row-manual { background: #fff8e1; }
    .preview-row-error { background: #fff5f5; }
    .preview-geo-ok { color: var(--ok); font-weight: 600; }
    .preview-geo-pendiente { color: #b45309; font-weight: 600; }
    .workflow-steps { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 8px; counter-reset: paso; }
    .workflow-step {
      flex: 1 1 140px;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px 12px;
      font-size: 12px;
      line-height: 1.35;
    }
    .workflow-step strong { display: block; font-size: 13px; margin-bottom: 4px; color: var(--primary); }
    .panel-tip {
      background: linear-gradient(135deg, #fafafa 0%, #fdecea 100%);
      border-left: 4px solid var(--primary);
    }
    .quick-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
    .quick-nav button {
      background: #fff;
      color: var(--primary);
      border: 1px solid var(--border);
      font-size: 12px;
      padding: 8px 12px;
    }
    .quick-nav button:hover { background: #fdecea; }
    input.address-upper, textarea.address-upper { text-transform: uppercase; }
    td.col-direccion, .direccion-text { text-transform: uppercase; font-size: 13px; letter-spacing: .02em; }
    .badge-sin-asignar { background: #fff3e0; color: #e65100; }
    .badge-visita-creada { background: #f3e5f5; color: #6a1b9a; }
    .badge-visita-asignada { background: #e3f2fd; color: #1565c0; }
    .badge-visita-curso { background: #fff8e1; color: #f57f17; }
    .badge-visita-no-efectiva { background: #efebe9; color: #6d4c41; }
    .badge-visita-final { background: #e8f5e9; color: #2e7d32; }
    .badge-visita-final-pendiente { background: #fff3e0; color: #ef6c00; }
    .badge-visita-sync { background: #e0f7fa; color: #006064; }
    .badge-resultado-conforme { background: #e8f5e9; color: #2e7d32; }
    .badge-resultado-no-conforme { background: #ffebee; color: #c62828; }
    .badge-resultado-criticos { background: #ffebee; color: #b71c1c; }
    .badge-resultado-no-criticos { background: #fff3e0; color: #e65100; }
    .badge-ciclo { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; max-width: 280px; }
    .filtros-despacho { align-items: end; }
    .section-actions-bar { display: flex; flex-wrap: wrap; gap: 8px; row-gap: 10px; align-items: center; }
    .btn-link.secondary-link { background: transparent; color: #546e7a !important; }
    .import-ok-banner {
      background: #fdecea;
      border: 1px solid #a5d6a7;
      border-radius: 8px;
      padding: 10px 12px;
      margin-top: 10px;
      font-size: 13px;
    }
    .form-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
    .form-section:first-of-type { margin-top: 12px; padding-top: 0; border-top: none; }
    .form-section-title {
      margin: 0 0 12px;
      font-size: .9rem;
      color: var(--primary);
      font-weight: 700;
    }
    .form-section-hint { margin: 0 0 10px; font-size: 12px; }
    .flujo-card {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-top: 12px;
    }
    @media (max-width: 700px) { .flujo-card { grid-template-columns: 1fr; } }
    .flujo-card-item {
      background: #f8faf8;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px;
      font-size: 13px;
    }
    .flujo-card-item strong { display: block; margin-bottom: 6px; color: var(--primary); }
    .module-cards {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
    }
    @media (max-width: 1100px) {
      .module-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    @media (max-width: 560px) {
      .module-cards { grid-template-columns: 1fr; }
    }
    .module-card-wrap { min-width: 0; position: relative; }
    .module-subcards--full {
      grid-column: 1 / -1;
    }
    .module-card {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 12px 12px 10px;
      cursor: pointer;
      text-align: left;
      display: flex;
      flex-direction: column;
      width: 100%;
      min-height: 0;
      transition: box-shadow .2s ease, border-color .2s ease;
      font: inherit;
      color: inherit;
      position: relative;
    }
    .module-card:hover {
      box-shadow: 0 1px 2px rgba(60,64,67,.2), 0 2px 6px rgba(60,64,67,.12);
      border-color: #bdc1c6;
    }
    .module-card-icon {
      width: 40px;
      height: 40px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      margin-bottom: 8px;
      flex-shrink: 0;
    }
    .module-card-title {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: #202124;
      margin-bottom: 2px;
      line-height: 1.25;
    }
    .module-card-vendor {
      display: block;
      font-size: 11px;
      color: #5f6368;
    }
    .module-card-desc { display: none; }
    .module-card-chevron {
      position: absolute;
      top: 10px;
      right: 10px;
      font-size: 12px;
      color: #80868b;
      transition: transform .15s ease;
    }
    .module-card-wrap--open .module-card-chevron { transform: rotate(180deg); }
    .module-card-wrap--open .module-card {
      border-color: #a8dab5;
      background: #f8fbf8;
    }
    .module-subcards {
      margin-top: 8px;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fafafa;
    }
    .module-subgroup + .module-subgroup { margin-top: 10px; }
    .module-subgroup-title {
      margin: 0 0 6px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .04em;
      color: #80868b;
    }
    .module-subcards-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .module-subcard {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 999px;
      padding: 5px 12px;
      font-size: 12px;
      font-weight: 500;
      color: #3c4043;
      cursor: pointer;
    }
    .module-subcard:hover {
      border-color: var(--primary);
      color: var(--primary);
      background: var(--primary-light);
    }
    .panel-compact { padding: 6px 8px; margin-bottom: 0; }
    .panel-compact h2 { font-size: .8rem !important; margin: 0 0 4px !important; }
    .section-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      flex-wrap: wrap;
      margin-bottom: 4px;
    }
    .section-toolbar h2 {
      margin: 0;
      font-size: 0.85rem;
      font-weight: 700;
      line-height: 1.2;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }
    .section-toolbar .acciones {
      margin: 0;
      flex: 0 1 auto;
      align-items: center;
    }
    .section-toolbar .muted { font-size: 10px !important; }
    .equipo-dia-label {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      margin: 0;
      font-size: 11px;
      font-weight: 600;
      white-space: nowrap;
    }
    .equipo-dia-label input[type="date"] {
      font: inherit;
      font-weight: 500;
      padding: 2px 4px;
      border: 1px solid var(--border);
      border-radius: 4px;
      background: #fff;
    }
    .form-row {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      align-items: flex-end;
      margin: 2px 0 4px;
    }
    .form-row > div {
      min-width: 0;
      display: flex;
      flex-direction: column;
    }
    .form-row-field { flex: 1 1 160px; max-width: 240px; }
    .form-row-field select,
    .form-row-field input { width: 100%; }
    .form-row label { margin-bottom: 1px; font-size: 10px; }
    .form-row input[type="date"],
    .form-row input[type="text"],
    .form-row select { min-width: 118px; }
    .form-row > button,
    .form-row > .espera-leyenda {
      align-self: center;
      margin-bottom: 1px;
    }
    .form-row > button { flex-shrink: 0; }
    .table-scroll {
      overflow: auto;
      -webkit-overflow-scrolling: touch;
      max-height: calc(100dvh - 195px);
    }
    #section-validacion .table-scroll,
    #section-digitacion .table-scroll,
    #section-consultas #panelResultadosConsulta,
    #section-consultas .panel.table-scroll {
      max-height: calc(100dvh - 185px);
    }
    .col-acciones { width: 1%; white-space: nowrap; text-align: right; }
    .col-acciones .btn-text + .btn-text,
    .col-acciones button + button { margin-left: 4px; }
    #validacionSubmodulos.tabs button { font-size: 11px; padding: 3px 8px; }
    #section-validacion .panel,
    #section-digitacion .panel,
    #section-consultas > .panel { padding: 8px 10px; margin-bottom: 8px; }
    #section-validacion .panel > h2,
    #section-digitacion .panel > h2 { font-size: 0.92rem; margin: 0 0 6px; }
    .informes-panel { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12px; }
    #section-dashboard {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    #section-dashboard > .panel,
    #section-dashboard > details.dashboard-bloque,
    #section-dashboard > .dashboard-secundario {
      margin-bottom: 0;
    }
    #section-dashboard .panel-mini {
      padding: 8px 10px;
    }
    #section-dashboard .panel-mini h2 {
      font-size: .85rem !important;
      margin: 0 0 6px !important;
    }
    details.dashboard-bloque {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 0;
    }
    details.dashboard-bloque > summary {
      list-style: none;
      cursor: pointer;
      user-select: none;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      padding: 8px 12px;
      font-size: .85rem;
      font-weight: 700;
    }
    details.dashboard-bloque > summary::-webkit-details-marker { display: none; }
    details.dashboard-bloque > summary::marker { content: ''; }
    details.dashboard-bloque > summary::before {
      content: '▸';
      color: #888;
      font-size: 11px;
    }
    details.dashboard-bloque[open] > summary::before { content: '▾'; }
    details.dashboard-bloque > .dashboard-bloque-body {
      padding: 0 12px 10px;
    }
    .dashboard-seguimiento {
      flex: 1 1 auto;
      min-height: 0;
      padding: 6px 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--card);
    }
    .dashboard-seguimiento-toolbar {
      align-items: center;
      margin-bottom: 4px;
      gap: 6px;
    }
    .dashboard-seguimiento-toolbar h2 {
      margin: 0;
      font-size: 0.8rem;
    }
    .dashboard-jornada-filtro {
      margin-left: auto;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
    }
    .dashboard-jornada-filtro label {
      margin: 0;
      font-size: 10px;
      white-space: nowrap;
    }
    .dashboard-jornada-filtro select {
      min-width: 100px;
      width: auto;
      padding: 2px 6px;
      font-size: 11px;
    }
    .dashboard-consulta-rapida {
      flex: 0 0 auto;
      padding: 8px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--card);
    }
    .dcr-form {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      margin: 0;
    }
    .dcr-titulo {
      font-size: .95rem;
      font-weight: 700;
      color: var(--brand, #b91c1c);
      margin-right: 6px;
    }
    .dcr-form .consulta-basica-select {
      min-width: 130px;
    }
    .dcr-input {
      flex: 1 1 220px;
      width: auto;
      min-width: 180px;
      max-width: 420px;
      padding: 5px 10px;
      font-size: 13px;
    }
    .dcr-form button {
      padding: 6px 14px;
      font-size: 12px;
    }
    .dcr-msg {
      margin: 4px 0 0;
      font-size: 12px;
      min-height: 0;
    }
    .dcr-msg:empty {
      display: none;
    }
    .dcr-resultados {
      margin-top: 6px;
      max-height: 340px;
      overflow: auto;
    }
    .dcr-resultados table {
      font-size: 12px;
    }
    .dcr-resultados thead th {
      position: sticky;
      top: 0;
      background: var(--card, #fff);
      z-index: 1;
    }
    .dcr-sub {
      font-size: 11px;
    }
    .dashboard-mi-trabajo {
      flex: 1 1 auto;
      padding: 8px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--card);
    }
    .dashboard-mi-trabajo > .section-toolbar {
      margin-bottom: 10px;
    }
    .dashboard-mi-trabajo > .section-toolbar h2 {
      margin: 0;
      font-size: 1.05rem;
      color: var(--brand, #b91c1c);
    }
    .mi-trabajo-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 10px;
    }
    .mi-trabajo-card {
      display: flex;
      flex-direction: column;
      gap: 4px;
      padding: 12px 14px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: #fafafa;
      text-align: left;
      cursor: pointer;
      transition: border-color .15s, box-shadow .15s;
    }
    .mi-trabajo-card:hover,
    .mi-trabajo-card:focus-visible {
      border-color: #b91c1c;
      box-shadow: 0 0 0 2px rgba(185, 28, 28, .12);
      outline: none;
    }
    .mi-trabajo-card .mt-label {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .03em;
      color: #666;
    }
    .mi-trabajo-card .mt-value {
      font-size: 1.55rem;
      font-weight: 700;
      line-height: 1.15;
      color: #1a1a1a;
    }
    .mi-trabajo-card .mt-hint {
      font-size: 11px;
      color: #777;
      line-height: 1.3;
    }
    .mi-trabajo-card.mt-ok .mt-value { color: #15803d; }
    .mi-trabajo-card.mt-warn .mt-value { color: #b45309; }
    .mi-trabajo-card.mt-crit .mt-value { color: #b91c1c; }
    .mi-trabajo-card.mt-empty .mt-value { color: #888; font-size: 1.15rem; }
    .mi-trabajo-bloque {
      margin-bottom: 14px;
    }
    .mi-trabajo-bloque:last-child { margin-bottom: 0; }
    .mi-trabajo-bloque h3 {
      margin: 0 0 8px;
      font-size: 13px;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .dashboard-secundario {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 4px;
      opacity: 0.96;
    }
    .dashboard-secundario details.dashboard-bloque > summary {
      font-size: .8rem;
      padding: 6px 10px;
      font-weight: 600;
      color: #555;
    }
    #tbodyInspectoresDia tr.inspector-dia-row {
      cursor: pointer;
    }
    #tbodyInspectoresDia tr.inspector-dia-row:hover {
      background: #f5f7fa;
    }
    #tbodyInspectoresDia tr.inspector-dia-row.selected {
      background: #fff0f0;
      outline: 1px solid #f5c2c2;
    }
    /* Alertas de jornada: sin iniciar (rojo) / mañana atrasada (ámbar). */
    #tbodyInspectoresDia tr.inspector-dia-row--sin-inicio {
      background: #fde7e7;
    }
    #tbodyInspectoresDia tr.inspector-dia-row--atraso {
      background: #fff3cd;
    }
    #tbodyInspectoresDia tr.inspector-dia-row--sin-inicio:hover {
      background: #fbd5d5;
    }
    #tbodyInspectoresDia tr.inspector-dia-row--atraso:hover {
      background: #ffe8a3;
    }
    #tbodyInspectoresDia tr.inspector-dia-row--sin-inicio > td:first-child {
      box-shadow: inset 4px 0 0 #c62828;
    }
    #tbodyInspectoresDia tr.inspector-dia-row--atraso > td:first-child {
      box-shadow: inset 4px 0 0 #f9a825;
    }
    #tbodyInspectoresDia tr.inspector-dia-row--sin-inicio .insp-dia-nombre {
      color: #b71c1c;
      font-weight: 700;
    }
    #tbodyInspectoresDia tr.inspector-dia-row--atraso .insp-dia-nombre {
      color: #7a4f00;
      font-weight: 700;
    }
    .dashboard-seguimiento > h2 {
      margin: 0 0 10px;
      font-size: 1.05rem;
      color: var(--primary);
    }
    .dashboard-resumen { margin-top: 0; }
    .dashboard-resumen-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
      margin-top: 0;
    }
    .dashboard-inicio-stack {
      align-items: start;
    }
    .dashboard-inicio-stack:has(#dashboardPanelRecientes.hidden-by-role) {
      grid-template-columns: 1fr;
    }
    details.ayuda-plegable { margin: 2px 0 6px; }
    details.ayuda-plegable > summary {
      display: inline-block;
      cursor: pointer;
      font-size: 11px;
      color: var(--muted, #6b7280);
      user-select: none;
      list-style: none;
    }
    details.ayuda-plegable > summary::-webkit-details-marker { display: none; }
    details.ayuda-plegable > summary:hover { color: var(--primary, #1565c0); text-decoration: underline; }
    details.ayuda-plegable[open] > summary { margin-bottom: 4px; }
    .dashboard-inicio-col-izq {
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-width: 0;
    }
    .dashboard-panel-recientes {
      align-self: stretch;
    }
    @media (max-width: 900px) {
      .dashboard-resumen-grid { grid-template-columns: 1fr; }
    }
    .dashboard-resumen-grid .panel-compact {
      margin-bottom: 0;
      padding: 6px 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fafafa;
    }
    .dashboard-resumen-grid .panel-compact > .muted {
      font-size: 10px !important;
      margin: 0 0 4px !important;
    }
    .dashboard-resumen-grid table { font-size: 11px; }
    .dashboard-resumen-grid th,
    .dashboard-resumen-grid td { padding: 3px 5px; }
    #tbodyInspectoresDia td.insp-pct-efec {
      text-align: right;
      font-variant-numeric: tabular-nums;
      font-weight: 600;
      color: #334155;
      white-space: nowrap;
    }
    #tbodyInspectoresDia tr.inspector-dia-total {
      font-weight: 700;
      background: var(--bg-soft, #f1f5f9);
      cursor: pointer;
    }
    #tbodyInspectoresDia tr.inspector-dia-total:hover {
      background: #e2e8f0;
    }
    #tbodyInspectoresDia tr.inspector-dia-total.selected {
      outline: 2px solid #94a3b8;
      outline-offset: -2px;
    }
    #tbodyInspectoresDia button.insp-num-link,
    #tbodyValidadoresEquipoDia button.equipo-num-link {
      appearance: none;
      background: none;
      border: none;
      padding: 0;
      margin: 0;
      font: inherit;
      color: #1565c0;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 2px;
      text-align: inherit;
    }
    #tbodyInspectoresDia button.insp-num-link:hover,
    #tbodyValidadoresEquipoDia button.equipo-num-link:hover {
      color: #0d47a1;
    }
    #tbodyInspectoresDia td.insp-celda-click,
    #tbodyValidadoresEquipoDia td.equipo-celda-click {
      text-align: center;
    }
    #tbodyValidadoresEquipoDia tr.validador-equipo-atrasado {
      background: #fff8e1;
    }
    #tbodyValidadoresEquipoDia .equipo-atraso-reloj {
      white-space: nowrap;
    }
    .equipo-cola-banner {
      margin: 0 0 10px;
      padding: 8px 12px;
      background: #e3f2fd;
      border: 1px solid #90caf9;
      border-radius: 6px;
      font-size: 13px;
      color: #0d47a1;
    }
    .consulta-tabs-wrap {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin-bottom: 8px;
      padding: 4px 0 6px;
      border-bottom: 1px solid var(--border);
      overflow-x: auto;
      scrollbar-width: thin;
      align-items: center;
    }
    .consulta-grupo-label {
      flex: 0 0 100%;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      color: #80868b;
      letter-spacing: .05em;
      margin: 4px 0 2px;
    }
    .consulta-basica-select-wrap {
      display: inline-flex;
      align-items: center;
      margin: 0 4px 0 0;
    }
    .consulta-basica-select {
      min-width: 160px;
      max-width: 220px;
      border: 1px solid var(--border);
      background: #fff;
      color: #202124;
      border-radius: 8px;
      padding: 5px 10px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
    }
    th[data-col-filter] {
      vertical-align: top;
      white-space: nowrap;
      min-width: 72px;
    }
    th[data-col-filter] .th-filter {
      display: block;
      width: 100%;
      min-width: 64px;
      max-width: 140px;
      margin-top: 4px;
      padding: 3px 8px 3px 22px;
      font-size: 11px;
      font-weight: 400;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: #fff 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='%2380868b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 6px center;
      color: #202124;
      box-sizing: border-box;
    }
    th[data-col-filter] .th-filter:focus {
      outline: none;
      border-color: var(--primary);
    }
    th > .th-cf {
      display: block;
      width: 100%;
      min-width: 56px;
      max-width: 170px;
      margin-top: 4px;
      padding: 3px 6px 3px 21px;
      font-family: inherit;
      font-size: 11px;
      font-weight: 400;
      line-height: 1.3;
      text-transform: none;
      letter-spacing: normal;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: #fff 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='%2380868b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 6px center;
      color: #202124;
      box-sizing: border-box;
    }
    th > .th-cf:focus {
      outline: none;
      border-color: var(--primary);
    }
    th > .th-cf:not(:placeholder-shown) {
      border-color: var(--primary);
      background-color: #e8f0fe;
    }
    tr.cf-oculta {
      display: none !important;
    }
    .fachada-si { color: #1e8e3e; font-weight: 700; }
    .fachada-no { font-weight: 600; }
    .consulta-tabs-wrap button {
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      border: 1px solid var(--border);
      background: #fff !important;
      color: #202124 !important;
      border-radius: 8px;
      padding: 4px 10px;
      font-size: 11px;
      cursor: pointer;
      white-space: nowrap;
      font-weight: 600;
      transition: border-color .12s ease, color .12s ease, background .12s ease;
    }
    .consulta-tabs-wrap button .tab-ico {
      display: inline-flex;
      width: 13px;
      height: 13px;
      flex: 0 0 13px;
    }
    .consulta-tabs-wrap button .tab-ico svg {
      width: 13px;
      height: 13px;
      display: block;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.25;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    .consulta-tabs-wrap button.active,
    .consulta-tabs-wrap button:hover {
      border-color: var(--primary) !important;
      color: var(--primary) !important;
      background: #fdecea !important;
      font-weight: 700;
    }
    .inspector-sugerido-hint {
      margin: 8px 0 0;
      padding: 8px 10px;
      border-radius: 8px;
      background: #fff8e1;
      border: 1px solid #ffe082;
      font-size: 12px;
      color: #6d4c00;
    }
    #section-dashboard .module-help { margin-top: 10px; }
    #section-dashboard .module-help summary { padding: 8px 12px; font-size: 12px; }
    .role-badge {
      font-size: 10px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 999px;
      background: #fdecea;
      color: var(--primary);
      white-space: nowrap;
      max-width: 280px;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .session-user-header {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      max-width: min(360px, 42vw);
    }
    .session-user-header-name {
      font-size: 12px;
      font-weight: 600;
      color: #222;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 160px;
    }
    .session-user-header .role-badge {
      max-width: 160px;
      font-weight: 600;
    }
    .session-user-sidebar {
      padding: 10px 12px 12px;
      border-top: 1px solid rgba(255,255,255,.12);
      font-size: 12px;
      color: rgba(255,255,255,.85);
      line-height: 1.35;
    }
    .session-user-sidebar strong {
      display: block;
      font-size: 13px;
      color: #fff;
      margin-bottom: 2px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .session-user-sidebar #sessionUserSidebarMeta {
      display: block;
      font-size: 11px;
      color: rgba(255,255,255,.65);
      margin-bottom: 8px;
    }
    .sidebar-session-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
    }
    .sidebar-session-actions .btn-sm,
    .sidebar-session-actions button.secondary {
      background: rgba(255,255,255,.08);
      color: #fff;
      border-color: rgba(255,255,255,.25);
      font-size: 11px;
      padding: 4px 8px;
    }
    .sidebar-session-actions .btn-sm:hover,
    .sidebar-session-actions button.secondary:hover {
      background: rgba(255,255,255,.16);
    }
    /* Cualquier elemento marcado por rol (tabs de cola, nav, paneles, botones). */
    .hidden-by-role { display: none !important; }
    .nav-group {
      margin: 0;
      padding: 0;
      border: none;
    }
    .nav-group-label {
      list-style: none;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 8px;
      margin: 10px 8px 4px;
      padding: 8px 8px;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      color: rgba(255,255,255,.45);
      letter-spacing: .05em;
      cursor: pointer;
      user-select: none;
      border-radius: 6px;
    }
    .nav-group-label::-webkit-details-marker { display: none; }
    .nav-group-label::marker { content: ''; }
    .nav-group-label:hover {
      color: rgba(255,255,255,.75);
      background: rgba(255,255,255,.06);
    }
    .nav-group-label::after {
      content: '';
      margin-left: auto;
      width: 8px;
      height: 8px;
      flex: 0 0 8px;
      background: no-repeat center / contain;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.45)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
      transition: transform .15s ease;
    }
    .nav-group[open] > .nav-group-label::after {
      transform: rotate(90deg);
    }
    .nav-group:has(.nav-item.active) > .nav-group-label {
      color: rgba(255,255,255,.88);
    }
    .nav-group:has(.nav-item.active) > .nav-group-label::after {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6b61' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
    }
    .nav-group-items {
      display: flex;
      flex-direction: column;
    }
    .nav-group-items .nav-item {
      padding-left: 22px;
    }
    .filtros-despacho {
      background: #fafafa;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px;
      margin-bottom: 12px;
    }
    @media (max-width: 720px) {
      .content-header { flex-direction: column; align-items: flex-start; }
      .header-actions { width: 100%; justify-content: flex-start; }
      #status { max-width: none; text-align: left; }
    }
    .permisos-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
      gap: 6px 16px;
      margin-top: 6px;
    }
    .permisos-grid label {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      font-weight: 400;
      padding: 4px 0;
    }
    .permisos-grid .permiso-grupo {
      grid-column: 1 / -1;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: .04em;
      color: var(--muted, #6b7280);
      margin: 8px 0 0;
      font-weight: 600;
    }
    .asignacion-masiva-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      padding: 10px 12px;
      background: #f8faf8;
      border: 1px solid var(--border);
      border-radius: 8px;
      margin-bottom: 10px;
    }
    .asignacion-masiva-bar select { min-width: 220px; }
    .asignacion-masiva-count { font-size: 12px; font-weight: 600; color: var(--primary); }
    table.asignacion-table input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
    table.asignacion-table tr.row-seleccionada { background: #fdecea; }
    .admin-login-gate {
      position: fixed;
      inset: 0;
      z-index: 9999;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background:
        radial-gradient(ellipse at top, rgba(219, 36, 24, 0.08), transparent 55%),
        linear-gradient(180deg, #f7f7f7 0%, #ececed 100%);
    }
    .admin-login-gate.hidden { display: none !important; }
    .admin-login-card {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 28px 26px 24px;
      width: min(400px, 100%);
      box-shadow: 0 12px 36px rgba(65, 66, 71, 0.12);
      text-align: center;
    }
    .admin-login-card .login-logo {
      display: block;
      width: min(260px, 78%);
      height: auto;
      margin: 0 auto 18px;
      background: transparent;
    }
    .admin-login-card h2 {
      margin: 0 0 6px;
      font-size: 1.15rem;
      color: var(--brand-charcoal);
    }
    .admin-login-card .login-sub {
      margin: 0 0 18px;
      font-size: 13px;
      color: #6b6e73;
      line-height: 1.4;
    }
    .admin-login-card label {
      display: block;
      text-align: left;
      font-size: 12px;
      font-weight: 600;
      color: var(--brand-charcoal);
      margin-bottom: 4px;
    }
    .admin-login-card form { text-align: left; }
    .content-header-brand {
      display: none;
    }
    #btnVolverInicio { margin-right: 4px; }
    .address-wrap { position: relative; }
    .address-status {
      margin: 6px 0 0;
      font-size: 12px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .address-status.ok { color: var(--ok); }
    .address-status.warn { color: var(--warn); }
    .address-status.err { color: var(--err); }
    .address-status.info { color: #1565c0; }
    .address-suggestions {
      list-style: none;
      margin: 6px 0 0;
      padding: 0;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fff;
      max-height: 320px;
      overflow-y: auto;
      overflow-x: hidden;
      box-shadow: 0 8px 24px rgba(0,0,0,.08);
      position: relative;
      z-index: 5;
    }
    .address-suggestions li button {
      width: 100%;
      text-align: left;
      background: #fff;
      color: #222;
      border: none;
      border-bottom: 1px solid #eee;
      padding: 10px 12px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      white-space: normal;
      word-break: break-word;
      line-height: 1.4;
    }
    .address-suggestions li button:hover { background: #fdecea; }
    .address-suggestions .sug-dir {
      display: block;
      font-weight: 600;
      color: #111;
      margin-bottom: 3px;
    }
    .address-suggestions li small {
      display: block;
      color: #666;
      font-size: 11px;
      margin-top: 2px;
      font-weight: 400;
      white-space: normal;
      word-break: break-word;
    }
    .address-suggestions .sug-barrio {
      display: block;
      color: #1565c0;
      font-size: 12px;
      font-weight: 600;
      margin-top: 2px;
    }
    .address-map {
      height: 280px;
      width: 100%;
      border-radius: 10px;
      border: 1px solid var(--border);
      margin-top: 12px;
      z-index: 1;
    }
    .address-map.empty {
      display: flex;
      align-items: center;
      justify-content: center;
      background: #eef2ee;
      color: #666;
      font-size: 13px;
    }
    .address-map-tools {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      margin-top: 8px;
    }
    .address-map-tools.hidden { display: none; }
    .address-map-tools .map-nudge {
      min-width: 36px;
      padding: 4px 8px;
      font-size: 12px;
    }
    .address-fields-row {
      display: grid;
      grid-template-columns: 1.1fr 42px 68px 42px 68px 42px;
      gap: 8px;
      margin-bottom: 8px;
    }
    .address-fields-actions {
      display: flex;
      gap: 8px;
      margin: 6px 0 10px;
      flex-wrap: wrap;
    }
    .address-complementos {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
      margin-bottom: 8px;
    }
    @media (max-width: 720px) {
      .address-fields-row { grid-template-columns: 1fr; }
      .address-complementos { grid-template-columns: 1fr 1fr; }
    }
    .address-compiled {
      font-size: 12px;
      color: #555;
      margin: 6px 0 0;
      padding: 8px 10px;
      background: #f8f9fa;
      border-radius: 6px;
      border: 1px dashed #ccc;
    }
    .address-resumen {
      margin-top: 12px;
      padding: 12px;
      border-radius: 10px;
      background: #f8faf8;
      border: 1px solid var(--border);
      font-size: 13px;
    }
    .address-resumen.confirmada {
      background: #fdecea;
      border-color: #a5d6a7;
    }
    .address-resumen.preview {
      background: #fff8e1;
      border-color: #ffcc80;
    }
    .address-resumen strong { display: block; margin-bottom: 6px; }
    .admin-smtp-banner {
      margin: 0 0 12px;
      padding: 10px 12px;
      border-radius: 8px;
      font-size: 13px;
    }
    .admin-smtp-banner.ok { background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; }
    .admin-smtp-banner.warn { background: #fff8e1; border: 1px solid #ffcc80; color: #e65100; }
    .admin-smtp-banner.error { background: #ffebee; border: 1px solid #ef9a9a; color: #b71c1c; }
    .btn-entrega {
      margin-top: 4px;
      padding: 4px 8px;
      font-size: 12px;
      border-radius: 6px;
      border: 1px solid #90caf9;
      background: #e3f2fd;
      color: #0d47a1;
      cursor: pointer;
    }
    .consulta-form.panel { padding: 8px 10px; margin-bottom: 6px; }
    .consulta-form h3 { font-size: 0.85rem; margin: 0 0 6px; font-weight: 700; }
    .consulta-form .acciones { margin-top: 4px; }
    .section-toolbar h2[style] { margin: 0 !important; font-size: 0.85rem !important; }
    .module-help:not(.dashboard-resumen) { display: none; }
    @media (max-width: 860px) {
      .app-shell { flex-direction: row; }
      .btn-mobile-menu { display: inline-flex; }
      .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(288px, 88vw);
        height: 100dvh;
        z-index: 1200;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: none;
      }
      body.mobile-nav-open {
        overflow: hidden;
      }
      body.mobile-nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 28px rgba(0, 0, 0, 0.28);
      }
      .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1190;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
      }
      body.mobile-nav-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
      }
      .sidebar-nav {
        display: block;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 8px 0;
        -webkit-overflow-scrolling: touch;
      }
      .sidebar-nav .nav-divider,
      .sidebar-nav .nav-group-label {
        display: flex;
      }
      .sidebar-nav .nav-group {
        display: block;
      }
      .sidebar-nav .nav-group-items {
        display: block;
      }
      .nav-item {
        min-height: 44px;
        padding: 12px 14px;
        font-size: 14px;
        white-space: normal;
      }
      .nav-group-label {
        min-height: 40px;
        padding: 10px 14px;
        font-size: 12px;
      }
      .sidebar-footer { display: block; }
      .sidebar-brand {
        padding: 14px 12px 10px;
      }
      .sidebar-brand img {
        max-width: 160px;
      }
      .main-wrap {
        width: 100%;
        min-width: 0;
      }
      .content-header-left {
        align-items: flex-start;
        gap: 10px;
      }
      .content-header h1 {
        font-size: 1rem;
      }
      .header-actions button {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 13px;
      }
      main.content {
        padding: 8px;
      }
      .tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding-bottom: 4px;
      }
      .tabs button {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 8px 12px;
        font-size: 12px;
      }
      .form-row {
        flex-direction: column;
        align-items: stretch;
      }
      .form-row > div,
      .form-row > button,
      .form-row > label,
      .form-row select,
      .form-row input {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
      }
      .section-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px;
      }
      .section-toolbar .acciones {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
      }
      .table-scroll {
        max-height: none;
      }
      main.content .panel {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
      .mi-trabajo-grid {
        grid-template-columns: 1fr !important;
      }
      .session-user-header {
        max-width: 100%;
      }
      #sessionUserHeaderName {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }


/* —— Dinamismo panel (2026-09) —— */
.nav-ico svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .95;
  transition: opacity .12s ease, stroke .12s ease, transform .12s ease;
}
.nav-item:hover .nav-ico svg {
  opacity: 1;
  transform: translateY(-0.5px);
}
.nav-item.active .nav-ico svg {
  opacity: 1;
  stroke: #ff6b61;
  stroke-width: 2.35;
}
.panel { animation: panel-in .18s ease-out; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.consulta-tabs-wrap {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f7f7f7;
  padding: 6px 0 8px;
  margin-bottom: 4px;
}
.consulta-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 0;
  font-size: 12px;
}
.consulta-pager .pager-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}
.consulta-pager button[disabled] { opacity: .4; }
.skeleton-row td {
  position: relative;
  overflow: hidden;
  color: transparent !important;
}
.skeleton-row td::after {
  content: '';
  position: absolute;
  inset: 6px 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #eee, #f5f5f5, #eee);
  background-size: 200% 100%;
  animation: skel 1.1s ease-in-out infinite;
}
@keyframes skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.table-scroll table tbody tr { transition: background .12s ease; }
#panelFichaConsulta { scroll-margin-top: 12px; }
tr.vt-spacer td { background: transparent !important; pointer-events: none; }
.msg-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  background: #2f3033;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  animation: panel-in .2s ease;
  max-width: min(360px, 90vw);
}
.msg-toast.ok { background: #2e7d32; }
.msg-toast.err { background: #b71c1c; }

/* Mensajería interna (mural + chat) */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}
.nav-item .nav-badge { background: #ef5350; }
.tabs .nav-badge { margin-left: 4px; }
.msg-composer {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  background: #fafafa;
}
.msg-composer--sticky { margin-top: 8px; margin-bottom: 0; }
.msg-composer textarea { resize: vertical; min-height: 56px; }
.msg-presencia {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}
.msg-presencia-leyenda {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.msg-presencia-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2e7d32;
  display: inline-block;
  flex-shrink: 0;
}
.msg-presencia-nombres { color: #333; font-weight: 500; }
.msg-presencia--offline .msg-presencia-dot {
  background: #9e9e9e;
}
.msg-dm-hilo--online strong::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2e7d32;
  margin-right: 6px;
  vertical-align: middle;
}
.msg-mural-list { display: grid; gap: 10px; }
.msg-aviso {
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.msg-aviso--fijo { border-color: #ffcc80; background: #fff8e1; }
.msg-aviso-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.msg-aviso-head strong { font-size: 0.95rem; }
.msg-aviso-meta { font-size: 11px; color: #666; }
.msg-aviso-cuerpo {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}
.msg-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 480px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  background: #f7f7f8;
}
.msg-bubble {
  max-width: min(85%, 520px);
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e8e8e8;
  align-self: flex-start;
}
.msg-bubble--mia {
  align-self: flex-end;
  background: #e8f5e9;
  border-color: #c8e6c9;
}
.msg-bubble-meta {
  font-size: 11px;
  color: #666;
  margin-bottom: 3px;
}
.msg-bubble-cuerpo {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.4;
}
.msg-visto {
  margin-top: 3px;
  font-size: 11px;
  color: #8a8f98;
  text-align: right;
  cursor: default;
}
.msg-visto--leido { color: #1e88e5; font-weight: 600; }
.msg-escribiendo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 2px 0;
  font-size: 12px;
  font-style: italic;
  color: #5f6b7a;
}
.msg-escribiendo[hidden] { display: none; }
.msg-escribiendo-dots { display: inline-flex; gap: 3px; }
.msg-escribiendo-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #90a4ae;
  animation: msg-escribiendo-rebote 1.2s infinite ease-in-out;
}
.msg-escribiendo-dots i:nth-child(2) { animation-delay: .15s; }
.msg-escribiendo-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes msg-escribiendo-rebote {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.msg-dm-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 12px;
  align-items: stretch;
}
.msg-dm-sidebar {
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
  max-height: min(60vh, 560px);
  overflow-y: auto;
}
.msg-dm-hilos { display: grid; gap: 4px; }
.msg-dm-hilo {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px;
  padding-right: 36px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  position: relative;
}
.msg-dm-hilo:hover { border-color: #c8e6c9; }
.msg-dm-hilo.active { border-color: var(--primary, #2e7d32); background: #e8f5e9; }
.msg-dm-hilo--unread { border-color: #ffcc80; background: #fff8e1; }
.msg-dm-hilo .muted { font-size: 11px; }
.msg-dm-unread {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.msg-dm-titulo {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 0;
  color: var(--brand-charcoal, #2f3033);
}
.msg-dm-titulo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
@media (max-width: 720px) {
  .msg-dm-layout { grid-template-columns: 1fr; }
  .msg-thread { max-height: 40vh; }
}

/* Ventanas flotantes de comunicaciones (cualquier sección) */
.comms-notify-stack {
  position: fixed;
  right: 16px;
  bottom: 88px;
  z-index: 12000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.comms-notify {
  pointer-events: auto;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-left: 4px solid #2e7d32;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(47, 48, 51, 0.18);
  padding: 10px 12px;
  animation: comms-pop 0.22s ease-out;
  cursor: pointer;
}
.comms-notify--mural { border-left-color: #ef6c00; }
.comms-notify--general { border-left-color: #1565c0; }
.comms-notify--dm { border-left-color: #2e7d32; }
.comms-notify--pendientes { border-left-color: #c62828; background: #fff8e1; }
.msg-pref-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.msg-pref-toggle input { margin: 0; }
#btnMsgDesktopNotif.msg-pref-on {
  border-color: #2e7d32;
  color: #1b5e20;
}
.comms-notify-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 4px;
}
.comms-notify-head strong {
  font-size: 13px;
  line-height: 1.3;
  color: #2f3033;
}
.comms-notify-close {
  border: none;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.comms-notify-close:hover { color: #333; }
.comms-notify-meta {
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
}
.comms-notify-body {
  font-size: 13px;
  line-height: 1.4;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 4.2em;
  overflow: hidden;
}
.comms-notify-hint {
  margin-top: 6px;
  font-size: 11px;
  color: #2e7d32;
  font-weight: 600;
}
.comms-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 12001;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 52px;
  height: 52px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: #2e7d32;
  color: #fff;
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.35);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
.comms-fab:hover { background: #1b5e20; }
.comms-fab.hidden { display: none !important; }
.comms-fab-ico {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.comms-fab-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: #c62828;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}
@keyframes comms-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 720px) {
  .comms-notify-stack { right: 10px; bottom: 78px; width: calc(100vw - 20px); }
  .comms-fab { right: 12px; bottom: 12px; }
}
.comms-fab-count[hidden] { display: none; }
.comms-fab--sin-pendientes {
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  opacity: .85;
  box-shadow: 0 6px 18px rgba(46, 125, 50, 0.28);
}
.comms-fab--sin-pendientes:hover { opacity: 1; }
body.chat-flot-abierto .comms-fab { background: #1b5e20; opacity: 1; }

/* Imágenes y visitas dentro de los mensajes */
.msg-adjunto-img {
  display: block;
  max-width: 100%;
  max-height: 260px;
  margin: 4px 0;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  background: #f3f3f3;
  cursor: zoom-in;
  min-height: 40px;
  min-width: 60px;
  object-fit: contain;
}
.msg-adjunto-error {
  margin: 4px 0;
  padding: 8px;
  font-size: 12px;
  color: #8a6d3b;
  background: #fff8e1;
  border-radius: 6px;
}
.msg-ref {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 3px 0 4px;
  padding: 6px 8px;
  border-left: 3px solid var(--primary, #db2418);
  border-radius: 6px;
  background: #fff6f5;
  font-size: 12px;
}
.msg-ref-tipo {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--primary, #db2418);
}
.msg-ref-etiqueta {
  flex: 1 1 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #333;
}
.msg-ref-links { display: inline-flex; gap: 10px; }
.msg-ref-links a { color: #1565c0; font-weight: 600; text-decoration: none; }
.msg-ref-links a:hover { text-decoration: underline; }
.msg-visor {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 20px;
  background: rgba(20, 20, 22, 0.86);
  cursor: zoom-out;
}
.msg-visor--abierto { display: flex; }
.msg-visor img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  background: #fff;
}
.msg-visor-cerrar {
  position: absolute;
  top: 8px;
  right: 14px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.msg-visor-abrir {
  position: absolute;
  top: 14px;
  left: 18px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.chat-captura-oculto { visibility: hidden !important; }

/* Chat flotante (conversar sin salir de la pantalla) */
.chat-flot {
  position: fixed;
  right: 16px;
  bottom: 78px;
  z-index: 12002;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 100px));
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(47, 48, 51, 0.28);
  overflow: hidden;
  animation: comms-pop 0.18s ease-out;
}
.chat-flot--drop { outline: 3px dashed #2e7d32; outline-offset: -6px; }
body.chat-flot-abierto .comms-notify-stack { right: calc(16px + min(400px, calc(100vw - 24px)) + 12px); }
.chat-flot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--brand-charcoal, #414247);
  color: #fff;
}
.chat-flot-tabs { display: inline-flex; gap: 4px; }
.chat-flot-tabs button {
  border: 1px solid rgba(255, 255, 255, .3);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.chat-flot-tabs button.active { background: #fff; color: var(--brand-charcoal, #414247); }
.chat-flot-badge {
  display: inline-block;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}
.chat-flot-badge[hidden] { display: none; }
.chat-flot-head-acciones { display: inline-flex; gap: 2px; }
.chat-flot-icono {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
}
.chat-flot-icono:hover { background: rgba(255, 255, 255, .15); }
.chat-flot-peer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}
.chat-flot-peer[hidden] { display: none; }
.chat-flot-peer select { flex: 1; min-width: 0; font-size: 12px; padding: 4px 6px; }
.chat-flot-presencia { font-size: 11px; color: #8a8f98; white-space: nowrap; }
.chat-flot-presencia--on { color: #2e7d32; font-weight: 600; }
.chat-flot-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: #f7f7f8;
}
.chat-flot-thread .msg-bubble { max-width: 88%; }
.chat-flot-vacio { margin: auto 0; text-align: center; font-size: 12px; }
.chat-flot-escribiendo { margin: 0; padding: 4px 10px; background: #f7f7f8; }
.chat-flot-escribiendo[hidden] { display: none; }
.chat-flot-composer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 6px;
  border-top: 1px solid #e6e6e6;
  background: #fff;
}
.chat-flot-composer textarea {
  width: 100%;
  min-height: 44px;
  max-height: 140px;
  resize: vertical;
  font-size: 13px;
  padding: 6px 8px;
  box-sizing: border-box;
}
.chat-flot-adjuntos { display: flex; flex-direction: column; gap: 6px; }
.chat-flot-adjuntos[hidden] { display: none; }
.chat-flot-ref {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 8px;
  border-left: 3px solid var(--primary, #db2418);
  border-radius: 6px;
  background: #fff6f5;
  font-size: 12px;
}
.chat-flot-ref[hidden] { display: none; }
.chat-flot-ref-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-flot-imgprev {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.chat-flot-imgprev[hidden] { display: none; }
.chat-flot-imgprev img {
  max-height: 110px;
  max-width: 70%;
  border-radius: 6px;
  border: 1px solid #ddd;
  object-fit: contain;
  background: #f3f3f3;
}
.chat-flot-img-info { font-size: 11px; color: #777; }
.chat-flot-quitar {
  border: none;
  background: #eee;
  color: #555;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-flot-quitar:hover { background: #ddd; color: #000; }
.chat-flot-acciones { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chat-flot-acciones .chat-flot-enviar { margin-left: auto; }
.chat-flot-estado { min-height: 14px; font-size: 11px; color: #777; }
.chat-flot-estado--error { color: #c62828; }
.chat-flot-estado--ok { color: #2e7d32; }
@media (max-width: 720px) {
  .chat-flot { right: 8px; left: 8px; width: auto; bottom: 70px; height: calc(100vh - 90px); }
  body.chat-flot-abierto .comms-notify-stack { display: none; }
}

/* Plazo de corrección de devoluciones (48 h) */
.devolucion-plazo { margin-top: 3px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.devolucion-plazo--ok { color: #2e7d32; }
.devolucion-plazo--urgente { color: #e65100; }
.devolucion-plazo--vencida { color: var(--err); }
.devolucion-plazos-alerta {
  margin: 0 0 10px; padding: 8px 12px; border-radius: 6px; font-size: 13px;
  background: #fdecea; border: 1px solid #f5c2c0; color: #7f1d1d;
}

/* Editor FR-003 desde el panel */
.admin-dialog.fr003-editor { width: min(1180px, 97vw); max-height: 92vh; }
.fr3-head-acc { display: flex; align-items: center; gap: 10px; }
.fr3-buscar { width: 100%; padding: 7px 10px; margin-bottom: 6px; }
.fr3-nota { font-size: 12px; margin: 0 0 8px; }
.fr3-alerta {
  padding: 8px 12px; margin: 0 0 10px; border-radius: 6px; font-size: 13px;
  background: #fff8e1; border: 1px solid #ffe082; color: #5d4037;
}
.fr3-alerta--err { background: #fdecea; border-color: #f5c2c0; color: var(--err); }
.fr3-alerta--ok { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.fr3-seccion { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 8px; background: #fff; }
.fr3-seccion > summary { cursor: pointer; padding: 8px 12px; font-weight: 600; font-size: 13px; }
.fr3-seccion[open] > summary { border-bottom: 1px solid var(--border); background: #fafbfd; }
.fr3-seccion.fr3-cambiado { border-color: #f9a825; }
.fr3-chip {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px;
  background: #fff3c4; color: #8d6e00; font-size: 11px; font-weight: 600;
}
.fr3-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px 12px; padding: 10px 12px;
}
.fr3-campo { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fr3-campo label { font-size: 11px; color: var(--muted); font-weight: 600; }
.fr3-campo input[type="text"], .fr3-campo textarea { width: 100%; padding: 5px 7px; font-size: 13px; }
.fr3-campo.fr3-cambiado input[type="text"], .fr3-campo.fr3-cambiado textarea { border-color: #f9a825; background: #fffdf3; }
.fr3-antes { font-size: 11px; color: #8d6e00; overflow-wrap: anywhere; }
.fr3-bool { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.fr3-tabla-wrap { overflow-x: auto; padding: 8px 12px 4px; }
.fr3-tabla { border-collapse: collapse; width: 100%; font-size: 12px; }
.fr3-tabla th, .fr3-tabla td { border: 1px solid var(--border); padding: 3px 5px; text-align: left; }
.fr3-tabla th { background: #f5f6f8; font-weight: 600; white-space: nowrap; }
.fr3-tabla td input[type="text"] { width: 100%; min-width: 80px; padding: 3px 5px; font-size: 12px; }
.fr3-td-n { color: var(--muted); width: 28px; text-align: center; }
.fr3-td-bool { text-align: center; }
.fr3-td-cambiada input { border-color: #f9a825; background: #fffdf3; }
.fr3-fila-nueva td { background: #f1f8e9; }
.fr3-seccion > .btn-sm { margin: 4px 12px 10px; }
.fr3-pie { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.fr3-pie textarea { width: 100%; padding: 6px 8px; }
.fr3-acciones { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.fr3-acciones .muted { margin-right: auto; font-size: 12px; }
.fr3-confirmar { border: 1px solid #f9a825; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #fffdf3; }
.fr3-diff { margin: 8px 0; }
.fr3-historial { margin-top: 10px; font-size: 12px; }
.fr3-historial ul { margin: 6px 0 0 16px; padding: 0; }
.fr3-spinner {
  display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -2px;
  border: 2px solid #f9a825; border-top-color: transparent; border-radius: 50%;
  animation: fr3-spin .8s linear infinite;
}
@keyframes fr3-spin { to { transform: rotate(360deg); } }
.fr3-chip[hidden] { display: none; }
.fr3-planos-host { padding: 8px 12px 10px; }

/* Editor de planos (admin-plano-editor.js) */
.pl-editor { display: flex; flex-direction: column; gap: 8px; outline: none; }
.pl-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.pl-tabs, .pl-tools { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.pl-tabs button, .pl-tools button {
  border: 1px solid var(--border); background: #fff; color: inherit; border-radius: 6px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; line-height: 1.4;
}
.pl-tabs button:hover, .pl-tools button:hover:not(:disabled) { background: #f0f4fa; }
.pl-tabs button.active, .pl-tools button.active { background: #1565c0; border-color: #1565c0; color: #fff; }
.pl-tools button:disabled { opacity: .45; cursor: default; }
.pl-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 10px; }
.pl-svg {
  width: 100%; height: 60vh; min-height: 360px; display: block; touch-action: none; user-select: none;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: grab;
}
.pl-svg[data-tool="linea"], .pl-svg[data-tool="simbolo"], .pl-svg[data-tool="texto"] { cursor: crosshair; }
.pl-svg[data-tool="borrar"] { cursor: not-allowed; }
.pl-svg[data-tool="borrar"] .pl-hit, .pl-svg[data-tool="borrar"] .pl-simbolo,
.pl-svg[data-tool="borrar"] .pl-texto, .pl-svg[data-tool="borrar"] .pl-acot { cursor: pointer; }
.pl-grid-line { fill: none; stroke: #e3e7ee; stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.pl-seg { stroke: #d32f2f; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.pl-seg.sel { stroke: #1565c0; stroke-width: 3; }
.pl-hit { stroke: transparent; stroke-width: 12; vector-effect: non-scaling-stroke; pointer-events: stroke; cursor: move; }
.pl-svg[data-tool="linea"] .pl-hit { pointer-events: none; }
.pl-simbolo { cursor: move; }
.pl-simbolo-bg { fill: transparent; stroke: none; }
.pl-simbolo.sel .pl-simbolo-bg { fill: rgba(21, 101, 192, .08); stroke: #1565c0; stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.pl-acot { cursor: pointer; }
.pl-acot rect { fill: #e3f2fd; stroke: #1565c0; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pl-acot text { font-size: 8px; font-weight: 700; fill: #0d47a1; pointer-events: none; }
.pl-acot.sel rect { fill: #bbdefb; stroke-width: 2; }
.pl-texto { fill: #212121; cursor: move; font-family: Arial, Helvetica, sans-serif; }
.pl-texto.recinto { font-weight: 700; }
.pl-texto.sel { fill: #1565c0; text-decoration: underline; }
.pl-medida { font-size: 9px; fill: #6d4c41; font-weight: 600; pointer-events: none; opacity: .85; }
.pl-handle { fill: #fff; stroke: #1565c0; stroke-width: 2; vector-effect: non-scaling-stroke; cursor: grab; }
.pl-linea-ini { fill: #1565c0; pointer-events: none; }
.pl-linea-prev { stroke: #1565c0; stroke-width: 2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.pl-svg[data-tool="linea"] .pl-simbolo, .pl-svg[data-tool="linea"] .pl-texto, .pl-svg[data-tool="linea"] .pl-acot { pointer-events: none; }
.pl-panel {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fafbfd;
  font-size: 12px; display: flex; flex-direction: column; gap: 8px; align-self: start;
}
.pl-panel h4 { margin: 0; font-size: 13px; }
.pl-panel p { margin: 0; }
.pl-panel label { display: flex; flex-direction: column; gap: 3px; font-weight: 600; color: var(--muted); font-size: 11px; }
.pl-panel input[type="text"], .pl-panel input[type="number"], .pl-panel select { width: 100%; padding: 4px 6px; font-size: 12px; color: var(--text, #222); }
.pl-panel input[type="range"] { width: 100%; }
.pl-row { display: flex; gap: 4px; align-items: center; }
.pl-row input { flex: 1; min-width: 0; }
.pl-row button { border: 1px solid var(--border); background: #fff; border-radius: 5px; padding: 3px 8px; cursor: pointer; }
.pl-simbolo-prev { display: flex; justify-content: center; padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.pl-simbolo-prev img { width: 64px; height: 64px; object-fit: contain; }
.pl-medidas details { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.pl-medidas summary { cursor: pointer; font-weight: 600; font-size: 12px; }
.pl-medidas .fr3-tabla { margin: 6px 0; }
.pl-medidas .fr3-alerta { margin: 6px 0; }
@media (max-width: 900px) {
  .pl-body { grid-template-columns: 1fr; }
}

/* —— Pulido visual (2026-09). Selectores en :where() para no ganarle a estilos existentes —— */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
:where(.panel) {
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
:where(table) {
  font-variant-numeric: tabular-nums;
}
.table-scroll thead > tr:first-child > th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 var(--border);
}
:where(button) {
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, filter .12s ease;
}
:where(button:not(.nav-item):not(:disabled)):hover {
  filter: brightness(.94);
}
:where(button:not(:disabled)):active {
  filter: brightness(.88);
}
:where(input, select, textarea):focus-visible {
  outline: 2px solid rgba(219, 36, 24, .35);
  outline-offset: 0;
}
:where(.table-scroll, .sidebar, .content) {
  scrollbar-width: thin;
}
:where(.table-scroll) {
  scrollbar-color: #c5c9cf transparent;
}
:where(.sidebar) {
  scrollbar-color: rgba(255, 255, 255, .22) transparent;
}

/* Alertas de jornada (08:30 / 12:30) */
.alj-banners { display: flex; flex-direction: column; gap: 6px; margin: 0 0 10px; }
.alj-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  border: 1px solid; border-radius: 8px; padding: 7px 12px; font-size: 13px;
}
.alj-banner--mal { background: #ffebee; border-color: #ef9a9a; color: #8e1b1b; }
.alj-banner--med { background: #fff8e1; border-color: #ffd54f; color: #6d4c00; }
.alj-banner--ok { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.alj-banner-lista { font-size: 12px; }
.alj-hora {
  display: inline-block; font-weight: 700; font-size: 12px; padding: 1px 7px;
  border-radius: 999px; background: rgba(0, 0, 0, .08);
}
.alj-link {
  margin-left: auto; background: none; border: none; padding: 0; color: inherit;
  text-decoration: underline; font-weight: 600; cursor: pointer; font-size: 12px;
}
.alj-modal {
  position: fixed; inset: 0; z-index: 12500; background: rgba(15, 23, 42, .45);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px;
}
.alj-modal.hidden { display: none; }
.alj-modal-card {
  background: #fff; border-radius: 12px; width: min(760px, 100%); max-height: 86vh;
  display: flex; flex-direction: column; box-shadow: 0 18px 48px rgba(0, 0, 0, .3);
}
.alj-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #eceff1;
  background: #fff3e0; border-radius: 12px 12px 0 0;
}
.alj-modal-head h2 { margin: 0; font-size: 17px; color: #bf360c; }
.alj-cerrar { background: none; border: none; font-size: 24px; line-height: 1; cursor: pointer; color: #555; padding: 0 4px; }
.alj-modal-body { padding: 12px 18px; overflow: auto; }
.alj-modal-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 18px; border-top: 1px solid #eceff1;
}
.alj-spacer { flex: 1; }
.alj-bloque + .alj-bloque { margin-top: 16px; padding-top: 12px; border-top: 1px dashed #cfd8dc; }
.alj-bloque h3 { margin: 0 0 4px; font-size: 15px; }
.alj-bloque > p { margin: 0 0 8px; font-size: 12px; }
.alj-tabla { width: 100%; font-size: 13px; }
.alj-tabla td { vertical-align: top; }
.alj-tabla .alj-num { font-weight: 700; white-space: nowrap; }
.alj-tabla .alj-num .muted { font-weight: 400; font-size: 11px; }
.alj-tabla tr.alj-resuelto td { opacity: .6; }
.alj-ids { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.alj-ids span { font-size: 10px; background: #eceff1; border-radius: 4px; padding: 0 4px; color: #37474f; }
.alj-ok { color: #2e7d32; font-weight: 600; }
.alj-mal { color: #c62828; font-weight: 600; }
.alj-med { color: #ef6c00; font-weight: 600; }
.alj-ids span.alj-id--ok { background: #e8f5e9; color: #1b5e20; }
.alj-ids span.alj-id--pend { background: #ffebee; color: #b71c1c; }
.alj-motivos { font-size: 11px; margin-top: 3px; color: #37474f; }
.alj-banner--justif { border-width: 2px; }

/* Justificación de retrasos (director técnico) */
.alj-modal--justif { z-index: 12600; }
.alj-modal--justif .alj-modal-card { width: min(1100px, 100%); max-height: 90vh; }
.alj-modal--justif .alj-modal-head { background: #ede7f6; }
.alj-modal--justif .alj-modal-head h2 { color: #4527a0; }
.alj-jintro { margin: 0 0 10px; font-size: 13px; }
.alj-jinsp { border: 1px solid #e0e0e0; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.alj-jinsp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.alj-jinsp-todas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.alj-jinsp-todas select, .alj-jinsp-todas input { font-size: 12px; padding: 4px 6px; }
.alj-jinsp-todas input { width: 200px; }
.alj-jinsp-todas button { font-size: 12px; padding: 4px 10px; }
.alj-jtabla select { width: 100%; min-width: 220px; font-size: 12px; padding: 4px; }
.alj-jtabla input[type="text"] { width: 100%; min-width: 160px; font-size: 12px; padding: 4px 6px; }
.alj-jtabla .alj-jid { font-weight: 700; white-space: nowrap; }
.alj-jtabla tr.alj-jlista td { background: #f1f8e9; }
.alj-jtabla tr.alj-jerror td { background: #ffebee; }
.alj-jtabla tr.alj-jerror input[type="text"] { border-color: #c62828; }
.alj-jmsg { font-size: 12px; }


/* ===== Autoagendamiento web ===== */
.aa-filtro { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 14px; margin-bottom: 12px; }
.aa-rangos { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.aa-rangos button { background: #fff; color: var(--text); border: 0; border-right: 1px solid var(--border); border-radius: 0; padding: 6px 12px; font-size: 13px; box-shadow: none; }
.aa-rangos button:last-child { border-right: 0; }
.aa-rangos button:hover { background: #f6f6f7; }
.aa-rangos button.activo { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.aa-fechas { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.aa-fechas input[type="date"] { padding: 5px 8px; }
.aa-msg { flex-basis: 100%; margin: 0; font-size: 12px; }

.aa-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.aa-kpi { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.aa-kpi strong { font-size: 24px; line-height: 1.1; color: var(--text); }
.aa-kpi span { font-size: 13px; font-weight: 600; color: var(--text); }
.aa-kpi small { font-size: 11px; color: var(--muted); }
.aa-kpi--ok strong { color: var(--ok); }
.aa-kpi--warn strong { color: var(--warn); }

.aa-acordeon { display: flex; flex-direction: column; gap: 8px; }
.aa-sec { background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.aa-sec > summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; user-select: none; }
.aa-sec > summary::-webkit-details-marker { display: none; }
.aa-sec > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: 0 0 auto; margin-right: 2px; }
.aa-sec[open] > summary::before { transform: rotate(45deg); }
.aa-sec > summary:hover { background: #fafafa; border-radius: 10px; }
.aa-sec-titulo { font-weight: 600; font-size: 14px; color: var(--text); }
.aa-sec-resumen { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }
.aa-sec-cuerpo { padding: 4px 16px 16px; border-top: 1px solid #f0f0f1; }
.aa-sec--config .aa-sec-titulo { font-weight: 500; color: var(--muted); }
.aa-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; }
@media (max-width: 1000px) { .aa-cols-2 { grid-template-columns: 1fr; } }

.aa-h3 { margin: 16px 0 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.aa-h3--top { margin-top: 12px; }
.aa-nota { margin: 0 0 8px; font-size: 12px; }
.aa-vacio { margin: 4px 0; font-size: 12px; }
.aa-check { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 10px 0 0; }
.aa-link-pagina { text-decoration: none; padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; color: var(--text); }

.aa-datos { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 12px 0 4px; }
.aa-dato { display: flex; flex-direction: column; }
.aa-dato strong { font-size: 18px; color: var(--text); }
.aa-dato span { font-size: 11px; color: var(--muted); }

.aa-barras { display: flex; flex-direction: column; gap: 6px; }
.aa-barra { display: grid; grid-template-columns: minmax(90px, 36%) 1fr auto; align-items: center; gap: 10px; font-size: 12px; }
.aa-barra-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aa-barra-track { background: #f3f3f4; border-radius: 4px; height: 8px; overflow: hidden; }
.aa-barra-fill { display: block; height: 100%; background: #7986cb; border-radius: 4px; }
.aa-barra--warn .aa-barra-fill { background: #f0a35e; }
.aa-barra-val { white-space: nowrap; font-weight: 600; min-width: 64px; text-align: right; }
.aa-barra-val small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.aa-fill--pend { background: #f9a825 !important; }
.aa-fill--aprob { background: #1e88e5 !important; }
.aa-fill--ok { background: #43a047 !important; }
.aa-fill--warn { background: #ef6c00 !important; }
.aa-fill--bad { background: #e57373 !important; }
.aa-fill--gris { background: #bdbdbd !important; }

.aa-embudo { display: flex; flex-direction: column; gap: 8px; }
.aa-embudo-paso { display: grid; grid-template-columns: minmax(140px, 40%) 1fr 48px; gap: 10px; align-items: center; font-size: 12px; }
.aa-embudo-track { background: #f3f3f4; border-radius: 6px; height: 22px; overflow: hidden; }
.aa-embudo-fill { display: flex; align-items: center; justify-content: flex-end; height: 100%; padding: 0 8px; color: #fff; font-weight: 700; border-radius: 6px; min-width: 26px; box-sizing: border-box; }
.aa-embudo-fill--1 { background: #b0bec5; }
.aa-embudo-fill--2 { background: #7986cb; }
.aa-embudo-fill--3 { background: #42a5f5; }
.aa-embudo-fill--4 { background: #43a047; }
.aa-embudo-pct { font-weight: 700; text-align: right; }

.aa-leyenda { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.aa-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.aa-dot--a, .aa-col-a { background: #bbdefb; }
.aa-dot--b, .aa-col-b { background: #43a047; }
.aa-columnas { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 14px; overflow-x: auto; }
.aa-columnas--compacta { height: 130px; }
.aa-col { flex: 1 1 0; min-width: 14px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.aa-col-barras { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 1px; }
.aa-col-a, .aa-col-b { position: relative; width: 45%; min-height: 0; border-radius: 3px 3px 0 0; }
.aa-col-a em, .aa-col-b em { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); font-size: 9px; font-style: normal; color: var(--muted); white-space: nowrap; }
.aa-col-b em { color: var(--ok); font-weight: 700; }
.aa-col-lbl { font-size: 9px; color: var(--muted); height: 14px; margin-top: 3px; white-space: nowrap; }

.aa-mini { width: 100%; font-size: 12px; border-collapse: collapse; }
.aa-mini td { padding: 5px 2px; border-bottom: 1px solid #f3f3f4; }
.aa-mini td:last-child { text-align: right; }
.aa-tag-ok { color: var(--ok); font-weight: 700; font-size: 11px; }
.aa-tag-bad { color: #c62828; font-weight: 600; font-size: 11px; }
.aa-filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 8px; }
.aa-filtros input[type="search"] { min-width: 260px; }
.aa-filtros .aa-nota { margin: 0; }
.aa-tabla { max-height: 480px; }
.aa-tabla--baja { max-height: 260px; margin-top: 12px; }
.aa-tabla td small { font-size: 11px; }
.aa-chip { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #eceff1; color: #37474f; white-space: nowrap; }
.aa-chip--pend { background: #fff8e1; color: #8d6e00; }
.aa-chip--aprob { background: #e3f2fd; color: #1565c0; }
.aa-chip--ok { background: #e8f5e9; color: #2e7d32; }
.aa-chip--warn { background: #fff3e0; color: #e65100; }
.aa-chip--bad { background: #ffebee; color: #c62828; }
.aa-chip--gris { background: #eeeeee; color: #616161; }
.aa-link { font-weight: 600; white-space: nowrap; }
.aa-mini-btn { font-size: 10px; padding: 1px 6px; margin-left: 4px; border-radius: 4px; }
tr.aa-sesion-row { cursor: pointer; }
tr.aa-sesion-row.aa-abierta td { background: #f5f7ff; }
tr.aa-timeline-row > td { background: #fafbff; }
.aa-timeline ol { list-style: none; margin: 4px 0 8px; padding: 0 0 0 14px; border-left: 2px solid #c5cae9; }
.aa-timeline li { position: relative; padding: 4px 0 4px 10px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.aa-timeline li::before { content: ''; position: absolute; left: -20px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: #7986cb; }
.aa-timeline li.aa-tl-envio_ok::before, .aa-timeline li.aa-tl-pse::before { background: #43a047; }
.aa-timeline li[class*="error"]::before { background: #e53935; }
.aa-timeline li.aa-tl-salida::before { background: #9e9e9e; }
.aa-tl-t { color: var(--muted); min-width: 130px; }
.aa-tl-e { font-weight: 600; }
.aa-tl-d { color: #555; }
.aa-sec--config textarea { font-family: monospace; font-size: 12px; }

/* Informe gestión plegable (consultas) */
.consulta-plegable > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; user-select: none; }
.consulta-plegable > summary::-webkit-details-marker { display: none; }
.consulta-plegable > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: 0 0 auto; }
.consulta-plegable[open] > summary::before { transform: rotate(45deg); }
.consulta-plegable > summary h3 { margin: 0; font-size: .95rem; }
.consulta-plegable-ayuda { margin-left: auto; font-size: 11px; }
.consulta-plegable:not([open]) { padding-bottom: 12px; }
/* Paneles plegables (rutas: mapa, inspectores habilitados, demanda) */
.panel-plegable > summary { display: flex; align-items: center; gap: 10px; list-style: none; }
details.panel-plegable[data-single-click="true"] > summary {
  cursor: pointer !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
.panel-plegable > summary::-webkit-details-marker { display: none; }
.panel-plegable > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: 0 0 auto; }
.panel-plegable[open] > summary::before { transform: rotate(45deg); }
.panel-plegable > summary h2 { margin: 0; font-size: 1rem; }
.panel-plegable > summary h3 { margin: 0; font-size: .95rem; }
.panel-plegable-ayuda { margin-left: auto; font-size: 11px; }
.panel-plegable-ayuda::after { content: 'Clic para mostrar'; }
.panel-plegable[open] > summary .panel-plegable-ayuda::after { content: 'Clic para ocultar'; }
/* Solicitudes de equipo (pie de rey) */
.seq-tabs { display: inline-flex; gap: 4px; }
.seq-tabs button { background: #fff; color: var(--text); border: 1px solid var(--border); }
.seq-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.seq-card { border: 1px solid var(--border); border-left: 4px solid #f59e0b; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #fffdf7; }
.seq-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.seq-card-body { margin: 6px 0 8px; font-size: 13px; }
.seq-motivo { margin-top: 4px; padding: 4px 8px; background: #fff; border: 1px dashed var(--border); border-radius: 6px; }
.seq-card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seq-card-actions select { flex: 1 1 320px; min-width: 220px; }
.seq-estado { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #eef0f3; }
.seq-estado--aprobada { background: #e6f4ea; color: #1e7b34; }
.seq-estado--rechazada { background: #fdecea; color: #b42318; }
.seq-estado--pendiente { background: #fff4e0; color: #9a5b00; }
.seq-pin-resultado { padding: 8px 12px; border-radius: 8px; background: #eef6ff; border: 1px solid #bfdbfe; font-size: 13px; }
.seq-pin-codigo { font-size: 1.15rem; letter-spacing: 2px; font-family: ui-monospace, Consolas, monospace; }
.link-btn { background: none; border: none; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font: inherit; }

/* Validación FR-003: ítems marcados con error (admin-items-informe.js) */
.ii-host:empty { display: none; }
.ii-box { border: 1px solid var(--border, #d0d7de); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }
.ii-host.ii-con-marcas .ii-box { border-color: var(--err, #dc2626); }
.ii-box > summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.ii-box[open] { max-height: 340px; overflow-y: auto; }
.ii-grupo { margin-top: 6px; }
.ii-grupo-titulo { font-size: 11px; font-weight: 700; text-transform: uppercase; opacity: 0.7; margin-bottom: 2px; }
.ii-item label { display: flex; gap: 6px; align-items: baseline; font-size: 13px; cursor: pointer; flex-wrap: wrap; }
.ii-item label small { font-size: 11px; }
.ii-item .ii-obs { width: 100%; margin: 2px 0 4px 22px; max-width: calc(100% - 22px); font-size: 12px; }
.ii-previos { color: var(--err, #dc2626); }
