    :root {
      --bg-app: #f1f5f9;
      --bg-sidebar: #ffffff;
      --bg-card: #ffffff;
      --bg-card-hover: #f8fafc;
      --border-card: #e2e8f0;
      --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
      --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);

      --text-main: #0f172a;
      --text-secondary: #475569;
      --text-muted: #94a3b8;

      --bg-input: #ffffff;
      --border-input: #cbd5e1;
      --focus-ring: #4f46e5;

      --accent-primary: #4f46e5;
      --accent-primary-hover: #4338ca;
      --accent-success: #10b981;
      --accent-warning: #f59e0b;
      --accent-danger: #ef4444;
      --accent-info: #06b6d4;

      --table-zebra: #f8fafc;
      --status-pendiente: #3b82f6; /* AZUL */
      --status-facturado: #10b981; /* VERDE */
      --status-rechazado: #ef4444; /* ROJO */

      --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      --radius-sm: 4px;
      --radius-md: 8px;
      --radius-lg: 12px;
      --transition: all 0.15s ease;
      --table-font-size: 0.84rem;
    }

    [data-theme="dark"] {
      --bg-app: #0b0f19;
      --bg-sidebar: #111827;
      --bg-card: #1f2937;
      --bg-card-hover: #283548;
      --border-card: #374151;
      --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.3);
      --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.7);

      --text-main: #f9fafb;
      --text-secondary: #d1d5db;
      --text-muted: #6b7280;

      --bg-input: #111827;
      --border-input: #374151;
      --focus-ring: #818cf8;

      --accent-primary: #6366f1;
      --accent-primary-hover: #4f46e5;
      --table-zebra: rgba(255, 255, 255, 0.03);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      background-color: var(--bg-app);
      color: var(--text-main);
      font-family: var(--font-family);
      height: 100vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      -webkit-font-smoothing: antialiased;
    }

    .app-container {
      display: flex;
      flex: 1;
      height: calc(100vh - 46px);
      overflow: hidden;
    }

    header.compact-header {
      height: 46px;
      background: var(--bg-card);
      border-bottom: 1px solid var(--border-card);
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0 14px;
      gap: 12px;
      z-index: 10;
    }
    .header-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .brand-title {
      font-size: 1.05rem;
      font-weight: 800;
      letter-spacing: -0.02em;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .version-tag {
      font-size: 0.72rem;
      background: var(--accent-primary);
      color: #fff;
      padding: 2px 6px;
      border-radius: 4px;
      font-weight: 800;
      letter-spacing: 0.05em;
    }

    .classic-menu-bar {
      display: flex;
      gap: 4px;
      list-style: none;
      font-size: 0.76rem;
      font-weight: 600;
      color: var(--text-secondary);
    }
    .classic-menu-item {
      padding: 4px 8px;
      border-radius: var(--radius-sm);
      cursor: pointer;
      transition: var(--transition);
      user-select: none;
    }
    .classic-menu-item:hover {
      background: var(--bg-card-hover);
      color: var(--text-main);
    }

    .header-right {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .header-dolar-box {
      background: rgba(16, 185, 129, 0.12);
      border: 1px solid rgba(16, 185, 129, 0.3);
      padding: 3px 10px;
      border-radius: 6px;
      font-size: 0.8rem;
      font-weight: 800;
      color: var(--accent-success);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .sidebar {
      width: 210px;
      background: var(--bg-sidebar);
      border-right: 1px solid var(--border-card);
      display: flex;
      flex-direction: column;
      transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      user-select: none;
      z-index: 5;
      overflow-y: auto;
      overflow-x: hidden;
      flex-shrink: 0;
    }
    .sidebar.collapsed {
      width: 62px;
    }
    .sidebar-header {
      padding: 8px 10px;
      display: flex;
      justify-content: flex-end;
      border-bottom: 1px solid var(--border-card);
    }
    .sidebar-toggle-btn {
      background: none;
      border: 1px solid var(--border-card);
      border-radius: 6px;
      cursor: pointer;
      color: var(--text-secondary);
      padding: 4px 8px;
      font-size: 0.8rem;
      transition: var(--transition);
    }
    .sidebar-toggle-btn:hover {
      background: var(--bg-card-hover);
      color: var(--text-main);
    }
    .sidebar-nav {
      display: flex;
      flex-direction: column;
      gap: 4px;
      padding: 8px 6px;
      flex: 1;
    }
    .sidebar-btn {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 12px;
      border-radius: 8px;
      border: none;
      background: transparent;
      color: var(--text-secondary);
      font-family: inherit;
      font-size: 0.86rem;
      font-weight: 700;
      cursor: pointer;
      transition: var(--transition);
      text-align: left;
      white-space: nowrap;
      width: 100%;
    }
    .sidebar-btn:hover {
      background: var(--bg-card-hover);
      color: var(--text-main);
    }
    .sidebar-btn.active {
      background: var(--accent-primary);
      color: #ffffff;
      box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
    }
    .sidebar-btn .icon {
      font-size: 1.15rem;
      min-width: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .sidebar.collapsed .sidebar-btn {
      padding: 10px 0;
      justify-content: center;
    }
    .sidebar.collapsed .label,
    .sidebar.collapsed .shortcut {
      display: none;
    }
    .sidebar-btn .shortcut {
      margin-left: auto;
      font-size: 0.72rem;
      opacity: 0.7;
      font-family: 'JetBrains Mono', monospace;
    }
    .sidebar-footer {
      padding: 10px;
      border-top: 1px solid var(--border-card);
      font-size: 0.78rem;
      text-align: center;
    }
    .sidebar.collapsed .sidebar-footer {
      display: none;
    }

    .main-viewport {
      flex: 1;
      height: 100%;
      overflow-y: auto;
      padding: 10px 14px;
      display: flex;
      flex-direction: column;
      background: transparent !important;
      position: relative;
    }
    .tab-pane {
      display: none;
      flex-direction: column;
      gap: 10px;
      height: 100%;
      position: relative;
    }
    .tab-pane.active {
      display: flex;
    }

    /* ESTILO VENTANA MODULAR DE ESCRITORIO PARA TABS */
    .tab-pane.window-pane {
      border-radius: 8px;
      background: var(--bg-card);
      border: 1px solid var(--border-card);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
      overflow: hidden;
      transition: all 0.2s ease;
    }

    .tab-pane.window-pane.is-restored {
      height: 88% !important;
      max-width: 96% !important;
      margin: 1.5vh auto !important;
      border-radius: 10px !important;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55) !important;
    }

    .window-pane-header {
      height: 36px;
      min-height: 36px;
      background: linear-gradient(180deg, var(--bg-card-hover) 0%, var(--bg-card) 100%);
      border-bottom: 1px solid var(--border-card);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 12px;
      user-select: none;
      border-top-left-radius: 8px;
      border-top-right-radius: 8px;
    }

    .window-pane-title {
      font-size: 0.84rem;
      font-weight: 700;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .window-pane-actions {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .btn-window-action {
      background: rgba(255, 255, 255, 0.12);
      border: 1px solid rgba(255, 255, 255, 0.22);
      color: inherit;
      border-radius: 4px;
      width: 26px;
      height: 24px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 0.9rem;
      line-height: 1;
      transition: all 0.15s ease;
      user-select: none;
      padding: 0;
    }

    .btn-window-action:hover {
      background: rgba(255, 255, 255, 0.28);
      transform: scale(1.05);
    }

    .btn-window-action.btn-window-close:hover {
      background: #ef4444 !important;
      color: #ffffff !important;
      border-color: #dc2626 !important;
    }

    /* Scrollbars siempre visibles y estilizados */
    *::-webkit-scrollbar {
      width: 10px;
      height: 10px;
    }
    *::-webkit-scrollbar-track {
      background: rgba(0, 0, 0, 0.08);
      border-radius: 4px;
    }
    *::-webkit-scrollbar-thumb {
      background: var(--accent-primary, #3b82f6);
      border-radius: 4px;
    }
    *::-webkit-scrollbar-thumb:hover {
      background: #2563eb;
    }
    * {
      scrollbar-width: thin;
      scrollbar-color: var(--accent-primary, #3b82f6) rgba(0, 0, 0, 0.08);
    }

    .ui-panel {
      background: var(--bg-card);
      border: 1px solid var(--border-card);
      border-radius: var(--radius-lg);
      padding: 12px 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      box-shadow: var(--shadow-card);
      flex: 1;
      overflow-y: auto !important;
      min-height: 0;
    }
    .panel-toolbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
    }

    .table-container {
      flex: 1;
      overflow-x: scroll !important;
      overflow-y: scroll !important;
      border: 1px solid var(--border-card);
      border-radius: var(--radius-md);
      background: var(--bg-card);
      position: relative;
    }
    .table-grid {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      font-size: var(--table-font-size);
      min-width: 900px;
    }
    .table-grid thead th {
      background: var(--bg-card-hover);
      color: var(--text-secondary);
      font-weight: 700;
      text-transform: uppercase;
      font-size: 0.74rem;
      letter-spacing: 0.04em;
      padding: 8px 12px;
      border-bottom: 2px solid var(--border-card);
      position: sticky;
      top: 0;
      z-index: 2;
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
    }
    .table-grid thead th:hover {
      background: var(--border-card);
      color: var(--text-main);
    }
    .table-grid thead th .sort-indicator {
      margin-left: 4px;
      font-size: 0.7rem;
      color: var(--accent-primary);
    }
    .table-grid tbody td {
      padding: 7px 12px;
      border-bottom: 1px solid var(--border-card);
      white-space: nowrap;
    }
    .table-grid tbody tr:nth-child(even) {
      background-color: var(--table-zebra);
    }
    .table-grid tbody tr:nth-child(odd) {
      background-color: var(--bg-card);
    }
    .table-grid tbody tr:hover {
      background-color: rgba(79, 70, 229, 0.08) !important;
      cursor: pointer;
    }
    .table-grid tbody tr.selected {
      background-color: rgba(79, 70, 229, 0.16) !important;
      font-weight: 600;
    }

    .zoom-controls {
      display: flex;
      align-items: center;
      gap: 4px;
      background: var(--bg-card-hover);
      border: 1px solid var(--border-card);
      border-radius: 6px;
      padding: 2px 6px;
      font-size: 0.78rem;
      font-weight: 700;
    }
    .zoom-btn {
      background: none;
      border: none;
      cursor: pointer;
      color: var(--text-secondary);
      font-size: 0.85rem;
      padding: 2px 4px;
    }
    .zoom-btn:hover {
      color: var(--accent-primary);
    }

    .btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border-radius: var(--radius-md);
      font-family: inherit;
      font-size: 0.82rem;
      font-weight: 700;
      cursor: pointer;
      transition: var(--transition);
      border: 1px solid transparent;
      white-space: nowrap;
    }
    .btn-primary { background: var(--accent-primary); color: #fff; }
    .btn-primary:hover { background: var(--accent-primary-hover); }
    .btn-secondary { background: var(--bg-card-hover); color: var(--text-main); border-color: var(--border-card); }
    .btn-secondary:hover { background: var(--border-card); }
    .btn-danger { background: rgba(239, 68, 68, 0.12); color: var(--accent-danger); border-color: rgba(239, 68, 68, 0.3); }
    .btn-danger:hover { background: var(--accent-danger); color: #fff; }

    .btn-icon {
      background: var(--bg-card-hover);
      border: 1px solid var(--border-card);
      border-radius: var(--radius-sm);
      color: var(--text-secondary);
      padding: 5px 8px;
      cursor: pointer;
    }
    .btn-icon:hover { color: var(--text-main); }

    .f-input, .f-select {
      background: var(--bg-input);
      border: 1px solid var(--border-input);
      color: var(--text-main);
      padding: 6px 10px;
      border-radius: var(--radius-sm);
      font-family: inherit;
      font-size: 0.84rem;
    }
    .f-input:focus, .f-select:focus {
      outline: none;
      border-color: var(--focus-ring);
    }
    .mono { font-family: 'JetBrains Mono', monospace; }

    .badge-status {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 8px;
      border-radius: 9999px;
      font-size: 0.74rem;
      font-weight: 800;
      text-transform: uppercase;
    }
    .badge-status.pendiente { background: rgba(59, 130, 246, 0.14); color: var(--status-pendiente); border: 1px solid rgba(59, 130, 246, 0.3); }
    .badge-status.facturado { background: rgba(16, 185, 129, 0.14); color: var(--status-facturado); border: 1px solid rgba(16, 185, 129, 0.3); }
    .badge-status.rechazado { background: rgba(239, 68, 68, 0.14); color: var(--status-rechazado); border: 1px solid rgba(239, 68, 68, 0.3); }
    .badge-status.anulada { background: rgba(107, 114, 128, 0.16); color: #9ca3af; border: 1px solid rgba(156, 163, 175, 0.3); text-decoration: line-through; }

    .modal-overlay {
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(15, 23, 42, 0.6);
      backdrop-filter: blur(3px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      padding: 16px;
    }
    .modal-overlay.open { display: flex; }
    .modal-window {
      background: var(--bg-card);
      border: 1px solid var(--border-card);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-modal);
      display: flex;
      flex-direction: column;
      resize: both;
      overflow: hidden;
      max-width: 98vw;
      max-height: 96vh;
      position: relative;
      transition: width 0.15s ease, height 0.15s ease;
    }

    /* Modal Maximizado / Ajustar Tamaño a Pantalla Completa */
    .modal-window.is-maximized {
      width: 98vw !important;
      max-width: 98vw !important;
      height: 96vh !important;
      max-height: 96vh !important;
      top: 2vh !important;
      left: 1vw !important;
      margin: 0 !important;
      transform: none !important;
      border-radius: 8px !important;
      display: flex !important;
      flex-direction: column !important;
      z-index: 1050 !important;
      resize: none !important;
    }

    .modal-header-actions {
      display: flex;
      align-items: center;
      gap: 5px;
      margin-left: auto;
    }

    .btn-modal-action {
      background: rgba(255, 255, 255, 0.12);
      border: 1px solid rgba(255, 255, 255, 0.22);
      color: inherit;
      border-radius: 4px;
      width: 28px;
      height: 26px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 0.95rem;
      line-height: 1;
      transition: all 0.15s ease;
      user-select: none;
      padding: 0;
    }

    .btn-modal-action:hover {
      background: rgba(255, 255, 255, 0.28);
      transform: scale(1.05);
    }

    .btn-modal-action.btn-modal-close:hover {
      background: #ef4444 !important;
      color: #ffffff !important;
      border-color: #dc2626 !important;
    }

    /* Estilos cuando hay un fondo de pantalla personalizado */
    .has-custom-wallpaper .app-container {
      background-size: cover !important;
      background-position: center center !important;
      background-repeat: no-repeat !important;
      background-attachment: fixed !important;
    }

    .has-custom-wallpaper .main-viewport,
    .has-custom-wallpaper .tab-panel {
      background: transparent !important;
    }

    .has-custom-wallpaper .tab-pane.window-pane {
      backdrop-filter: blur(8px);
      background: rgba(255, 255, 255, 0.94);
    }

    [data-theme="dark"].has-custom-wallpaper .tab-pane.window-pane {
      background: rgba(15, 23, 42, 0.92);
      border-color: rgba(255, 255, 255, 0.12);
    }

    .modal-header {
      padding: 10px 16px;
      border-bottom: 1px solid var(--border-card);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--bg-card-hover);
      user-select: none;
    }
    .modal-title {
      font-weight: 800;
      font-size: 0.95rem;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .modal-body {
      padding: 14px;
      overflow-x: scroll !important;
      overflow-y: scroll !important;
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .modal-footer {
      padding: 10px 16px;
      border-top: 1px solid var(--border-card);
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      background: var(--bg-card-hover);
    }

    .gds-window-box {
      background: var(--bg-card-hover);
      border: 1px solid var(--border-card);
      border-radius: var(--radius-md);
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .gds-row {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }
    .gds-input-group {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .gds-input-group label {
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--text-secondary);
      text-transform: uppercase;
    }
    .gds-bottom-toolbar {
      display: flex;
      gap: 6px;
      padding: 8px;
      background: var(--bg-card-hover);
      border: 1px solid var(--border-card);
      border-radius: var(--radius-md);
      align-items: center;
      flex-wrap: wrap;
    }
    .gds-tool-btn {
      background: var(--bg-card);
      border: 1px solid var(--border-card);
      padding: 5px 10px;
      font-family: inherit;
      font-size: 0.8rem;
      font-weight: 800;
      border-radius: 4px;
      cursor: pointer;
    }
    .gds-tool-btn:hover { background: var(--border-card); }
  
    /* --- RESIZABLE & REORDERABLE COLUMNS --- */
    th.draggable-col {
      cursor: grab;
      user-select: none;
      position: relative;
    }
    th.draggable-col:active {
      cursor: grabbing;
    }
    th.col-drag-over {
      background: rgba(59, 130, 246, 0.3) !important;
      outline: 2px dashed var(--accent-primary);
    }
    .col-resizer {
      position: absolute;
      right: 0;
      top: 0;
      bottom: 0;
      width: 7px;
      cursor: col-resize;
      user-select: none;
      z-index: 5;
    }
    .col-resizer:hover, .col-resizer.resizing {
      background: var(--accent-primary);
    }

    /* --- DRAGGABLE MODAL WINDOW --- */
    .modal-window.is-draggable {
      position: relative;
      user-select: text;
    }
    .modal-header.drag-handle {
      cursor: grab;
      user-select: none;
    }
    .modal-header.drag-handle:active {
      cursor: grabbing;
    }

    /* --- CONSULTA DE FACTURAS / DETALLE MOVIMIENTO (GDS AESTHETICS) --- */
    .gds-detail-box {
      background: var(--bg-card);
      border: 1px solid var(--border-card);
      border-radius: 8px;
      padding: 12px;
    }
    .gds-field-label {
      font-size: 0.74rem;
      font-weight: 700;
      color: var(--text-secondary);
      margin-bottom: 2px;
    }
    .gds-field-val {
      font-size: 0.86rem;
      font-weight: 600;
      color: var(--text-primary);
    }
    .gds-totals-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      background: rgba(0, 0, 0, 0.2);
      border: 1px solid var(--border-card);
      border-radius: 6px;
      padding: 10px 14px;
      align-items: center;
      margin-top: 10px;
    }
    .gds-total-box {
      display: flex;
      flex-direction: column;
      min-width: 90px;
    }
    .gds-total-box span:first-child {
      font-size: 0.72rem;
      color: var(--text-secondary);
      font-weight: 700;
    }
    .gds-total-box span:last-child {
      font-family: monospace;
      font-weight: 800;
      font-size: 0.95rem;
    }

    /* --- DROPDOWN EN MENÚ SUPERIOR CLÁSICO --- */
    .classic-menu-item.has-dropdown {
      position: relative;
    }
    .classic-dropdown-menu {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      background: var(--bg-card);
      border: 1px solid var(--border-card);
      border-radius: 6px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
      min-width: 250px;
      padding: 6px 0;
      z-index: 1000;
      animation: fadeInDropdown 0.15s ease-out;
    }
    @keyframes fadeInDropdown {
      from { opacity: 0; transform: translateY(-4px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .classic-menu-item.has-dropdown.is-open .classic-dropdown-menu {
      display: block;
    }
    .classic-dropdown-item {
      padding: 8px 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 0.82rem;
      color: var(--text-primary);
      cursor: pointer;
      transition: background 0.15s ease, color 0.15s ease;
    }
    .classic-dropdown-item:hover {
      background: var(--accent-primary);
      color: #fff;
    }

    .btn-secondary.active {
      background: var(--accent-primary) !important;
      color: #ffffff !important;
      border-color: var(--accent-primary) !important;
      box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
    }

    /* --- ASISTENTE DE IMPORTACIÓN GDS --- */
    .import-cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 14px;
      margin-bottom: 16px;
    }
    .import-card {
      background: var(--bg-card);
      border: 1px solid var(--border-card);
      border-radius: 8px;
      padding: 14px;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
    .import-card:hover {
      border-color: var(--accent-primary);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    .import-card.is-selected {
      border: 2px solid var(--accent-primary);
      background: rgba(59, 130, 246, 0.08);
    }
    .import-card-header {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 8px;
    }
    .import-card-icon {
      font-size: 1.6rem;
    }
    .import-card-title {
      font-weight: 700;
      font-size: 0.92rem;
      color: var(--text-primary);
    }
    .import-card-file {
      font-size: 0.76rem;
      font-family: monospace;
      color: var(--text-secondary);
    }
    .import-card-desc {
      font-size: 0.8rem;
      color: var(--text-secondary);
      margin: 0 0 10px 0;
      line-height: 1.35;
    }
    .import-card-footer {
      border-top: 1px solid var(--border-card);
      padding-top: 8px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      color: var(--text-secondary);
    }

    /* Status badges */
    .status-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 0.78rem;
      font-weight: 600;
    }
    .status-badge-ok {
      background: rgba(34, 197, 94, 0.15);
      color: #22c55e;
      border: 1px solid rgba(34, 197, 94, 0.3);
    }
    .status-badge-warn {
      background: rgba(245, 158, 11, 0.15);
      color: #f59e0b;
      border: 1px solid rgba(245, 158, 11, 0.3);
    }

    /* Mini KPI Card */
    .kpi-mini-card {
      background: var(--bg-card);
      border: 1px solid var(--border-card);
      border-radius: 6px;
      padding: 10px;
      display: flex;
      flex-direction: column;
    }
    .kpi-mini-label {
      font-size: 0.72rem;
      color: var(--text-secondary);
      font-weight: 600;
    }
    .kpi-mini-val {
      font-size: 1.15rem;
      font-family: monospace;
      font-weight: 800;
      margin-top: 2px;
    }

    /* Progress bar */
    .progress-bar-wrap {
      width: 100%;
      height: 22px;
      background: rgba(0,0,0,0.3);
      border-radius: 12px;
      overflow: hidden;
      border: 1px solid var(--border-card);
    }
    .progress-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--accent-primary), #60a5fa);
      color: #fff;
      font-size: 0.75rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: width 0.3s ease;
    }

    /* --- USUARIOS, GRUPOS Y POLÍTICAS --- */
    .header-user-badge:hover {
      border-color: var(--accent-primary);
      background: rgba(59, 130, 246, 0.08);
    }
    .user-select-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      border-radius: 6px;
      background: var(--bg-card);
      border: 1px solid var(--border-card);
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .user-select-row:hover {
      border-color: var(--accent-primary);
      transform: translateX(2px);
    }
    .user-select-row.is-active {
      border-color: var(--accent-primary);
      background: rgba(59, 130, 246, 0.12);
    }
    .grupo-card {
      background: var(--bg-card);
      border: 1px solid var(--border-card);
      border-radius: 6px;
      padding: 12px;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .grupo-card:hover {
      border-color: var(--accent-primary);
      transform: translateY(-1px);
    }
    .grupo-card.is-selected {
      border-color: var(--accent-primary);
      background: rgba(59, 130, 246, 0.08);
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    .politica-item:hover {
      border-color: var(--accent-primary) !important;
      background: rgba(255, 255, 255, 0.06) !important;
    }

/* --- ARTÍCULOS: PILLS DE CLASIFICACIÓN Y SELECCIÓN EN BLOQUE --- */
.art-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.art-pill-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.08);
}
.art-pill-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}
.art-pill-btn .pill-badge {
  background: rgba(0, 0, 0, 0.15);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-family: monospace;
}
.art-pill-btn.active .pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.row-bulk-selected {
  background: rgba(59, 130, 246, 0.14) !important;
  border-left: 3px solid #3b82f6 !important;
}
.row-bulk-selected td {
  background: transparent !important;
}



