@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

    :root {
      --primary: #4f46e5;
      --primary-dark: #4338ca;
      --success: #10b981;
      --danger: #ef4444;
      --warning: #f59e0b;
      --info: #06b6d4;
      --bg: #f8fafc;
      --card: #ffffff;
      --border: #f1f5f9;
      --text: #0f172a;
      --text-muted: #64748b;
      --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 8px -1px rgba(15, 23, 42, 0.02);
      --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 10px 10px -5px rgba(15, 23, 42, 0.03);
      --radius: 14px;
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      letter-spacing: -0.1px;
    }
    .layout { display: flex; min-height: 100vh; }
    .sidebar {
      width: 250px;
      background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
      color: #fff;
      display: flex;
      flex-direction: column;
      padding: 0;
      position: fixed;
      top: 0; left: 0; bottom: 0;
      z-index: 100;
      transition: width .3s;
      border-right: 1px solid rgba(255, 255, 255, 0.05);
    }
    .sidebar-logo {
      padding: 24px 20px;
      font-size: 1.15rem;
      font-weight: 800;
      letter-spacing: .5px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .sidebar-logo span { font-size: 1.5rem; }
    .sidebar nav { flex: 1; padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; }
    .nav-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 16px;
      cursor: pointer;
      border-radius: 8px;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      font-size: .9rem;
      font-weight: 500;
      color: rgba(255, 255, 255, 0.7);
    }
    .nav-item:hover {
      background: rgba(255, 255, 255, 0.06);
      color: #fff;
      transform: translateX(4px);
    }
    .nav-item.active {
      background: rgba(79, 70, 229, 0.2);
      color: #fff;
      font-weight: 600;
      border: 1px solid rgba(79, 70, 229, 0.4);
    }
    .nav-item .icon { font-size: 1.2rem; width: 22px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
    .sidebar-footer {
      padding: 16px;
      font-size: .75rem;
      color: rgba(255, 255, 255, 0.45);
      border-top: 1px solid rgba(255, 255, 255, 0.05);
      background: rgba(0, 0, 0, 0.1);
    }
    .main {
      margin-left: 250px;
      flex: 1;
      display: flex;
      flex-direction: column;
    }
    .topbar {
      background: var(--card);
      border-bottom: 1px solid var(--border);
      padding: 14px 28px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky;
      top: 0;
      z-index: 50;
      box-shadow: 0 1px 3px rgba(0,0,0,.03);
    }
    .topbar-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.2px; }
    .topbar-right { display: flex; align-items: center; gap: 14px; }
    .search-box {
      display: flex;
      align-items: center;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 7px 12px;
      gap: 8px;
      width: 320px;
      transition: all 0.2s;
      position: relative;
    }
    .search-box:focus-within {
      border-color: var(--primary);
      background: var(--card);
      box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    }
    .search-box input {
      border: none;
      background: transparent;
      outline: none;
      font-size: .9rem;
      width: 100%;
      color: var(--text);
    }
    .search-box .icon { color: var(--text-muted); }
    .search-preview-dropdown {
      display: none;
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      width: 460px;
      max-height: 440px;
      overflow-y: auto;
      background: var(--card);
      border: 1px solid #e2e8f0;
      border-radius: var(--radius);
      box-shadow: 0 20px 30px -5px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(15, 23, 42, 0.05);
      z-index: 1000;
      padding: 6px 0;
      animation: slideUp 0.15s ease;
    }
    .search-preview-header {
      padding: 8px 14px 4px;
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-muted);
      border-bottom: 1px solid rgba(241, 245, 249, 0.8);
      background: #f8fafc;
    }
    .search-preview-item {
      padding: 10px 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      cursor: pointer;
      border-bottom: 1px solid rgba(241, 245, 249, 0.7);
      transition: background 0.15s;
    }
    .search-preview-item:last-child {
      border-bottom: none;
    }
    .search-preview-item:hover {
      background: #f1f5f9;
    }
    .search-preview-info {
      display: flex;
      flex-direction: column;
      gap: 2px;
      overflow: hidden;
    }
    .search-preview-title {
      font-size: 0.88rem;
      font-weight: 600;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .search-preview-sub {
      font-size: 0.78rem;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }
    .tag-badge {
      display: inline-flex;
      align-items: center;
      padding: 2px 7px;
      border-radius: 999px;
      font-size: 0.72rem;
      font-weight: 600;
      background: #f1f5f9;
      color: #475569;
      border: 1px solid #e2e8f0;
      white-space: nowrap;
    }
    .tag-filter-wrap {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px dashed var(--border);
    }
    .tag-chip {
      padding: 4px 11px;
      border-radius: 999px;
      border: 1px solid #e2e8f0;
      background: #f8fafc;
      font-size: 0.76rem;
      font-weight: 500;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.15s;
    }
    .tag-chip:hover {
      background: #e2e8f0;
      color: var(--text);
    }
    .tag-chip.active {
      background: var(--primary);
      color: #fff;
      border-color: var(--primary);
      font-weight: 600;
    }
    .badge-notif {
      background: var(--danger);
      color: #fff;
      border-radius: 50%;
      width: 20px; height: 20px;
      font-size: .7rem;
      display: flex; align-items: center; justify-content: center;
      font-weight: 700;
    }
    .content { padding: 28px; flex: 1; }
    .page { display: none; }
    .page.active { display: block; }
    .summary-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 16px;
      margin-bottom: 22px;
    }
    .summary-card {
      background: var(--card);
      border-radius: var(--radius);
      padding: 18px 20px;
      box-shadow: var(--shadow);
      display: flex;
      align-items: center;
      gap: 14px;
      border: 1px solid rgba(15, 23, 42, 0.04);
      transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .summary-card:hover {
      transform: translateY(-3px) scale(1.01);
      box-shadow: var(--shadow-lg);
    }
    .summary-card.blue   { border-bottom: 3px solid var(--primary); }
    .summary-card.green  { border-bottom: 3px solid var(--success); }
    .summary-card.red    { border-bottom: 3px solid var(--danger); }
    .summary-card.amber  { border-bottom: 3px solid var(--warning); }
    .summary-card.cyan   { border-bottom: 3px solid var(--info); }
    .summary-card.purple { border-bottom: 3px solid #8b5cf6; }
    .summary-icon {
      font-size: 1.7rem;
      width: 50px; height: 50px;
      border-radius: 12px;
      display: flex; align-items: center; justify-content: center;
      transition: transform 0.3s ease;
      flex-shrink: 0;
    }
    .summary-card:hover .summary-icon {
      transform: scale(1.08) rotate(4deg);
    }
    .blue   .summary-icon { background: #e0e7ff; }
    .green  .summary-icon { background: #d1fae5; }
    .red    .summary-icon { background: #fee2e2; }
    .amber  .summary-icon { background: #fef3c7; }
    .cyan   .summary-icon { background: #ecfeff; }
    .purple .summary-icon { background: #f3e8ff; }
    .summary-info .label { font-size: .78rem; color: var(--text-muted); margin-bottom: 2px; }
    .summary-info .value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
    .summary-info .sub-label { font-size: .73rem; margin-top: 2px; }
    .section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
      flex-wrap: wrap;
      gap: 10px;
    }
    .section-header h2 { font-size: 1.1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 10px 20px;
      border-radius: 10px;
      border: none;
      cursor: pointer;
      font-size: .88rem;
      font-weight: 600;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    }
    .btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.08);
    }
    .btn:active {
      transform: translateY(0);
    }
    .btn-primary {
      background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
      color: #fff;
    }
    .btn-primary:hover {
      box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.35);
    }
    .btn-success {
      background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
      color: #fff;
    }
    .btn-success:hover {
      box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.35);
    }
    .btn-danger {
      background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
      color: #fff;
    }
    .btn-danger:hover {
      box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.35);
    }
    .btn-warning {
      background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
      color: #fff;
    }
    .btn-warning:hover {
      box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.35);
    }
    .btn-outline {
      background: var(--card);
      border: 1px solid #e2e8f0;
      color: var(--text);
    }
    .btn-outline:hover {
      background: #f8fafc;
      border-color: #cbd5e1;
    }
    .btn-sm { padding: 6px 14px; font-size: .8rem; border-radius: 8px; }
    .btn-icon { padding: 8px; border-radius: 8px; }
    .table-wrap {
      background: var(--card);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    .table-toolbar {
      padding: 14px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid var(--border);
      flex-wrap: wrap;
      gap: 10px;
    }
    .table-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    table {
      width: 100%;
      border-collapse: collapse;
      font-size: .9rem;
    }
    thead th {
      background: #f8fafc;
      padding: 12px 16px;
      text-align: left;
      font-weight: 600;
      font-size: .82rem;
      text-transform: uppercase;
      letter-spacing: .5px;
      color: var(--text-muted);
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
      cursor: pointer;
      user-select: none;
    }
    thead th:hover { background: #f1f5f9; }
    thead th .sort-icon { margin-left: 4px; opacity: .5; }
    thead th.sorted .sort-icon { opacity: 1; color: var(--primary); }
    tbody tr {
      border-bottom: 1px solid var(--border);
      transition: background .15s;
    }
    tbody tr:last-child { border-bottom: none; }
    tbody tr:hover { background: #f8fafc; }
    tbody td { padding: 12px 16px; vertical-align: middle; }
    tbody tr.sub-table td { padding: 0; }
    .sub-table-wrap { overflow: hidden; transition: max-height .3s ease; max-height: 0; }
    .sub-table-wrap.open { max-height: 2000px; }
    .sub-table-inner { background: #f8fafc; padding: 0 16px 16px; }
    .sub-table-inner table { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
    .sub-table-inner th { font-size: .75rem; padding: 8px 12px; background: #eef2f6; }
    .sub-table-inner td { padding: 8px 12px; font-size: .85rem; }
    .subtable-bulk-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: #fef3c7;
      border: 1px solid #fde68a;
      padding: 8px 14px;
      border-radius: 8px;
      margin-bottom: 10px;
      font-size: .85rem;
      color: #92400e;
      animation: slideUp .2s ease;
      flex-wrap: wrap;
      gap: 8px;
    }
    .table-footer {
      padding: 12px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-top: 1px solid var(--border);
      font-size: .85rem;
      color: var(--text-muted);
      flex-wrap: wrap;
      gap: 8px;
    }
    .pagination { display: flex; gap: 4px; }
    .page-btn {
      width: 32px; height: 32px;
      border-radius: 6px;
      border: 1px solid var(--border);
      background: var(--card);
      cursor: pointer;
      font-size: .85rem;
      display: flex; align-items: center; justify-content: center;
      transition: all .15s;
    }
    .page-btn:hover { background: var(--bg); }
    .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 10px;
      border-radius: 999px;
      font-size: .78rem;
      font-weight: 600;
    }
    .badge-green  { background: #dcfce7; color: #15803d; }
    .badge-red    { background: #fee2e2; color: #b91c1c; }
    .badge-amber  { background: #fef3c7; color: #92400e; }
    .badge-blue   { background: #dbeafe; color: #1d4ed8; }
    .badge-gray   { background: #f1f5f9; color: #475569; }
    .badge-purple { background: #ede9fe; color: #6d28d9; }
    
    /* MODAL ROBUSTO E RÍGIDO (NÃO FECHA AO CLICAR FORA OU ARRASTAR SELEÇÃO) */
    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.65);
      backdrop-filter: blur(2px);
      z-index: 200;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }
    .modal-overlay.open { display: flex; }
    .modal {
      background: var(--card);
      border-radius: var(--radius);
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
      width: 100%;
      max-width: 620px;
      max-height: 90vh;
      overflow-y: auto;
      animation: slideUp .22s cubic-bezier(0.16, 1, 0.3, 1);
      border: 1px solid rgba(255, 255, 255, 0.2);
    }
    @keyframes slideUp {
      from { transform: translateY(20px) scale(0.98); opacity: 0; }
      to   { transform: translateY(0) scale(1);       opacity: 1; }
    }
    @keyframes modalPulse {
      0%   { transform: scale(1); }
      50%  { transform: scale(1.015); }
      100% { transform: scale(1); }
    }
    .modal.pulse {
      animation: modalPulse 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .modal-header {
      padding: 18px 24px 16px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky;
      top: 0;
      background: var(--card);
      z-index: 10;
    }
    .modal-header h3 { font-size: 1.05rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
    .modal-close {
      background: rgba(0, 0, 0, 0.04);
      border: 1px solid var(--border);
      font-size: 1.1rem;
      cursor: pointer;
      color: var(--text-muted);
      line-height: 1;
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      transition: all 0.15s;
    }
    .modal-close:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
    .modal-body { padding: 20px 24px; }
    .modal-footer {
      padding: 16px 24px;
      border-top: 1px solid var(--border);
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      position: sticky;
      bottom: 0;
      background: var(--card);
      z-index: 10;
    }
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .form-grid .full { grid-column: 1 / -1; }
    .form-grid .triple { grid-column: 1 / -1; }
    .form-group { display: flex; flex-direction: column; gap: 5px; }
    .form-group label { font-size: .85rem; font-weight: 500; color: var(--text-muted); }
    .form-group input,
    .form-group select,
    .form-group textarea {
      padding: 9px 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: .9rem;
      outline: none;
      transition: border-color .2s, box-shadow .2s;
      background: var(--card);
      color: var(--text);
    }
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    }
    .form-group textarea { resize: vertical; min-height: 70px; }
    .tab-buttons {
      display: flex;
      gap: 8px;
      border-bottom: 2px solid var(--border);
      margin-bottom: 12px;
    }
    .tab-btn {
      padding: 8px 16px;
      font-size: .88rem;
      font-weight: 600;
      cursor: pointer;
      border: none;
      background: none;
      color: var(--text-muted);
      border-bottom: 2px solid transparent;
      margin-bottom: -2px;
      transition: all .2s;
    }
    .tab-btn:hover {
      color: var(--primary);
    }
    .tab-btn.active {
      color: var(--primary);
      border-bottom-color: var(--primary);
    }
    .bulk-select-list {
      max-height: 190px;
      overflow-y: auto;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px;
      background: var(--bg);
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 6px;
    }
    .bulk-select-item {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: .82rem;
      background: var(--card);
      padding: 6px 10px;
      border-radius: 6px;
      border: 1px solid var(--border);
      cursor: pointer;
      transition: all .15s;
    }
    .bulk-select-item:hover {
      border-color: var(--primary);
      background: #f8fafc;
    }
    .charts-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
      gap: 20px;
      margin-bottom: 28px;
    }
    .chart-card {
      background: var(--card);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 20px;
    }
    .chart-card h3 { font-size: .95rem; font-weight: 600; margin-bottom: 16px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
    .chart-bar-wrap { display: flex; flex-direction: column; gap: 10px; }
    .chart-bar-item { display: flex; flex-direction: column; gap: 4px; }
    .chart-bar-label { display: flex; justify-content: space-between; font-size: .82rem; }
    .chart-bar-track { background: var(--bg); border-radius: 999px; height: 10px; overflow: hidden; }
    .chart-bar-fill  { height: 100%; border-radius: 999px; transition: width .6s ease; }
    .log-list { display: flex; flex-direction: column; gap: 0; }
    .log-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 12px 0;
      border-bottom: 1px solid var(--border);
    }
    .log-item:last-child { border-bottom: none; }
    .log-dot {
      width: 10px; height: 10px;
      border-radius: 50%;
      margin-top: 5px;
      flex-shrink: 0;
    }
    .log-dot.in  { background: var(--success); }
    .log-dot.out { background: var(--danger); }
    .log-dot.adj { background: var(--warning); }
    .log-info { flex: 1; }
    .log-info .log-title { font-size: .88rem; font-weight: 500; }
    .log-info .log-sub   { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
    .log-qty { font-size: .88rem; font-weight: 600; }
    .log-qty.in  { color: var(--success); }
    .log-qty.out { color: var(--danger); }
    .log-qty.adj { color: var(--warning); }
    .alert-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
    .alert-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      border-radius: 10px;
      font-size: .88rem;
    }
    .alert-item.danger  { background: #fee2e2; color: #991b1b; }
    .alert-item.warning { background: #fef3c7; color: #92400e; }
    .alert-item.info    { background: #dbeafe; color: #1e40af; }
    .alert-icon { font-size: 1.2rem; }
    .filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
    .chip {
      padding: 5px 14px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: var(--card);
      font-size: .82rem;
      cursor: pointer;
      transition: all .15s;
      font-weight: 500;
    }
    .chip:hover { background: var(--bg); }
    .chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
    #toast-container {
      position: fixed;
      bottom: 24px;
      right: 24px;
      z-index: 999;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .toast {
      background: #1e293b;
      color: #fff;
      padding: 12px 18px;
      border-radius: 10px;
      font-size: .88rem;
      box-shadow: var(--shadow-lg);
      display: flex;
      align-items: center;
      gap: 10px;
      animation: toastIn .3s ease;
      min-width: 240px;
    }
    .toast.success { border-left: 4px solid var(--success); }
    .toast.error   { border-left: 4px solid var(--danger); }
    .toast.warning { border-left: 4px solid var(--warning); }
    @keyframes toastIn {
      from { transform: translateX(60px); opacity: 0; }
      to   { transform: translateX(0);    opacity: 1; }
    }
    .empty-state {
      text-align: center;
      padding: 48px 20px;
      color: var(--text-muted);
    }
    .empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
    .empty-state p { font-size: .95rem; }
    @media (max-width: 768px) {
      .sidebar { width: 60px; }
      .sidebar-logo span:last-child,
      .nav-item span:not(.icon),
      .sidebar-footer { display: none; }
      .main { margin-left: 60px; }
      .form-grid { grid-template-columns: 1fr; }
      .summary-grid { grid-template-columns: 1fr 1fr; }
    }
    .text-right { text-align: right; }
    .text-center { text-align: center; }
    .fw-600 { font-weight: 600; }
    .color-success { color: var(--success); }
    .color-danger  { color: var(--danger); }
    .color-warning { color: var(--warning); }
    .mt-4 { margin-top: 16px; }
    .mb-4 { margin-bottom: 16px; }
    .flex-gap { display: flex; gap: 8px; flex-wrap: wrap; }
    select.filter-select {
      padding: 7px 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: .9rem;
      background: var(--card);
      cursor: pointer;
      outline: none;
    }
    select.filter-select:focus { border-color: var(--primary); }
    input[type="file"] { cursor: pointer; }
    input[type="file"]::file-selector-button {
      padding: 8px 14px;
      background: var(--primary);
      color: #fff;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      font-weight: 500;
      margin-right: 10px;
      transition: background .2s;
    }
    input[type="file"]::file-selector-button:hover { background: var(--primary-dark); }
    .serial-bulk-textarea {
      min-height: 120px;
      font-family: 'Courier New', monospace;
      font-size: .85rem;
    }
    .progress-bar {
      height: 6px;
      background: var(--bg);
      border-radius: 999px;
      overflow: hidden;
      margin-top: 4px;
    }
    .progress-fill {
      height: 100%;
      border-radius: 999px;
    }
    .avatar {
      width: 32px; height: 32px;
      border-radius: 50%;
      background: linear-gradient(135deg, #667eea, #764ba2);
      color: #fff;
      display: flex; align-items: center; justify-content: center;
      font-size: .8rem;
      font-weight: 700;
    }
    .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    @media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
    .import-map-select {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 10px;
      background: var(--card);
      font-size: .85rem;
      color: var(--text);
      outline: none;
    }
    .import-map-select:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    }
    .import-mapping-warning {
      margin-top: 8px;
      font-size: .85rem;
      color: #b45309;
    }
    .import-mapping-success {
      margin-top: 8px;
      font-size: .85rem;
      color: #166534;
    }
    .expand-toggle {
      cursor: pointer;
      font-size: .82rem;
      color: var(--primary);
      font-weight: 500;
      background: none;
      border: none;
      padding: 0;
    }
    .expand-toggle:hover { text-decoration: underline; }
    .sub-table-hidden { display: none; }
    .sub-table-visible { display: table-row; }
    .info-card {
      background: var(--card);
      border-radius: var(--radius);
      padding: 16px 20px;
      box-shadow: var(--shadow);
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      gap: 12px;
      font-size: .9rem;
    }
    .info-card .info-icon { font-size: 1.6rem; }
