body {
      background-color: var(--fundo);
      color: var(--texto);
      min-height: 100vh;
      min-height: 100dvh;
      margin: 0;
      padding-bottom: max(50px, env(safe-area-inset-bottom, 0px));
    }

    .container {
      padding: 0 20px 40px 20px;
      max-width: 600px;
      margin: 0 auto;
      min-height: 80vh;
      min-height: 80dvh;
    }

    /* 1. TABS: SEGMENTED CONTROL UNIFICADO (HERDADO DO GLOBAL.CSS, ZERO SCROLL LATERAL) */
    .tabs {
      margin: 18px auto;
      max-width: 680px;
      width: calc(100% - 24px);
      box-sizing: border-box;
    }

    .tab-content {
      display: none;
      animation: fadeIn 0.3s ease;
    }

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

    /* 2. FORMS & CARDS GLASSMORPHIC */
    form, .card, #successScreen {
      background-color: #ffffff;
      border-radius: 24px;
      padding: 35px;
      box-shadow: 0 10px 30px -5px rgba(var(--primaria-escura-rgb), 0.04);
      border: 1.5px solid rgba(226, 232, 240, 0.8);
      transition: all 0.3s ease;
      margin-bottom: 25px;
    }

    .card {
      padding: 24px;
      border-left: 6px solid var(--azul-caixa);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      height: 100%;
      box-sizing: border-box;
    }

    @media (hover: hover) and (pointer: fine) {
      .card:hover {
        transform: translateY(-4px);
        box-shadow: 0 15px 30px -10px rgba(var(--primaria-escura-rgb), 0.12);
        border-color: rgba(var(--primaria-rgb), 0.2);
      }
    }

    /* FORM GRID EM COLUNA ├ÜNICA */
    .form-grid {
      display: flex;
      flex-direction: column;
      gap: 20px;
      margin-bottom: 20px;
    }

    .form-group-full {
      width: 100%;
    }

    @media (max-width: 640px) {
      form, #successScreen {
        padding: 25px 20px;
      }
      #btnShowTransferHistory,
      .card .btn-secondary,
      form .btn-secondary {
        padding: 11px 14px;
        font-size: 0.88rem;
        line-height: 1.25;
      }
    }

    @media (pointer: coarse) {
      .btn-delete {
        width: 36px;
        height: 36px;
      }
    }

    /* HIST├ôRICO EM COLUNA ├ÜNICA */
    #listaHistorico, #paymentHistoryList {
      display: flex;
      flex-direction: column;
      gap: 20px;
      margin-top: 20px;
    }

    /* INPUTS & SELECTS FINTECH */
    .form-group {
      margin-bottom: 0; /* Controlado pelo gap do grid */
    }

    .form-group label {
      display: block;
      font-size: 0.78rem;
      font-weight: 800;
      color: #64748b;
      margin-bottom: 8px;
      text-transform: uppercase;
      letter-spacing: 0.8px;
    }

    select, input[type="text"], input[type="tel"], input[type="date"] {
      width: 100%;
      box-sizing: border-box;
      padding: 14px 18px;
      font-size: 1rem;
      font-weight: 700;
      color: #0f172a;
      border: 1.5px solid rgba(226, 232, 240, 0.9);
      border-radius: 14px;
      outline: none;
      cursor: pointer;
      transition: all 0.25s ease-in-out;
      background-color: #ffffff;
      box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.01);
      font-family: inherit;
    }

    select:focus, input:focus {
      border-color: var(--azul-claro);
      background-color: white;
      box-shadow: 0 0 0 4px rgba(var(--primaria-rgb), 0.12);
    }

    select:disabled, input:disabled {
      background-color: var(--fundo-sutil);
      color: #94a3b8;
      border-color: #e2e8f0;
      cursor: not-allowed;
    }

    /* MONOSPACE CODE DISPLAY */
    .big-number-container {
      background: rgba(15, 23, 42, 0.02);
      padding: 24px;
      border-radius: 18px;
      border: 2px dashed rgba(var(--primaria-rgb), 0.3);
      margin: 22px 0;
      transition: all 0.3s ease;
    }

    .big-number-container:hover {
      background: rgba(var(--primaria-rgb), 0.04);
      border-color: var(--azul-caixa);
    }

    .big-number {
      font-family: 'Courier New', monospace;
      font-size: 1.2rem;
      font-weight: 700;
      color: #1e293b;
      letter-spacing: 0.5px;
      line-height: 1.6;
      word-break: break-all;
    }

    .digitable-code {
      font-family: 'Courier New', monospace;
      font-size: 1.0rem;
      font-weight: 700;
      word-break: break-all;
      display: block;
      margin-bottom: 12px;
      padding: 14px 16px;
      background: #f8faff;
      border-radius: 10px;
      border: 2px dashed rgba(var(--primaria-rgb), 0.3);
      color: var(--azul-caixa);
      letter-spacing: 0.5px;
      line-height: 1.8;
      text-align: center;
    }

    /* MODAL FULLSCREEN BARCODE */
    .barcode-modal {
      position: fixed;
      inset: 0;
      background-color: #ffffff;
      z-index: 9999;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 40px 20px;
      cursor: pointer;
      animation: fadeIn 0.2s ease;
    }
    .barcode-modal p {
      margin-top: 24px;
      font-size: 0.8rem;
      color: #94a3b8;
      font-weight: 600;
    }

    /* BADGES FINANCIAL STATUS */
    .badge {
      font-size: 0.72rem;
      padding: 5px 12px;
      border-radius: 50px;
      text-transform: uppercase;
      font-weight: 800;
      letter-spacing: 0.5px;
    }

    .bg-PENDING {
      background: rgba(245, 158, 11, 0.12);
      color: #d97706;
      border: 1px solid rgba(245, 158, 11, 0.2);
    }

    .bg-RECEIVED {
      background: rgba(16, 185, 129, 0.12);
      color: #059669;
      border: 1px solid rgba(16, 185, 129, 0.2);
    }

    .bg-OVERDUE {
      background: rgba(239, 68, 68, 0.12);
      color: #dc2626;
      border: 1px solid rgba(239, 68, 68, 0.2);
    }

    .bg-CANCELLED {
      background: rgba(100, 116, 139, 0.12);
      color: #475569;
      border: 1px solid rgba(100, 116, 139, 0.2);
    }

    .bg-INITIATED {
      background: rgba(6, 182, 212, 0.12);
      color: #0891b2;
      border: 1px solid rgba(6, 182, 212, 0.2);
    }

    /* SUCCESS ELEMENTS */
    #successScreen {
      display: none;
      text-align: center;
    }

    .success-icon {
      color: #10b981;
      font-size: 3.5rem;
      margin-bottom: 15px;
      filter: drop-shadow(0 4px 10px rgba(16, 185, 129, 0.2));
    }

    .card-price {
      color: var(--azul-caixa);
      font-weight: 900;
      font-size: 1.45rem;
      letter-spacing: -0.5px;
      margin: 8px 0;
    }

    .details-area {
      background: rgba(var(--primaria-rgb), 0.02);
      padding: 18px;
      border-radius: 16px;
      margin-top: 12px;
      border: 1.5px dashed rgba(var(--primaria-rgb), 0.25);
      display: none;
      animation: fadeIn 0.3s ease;
    }

    /* BUTTONS */
    .btn-delete {
      background: rgba(239, 68, 68, 0.08);
      border: none;
      color: #ef4444;
      font-size: 0.95rem;
      cursor: pointer;
      width: 32px;
      height: 32px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
    }

    .btn-delete:hover {
      background: #ef4444;
      color: white;
      transform: scale(1.05);
    }

    /* RESILI├èNCIA E TRATAMENTO DE ERRO ELEGANTE */
    .api-error-card {
      background: rgba(254, 242, 242, 0.9);
      border: 1.5px solid rgba(239, 68, 68, 0.25);
      border-radius: var(--radius-lg, 16px);
      padding: 35px 25px;
      text-align: center;
      margin: 20px auto;
      max-width: 500px;
      box-shadow: 0 10px 25px -10px rgba(220, 38, 38, 0.08);
      animation: fadeIn 0.3s ease;
      grid-column: 1 / -1; /* Ocupa a largura total em grids */
    }

    .api-error-icon {
      font-size: 3rem;
      color: #ef4444;
      margin-bottom: 18px;
    }

    .api-error-card h4 {
      color: #991b1b;
      font-size: 1.1rem;
      font-weight: 800;
      margin-top: 0;
      margin-bottom: 10px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .api-error-card p {
      font-size: 0.88rem;
      color: #7f1d1d;
      line-height: 1.6;
      margin: 0 0 22px 0;
    }

    .btn-retry-modern {
      background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
      color: white;
      border: none;
      padding: 12px 24px;
      border-radius: 50px;
      font-size: 0.8rem;
      font-weight: 800;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: all 0.25s;
      box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .btn-retry-modern:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45);
    }

    .btn-retry-modern:active {
      transform: translateY(0);
    }

    .alert-error-mini {
      background: rgba(254, 242, 242, 0.95);
      border: 1px dashed rgba(239, 68, 68, 0.4);
      padding: 12px;
      border-radius: 10px;
      color: #b91c1c;
      font-size: 0.8rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-top: 8px;
    }

    .btn-retry-mini {
      background: #ef4444;
      color: white;
      border: none;
      padding: 6px 10px;
      border-radius: 6px;
      font-size: 0.72rem;
      font-weight: 800;
      cursor: pointer;
      transition: all 0.2s;
      text-transform: uppercase;
    }

    .btn-retry-mini:hover {
      background: #dc2626;
    }

    /* SPINNERS AND ANIMATIONS */
    .spinner {
      border: 2.5px solid rgba(var(--primaria-rgb), 0.15);
      border-top: 2.5px solid var(--azul-caixa);
      border-radius: 50%;
      width: 18px;
      height: 18px;
      animation: spin 0.8s linear infinite;
      display: inline-block;
    }

    /* CARD FIXO DE SALDO CORA (EXCLUSIVO ADMIN) */
    .admin-balance-header-card {
      background: linear-gradient(135deg, #ffffff 0%, var(--fundo-sutil) 100%);
      border: 1px solid rgba(226, 232, 240, 0.9);
      border-left: 4.5px solid var(--laranja-caixa) !important;
      border-radius: var(--radius-lg, 16px);
      padding: 12px 16px;
      margin: 15px auto 5px auto;
      max-width: 600px;
      width: 100%;
      box-sizing: border-box;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      box-shadow: 0 4px 20px -5px rgba(var(--primaria-escura-rgb), 0.08);
      animation: fadeIn 0.4s ease;
      min-height: 68px;
    }

    .admin-balance-left {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
      flex: 1;
    }

    .admin-balance-badge {
      background: rgba(240, 130, 0, 0.12);
      color: var(--azul-acao);
      font-size: 0.65rem;
      font-weight: 800;
      padding: 2px 8px;
      border-radius: 50px;
      letter-spacing: 0.5px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      width: fit-content;
      line-height: 1.2;
    }

    .admin-balance-title {
      font-size: 0.88rem;
      font-weight: 800;
      color: var(--azul-caixa);
      margin-top: 1px;
      white-space: nowrap;
      line-height: 1.2;
    }

    .admin-balance-subtitle {
      font-size: 0.7rem;
      color: #94a3b8;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.2;
      height: 1.2em;
    }

    .admin-balance-right {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }

    .admin-balance-amount {
      font-size: 1.45rem;
      font-weight: 900;
      color: var(--sucesso);
      letter-spacing: -0.5px;
      white-space: nowrap;
      line-height: 1.2;
    }

    .btn-mini-refresh {
      background-color: white;
      border: 1px solid var(--borda);
      color: var(--azul-caixa);
      width: 32px;
      height: 32px;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.85rem;
      box-shadow: var(--shadow-sm);
      transition: all 0.2s ease;
      flex-shrink: 0;
    }

    .btn-mini-refresh:hover {
      background: var(--azul-caixa);
      color: white;
      transform: rotate(45deg);
    }

    @media (max-width: 480px) {
      .admin-balance-header-card {
        padding: 10px 12px;
        min-height: 64px;
      }
      .admin-balance-amount {
        font-size: 1.22rem;
      }
      .summary-val {
        font-size: 1.15rem;
      }
      .summary-box {
        padding: 12px 10px;
      }
    }
    /* ESTILOS DO DASHBOARD DE LOJAS (EXCLUSIVO ADMIN) */
    .dashboard-header-card {
      background: linear-gradient(135deg, #ffffff 0%, var(--fundo-sutil) 100%);
      border: 1px solid rgba(226, 232, 240, 0.9);
      border-left: 4.5px solid var(--azul-caixa) !important;
      border-radius: var(--radius-lg, 16px);
      padding: 16px 20px;
      margin-bottom: 15px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .dashboard-summary-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-bottom: 20px;
    }

    .summary-box {
      background-color: white;
      border: 1.5px solid var(--borda);
      border-radius: var(--radius-lg, 16px);
      padding: 16px;
      text-align: center;
      box-shadow: var(--shadow-sm);
    }

    .prev-month-box {
      border-top: 3px solid #64748b;
    }

    .curr-month-box {
      border-top: 3px solid var(--sucesso);
    }

    .summary-label {
      font-size: 0.75rem;
      font-weight: 800;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      display: block;
      margin-bottom: 6px;
    }

    .summary-val {
      font-size: 1.45rem;
      font-weight: 900;
      color: var(--azul-caixa);
    }

    .curr-month-box .summary-val {
      color: var(--sucesso);
    }

    .store-accordion-card {
      background-color: white;
      border: 1.5px solid var(--borda);
      border-radius: var(--radius-lg, 16px);
      padding: 0 !important;
      margin-bottom: 12px !important;
      overflow: hidden;
      box-shadow: var(--shadow-sm);
    }

    .store-header {
      padding: 16px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      background-color: #ffffff;
      transition: background 0.2s;
    }

    .store-header:hover {
      background: var(--fundo-sutil);
    }

    .store-name {
      font-size: 0.95rem;
      font-weight: 800;
      color: var(--azul-caixa);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .store-totals {
      font-size: 0.8rem;
      color: #64748b;
      margin-top: 4px;
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .btn-toggle-accordion {
      background: var(--fundo-hover);
      border: none;
      color: var(--azul-caixa);
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.85rem;
      cursor: pointer;
    }

    .employees-list {
      background: var(--fundo-sutil);
      border-top: 1px solid var(--borda);
      padding: 12px 18px 16px 18px;
    }

    .employees-list-header {
      font-size: 0.68rem;
      font-weight: 800;
      color: #94a3b8;
      letter-spacing: 0.8px;
      margin-bottom: 10px;
    }

    .employee-row {
      background-color: white;
      border: 1px solid var(--borda);
      border-radius: 12px;
      padding: 10px 14px;
      margin-bottom: 8px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .employee-row:last-child {
      margin-bottom: 0;
    }

    .emp-name {
      font-size: 0.84rem;
      font-weight: 700;
      color: #334155;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .emp-values {
      font-size: 0.78rem;
      color: #64748b;
      display: flex;
      gap: 12px;

    }

    @media (max-width: 480px) {
      .summary-val {
        font-size: 1.15rem;
      }
      .store-totals {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
      }
      .employee-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
      }
    }

    /* ROTEAMENTO INTELIGENTE CAIXA 104 / CORA */
    .caixa-deposit-banner {
      background: linear-gradient(135deg, #00366D 0%, #005CA9 100%);
      color: #ffffff;
      border-radius: 18px;
      padding: 20px 18px;
      margin: 16px 0 18px 0;
      text-align: left;
      box-shadow: 0 12px 26px -8px rgba(0, 54, 109, 0.35);
      position: relative;
      overflow: hidden;
    }

    .caixa-deposit-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 14px;
      padding-bottom: 12px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    }

    .caixa-bank-pill {
      background: #f59e0b;
      color: #0f172a;
      font-size: 0.72rem;
      font-weight: 900;
      padding: 4px 10px;
      border-radius: 99px;
      letter-spacing: 0.6px;
      text-transform: uppercase;
    }

    .caixa-data-grid {
      display: grid;
      grid-template-columns: 1fr 1.35fr;
      gap: 10px;
      margin-bottom: 12px;
    }

    .caixa-data-box {
      background: rgba(255, 255, 255, 0.12);
      border: 1px solid rgba(255, 255, 255, 0.22);
      border-radius: 12px;
      padding: 10px 12px;
    }

    .caixa-data-label {
      font-size: 0.68rem;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: rgba(255, 255, 255, 0.78);
      font-weight: 700;
      margin-bottom: 4px;
    }

    .caixa-data-val {
      font-family: 'Courier New', monospace;
      font-size: 1.35rem;
      font-weight: 900;
      color: #ffffff;
      letter-spacing: 0.6px;
      word-break: break-all;
    }

    .caixa-holder-box {
      background: rgba(255, 255, 255, 0.96);
      color: #0f172a;
      border-radius: 12px;
      padding: 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .caixa-warning-note {
      background: #fffbeb;
      border: 1.5px solid #fde68a;
      color: #92400e;
      border-radius: 12px;
      padding: 11px 14px;
      font-size: 0.78rem;
      font-weight: 700;
      text-align: left;
      margin-bottom: 14px;
      line-height: 1.4;
    }

    .btn-amber-reroute {
      width: 100%;
      padding: 13px 16px;
      border-radius: 14px;
      border: 1.5px solid #f59e0b;
      background: #fffbeb;
      color: #b45309;
      font-weight: 800;
      font-size: 0.86rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: all 0.2s ease;
      margin-bottom: 10px;
    }

    .btn-amber-reroute:hover {
      background: #fef3c7;
    }

    .btn-cancel-slot {
      width: 100%;
      padding: 11px 16px;
      border-radius: 14px;
      border: 1.5px solid #fecaca;
      background: #fff1f2;
      color: #be123c;
      font-weight: 700;
      font-size: 0.82rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: all 0.2s ease;
      margin-bottom: 10px;
    }

    .bg-CAIXA_ATIVO {
      background: rgba(0, 92, 169, 0.12);
      color: #005CA9;
      border: 1px solid rgba(0, 92, 169, 0.25);
    }

    .bg-CAIXA_CANCELADO, .bg-CAIXA_RECUSADO {
      background: rgba(100, 116, 139, 0.12);
      color: #475569;
      border: 1px solid rgba(100, 116, 139, 0.22);
    }

    @media (max-width: 480px) {
      .caixa-data-grid {
        grid-template-columns: 1fr;
      }
    }
