/* --- CSS (Estilos) --- */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
        }

        body {
            background: linear-gradient(145deg, #f0f4f8 0%, #e6ecf3 100%);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 2rem 1rem;
        }

        .container {
            max-width: 1100px;
            width: 100%;
            background: rgba(255, 255, 255, 0.7);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border-radius: 32px;
            box-shadow: 0 20px 40px -12px rgba(0, 30, 50, 0.35), inset 0 1px 2px rgba(255,255,255,0.8);
            padding: 2rem 1.5rem;
            border: 1px solid rgba(255,255,255,0.5);
        }

        h1 {
            font-size: 2.2rem;
            font-weight: 600;
            letter-spacing: -0.02em;
            color: #0b2b40;
            margin-bottom: 0.25rem;
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .subtitle {
            font-size: 1rem;
            color: #2c4e66;
            margin-bottom: 1.5rem;
            border-left: 4px solid #2a7faa;
            padding-left: 1rem;
            background: rgba(42, 127, 170, 0.05);
            border-radius: 0 12px 12px 0;
            line-height: 1.4;
        }

        /* --- Área de consulta dinâmica --- */
        .consulta-container {
            background: rgba(255, 255, 255, 0.6);
            border-radius: 60px;
            padding: 1.2rem 1.8rem;
            margin-bottom: 1.8rem;
            border: 1px solid rgba(42, 127, 170, 0.3);
            box-shadow: 0 4px 12px rgba(0, 30, 40, 0.1);
        }

        .input-group {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 15px;
            margin-bottom: 10px;
        }

        .codigo-box {
            display: flex;
            align-items: center;
            gap: 8px;
            background: white;
            padding: 0.3rem 0.3rem 0.3rem 1.5rem;
            border-radius: 50px;
            border: 1px solid #b9d1e3;
            flex: 2 1 300px;
        }

        .codigo-box label {
            font-weight: 700;
            color: #0b4b6b;
            font-size: 0.95rem;
            white-space: nowrap;
        }

        .codigo-box input {
            border: none;
            padding: 0.7rem 0.5rem;
            border-radius: 50px;
            font-size: 1rem;
            width: 120px;
            background: #f0f7fd;
            text-align: center;
            font-weight: 600;
            color: #022b3b;
            border: 1px solid #d5e2ed;
        }

        .codigo-box input:focus {
            outline: 2px solid #2a7faa;
            background: white;
        }

        .buscar-btn {
            background: #1d5b7a;
            border: none;
            color: white;
            padding: 0.7rem 2.2rem;
            border-radius: 50px;
            font-weight: 700;
            font-size: 1rem;
            cursor: pointer;
            transition: 0.15s;
            box-shadow: 0 4px 10px #155170;
            border: 1px solid #8fc5e6;
            letter-spacing: 0.5px;
            flex: 1 0 auto;
        }

        .buscar-btn:hover {
            background: #256f94;
            transform: translateY(-2px);
            box-shadow: 0 8px 16px #1a4b66;
        }

        .sugestoes {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 12px;
            margin-top: 12px;
            font-size: 0.9rem;
        }

        .sugestoes span {
            color: #2b5e7c;
            font-weight: 500;
        }

        .codigo-chip {
            background: white;
            border: 1px solid #83b9d6;
            border-radius: 30px;
            padding: 0.3rem 1rem;
            font-size: 0.85rem;
            font-weight: 600;
            color: #0a3c55;
            cursor: pointer;
            transition: 0.1s;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .codigo-chip:hover {
            background: #d3e8f5;
            border-color: #2a7faa;
            transform: scale(1.02);
        }

        .codigo-chip .desc {
            font-weight: 400;
            color: #346f90;
            margin-left: 5px;
        }

        .status-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
            gap: 15px;
        }

        .info-tag {
            background: #1a465b;
            color: white;
            padding: 0.5rem 1.2rem;
            border-radius: 40px;
            font-size: 0.9rem;
            font-weight: 500;
            box-shadow: 0 4px 8px rgba(0,40,60,0.2);
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .info-tag span {
            background: #ffd966;
            color: #1a2e3f;
            border-radius: 20px;
            padding: 0.2rem 0.8rem;
            font-weight: 700;
            margin-left: 6px;
        }

        .table-wrapper {
            border-radius: 24px;
            overflow: hidden;
            box-shadow: 0 8px 20px rgba(0, 20, 30, 0.2);
            border: 1px solid rgba(255,255,255,0.6);
            background: rgba(255,255,255,0.75);
            backdrop-filter: blur(4px);
            margin-top: 0.5rem;
            max-height: 500px;
            overflow-y: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.95rem;
        }

        th {
            background: #1d4e68;
            color: white;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            font-size: 0.85rem;
            padding: 1rem 0.8rem;
            text-align: center;
            border-right: 1px solid #4883a3;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        th:last-child {
            border-right: none;
        }

        td {
            padding: 0.7rem 0.8rem;
            border-bottom: 1px solid #d0dee9;
            text-align: center;
            background: rgba(255, 255, 255, 0.5);
        }

        tr:last-child td {
            border-bottom: none;
        }

        tbody tr:hover td {
            background: #d9eaf3;
            transition: 0.1s;
        }

        .valor {
            font-weight: 600;
            color: #0b3f4d;
        }

        .loading, .error-message, .sem-resultados {
            text-align: center;
            padding: 3rem 1rem;
            font-size: 1.1rem;
        }

        .loading {
            color: #286582;
        }

        .error-message {
            color: #b13e3e;
            background: #ffefef;
            border-radius: 60px;
        }

        .sem-resultados {
            color: #4a6070;
            background: #f0f7fc;
            border-radius: 60px;
        }

        footer {
            margin-top: 1.2rem;
            font-size: 0.8rem;
            color: #366077;
            opacity: 0.8;
            text-align: center;
        }

        .dicas {
            font-size: 0.8rem;
            color: #2e627c;
            margin-top: 0.4rem;
            background: rgba(255,255,240,0.7);
            padding: 0.2rem 1rem;
            border-radius: 30px;
            display: inline-block;
        }
		
		* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
        }

        body {
            background: linear-gradient(145deg, #f0f4f8 0%, #e6ecf3 100%);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 2rem 1rem;
        }

        .container {
            max-width: 1300px;
            width: 100%;
            background: rgba(255, 255, 255, 0.7);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border-radius: 32px;
            box-shadow: 0 20px 40px -12px rgba(0, 30, 50, 0.35), inset 0 1px 2px rgba(255,255,255,0.8);
            padding: 2rem 1.5rem;
            border: 1px solid rgba(255,255,255,0.5);
        }

        h1 {
            font-size: 2.2rem;
            font-weight: 600;
            letter-spacing: -0.02em;
            color: #0b2b40;
            margin-bottom: 0.25rem;
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .subtitle {
            font-size: 1rem;
            color: #2c4e66;
            margin-bottom: 1.5rem;
            border-left: 4px solid #2a7faa;
            padding-left: 1rem;
            background: rgba(42, 127, 170, 0.05);
            border-radius: 0 12px 12px 0;
            line-height: 1.4;
        }

        .consulta-container {
            background: rgba(255, 255, 255, 0.6);
            border-radius: 60px;
            padding: 1.2rem 1.8rem;
            margin-bottom: 1.5rem;
            border: 1px solid rgba(42, 127, 170, 0.3);
            box-shadow: 0 4px 12px rgba(0, 30, 40, 0.1);
        }

        .input-group {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 15px;
        }

        .codigo-box {
            display: flex;
            align-items: center;
            gap: 8px;
            background: white;
            padding: 0.3rem 0.3rem 0.3rem 1.5rem;
            border-radius: 50px;
            border: 1px solid #b9d1e3;
            flex: 2 1 300px;
        }

        .codigo-box label {
            font-weight: 700;
            color: #0b4b6b;
            font-size: 0.95rem;
            white-space: nowrap;
        }

        .codigo-box input {
            border: none;
            padding: 0.7rem 0.5rem;
            border-radius: 50px;
            font-size: 1rem;
            width: 100px;
            background: #f0f7fd;
            text-align: center;
            font-weight: 600;
            color: #022b3b;
            border: 1px solid #d5e2ed;
        }

        .codigo-box input:focus {
            outline: 2px solid #2a7faa;
            background: white;
        }

        .serie-select {
            padding: 0.7rem 1rem;
            border-radius: 50px;
            border: 1px solid #b9d1e3;
            background: white;
            font-size: 0.95rem;
            color: #022b3b;
            font-weight: 500;
            cursor: pointer;
            min-width: 200px;
        }

        .serie-select:focus {
            outline: 2px solid #2a7faa;
        }

        .buscar-btn {
            background: #1d5b7a;
            border: none;
            color: white;
            padding: 0.7rem 2.2rem;
            border-radius: 50px;
            font-weight: 700;
            font-size: 1rem;
            cursor: pointer;
            transition: 0.15s;
            box-shadow: 0 4px 10px #155170;
            border: 1px solid #8fc5e6;
            letter-spacing: 0.5px;
            flex: 1 0 auto;
        }

        .buscar-btn:hover {
            background: #256f94;
            transform: translateY(-2px);
            box-shadow: 0 8px 16px #1a4b66;
        }

        .filtro-container {
            background: rgba(255, 255, 255, 0.6);
            border-radius: 60px;
            padding: 1rem 1.8rem;
            margin-bottom: 1.8rem;
            border: 1px solid rgba(42, 127, 170, 0.3);
            box-shadow: 0 4px 12px rgba(0, 30, 40, 0.1);
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 20px;
        }

        .filtro-datas {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 15px;
            flex: 2 1 auto;
        }

        .campo-data {
            display: flex;
            align-items: center;
            gap: 10px;
            background: white;
            padding: 0.3rem 0.8rem 0.3rem 1.2rem;
            border-radius: 40px;
            box-shadow: inset 0 1px 4px rgba(0,0,0,0.05);
            border: 1px solid #cbdae6;
            flex: 1 1 200px;
        }

        .campo-data label {
            font-weight: 600;
            color: #1c5777;
            font-size: 0.85rem;
            text-transform: uppercase;
        }

        .campo-data input {
            border: none;
            padding: 0.5rem 0.2rem 0.5rem 0.5rem;
            border-radius: 30px;
            font-size: 0.9rem;
            color: #0a2e40;
            background: transparent;
            width: 130px;
            cursor: pointer;
            font-family: inherit;
        }

        .campo-data input:focus {
            outline: 2px solid #2a7faa;
            outline-offset: 2px;
            border-radius: 30px;
        }

        .filtro-acoes {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .btn-filtro {
            background: #1d5b7a;
            border: none;
            color: white;
            padding: 0.6rem 1.8rem;
            border-radius: 40px;
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            transition: 0.15s;
            box-shadow: 0 4px 8px rgba(20, 80, 120, 0.3);
            display: flex;
            align-items: center;
            gap: 8px;
            border: 1px solid rgba(255,255,255,0.2);
        }

        .btn-filtro:hover {
            background: #256f94;
            transform: translateY(-2px);
            box-shadow: 0 8px 14px rgba(20, 90, 130, 0.4);
        }

        .btn-filtro.limpar {
            background: #e0e9f2;
            color: #1d4a64;
            box-shadow: none;
            border: 1px solid #abc0cf;
        }

        .btn-filtro.limpar:hover {
            background: #cddeec;
        }

        .status-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
            gap: 15px;
        }

        .info-tag {
            background: #1a465b;
            color: white;
            padding: 0.5rem 1.2rem;
            border-radius: 40px;
            font-size: 0.9rem;
            font-weight: 500;
            box-shadow: 0 4px 8px rgba(0,40,60,0.2);
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .info-tag span {
            background: #ffd966;
            color: #1a2e3f;
            border-radius: 20px;
            padding: 0.2rem 0.8rem;
            font-weight: 700;
            margin-left: 6px;
        }

        .refresh-btn {
            background: white;
            border: none;
            padding: 0.6rem 1.5rem;
            border-radius: 40px;
            font-weight: 600;
            color: #0b3b4e;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(0, 30, 50, 0.15);
            transition: all 0.2s ease;
            border: 1px solid rgba(255,255,255,0.7);
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9rem;
        }

        .refresh-btn:hover {
            background: #e1ecf5;
            transform: translateY(-2px);
            box-shadow: 0 10px 18px -6px #1f4b66;
        }

        .table-wrapper {
            border-radius: 24px;
            overflow: hidden;
            box-shadow: 0 8px 20px rgba(0, 20, 30, 0.2);
            border: 1px solid rgba(255,255,255,0.6);
            background: rgba(255,255,255,0.75);
            backdrop-filter: blur(4px);
            margin-top: 0.5rem;
            max-height: 500px;
            overflow-y: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.95rem;
        }

        th {
            background: #1d4e68;
            color: white;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            font-size: 0.85rem;
            padding: 1rem 0.8rem;
            text-align: center;
            border-right: 1px solid #4883a3;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        th:last-child {
            border-right: none;
        }

        td {
            padding: 0.7rem 0.8rem;
            border-bottom: 1px solid #d0dee9;
            text-align: center;
            background: rgba(255, 255, 255, 0.5);
        }

        tr:last-child td {
            border-bottom: none;
        }

        tbody tr:hover td {
            background: #d9eaf3;
            transition: 0.1s;
        }

        .valor {
            font-weight: 600;
            color: #0b3f4d;
        }

        .loading, .error-message, .sem-resultados {
            text-align: center;
            padding: 3rem 1rem;
            font-size: 1.1rem;
        }

        .loading {
            color: #286582;
        }

        .error-message {
            color: #b13e3e;
            background: #ffefef;
            border-radius: 60px;
        }

        .sem-resultados {
            color: #4a6070;
            background: #f0f7fc;
            border-radius: 60px;
        }

        .indices-card {
            background: rgba(255, 255, 255, 0.6);
            border-radius: 24px;
            padding: 1.5rem;
            margin-top: 2rem;
            border: 1px solid rgba(42, 127, 170, 0.3);
        }

        .indices-card h3 {
            color: #0b2b40;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .indices-inputs {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            align-items: flex-end;
            margin-bottom: 1.5rem;
        }

        .indices-field {
            flex: 1 1 200px;
        }

        .indices-field label {
            display: block;
            font-size: 0.85rem;
            font-weight: 600;
            color: #1c5777;
            margin-bottom: 4px;
        }

        .indices-field input, .indices-field select {
            width: 100%;
            padding: 0.7rem 1rem;
            border-radius: 30px;
            border: 1px solid #b9d1e3;
            background: white;
            font-size: 0.95rem;
        }

        .indices-btn {
            background: #1d5b7a;
            color: white;
            border: none;
            padding: 0.7rem 2rem;
            border-radius: 30px;
            font-weight: 600;
            cursor: pointer;
            transition: 0.15s;
        }

        .indices-btn:hover {
            background: #256f94;
            transform: translateY(-2px);
        }

        .tabela-indices-wrapper {
            max-height: 500px;
            overflow-y: auto;
            border-radius: 16px;
            border: 1px solid #cbdae6;
            background: white;
        }

        .tabela-indices {
            width: 100%;
            border-collapse: collapse;
        }

        .tabela-indices th {
            background: #2a7faa;
            color: white;
            padding: 0.8rem;
            font-size: 0.85rem;
            position: sticky;
            top: 0;
            z-index: 5;
        }

        .tabela-indices td {
            padding: 0.6rem 0.8rem;
            border-bottom: 1px solid #e0e9f2;
            text-align: center;
        }

        .tabela-indices tr:last-child td {
            border-bottom: none;
        }

        .indice-tr {
            color: #1d5b7a;
            font-weight: 600;
        }

        .indice-rendimento {
            color: #2a7faa;
            font-weight: 600;
        }

        .indice-selic {
            color: #39738f;
        }

        .destaque-mes {
            background: #e8f0f7 !important;
            font-weight: 600;
        }

        .badge {
            background: #ffd966;
            color: #1a2e3f;
            padding: 0.2rem 0.8rem;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        footer {
            margin-top: 1.2rem;
            font-size: 0.8rem;
            color: #366077;
            opacity: 0.8;
            text-align: center;
        }

        .dicas {
            font-size: 0.8rem;
            color: #2e627c;
            margin-top: 0.4rem;
            background: rgba(255,255,240,0.7);
            padding: 0.2rem 1rem;
            border-radius: 30px;
            display: inline-block;
        }
		/* Botão Exportar CSV com Gradiente */
#exportarCSVBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-left: 10px;
    position: relative;
    overflow: hidden;
}

#exportarCSVBtn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

#exportarCSVBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#exportarCSVBtn:hover:before {
    left: 100%;
}

#exportarCSVBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

#exportarCSVBtn i, #exportarCSVBtn svg {
    font-size: 16px;
}