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

    body {
      font-family: 'Segoe UI', sans-serif;
      background: #f0f2f5;
      color: #333;
    }

    header {
      background: #020024;
      background: linear-gradient(90deg, rgba(2, 0, 36, 1) 0%, rgba(9, 9, 121, 1) 0%, rgba(7, 45, 145, 1) 12%, rgba(0, 212, 255, 1) 100%);
      color: white;
      height: 100px; /* ↓ mais estreito */
      /* padding: 16px 24px; */
      display: flex;
      align-items: center;
      gap: 12px;
      justify-content: center; /* central horizontal */
      align-items: center;     /* central vertical */
    }

    header h1 {
      font-size: 20px;
      font-weight: 600;
    }

    .tabs {
      display: flex;
      background: #fff;
      border-bottom: 2px solid #e0e0e0;
      padding: 0 24px;
    }

    .tab-btn {
      padding: 14px 28px;
      cursor: pointer;
      border: none;
      background: none;
      font-size: 15px;
      font-weight: 500;
      color: #666;
      border-bottom: 3px solid transparent;
      margin-bottom: -2px;
      transition: all 0.2s;
    }

    .tab-btn.active {
      color: #1a1a2e;
      border-bottom-color: #1a1a2e;
    }

    .tab-content {
      display: none;
      padding: 32px 24px;
    }

    .tab-content.active {
      display: block;
    }

    .upload-area {
      border: 2px dashed #c0c0c0;
      border-radius: 12px;
      padding: 48px 24px;
      text-align: center;
      background: #fff;
      cursor: pointer;
      transition: all 0.2s;
      max-width: 500px;
      margin: 0 auto;
    }

    .upload-area:hover,
    .upload-area.dragover {
      border-color: #1a1a2e;
      background: #f5f5ff;
    }

    .upload-area .icon {
      font-size: 48px;
      margin-bottom: 12px;
    }

    .upload-area p {
      color: #666;
      font-size: 14px;
      margin-top: 6px;
    }

    .upload-area input[type="file"] {
      display: none;
    }

    .status-bar {
      padding: 12px 16px;
      background: #fff;
      border-radius: 8px;
      border-left: 4px solid #1a1a2e;
      font-size: 14px;
      max-width: 500px;
      margin: 16px auto 0;
    }

    .btn {
      padding: 12px 24px;
      border: none;
      border-radius: 8px;
      font-size: 15px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    .btn-primary {
      background: #1a1a2e;
      color: white;
    }

    .btn-primary:hover {
      background: #2d2d4e;
    }

    .btn-secondary {
      background: #e0e0e0;
      color: #333;
    }

    .btn-secondary:hover {
      background: #c8c8c8;
    }

    .btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    .actions {
      display: flex;
      gap: 12px;
      justify-content: center;
      margin-top: 20px;
      flex-wrap: wrap;
    }

    .success-msg {
      background: #d1fae5;
      color: #065f46;
      padding: 12px 16px;
      border-radius: 8px;
      font-size: 14px;
      max-width: 500px;
      margin: 12px auto 0;
      text-align: center;
      display: none;
    }

    /* PICKING */
    #picking-output {
      width: 100mm;
      margin: 24px auto 0;
      background: white;
      font-family: Arial, sans-serif;
    }

    .pedido-bloco {
      width: 100%;
      padding: 8px 6px 0 6px;
      background: white;
      page-break-inside: avoid;
    }

    .pedido-titulo {
      font-size: 16pt;
      font-weight: 900;
      font-style: italic;
      color: #000;
      line-height: 1.1;
      margin-bottom: 1px;
    }

    .correios-pedido-label {
      text-align: center;
      font-size: 18pt;
      font-weight: 900;
      letter-spacing: 2px;
      color: #000;
      border: 3px solid #000;
      padding: 7px 0 6px 0;
      margin: 0 6px 6px 6px;
      background: #fff8e1;
      page-break-inside: avoid;
    }

    .pedido-barcode {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      margin: 4px 0 5px 0;
      padding: 3px 0;
      background: #fff;
    }

    .pedido-barcode svg {
      max-width: 92mm;
      height: 42px;
    }

    .pedido-barcode-numero {
      font-size: 7pt;
      font-weight: 800;
      letter-spacing: 1px;
      color: #000;
      margin-top: 1px;
    }

    .pedido-subtitulo {
      font-size: 8pt;
      color: #333;
      margin-bottom: 3px;
    }

    .pedido-cliente {
      font-size: 11pt;
      font-weight: 700;
      color: #000;
      margin-bottom: 5px;
      line-height: 1.2;
    }

    .linha-sep {
      border: none;
      border-top: 1.5px solid #000;
      margin: 4px 0;
    }

    .obs-box {
      background: #fef9c3;
      border: 1px solid #d4a800;
      border-radius: 3px;
      padding: 5px 7px;
      margin: 5px 0;
    }

    .obs-label {
      font-size: 7pt;
      font-weight: 900;
      color: #92600a;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      margin-bottom: 2px;
    }

    .obs-texto {
      font-size: 8.5pt;
      color: #333;
      line-height: 1.3;
    }

    .itens-table {
      width: 100%;
      border-collapse: collapse;
      margin: 4px 0;
    }

    .itens-table thead tr th {
      font-size: 7.5pt;
      font-weight: 900;
      letter-spacing: 0.3px;
      text-transform: uppercase;
      color: #000;
      padding: 3px 2px;
      border-top: 1.5px solid #000;
      border-bottom: 1.5px solid #000;
      background: white;
    }

    .th-ok {
      width: 20px;
      text-align: center;
    }

    .th-sku {
      width: 60px;
      text-align: left;
    }

    .th-desc {
      text-align: left;
    }

    .th-qtd {
      width: 28px;
      text-align: right;
    }

    .itens-table tbody tr td {
      font-size: 8.5pt;
      color: #000;
      padding: 4px 2px;
      vertical-align: top;
    }

    .itens-table tbody tr:not(:last-child) td {
      border-bottom: 1px solid #e0e0e0;
    }

    .td-ok {
      text-align: center;
      padding-top: 3px;
    }

    .td-sku {
      font-weight: 700;
      font-size: 8pt;
    }

    .td-desc {
      font-size: 8pt;
      line-height: 1.3;
    }

    .td-qtd {
      font-size: 20pt !important;
      font-weight: 900;
      text-align: right;
      vertical-align: middle;
      padding-right: 2px;
    }

    .check-box {
      display: inline-block;
      width: 13px;
      height: 13px;
      border: 1.5px solid #555;
      border-radius: 2px;
      background: white;
    }

    .total-linha {
      text-align: right;
      font-size: 8pt;
      color: #555;
      padding: 3px 2px 4px 0;
      border-top: 1px solid #ccc;
    }

    .rodape-info {
      margin: 5px 0 4px 0;
    }

    .rodape-linha {
      font-size: 8pt;
      color: #333;
      margin-bottom: 2px;
      display: flex;
      align-items: baseline;
      gap: 4px;
    }

    .rodape-label {
      font-size: 7pt;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: 0.3px;
      color: #555;
      white-space: nowrap;
    }

    .rodape-valor {
      font-size: 9pt;
      font-weight: 700;
      color: #000;
    }

    .separado-por-area {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 6px;
      margin-top: 3px;
    }

    .separado-por-linha {
      flex: 0 0 60px;
      border-top: 1px solid #999;
    }

    .separado-por-texto {
      font-size: 7pt;
      color: #888;
      white-space: nowrap;
    }

    .divisor-tracejado {
      border: none;
      border-top: 2px dashed #aaa;
      margin: 8px 0;
    }

    .correios-header-print {
      display: none;
    }

    .correios-section-start {
      page-break-before: always;
    }

    @media print {
      @page {
        size: 100mm auto;
        margin: 4mm 3mm;
      }

      body {
        background: white;
      }

      header,
      .tabs,
      #tab-etiquetas,
      #tab-arquivos,
      .actions,
      .status-bar,
      .success-msg,
      #statusPicking,
      #btnImprimirPicking,
      #btnNovoPicking,
      .upload-area {
        display: none !important;
      }

      #tab-picking {
        display: block !important;
        padding: 0 !important;
      }

      #picking-output {
        margin: 0;
        width: 100%;
      }

      .pedido-bloco {
        page-break-inside: avoid;
      }

      .divisor-tracejado {
        page-break-after: auto;
      }

      .correios-header-print {
        display: block !important;
        text-align: center;
        font-size: 22pt;
        font-weight: 900;
        letter-spacing: 2px;
        color: #000;
        border: 3px solid #000;
        padding: 10px 0 8px 0;
        margin-bottom: 10px;
        background: #fff;
        page-break-inside: avoid;
      }

      .correios-section-start {
        page-break-before: always;
      }
    }

    table.preview-table {
      width: 100%;
      border-collapse: collapse;
      background: #fff;
      border-radius: 10px;
      overflow: hidden;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
      margin-top: 20px;
      font-size: 13px;
    }

    table.preview-table th {
      background: #1a1a2e;
      color: white;
      padding: 10px 12px;
      text-align: left;
    }

    table.preview-table td {
      padding: 10px 12px;
      border-bottom: 1px solid #f0f0f0;
    }

    table.preview-table tr:last-child td {
      border-bottom: none;
    }

    table.preview-table tr:hover td {
      background: #f9f9ff;
    }

    table.preview-table tr.linha-rosa:hover td {
      background: #ffdce9 !important;
    }

    table.preview-table tr.linha-correios:hover td {
      background: #ffefb8 !important;
    }

    .history-wrap {
      background: #fff;
      border-radius: 16px;
      padding: 24px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
      border-top: 4px solid #7c3aed;
    }

    .history-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin-bottom: 18px;
      flex-wrap: wrap;
    }

    .history-header h2 {
      font-size: 22px;
      font-weight: 700;
      color: #1a1a2e;
      background: linear-gradient(90deg, #7c3aed, #2563eb, #10b981);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .muted-text {
      color: #777;
      font-size: 13px;
      margin-top: 4px;
    }

    .history-empty {
      background: #fff;
      border: 1px dashed #cfcfd8;
      border-radius: 12px;
      padding: 28px 20px;
      text-align: center;
      color: #666;
      font-size: 14px;
    }

    .history-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .btn-small {
      padding: 8px 14px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 600;
    }

    .btn-danger {
      background: linear-gradient(135deg, #ef4444, #991b1b);
      color: #fff;
      box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12), 0 6px 14px rgba(185, 28, 28, 0.28);
      display: block;
      margin-left: auto;
      margin-top: 14px;
      border: 1px solid #fff;
      outline: 1px solid #dc2626;
      font-size: 11px;
      font-weight: 900;
      letter-spacing: 0.3px;
      text-transform: uppercase;
      padding: 6px 10px;
      border-radius: 8px;
      animation: piscarBotaoPerigo 1.8s ease-in-out infinite;
    }

    @keyframes piscarBotaoPerigo {
      0%, 100% {
        transform: scale(1);
        filter: brightness(1);
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14), 0 8px 18px rgba(185, 28, 28, 0.32);
      }
      50% {
        transform: scale(1.018);
        filter: brightness(1.12);
        box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.22), 0 10px 22px rgba(185, 28, 28, 0.42);
      }
    }

    .btn-danger:hover {
      transform: translateY(-1px) scale(1.02);
      animation-play-state: paused;
    }



    /* .btn-danger {
      margin-top: 20px;

      background: #fbe4e4;
      color: #9f1d1d;
    }

    .btn-danger:hover {
      background: #f6d1d1;
    } */

    .history-table th,
    .history-table td {
      vertical-align: middle;
    }

    .history-table th.center,
    .history-table td.center {
      text-align: center;
    }

    .history-table .acoes-cell {
      text-align: center;
    }

    .btn-etiqueta {
      background: linear-gradient(135deg, #7c3aed, #4f46e5);
      color: #fff;
      box-shadow: 0 4px 10px rgba(79, 70, 229, 0.20);
    }

    .btn-etiqueta:hover {
      background: linear-gradient(135deg, #6d28d9, #4338ca);
      transform: translateY(-1px);
    }

    .btn-lista {
      background: linear-gradient(135deg, #0ea5e9, #2563eb);
      color: #fff;
      box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
    }

    .btn-lista:hover {
      background: linear-gradient(135deg, #0284c7, #1d4ed8);
      transform: translateY(-1px);
    }

    .btn-feito {
      background: linear-gradient(135deg, #22c55e, #16a34a);
      color: #fff;
      box-shadow: 0 4px 10px rgba(22, 163, 74, 0.18);
    }

    .btn-feito:hover {
      background: linear-gradient(135deg, #16a34a, #15803d);
      transform: translateY(-1px);
    }

    /* REGIÃO SUPERIOR NOVA */
    .history-wrap {
      display: flex;
      flex-direction: column;
      gap: 18px;
    }

    .email-import-box {
      margin: 0;
      background: transparent;
      border: none;
      padding: 0;
    }

    .email-import-header {
      display: block;
      margin-bottom: 0;
    }

    .email-import-title {
      font-size: 15px;
      font-weight: 700;
      color: #1a1a2e;
      margin-bottom: 4px;
    }

    .email-import-subtitle {
      font-size: 12px;
      color: #666;
      line-height: 1.45;
    }

    .email-import-form {
      display: block;
    }

    .history-upload {
      margin-bottom: 0;
    }

    /* layout lado a lado */
    .history-wrap .email-import-box+.history-upload,
    .history-wrap .history-upload {
      margin-top: 0;
    }

    /* para os dois blocos ficarem na mesma linha, o ideal é aplicar no HTML um wrapper.
       como você não enviou wrapper, este css usa grid no próprio fluxo visual */
    .email-import-box {
      display: grid;
      grid-template-columns: 320px 1fr;
      gap: 18px;
      align-items: stretch;
    }

    .email-import-header {
      background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
      border: 1px solid #d8e7ff;
      border-radius: 16px;
      padding: 18px;
      box-shadow: 0 8px 20px rgba(37, 99, 235, 0.06);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }

    .email-import-form {
      display: flex;
      align-items: stretch;
    }

    .input-email-endpoint {
      width: 100%;
      padding: 12px 14px;
      border: 1px solid #cfd8e3;
      border-radius: 8px;
      font-size: 14px;
      outline: none;
      background: #fff;
    }

    .input-email-endpoint:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
    }

    .btn-email {
      width: 100%;
      min-height: 150px;
      border-radius: 16px;
      background: #232aa6;
      background: linear-gradient(166deg, rgba(35, 42, 166, 1) 45%, rgba(4, 181, 217, 1) 100%);
      color: #fff;
      box-shadow: 0 10px 24px rgba(234, 88, 12, 0.20);
      font-size: 22px;
      font-weight: 800;
      letter-spacing: 0.2px;
    }

    .btn-email:hover {

      background: #1b1a7a;
      background: linear-gradient(182deg, rgba(27, 26, 122, 1) 45%, rgba(6, 122, 189, 1) 100%);

      transform: translateY(-2px);
    }

    .history-upload {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .history-upload .upload-area {
      max-width: none;
      margin: 0;
      min-height: 190px;
      border-color: #c7b8ff;
      border-radius: 18px;
      background: linear-gradient(180deg, #ffffff, #f8f7ff);
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: 30px 24px;
    }

    .history-upload .upload-area:hover,
    .history-upload .upload-area.dragover {
      border-color: #7c3aed;
      background: linear-gradient(180deg, #f8f7ff, #eef4ff);
      box-shadow: 0 10px 24px rgba(124, 58, 237, 0.10);
    }

    .history-upload .upload-area .icon {
      font-size: 52px;
      margin-bottom: 12px;
    }

    .history-upload .upload-area strong {
      display: block;
      font-size: 22px;
      color: #1a1a2e;
      margin-bottom: 8px;
    }

    .history-upload .upload-area p {
      color: #64748b;
      font-size: 14px;
      margin-top: 0;
      line-height: 1.5;
      max-width: 560px;
      margin-left: auto;
      margin-right: auto;
    }

    .history-upload .status-bar {
      max-width: none;
      margin: 0;
      min-height: 46px;
      padding: 12px 16px;
      background: #f8fafc;
      border-radius: 12px;
      border-left: 4px solid #2563eb;
      font-size: 14px;
      color: #35506b;
      display: flex;
      align-items: center;
    }

    .email-help {
      display: none;
    }

    .print-dates {
      line-height: 1.45;
      font-size: 12px;
    }

    .print-dates strong {
      color: #1a1a2e;
    }

    #tab-etiquetas {
      display: none !important;
    }

    @media (max-width: 980px) {
      .email-import-box {
        grid-template-columns: 1fr;
      }

      .btn-email {
        min-height: 88px;
        font-size: 20px;
      }

      .history-upload .upload-area {
        min-height: 160px;
        padding: 24px 18px;
      }

      .history-upload .upload-area strong {
        font-size: 19px;
      }
    }

    .connection-led-panel {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 12px;
      margin-left: auto;
      flex-wrap: wrap;
    }

    .email-connection-status {
      margin-top: 0;
      padding: 12px 14px;
      border-radius: 14px;
      background: #f8fafc;
      border: 1px solid #dbeafe;
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 13px;
      font-weight: 800;
      color: #334155;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
      min-width: 235px;
      white-space: nowrap;
    }

    @media (max-width: 720px) {
      .connection-led-panel {
        width: 100%;
        justify-content: flex-start;
      }
      .email-connection-status {
        width: 100%;
      }
    }

    .email-led,
    .printer-led {
      width: 14px;
      height: 14px;
      border-radius: 999px;
      background: #94a3b8;
      box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.18);
      flex: 0 0 auto;
    }

    .email-led.checking {
      background: #f59e0b;
      box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18), 0 0 14px rgba(245, 158, 11, 0.65);
      animation: ledPulse 0.9s ease-in-out infinite;
    }

    .email-led.connected {
      background: #22c55e;
      box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18), 0 0 16px rgba(34, 197, 94, 0.75);
      animation: ledPulse 1.2s ease-in-out infinite;
    }

    .printer-led.connected {
      background: #22c55e;
      box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18), 0 0 16px rgba(34, 197, 94, 0.75);
      animation: none;
    }

    .printer-led.printing {
      background: #22c55e;
      box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22), 0 0 22px rgba(34, 197, 94, 0.9);
      animation: ledPulse 0.55s ease-in-out infinite;
    }

    .printer-led.standby {
      background: #f59e0b;
      box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18), 0 0 14px rgba(245, 158, 11, 0.65);
      animation: none;
    }

    .email-led.error,
    .printer-led.error {
      background: #ef4444;
      box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18), 0 0 18px rgba(239, 68, 68, 0.78);
      animation: ledPulse 0.55s ease-in-out infinite;
    }

    @keyframes ledPulse {
      0%, 100% { transform: scale(1); opacity: 0.82; }
      50% { transform: scale(1.2); opacity: 1; }
    }


    /* LED DA IMPRESSORA FLUTUANTE - TODAS AS TELAS */
    .printer-float-status {
      position: fixed;
      bottom: 18px;
      left: 18px;
      z-index: 9997;
      display: flex;
      align-items: center;
      gap: 7px;
      min-width: 165px;
      max-width: calc(100vw - 20px);
      padding: 7px 10px;
      border-radius: 999px;
      background: rgba(240, 253, 244, 0.96);
      border: 1px solid #bbf7d0;
      color: #14532d;
      font-size: 11px;
      font-weight: 900;
      box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      white-space: nowrap;
    }

    .printer-float-status.error {
      background: rgba(254, 242, 242, 0.97);
      border-color: #fecaca;
      color: #7f1d1d;
    }

    .printer-float-status.printing {
      background: rgba(239, 246, 255, 0.97);
      border-color: #bfdbfe;
      color: #1e3a8a;
    }

    .printer-float-status.standby {
      background: rgba(255, 251, 235, 0.97);
      border-color: #fde68a;
      color: #78350f;
    }

    .printer-float-status .printer-led {
      width: 10px;
      height: 10px;
      box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16), 0 0 10px rgba(34, 197, 94, 0.55);
    }

    @media (max-width: 720px) {
      .printer-float-status {
        bottom: 14px;
        left: 14px;
        right: auto;
        width: auto;
        min-width: 142px;
        max-width: calc(100vw - 16px);
        justify-content: center;
        font-size: 10px;
        padding: 6px 8px;
      }
    }

    .email-alert-big,
    .printer-alert-big {
      display: none;
      position: fixed;
      left: 50%;
      top: 28px;
      transform: translateX(-50%);
      z-index: 9999;
      width: min(760px, calc(100vw - 28px));
      background: linear-gradient(135deg, #fee2e2, #fecaca);
      color: #7f1d1d;
      border: 3px solid #ef4444;
      border-radius: 18px;
      box-shadow: 0 18px 55px rgba(127, 29, 29, 0.35);
      padding: 22px 24px;
      font-size: 18px;
      font-weight: 900;
      text-align: center;
      line-height: 1.35;
      animation: alertaEmailPulse 0.85s ease-in-out infinite;
    }

    @keyframes alertaEmailPulse {
      0%, 100% { filter: brightness(1); }
      50% { filter: brightness(1.08); }
    }

    .top-import-row {
      display: grid;
      grid-template-columns: 320px 1fr;
      gap: 18px;
      align-items: stretch;
    }

    @media (max-width: 980px) {
      .top-import-row {
        grid-template-columns: 1fr;
      }
    }

    .logo {
      max-height: 200px; /* tamanho da logo */
      width: auto;
    }

    .brand-logo-expedicao {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      user-select: none;
    }

    .brand-logo-expedicao svg {
      width: 34px;
      height: 34px;
      flex: 0 0 auto;
    }

    .brand-logo-text {
      color: #fff;
      font-size: 25px;
      line-height: 1;
      letter-spacing: -0.8px;
      font-weight: 950;
      display: inline-flex;
      align-items: baseline;
      gap: 0;
    }

    .brand-logo-highlight {
      color: #fff;
      font-weight: 650;
      position: relative;
      padding-bottom: 4px;
    }

    .brand-logo-highlight::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      bottom: -3px;
      height: 4px;
      background: #4ade24;
      border-radius: 999px;
    }

    header {
      background: #1e293b !important;
      height: 74px !important;
    }

    /* FATURAMENTO */
    .main-menu {
      display: flex;
      gap: 10px;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      background: #fff;
      padding: 14px 18px;
      border-bottom: 1px solid #e5e7eb;
      box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
      position: sticky;
      top: 0;
      z-index: 50;
    }

    .main-menu-btn {
      border: 1px solid #dbeafe;
      background: #f8fafc;
      color: #1e293b;
      border-radius: 999px;
      padding: 11px 18px;
      font-size: 14px;
      font-weight: 900;
      cursor: pointer;
      transition: all 0.18s ease;
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .main-menu-btn:hover,
    .main-menu-btn.active {
      background: linear-gradient(135deg, #1d4ed8, #06b6d4);
      color: #fff;
      transform: translateY(-1px);
      box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
    }

    .billing-wrap {
      max-width: 1280px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: 380px 1fr;
      gap: 18px;
      align-items: start;
    }

    .billing-card {
      background: #fff;
      border-radius: 20px;
      padding: 22px;
      box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
      border: 1px solid #e5e7eb;
    }

    .billing-card-title {
      color: #0f172a;
      font-size: 20px;
      font-weight: 900;
      margin-bottom: 6px;
    }

    .billing-card-subtitle {
      color: #64748b;
      font-size: 13px;
      line-height: 1.45;
      margin-bottom: 18px;
    }

    .billing-scan-box {
      background: linear-gradient(180deg, #f8fbff, #eef7ff);
      border: 2px dashed #93c5fd;
      border-radius: 18px;
      padding: 18px;
    }

    .billing-input {
      width: 100%;
      height: 62px;
      border: 2px solid #bfdbfe;
      border-radius: 16px;
      padding: 0 16px;
      font-size: 22px;
      font-weight: 900;
      color: #0f172a;
      outline: none;
      background: #fff;
      text-align: center;
      letter-spacing: 1px;
    }

    .billing-input:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    }

    .billing-kpis {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin-bottom: 16px;
    }

    .billing-kpi {
      background: linear-gradient(180deg, #fff, #f8fafc);
      border: 1px solid #e2e8f0;
      border-radius: 16px;
      padding: 14px;
    }

    .billing-kpi-label {
      color: #64748b;
      font-size: 11px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: .4px;
      margin-bottom: 4px;
    }

    .billing-kpi-value {
      color: #0f172a;
      font-size: 25px;
      font-weight: 950;
    }

    .billing-filter-row {
      display: grid;
      grid-template-columns: 1fr 180px 180px;
      gap: 10px;
      margin-bottom: 14px;
    }

    .billing-select,
    .billing-search {
      height: 44px;
      border: 1px solid #cbd5e1;
      border-radius: 12px;
      padding: 0 12px;
      font-size: 14px;
      outline: none;
      background: #fff;
    }

    .billing-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .billing-order-card {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 12px;
      align-items: center;
      padding: 14px;
      border: 1px solid #e2e8f0;
      border-left: 5px solid #94a3b8;
      border-radius: 16px;
      background: #fff;
    }

    .billing-order-card.lido {
      border-left-color: #22c55e;
      background: #f0fdf4;
    }

    .billing-order-card.enviado {
      border-left-color: #2563eb;
      background: #eff6ff;
    }

    .billing-order-title {
      font-size: 17px;
      font-weight: 950;
      color: #0f172a;
      margin-bottom: 4px;
    }

    .billing-order-meta {
      color: #475569;
      font-size: 12px;
      line-height: 1.55;
    }

    .billing-tag {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      padding: 7px 10px;
      font-size: 11px;
      font-weight: 950;
      text-transform: uppercase;
      background: #e2e8f0;
      color: #334155;
      white-space: nowrap;
    }

    .billing-tag.lido {
      background: #dcfce7;
      color: #166534;
    }

    .billing-tag.enviado {
      background: #dbeafe;
      color: #1d4ed8;
    }

    .billing-side-actions {
      display: grid;
      gap: 9px;
    }

    .billing-read-list {
      margin-top: 16px;
      max-height: 380px;
      overflow: auto;
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding-right: 4px;
    }

    .billing-read-item {
      border: 1px solid #e2e8f0;
      border-left: 4px solid #22c55e;
      border-radius: 14px;
      padding: 12px;
      background: #fff;
    }

    .billing-read-item.enviado {
      border-left-color: #2563eb;
      background: #eff6ff;
    }

    .billing-modal-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.55);
      z-index: 9998;
      align-items: center;
      justify-content: center;
      padding: 18px;
    }

    .billing-modal {
      width: min(520px, 100%);
      background: #fff;
      border-radius: 22px;
      padding: 24px;
      box-shadow: 0 28px 80px rgba(0,0,0,.32);
      border-top: 6px solid #2563eb;
    }

    .billing-modal h3 {
      color: #0f172a;
      font-size: 24px;
      font-weight: 950;
      margin-bottom: 8px;
    }

    .billing-modal-info {
      color: #475569;
      font-size: 14px;
      line-height: 1.5;
      margin-bottom: 16px;
    }

    .billing-volume-input {
      width: 100%;
      height: 74px;
      border: 2px solid #bfdbfe;
      border-radius: 18px;
      text-align: center;
      font-size: 34px;
      font-weight: 950;
      outline: none;
      margin-bottom: 14px;
    }

    .billing-volume-input:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 4px rgba(37,99,235,.13);
    }

    .billing-modal-actions {
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      flex-wrap: wrap;
    }

    @media (max-width: 980px) {
      .billing-wrap {
        grid-template-columns: 1fr;
      }
      .billing-kpis {
        grid-template-columns: repeat(2, 1fr);
      }
      .billing-filter-row {
        grid-template-columns: 1fr;
      }
    }

    @media print {
      .main-menu,
      #tab-faturamento {
        display: none !important;
      }
    }


    /* ══════════════════════════════════════════════════════════════
       EXPEDIÇÃO / SEPARAÇÃO / NF
       ══════════════════════════════════════════════════════════════ */
    .exp-wrap {
      display: grid;
      grid-template-columns: minmax(360px, 480px) 1fr;
      gap: 18px;
      align-items: start;
    }

    .exp-card {
      background: #fff;
      border-radius: 18px;
      padding: 20px;
      box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
      border: 1px solid #e2e8f0;
    }

    .exp-title {
      font-size: 23px;
      font-weight: 950;
      color: #0f172a;
      margin-bottom: 4px;
    }

    .exp-subtitle {
      color: #64748b;
      font-size: 13px;
      line-height: 1.45;
      margin-bottom: 14px;
    }

    .exp-toolbar {
      display: grid;
      grid-template-columns: 1fr 150px;
      gap: 10px;
      margin-bottom: 14px;
    }

    .exp-input,
    .exp-select,
    .exp-textarea {
      width: 100%;
      border: 1px solid #cbd5e1;
      border-radius: 12px;
      padding: 12px 14px;
      font-size: 14px;
      outline: none;
      background: #fff;
    }

    .exp-textarea {
      min-height: 88px;
      resize: vertical;
    }

    .exp-input:focus,
    .exp-select:focus,
    .exp-textarea:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    }

    .exp-queue {
      display: flex;
      flex-direction: column;
      gap: 10px;
      max-height: calc(100vh - 250px);
      overflow: auto;
      padding-right: 4px;
    }

    .exp-row {
      display: grid;
      grid-template-columns: 48px 1fr auto;
      gap: 12px;
      align-items: center;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-left: 5px solid #2563eb;
      border-radius: 16px;
      padding: 12px;
      transition: .16s;
    }

    .exp-row:hover {
      transform: translateY(-1px);
      background: #f1f5f9;
      box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
    }

    .exp-pos {
      width: 38px;
      height: 38px;
      border-radius: 12px;
      background: #e0ecff;
      color: #1d4ed8;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 950;
    }

    .exp-row-title {
      font-weight: 950;
      font-size: 16px;
      color: #0f172a;
      margin-bottom: 2px;
    }

    .exp-row-meta {
      font-size: 12px;
      color: #64748b;
      line-height: 1.35;
    }

    .exp-detail-empty {
      min-height: 520px;
      border: 2px dashed #cbd5e1;
      border-radius: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      color: #64748b;
      padding: 28px;
      background: linear-gradient(180deg, #fff, #f8fafc);
    }

    .exp-detail-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 14px;
      margin-bottom: 16px;
      flex-wrap: wrap;
    }

    .exp-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 8px 11px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 900;
      background: #dbeafe;
      color: #1e40af;
      white-space: nowrap;
    }

    .exp-info-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
      margin: 14px 0;
    }

    .exp-info-box {
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 14px;
      padding: 12px;
    }

    .exp-info-label {
      font-size: 10px;
      font-weight: 950;
      letter-spacing: .5px;
      text-transform: uppercase;
      color: #64748b;
      margin-bottom: 5px;
    }

    .exp-info-value {
      font-size: 14px;
      font-weight: 850;
      color: #0f172a;
      line-height: 1.25;
      word-break: break-word;
    }

    .exp-actions-main {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin: 16px 0;
    }

    .btn-stock {
      background: linear-gradient(135deg, #ef4444, #991b1b);
      color: #fff;
      box-shadow: 0 4px 12px rgba(185, 28, 28, .22);
    }

    .btn-next {
      background: linear-gradient(135deg, #f59e0b, #b45309);
      color: #fff;
      box-shadow: 0 4px 12px rgba(180, 83, 9, .22);
    }

    .exp-items-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 14px;
      overflow: hidden;
      border-radius: 14px;
      font-size: 13px;
    }

    .exp-items-table th {
      background: #0f172a;
      color: #fff;
      text-align: left;
      padding: 11px;
      font-weight: 900;
    }

    .exp-items-table td {
      border-bottom: 1px solid #e2e8f0;
      padding: 10px 11px;
      vertical-align: top;
      background: #fff;
    }

    .exp-items-table tr:nth-child(even) td {
      background: #f8fafc;
    }

    .workflow-table {
      width: 100%;
      border-collapse: collapse;
      background: #fff;
      border-radius: 16px;
      overflow: hidden;
      box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
      font-size: 13px;
    }

    .workflow-table th {
      background: #0f172a;
      color: #fff;
      padding: 12px;
      text-align: left;
      font-weight: 900;
    }

    .workflow-table td {
      padding: 12px;
      border-bottom: 1px solid #e2e8f0;
      vertical-align: top;
    }

    .workflow-table tr:last-child td {
      border-bottom: none;
    }

    .modal-form-row {
      margin-bottom: 12px;
    }

    .modal-form-row label {
      display: block;
      font-size: 12px;
      font-weight: 900;
      color: #334155;
      margin-bottom: 6px;
      text-transform: uppercase;
      letter-spacing: .3px;
    }

    .other-person-wrap {
      display: none;
      margin-top: 8px;
    }

    @media (max-width: 1120px) {
      .exp-wrap {
        grid-template-columns: 1fr;
      }
      .exp-queue {
        max-height: none;
      }
      .exp-info-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (max-width: 720px) {
      .exp-toolbar,
      .exp-actions-main {
        grid-template-columns: 1fr;
      }
      .exp-info-grid {
        grid-template-columns: 1fr;
      }
      .exp-row {
        grid-template-columns: 40px 1fr;
      }
      .exp-row .btn {
        grid-column: 1 / -1;
        width: 100%;
      }
    }


    /* AJUSTES EXPEDIÇÃO / ARQUIVOS IMPORTADOS */
    .history-toggle-btn {
      background: #ffffff;
      border: 1px solid #cbd5e1;
      color: #0f172a;
      border-radius: 999px;
      padding: 7px 12px;
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
      transition: .16s;
    }

    .history-toggle-btn:hover {
      background: #f1f5f9;
      transform: translateY(-1px);
    }

    .history-detail-row td {
      padding: 0 !important;
      background: #fff !important;
    }

    .history-detail-box {
      display: none;
      padding: 14px 16px 18px 16px;
      background: linear-gradient(180deg, #ffffff, #f8fafc);
      border-top: 1px solid #e2e8f0;
    }

    .history-detail-box.open {
      display: block;
    }

    .history-detail-title {
      font-size: 13px;
      font-weight: 950;
      color: #0f172a;
      margin-bottom: 10px;
      text-transform: uppercase;
      letter-spacing: .3px;
    }

    .history-pedidos-grid {
      display: block;
      width: 100%;
    }

    .history-pedido-card {
      border: 1px solid #e2e8f0;
      border-left: 5px solid #2563eb;
      background: #fff;
      border-radius: 14px;
      padding: 12px;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
      box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
    }

    .history-pedidos-list-wrap {
      width: 100%;
      overflow-x: auto;
      border: 1px solid #e2e8f0;
      border-radius: 14px;
      background: #fff;
    }

    .history-pedidos-list-table {
      width: 100%;
      border-collapse: collapse;
      min-width: 760px;
      font-size: 13px;
    }

    .history-pedidos-list-table th {
      background: #f8fafc;
      color: #0f172a;
      padding: 10px 12px;
      text-align: left;
      font-weight: 950;
      border-bottom: 1px solid #e2e8f0;
      white-space: nowrap;
    }

    .history-pedidos-list-table td {
      padding: 10px 12px;
      border-bottom: 1px solid #f1f5f9;
      vertical-align: middle;
      color: #334155;
    }

    .history-pedidos-list-table tr:last-child td {
      border-bottom: none;
    }

    .history-pedidos-list-table tr.correios td {
      background: #fff8e1;
    }

    .history-pedidos-list-table tr.rosa td {
      background: #fff0f6;
    }

    .history-pedido-num-list {
      font-weight: 950;
      color: #0f172a;
      white-space: nowrap;
    }

    .history-pedido-status-cell {
      text-align: center;
      white-space: nowrap;
    }

    .history-pedido-card.correios,
    .exp-row.correios,
    .exp-detail-head.correios {
      border-left-color: #f59e0b;
      background: linear-gradient(90deg, #fff8e1, #ffffff 70%);
    }

    .history-pedido-card.rosa,
    .exp-row.rosa,
    .exp-detail-head.rosa {
      border-left-color: #ec4899;
      background: linear-gradient(90deg, #fff0f6, #ffffff 70%);
    }

    .history-pedido-num {
      font-size: 15px;
      font-weight: 950;
      color: #0f172a;
      margin-bottom: 3px;
    }

    .history-pedido-cliente {
      font-size: 12px;
      color: #64748b;
      line-height: 1.35;
    }

    .pedido-status-feito {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 8px 11px;
      border-radius: 999px;
      background: #dcfce7;
      color: #166534;
      font-size: 12px;
      font-weight: 950;
      white-space: nowrap;
    }

    .pedido-status-estoque {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 8px 11px;
      border-radius: 999px;
      background: #fee2e2;
      color: #991b1b;
      font-size: 12px;
      font-weight: 950;
      white-space: nowrap;
    }

    .exp-badge-correios {
      background: #fff8e1;
      color: #92400e;
      border: 1px solid #f59e0b;
    }

    .exp-badge-rosa {
      background: #fff0f6;
      color: #9d174d;
      border: 1px solid #ec4899;
    }

    .exp-items-table th {
      font-size: 15px;
    }

    .exp-items-table td.exp-sku-cell {
      font-size: 22px;
      font-weight: 950;
      color: #0f172a;
      white-space: nowrap;
    }

    .exp-items-table td.exp-prod-cell {
      font-size: 20px;
      font-weight: 900;
      color: #111827;
      line-height: 1.25;
    }

    .exp-items-table td.exp-qtd-cell {
      font-size: 34px;
      font-weight: 950;
      text-align: right;
      color: #0f172a;
      white-space: nowrap;
    }

    .stock-products-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      max-height: 360px;
      overflow: auto;
      padding-right: 4px;
    }

    .stock-product-row {
      display: grid;
      grid-template-columns: 1fr 110px 90px;
      gap: 10px;
      align-items: center;
      border: 1px solid #e2e8f0;
      border-left: 5px solid #ef4444;
      border-radius: 14px;
      background: #fff;
      padding: 12px;
    }

    .stock-product-name {
      font-size: 13px;
      font-weight: 900;
      color: #0f172a;
      line-height: 1.3;
    }

    .stock-product-sku {
      font-size: 12px;
      color: #64748b;
      margin-top: 3px;
      font-weight: 800;
    }

    .stock-product-row input {
      width: 100%;
      height: 42px;
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      padding: 8px 10px;
      font-size: 18px;
      font-weight: 950;
      text-align: center;
      outline: none;
    }

    .stock-product-total {
      font-size: 12px;
      color: #64748b;
      font-weight: 900;
      text-align: center;
    }



    .history-ver-pedidos-cell {
      text-align: center;
      vertical-align: middle !important;
    }

    .history-ver-pedidos-cell .history-toggle-btn {
      min-width: 118px;
      justify-content: center;
    }

    .exp-items-table th {
      text-align: center !important;
      font-size: 20px !important;
      letter-spacing: .5px;
      padding: 16px 12px !important;
    }

    .exp-items-table td.exp-sku-cell,
    .exp-items-table td.exp-prod-cell,
    .exp-items-table td.exp-qtd-cell {
      text-align: center !important;
      vertical-align: middle;
    }

    .stock-missing-box {
      display: flex;
      flex-direction: column;
      gap: 4px;
      align-items: center;
    }

    .stock-missing-label {
      font-size: 11px;
      font-weight: 950;
      color: #991b1b;
      text-transform: uppercase;
      letter-spacing: .4px;
    }

    .stock-observacao {
      width: 100%;
      min-height: 82px;
      border: 1px solid #cbd5e1;
      border-radius: 12px;
      padding: 10px 12px;
      resize: vertical;
      font-family: inherit;
      font-size: 14px;
      outline: none;
    }

    .btn-stock-return {
      background: linear-gradient(135deg, #22c55e, #15803d);
      color: #fff;
      padding: 7px 10px;
      border-radius: 10px;
      font-size: 12px;
      font-weight: 950;
      border: none;
      cursor: pointer;
      margin-top: 5px;
    }

    .completed-products-list {
      margin-top: 8px;
      padding: 10px;
      background: #f8fafc;
      border-radius: 12px;
      border: 1px solid #e2e8f0;
      font-size: 12px;
      color: #334155;
      line-height: 1.4;
    }

    .completed-products-list strong {
      color: #0f172a;
    }

    .performance-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(160px, 1fr));
      gap: 14px;
      margin: 14px 0 18px;
    }

    .performance-kpi {
      background: #fff;
      border: 1px solid #e2e8f0;
      border-radius: 18px;
      padding: 16px;
      box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
    }

    .performance-kpi-label {
      font-size: 11px;
      color: #64748b;
      font-weight: 950;
      text-transform: uppercase;
      letter-spacing: .4px;
    }

    .performance-kpi-value {
      font-size: 28px;
      font-weight: 950;
      color: #0f172a;
      margin-top: 5px;
    }

    .perf-options {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      margin: 12px 0;
      color: #334155;
      font-weight: 800;
    }

    .perf-section-title {
      margin: 22px 0 10px;
      font-size: 18px;
      font-weight: 950;
      color: #0f172a;
    }

    @media (max-width: 1000px) {
      .performance-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (max-width: 720px) {
      .stock-product-row {
        grid-template-columns: 1fr;
      }
      .stock-product-total {
        text-align: left;
      }
      .history-pedido-card {
        grid-template-columns: 1fr;
      }
      .exp-items-table td.exp-sku-cell,
      .exp-items-table td.exp-prod-cell {
        font-size: 16px;
      }
      .exp-items-table td.exp-qtd-cell {
        font-size: 26px;
      }
    }



/* AJUSTES PERFORMANCE E EXPEDIÇÃO - PATCH */
.perf-filter-panel{background:#f8fafc;border:1px solid #dbeafe;border-radius:18px;padding:16px;margin:14px 0 18px;display:grid;grid-template-columns:1.4fr 1fr;gap:14px;align-items:end}
.perf-filter-buttons{display:flex;gap:8px;flex-wrap:wrap}
.perf-filter-btn{border:1px solid #cbd5e1;background:#fff;color:#0f172a;padding:9px 12px;border-radius:999px;font-weight:900;cursor:pointer;font-size:12px;text-transform:uppercase;letter-spacing:.2px}
.perf-filter-btn.active{background:#1d4ed8;color:#fff;border-color:#1d4ed8;box-shadow:0 8px 20px rgba(37,99,235,.22)}
.perf-date-custom{display:flex;gap:8px;flex-wrap:wrap;align-items:center;justify-content:flex-end}
.perf-date-custom input{height:38px;border:1px solid #cbd5e1;border-radius:10px;padding:0 10px;font-weight:800;color:#0f172a;background:#fff}
.perf-compare-line{margin-top:10px;padding:12px 14px;background:#fff;border:1px solid #e2e8f0;border-radius:14px;color:#334155;font-weight:800}
.perf-split{display:grid;grid-template-columns:minmax(320px,1fr) minmax(360px,1.1fr);gap:18px;align-items:start;margin-top:18px}
.perf-chart-card,.perf-list-card,.perf-podium-card{background:#fff;border:1px solid #e2e8f0;border-radius:18px;padding:18px;box-shadow:0 10px 24px rgba(15,23,42,.06)}
.perf-chart-title,.perf-list-title{font-size:17px;font-weight:950;color:#0f172a;margin-bottom:12px}
.perf-bar-row{display:grid;grid-template-columns:110px 1fr 72px;gap:10px;align-items:center;margin:12px 0;font-size:13px;font-weight:900;color:#334155}
.perf-bar-track{height:26px;background:#eef2ff;border-radius:999px;overflow:hidden;border:1px solid #dbeafe}
.perf-bar-fill{height:100%;background:linear-gradient(90deg,#2563eb,#06b6d4);border-radius:999px;min-width:5px}
.perf-ranking-grid{display:grid;grid-template-columns:repeat(3,minmax(220px,1fr));gap:14px;margin:18px 0}
.perf-podium-title{font-weight:950;font-size:16px;color:#0f172a;margin-bottom:12px;text-align:center}
.perf-podium{display:flex;align-items:end;justify-content:center;gap:10px;min-height:150px}
.perf-place{width:31%;border-radius:18px 18px 10px 10px;text-align:center;padding:12px 7px;color:#fff;font-weight:900;box-shadow:0 10px 22px rgba(15,23,42,.16);display:flex;flex-direction:column;justify-content:flex-start}
.perf-place .medal{font-size:24px;margin-bottom:6px}.perf-place .name{font-size:13px;line-height:1.15}.perf-place .metric{font-size:20px;margin-top:6px}.perf-place .sub{font-size:10px;opacity:.9}
.perf-place.one{height:140px;background:linear-gradient(180deg,#f59e0b,#b45309);order:2}.perf-place.two{height:115px;background:linear-gradient(180deg,#64748b,#334155);order:1}.perf-place.three{height:95px;background:linear-gradient(180deg,#b45309,#7c2d12);order:3}
.perf-empty-place{background:#e2e8f0;color:#64748b}
@media(max-width:980px){.perf-filter-panel,.perf-split,.perf-ranking-grid{grid-template-columns:1fr}.perf-date-custom{justify-content:flex-start}.perf-bar-row{grid-template-columns:92px 1fr 55px}}



/* CONFIGURAÇÕES EXPEDIÇÃO - RESPONSÁVEIS */
.config-grid{display:grid;grid-template-columns:minmax(320px,1fr) minmax(320px,1fr);gap:18px;align-items:start}
.config-card{background:#fff;border:1px solid #e2e8f0;border-radius:18px;padding:20px;box-shadow:0 10px 24px rgba(15,23,42,.06)}
.config-title{font-size:20px;font-weight:950;color:#0f172a;margin-bottom:6px}
.config-subtitle{font-size:13px;color:#64748b;line-height:1.45;margin-bottom:16px}
.config-form{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.config-input{height:44px;border:1px solid #cbd5e1;border-radius:12px;padding:0 14px;font-size:15px;font-weight:800;color:#0f172a;background:#fff;flex:1;min-width:220px}
.config-list{display:flex;flex-direction:column;gap:10px}
.config-person-row{display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:center;background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:12px}
.config-person-name{font-weight:950;color:#0f172a;font-size:15px}
.config-help-box{background:#eef2ff;border:1px solid #c7d2fe;color:#1e3a8a;border-radius:16px;padding:16px;font-weight:800;line-height:1.5}
.perf-next-table-wrap{margin-top:18px}
.perf-section-title{font-size:18px;font-weight:950;color:#0f172a;margin:22px 0 10px}
@media(max-width:900px){.config-grid{grid-template-columns:1fr}.config-person-row{grid-template-columns:1fr}.config-person-row .btn{width:100%}}



/* PATCH PERFORMANCE: tabelas roláveis, ordenação, comparação e SKU performance */
.perf-table-scroll{max-height:520px;overflow:auto;border:1px solid #e2e8f0;border-radius:16px;background:#fff}
.perf-table-scroll table{margin-top:0!important;border-radius:0!important;box-shadow:none!important}
.perf-table-scroll.limited-10{max-height:520px}
.perf-sortable th{position:sticky;top:0;z-index:2;cursor:pointer;user-select:none;white-space:nowrap}
.perf-sortable th::after{content:' ⇅';font-size:11px;opacity:.65}
.perf-sortable th.sort-asc::after{content:' ↑';opacity:1}
.perf-sortable th.sort-desc::after{content:' ↓';opacity:1}
.perf-compare-toggle{border:none;background:linear-gradient(135deg,#7c3aed,#2563eb);color:#fff;border-radius:14px;padding:11px 15px;font-weight:950;cursor:pointer;box-shadow:0 10px 22px rgba(37,99,235,.2)}
.perf-compare-chart{display:none;margin-top:14px;background:#fff;border:1px solid #e2e8f0;border-radius:18px;padding:16px;box-shadow:0 10px 24px rgba(15,23,42,.06)}
.perf-compare-chart.show{display:block}
.perf-compare-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.perf-compare-box{background:#f8fafc;border:1px solid #e2e8f0;border-radius:16px;padding:14px}
.perf-compare-box-title{font-size:12px;font-weight:950;color:#475569;text-transform:uppercase;margin-bottom:10px}
.perf-compare-bar-row{display:grid;grid-template-columns:72px 1fr 70px;gap:8px;align-items:center;margin:9px 0;font-size:12px;font-weight:900;color:#334155}
.perf-compare-bar-track{height:20px;background:#e2e8f0;border-radius:999px;overflow:hidden}
.perf-compare-bar-fill{height:100%;background:linear-gradient(90deg,#2563eb,#06b6d4);border-radius:999px;min-width:4px}
.perf-compare-bar-fill.prev{background:linear-gradient(90deg,#94a3b8,#64748b)}
.perf-muted-small{font-size:12px;color:#64748b;font-weight:800;margin-top:6px}
.perf-next-bottom{margin-top:26px}
@media(max-width:900px){.perf-compare-grid{grid-template-columns:1fr}}



/* PATCH PEDIDOS / BLOCOS DE SEPARAÇÃO */
.pedidos-wrap{background:#fff;border-radius:18px;padding:22px;box-shadow:0 10px 28px rgba(15,23,42,.08);border-top:4px solid #2563eb}
.pedidos-top-head{margin-bottom:16px}.pedidos-kpis{display:flex;gap:10px;flex-wrap:wrap}.pedido-kpi{background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:10px 14px;font-weight:950;color:#1e293b}.pedidos-filter-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:18px;padding:16px;margin-bottom:16px}.pedidos-filter-grid{display:grid;grid-template-columns:180px repeat(3,1fr);gap:12px}.pedidos-filter-grid label{font-size:12px;font-weight:950;color:#475569;text-transform:uppercase;display:flex;flex-direction:column;gap:6px}.pedidos-select-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:14px}.pedidos-table-wrap{border:1px solid #e2e8f0;border-radius:18px;overflow:hidden;background:#fff}.pedidos-table-scroll{max-height:650px;overflow:auto}.pedidos-table{width:100%;border-collapse:collapse;font-size:13px}.pedidos-table th{position:sticky;top:0;z-index:2;background:#1a1a2e;color:#fff;text-align:left;padding:12px;white-space:nowrap}.pedidos-table td{padding:12px;border-bottom:1px solid #f1f5f9;vertical-align:middle}.pedidos-table tr.urgente td{background:#fff7ed}.pedidos-table tr.correios td{border-left:4px solid #f59e0b}.pedidos-table tr.rosa td{border-left:4px solid #ec4899}.pedido-select-check{width:22px;height:22px;accent-color:#2563eb}.pedido-urgent-tag{display:inline-flex;background:linear-gradient(135deg,#ef4444,#b91c1c);color:#fff;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:950;text-transform:uppercase;margin-left:6px;box-shadow:0 6px 14px rgba(185,28,28,.18)}.pedido-normal-tag{display:inline-flex;background:#e2e8f0;color:#475569;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:850;text-transform:uppercase}.bloco-card{background:#fff;border:1px solid #e2e8f0;border-radius:18px;padding:16px;margin-bottom:14px;box-shadow:0 10px 24px rgba(15,23,42,.06)}.bloco-card.active{border-color:#2563eb;box-shadow:0 0 0 4px rgba(37,99,235,.08),0 10px 24px rgba(15,23,42,.08)}.bloco-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;flex-wrap:wrap}.bloco-title{font-size:20px;font-weight:950;color:#0f172a}.bloco-meta{font-size:13px;color:#64748b;font-weight:700;line-height:1.5}.bloco-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.bloco-pedidos{margin-top:12px;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px}.bloco-pedido-chip{background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:9px;font-size:12px;color:#334155}.checkout-bloco-alert{background:linear-gradient(135deg,#eff6ff,#dbeafe);border:1px solid #93c5fd;color:#1e3a8a;border-radius:14px;padding:12px 14px;margin-bottom:12px;font-weight:950;display:flex;justify-content:space-between;gap:12px;align-items:center}.btn-clear-bloco{border:none;border-radius:10px;background:#1e40af;color:#fff;padding:8px 12px;font-weight:900;cursor:pointer}.perf-compare-line{font-size:0!important;line-height:1!important}.perf-compare-line .perf-compare-toggle{font-size:14px!important;line-height:1.2!important}.perf-compare-line br,.perf-compare-line strong{display:none!important}
@media(max-width:980px){.pedidos-filter-grid{grid-template-columns:1fr}.pedidos-select-actions .btn{width:100%}#btnGerarBlocoSeparacao{margin-left:0!important}}



/* MENU RESPONSIVO - PATCH */
.main-menu {
  width: 100%;
}

@media (max-width: 1024px) {
  header {
    height: 82px;
    padding: 10px 14px;
  }

  .logo {
    max-height: 145px;
    max-width: 92vw;
    object-fit: contain;
  }

  .main-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    align-items: stretch;
    justify-content: stretch;
    overflow: visible;
  }

  .main-menu-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    border-radius: 14px;
    padding: 10px 8px;
    font-size: 12px;
    line-height: 1.15;
    white-space: normal;
    min-height: 46px;
  }
}

@media (max-width: 720px) {
  header {
    height: 72px;
  }

  .logo {
    max-height: 115px;
  }

  .main-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 8px;
    position: sticky;
    top: 0;
    z-index: 80;
    max-height: 42vh;
    overflow-y: auto;
  }

  .main-menu-btn {
    font-size: 11px;
    padding: 9px 7px;
    min-height: 44px;
  }

  .tab-content {
    padding: 18px 10px;
  }
}

@media (max-width: 430px) {
  .main-menu {
    grid-template-columns: 1fr;
    max-height: 38vh;
  }

  .main-menu-btn {
    min-height: 42px;
    font-size: 12px;
  }
}



/* MENU RESPONSIVO ENCOLHÍVEL - PATCH */
.menu-toggle-btn {
  display: none;
  width: calc(100% - 20px);
  margin: 10px auto 0;
  border: 1px solid #dbeafe;
  background: linear-gradient(135deg, #1d4ed8, #06b6d4);
  color: #fff;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 950;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
  position: sticky;
  top: 0;
  z-index: 95;
}

.menu-toggle-btn .menu-toggle-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.menu-toggle-icon {
  font-size: 20px;
  line-height: 1;
}

.menu-toggle-current {
  font-size: 12px;
  font-weight: 800;
  opacity: .95;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 46vw;
}

.main-menu {
  transition: max-height .24s ease, padding .24s ease, opacity .18s ease;
}

@media (max-width: 1024px) {
  .menu-toggle-btn {
    display: flex;
  }

  .main-menu {
    display: grid !important;
    max-height: 48vh;
    overflow-y: auto;
  }

  .main-menu.menu-collapsed {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0;
    overflow: hidden !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .main-menu.menu-collapsed .main-menu-btn {
    pointer-events: none;
  }
}

@media (max-width: 720px) {
  .menu-toggle-btn {
    width: calc(100% - 16px);
    margin-top: 8px;
    border-radius: 14px;
    padding: 11px 13px;
    font-size: 14px;
  }

  .menu-toggle-current {
    max-width: 42vw;
    font-size: 11px;
  }

  .main-menu:not(.menu-collapsed) {
    max-height: 46vh;
  }
}

@media (max-width: 430px) {
  .menu-toggle-current {
    max-width: 38vw;
  }
}


/* PATCH 29/04 - Filtros completos na tela Pedidos */
.pedidos-filter-grid-completo{grid-template-columns:repeat(4,minmax(160px,1fr))!important}
@media(max-width:1100px){.pedidos-filter-grid-completo{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:720px){.pedidos-filter-grid-completo{grid-template-columns:1fr!important}}
