/* ============================================================
   SISTEMA WEB - TEMA MODERNO / TECNOLÓGICO
   Mantém os IDs e classes existentes do sistema
   ============================================================ */

/* ============================================================
   VARIÁVEIS
   ============================================================ */

:root {
    --primary: #0878f9;
    --primary-dark: #0757b8;
    --primary-light: #38bdf8;

    --secondary: #0ea5e9;

    --success: #16a34a;
    --success-light: #22c55e;

    --danger: #ef4444;
    --warning: #f59e0b;

    --dark: #07111f;
    --dark-2: #0b1728;
    --dark-3: #10243c;

    --text: #172033;
    --text-light: #64748b;
    --white: #ffffff;

    --border: rgba(148, 163, 184, 0.25);

    --glass: rgba(255, 255, 255, 0.88);
    --glass-dark: rgba(8, 20, 35, 0.88);

    --shadow-sm:
        0 4px 15px rgba(15, 23, 42, 0.08);

    --shadow:
        0 10px 30px rgba(15, 23, 42, 0.12);

    --shadow-lg:
        0 20px 60px rgba(2, 12, 27, 0.22);

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;

    --transition:
        all 0.25s ease;
}


/* ============================================================
   RESET
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;

    min-height: 100vh;

    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    color: var(--text);

    background:
        linear-gradient(
            135deg,
            rgba(7, 17, 31, 0.35),
            rgba(8, 120, 249, 0.08)
        ),
        url('Arquivos/Fundo/desktop.jpeg')
        center center / cover
        fixed no-repeat;

    line-height: 1.5;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


/* ============================================================
   SELEÇÃO DE TEXTO
   ============================================================ */

::selection {
    background: var(--primary);
    color: white;
}


/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
    width: 9px;
}

::-webkit-scrollbar-track {
    background: rgba(7, 17, 31, 0.08);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(
        var(--primary),
        var(--secondary)
    );

    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}


/* ============================================================
   HEADER
   ============================================================ */

header {
    position: sticky;
    top: 0;

    width: 100%;

    z-index: 999;

    color: white;

    background:
        linear-gradient(
            135deg,
            rgba(7, 17, 31, 0.97),
            rgba(13, 48, 82, 0.96)
        );

    border-bottom:
        1px solid rgba(56, 189, 248, 0.18);

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.18);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}


/* ============================================================
   LOGO
   ============================================================ */

.logo {
    margin: 0;
}

.logo-wrapper {
    display: flex;

    justify-content: center;
    align-items: center;

    min-height: 76px;

    padding: 10px 20px;

    gap: 14px;
}


/* ============================================================
   NAVEGAÇÃO
   ============================================================ */

nav {
    width: 100%;

    display: flex;

    justify-content: center;
    align-items: center;

    gap: 5px;

    padding: 7px 12px;

    background:
        rgba(3, 20, 38, 0.94);

    border-top:
        1px solid rgba(255, 255, 255, 0.05);

    border-bottom:
        1px solid rgba(56, 189, 248, 0.12);

    overflow-x: auto;

    scrollbar-width: thin;

    z-index: 1000;
}

nav a {
    position: relative;

    display: inline-flex;

    justify-content: center;
    align-items: center;

    min-height: 42px;

    padding: 9px 16px;

    color: rgba(255, 255, 255, 0.86);

    text-decoration: none;

    font-size: 15px;
    font-weight: 600;

    white-space: nowrap;

    border-radius: 9px;

    transition: var(--transition);
}

nav a::after {
    content: "";

    position: absolute;

    left: 50%;
    bottom: 3px;

    width: 0;
    height: 2px;

    background:
        linear-gradient(
            90deg,
            var(--primary-light),
            var(--primary)
        );

    border-radius: 20px;

    transform: translateX(-50%);

    transition: width 0.25s ease;
}

nav a:hover {
    color: white;

    background:
        rgba(8, 120, 249, 0.16);

    transform: translateY(-1px);
}

nav a:hover::after {
    width: 55%;
}


/* ============================================================
   LINKS
   ============================================================ */

a {
    color: var(--primary);

    text-decoration: none;

    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}


/* ============================================================
   ÁREA PRINCIPAL
   ============================================================ */

.content-section {
    width: min(1400px, 94%);

    margin: 25px auto;

    padding: 22px;

    background:
        rgba(255, 255, 255, 0.80);

    border:
        1px solid rgba(255, 255, 255, 0.65);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}


/* ============================================================
   PESQUISA
   ============================================================ */

#pesquisa {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;

    width: 100%;
}

#pesquisa div {
    width: 100%;
}


/* ============================================================
   INPUTS GERAIS
   ============================================================ */

input,
select,
textarea {
    width: 100%;

    min-height: 42px;

    padding: 10px 13px;

    border:
        1px solid #d8e0ea;

    border-radius:
        var(--radius-sm);

    background:
        rgba(255, 255, 255, 0.95);

    color:
        var(--text);

    font-family: inherit;

    font-size: 15px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color:
        var(--primary);

    box-shadow:
        0 0 0 4px
        rgba(8, 120, 249, 0.12);
}


/* ============================================================
   CARDS DE DOWNLOAD
   ============================================================ */

.download-item {
    position: relative;

    display: inline-block;

    vertical-align: top;

    width: calc(33.333% - 14px);

    min-height: 150px;

    margin:
        0 10px 16px 0;

    padding: 18px;

    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,0.96),
            rgba(244,248,253,0.90)
        );

    border:
        1px solid rgba(148,163,184,0.24);

    border-radius:
        var(--radius);

    box-shadow:
        0 8px 24px
        rgba(15,23,42,0.08);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.download-item::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: 4px;
    height: 100%;

    background:
        linear-gradient(
            180deg,
            var(--primary-light),
            var(--primary)
        );

    opacity: 0;

    transition:
        opacity 0.25s ease;
}

.download-item:hover {
    transform:
        translateY(-6px);

    border-color:
        rgba(8,120,249,0.30);

    box-shadow:
        0 18px 40px
        rgba(15,23,42,0.15);
}

.download-item:hover::before {
    opacity: 1;
}


/* ============================================================
   IMAGENS DOS CARDS
   ============================================================ */

.download-item img {
    float: left;

    width: 58px;
    height: 58px;

    object-fit: cover;

    margin:
        0 16px 10px 0;

    border-radius:
        14px;

    box-shadow:
        0 5px 15px
        rgba(15,23,42,0.12);
}


/* ============================================================
   TÍTULO DOS CARDS
   ============================================================ */

.download-item h3 {
    margin:
        3px 0 8px;

    color:
        var(--dark);

    font-size:
        17px;

    font-weight:
        700;
}


/* ============================================================
   BOTÃO DOWNLOAD
   ============================================================ */

.download-button {
    display: inline-flex;

    justify-content: center;
    align-items: center;

    gap: 7px;

    padding:
        9px 15px;

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--success),
            var(--success-light)
        );

    border: none;

    border-radius:
        var(--radius-sm);

    text-decoration: none;

    font-size:
        14px;

    font-weight:
        700;

    cursor:
        pointer;

    box-shadow:
        0 5px 15px
        rgba(22,163,74,0.20);

    transition:
        var(--transition);
}

.download-button:hover {
    color: white;

    transform:
        translateY(-2px);

    box-shadow:
        0 8px 22px
        rgba(22,163,74,0.30);
}


/* ============================================================
   LISTA DE LINKS
   ============================================================ */

.link-list {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));

    gap: 12px;

    list-style: none;

    padding: 0;

    margin: 0;
}

.link-list li {
    margin: 0;
}

.link-list li a {
    display: flex;

    justify-content: center;
    align-items: center;

    min-height: 44px;

    padding: 10px 14px;

    color: white;

    background:
        linear-gradient(
            135deg,
            #111827,
            #1e293b
        );

    border:
        1px solid
        rgba(255,255,255,0.08);

    border-radius:
        var(--radius-sm);

    box-shadow:
        var(--shadow-sm);

    transition:
        var(--transition);
}

.link-list li a:hover {
    color: white;

    background:
        linear-gradient(
            135deg,
            var(--primary-dark),
            var(--primary)
        );

    transform:
        translateY(-3px);

    box-shadow:
        0 10px 24px
        rgba(8,120,249,0.22);
}


/* ============================================================
   FOOTER
   ============================================================ */

footer {
    position: relative;

    width: 100%;

    margin-top: 30px;

    padding: 18px 20px;

    color:
        rgba(255,255,255,0.86);

    text-align:
        center;

    background:
        linear-gradient(
            135deg,
            #07111f,
            #0d2f52
        );

    border-top:
        1px solid
        rgba(56,189,248,0.15);

    box-shadow:
        0 -8px 30px
        rgba(0,0,0,0.12);

    z-index: 1000;
}


/* ============================================================
   TELA DE SENHA
   ============================================================ */

#dialog-overlay {
    position: fixed;

    inset: 0;

    display: flex;

    justify-content: center;
    align-items: center;

    width: 100%;
    height: 100%;

    padding: 20px;

    z-index: 9999;

    background:
        center center /
        cover
        no-repeat;

    isolation: isolate;
}

#dialog-overlay::before {
    content: "";

    position: absolute;

    inset: 0;

    z-index: -1;

    background:
        linear-gradient(
            135deg,
            rgba(3, 12, 24, 0.70),
            rgba(3, 64, 125, 0.45)
        );

    backdrop-filter:
        blur(5px);
}


/* ============================================================
   CAIXA DE LOGIN
   ============================================================ */

#dialog-box {
    position: relative;

    width:
        min(430px, 94vw);

    padding:
        34px 30px;

    text-align:
        center;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,0.94),
            rgba(238,246,255,0.90)
        );

    border:
        1px solid
        rgba(255,255,255,0.70);

    border-radius:
        24px;

    box-shadow:
        0 30px 80px
        rgba(0,0,0,0.35);

    backdrop-filter:
        blur(20px);

    -webkit-backdrop-filter:
        blur(20px);

    overflow:
        hidden;

    animation:
        slide-up 0.65s
        cubic-bezier(.16,1,.3,1)
        forwards;
}

#dialog-box::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 4px;

    background:
        linear-gradient(
            90deg,
            var(--primary-light),
            var(--primary),
            #8b5cf6
        );
}


/* ============================================================
   ANIMAÇÃO LOGIN
   ============================================================ */

@keyframes slide-up {

    from {
        opacity: 0;

        transform:
            translateY(45px)
            scale(0.96);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}


/* ============================================================
   BOTÕES
   ============================================================ */

button,
.botao,
.pesquisar-btn,
.uploadButton {
    font-family: inherit;

    cursor: pointer;

    transition:
        var(--transition);
}

button {
    border: none;
}


/* ============================================================
   BOTÃO SAIR
   ============================================================ */

.botao {
    display: inline-flex;

    justify-content: center;
    align-items: center;

    gap: 7px;

    min-height: 38px;

    padding:
        8px 15px;

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );

    border-radius:
        var(--radius-sm);

    text-decoration:
        none;

    font-weight:
        700;

    box-shadow:
        0 5px 15px
        rgba(8,120,249,0.20);
}

.botao:hover {
    color: white;

    transform:
        translateY(-2px);

    box-shadow:
        0 8px 22px
        rgba(8,120,249,0.30);
}


/* ============================================================
   BOTÃO PESQUISAR
   ============================================================ */

.pesquisar-btn {
    display: inline-flex;

    justify-content: center;
    align-items: center;

    min-height: 40px;

    padding:
        8px 15px;

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--secondary)
        );

    border:
        none;

    border-radius:
        var(--radius-sm);

    font-size:
        14px;

    font-weight:
        700;

    box-shadow:
        0 5px 15px
        rgba(8,120,249,0.18);
}

.pesquisar-btn:hover {
    transform:
        translateY(-2px);

    box-shadow:
        0 8px 22px
        rgba(8,120,249,0.28);
}


/* ============================================================
   UPLOAD
   ============================================================ */

.uploadButton {
    display: inline-flex;

    justify-content: center;
    align-items: center;

    min-height: 40px;

    padding:
        8px 15px;

    color: white;

    background:
        linear-gradient(
            135deg,
            #0878f9,
            #0ea5e9
        );

    border:
        none;

    border-radius:
        var(--radius-sm);

    font-weight:
        700;

    box-shadow:
        0 5px 15px
        rgba(8,120,249,0.20);
}

.uploadButton:hover {
    transform:
        translateY(-2px);

    box-shadow:
        0 8px 22px
        rgba(8,120,249,0.30);
}


/* ============================================================
   POPUPS
   ============================================================ */

.popup {
    position: fixed;

    top: 50%;
    left: 50%;

    display: none;

    width:
        min(430px, calc(100% - 30px));

    padding:
        22px 24px;

    transform:
        translate(-50%, -50%);

    border:
        1px solid
        rgba(255,255,255,0.25);

    border-radius:
        var(--radius);

    font-weight:
        600;

    text-align:
        center;

    z-index:
        10000;

    box-shadow:
        var(--shadow-lg);

    backdrop-filter:
        blur(14px);

    animation:
        popup-in 0.25s ease;
}

@keyframes popup-in {

    from {
        opacity: 0;

        transform:
            translate(-50%, -46%)
            scale(0.95);
    }

    to {
        opacity: 1;

        transform:
            translate(-50%, -50%)
            scale(1);
    }
}


.envio-success-popup {
    color: white;

    background:
        linear-gradient(
            135deg,
            #15803d,
            #16a34a
        );
}

.error-popup {
    color: white;

    background:
        linear-gradient(
            135deg,
            #dc2626,
            #ef4444
        );
}

.confirm-popup {
    color: white;

    background:
        linear-gradient(
            135deg,
            #dc2626,
            #f43f5e
        );
}


/* ============================================================
   BOTÕES DE CONFIRMAÇÃO
   ============================================================ */

.confirm-buttons {
    display: flex;

    justify-content: center;

    gap: 10px;

    margin-top: 18px;
}

.confirm-buttons button {
    min-width: 90px;

    padding:
        9px 15px;

    border:
        1px solid
        rgba(255,255,255,0.18);

    border-radius:
        var(--radius-sm);

    font-weight:
        700;

    cursor:
        pointer;
}

.confirm-buttons button:hover {
    transform:
        translateY(-2px);
}


/* ============================================================
   LOADING
   ============================================================ */

#loadingMessage {
    display: none;

    padding: 10px;

    color:
        var(--primary);

    font-weight:
        700;

    text-align:
        center;
}


/* ============================================================
   LISTA DE ARQUIVOS
   ============================================================ */

#fileList {
    list-style: none;

    padding: 0;

    margin: 0;
}

#fileList li {
    display: flex;

    align-items: center;

    gap: 10px;

    padding:
        13px 15px;

    margin-bottom:
        8px;

    background:
        rgba(224,242,254,0.70);

    border:
        1px solid
        rgba(14,165,233,0.15);

    border-radius:
        var(--radius-sm);

    box-shadow:
        var(--shadow-sm);

    transition:
        var(--transition);
}

#fileList li:hover {
    background:
        rgba(224,242,254,0.95);

    transform:
        translateX(3px);
}

#fileList li a {
    color:
        var(--primary);

    font-weight:
        600;
}

#fileList li a:hover {
    text-decoration:
        underline;
}

#fileList li strong {
    font-weight:
        700;
}


/* ============================================================
   BARRA DE PROGRESSO
   ============================================================ */

#progressBar {
    width: 100%;

    height: 10px;

    margin-top:
        20px;

    overflow:
        hidden;

    background:
        #e2e8f0;

    border-radius:
        20px;
}

#progressBarFill {
    width: 0;

    height: 100%;

    background:
        linear-gradient(
            90deg,
            var(--primary),
            var(--secondary),
            var(--primary-light)
        );

    border-radius:
        20px;

    transition:
        width 0.3s ease;
}


/* ============================================================
   TABELAS
   ============================================================ */

table {
    width: 100%;

    border-collapse:
        separate;

    border-spacing:
        0;

    margin-top:
        20px;

    overflow:
        hidden;

    background:
        rgba(255,255,255,0.92);

    border:
        1px solid
        rgba(148,163,184,0.20);

    border-radius:
        var(--radius);

    box-shadow:
        var(--shadow-sm);
}

th,
td {
    padding:
        13px 15px;

    border-bottom:
        1px solid
        rgba(148,163,184,0.15);

    text-align:
        left;
}

th {
    color:
        white;

    background:
        linear-gradient(
            135deg,
            #0b2a49,
            #0f4775
        );

    font-weight:
        700;
}

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

tbody tr {
    transition:
        background 0.2s ease;
}

tbody tr:hover {
    background:
        rgba(8,120,249,0.05);
}


/* ============================================================
   LISTA DE USUÁRIOS
   ============================================================ */

.user-list-table {
    width: 100%;
}

.user-list-table tr {
    background:
        rgba(224,242,254,0.65);

    transition:
        background 0.2s ease;
}

.user-list-table tr:hover {
    background:
        rgba(191,219,254,0.80);
}


/* ============================================================
   ABAS
   ============================================================ */

.tablinks {
    display: inline-flex;

    justify-content: center;
    align-items: center;

    min-height: 42px;

    padding:
        9px 15px;

    margin:
        0 4px 6px 0;

    color:
        #475569;

    background:
        rgba(241,245,249,0.85);

    border:
        1px solid
        rgba(148,163,184,0.20);

    border-radius:
        var(--radius-sm);

    font-weight:
        600;

    cursor:
        pointer;

    transition:
        var(--transition);
}

.tablinks:hover {
    color:
        var(--primary);

    background:
        rgba(219,234,254,0.90);

    transform:
        translateY(-2px);
}

.tablinks.active {
    color:
        white;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );

    border-color:
        transparent;

    box-shadow:
        0 6px 18px
        rgba(8,120,249,0.22);
}

.tabcontent {
    display: none;

    padding:
        16px 0;
}


/* ============================================================
   BOXES DAS ABAS
   ============================================================ */

.tabcontent .box {
    padding:
        16px;

    margin-bottom:
        12px;

    background:
        rgba(255,255,255,0.88);

    border:
        1px solid
        rgba(148,163,184,0.20);

    border-radius:
        var(--radius);

    box-shadow:
        var(--shadow-sm);
}


/* ============================================================
   LISTAS
   ============================================================ */

ul {
    list-style:
        none;

    padding:
        0;
}

.lista-dinamica {
    display:
        grid;

    gap:
        10px;
}

.lista-dinamica li {
    display:
        flex;

    align-items:
        center;

    gap:
        10px;

    padding:
        13px 15px;

    margin-bottom:
        0;

    background:
        rgba(224,242,254,0.70);

    border:
        1px solid
        rgba(14,165,233,0.14);

    border-radius:
        var(--radius-sm);

    box-shadow:
        var(--shadow-sm);

    transition:
        var(--transition);
}

.lista-dinamica li:hover {
    background:
        rgba(191,219,254,0.80);

    transform:
        translateX(3px);
}

.lista-dinamica li img {
    width:
        38px;

    height:
        38px;

    object-fit:
        cover;

    vertical-align:
        middle;

    border-radius:
        50%;
}


/* ============================================================
   CONTADOR DE ACESSOS
   ============================================================ */

.contador-box {
    position:
        fixed;

    top:
        15px;

    right:
        15px;

    width:
        150px;

    min-height:
        60px;

    margin-top:
        90px;

    padding:
        10px 12px;

    color:
        var(--text);

    background:
        rgba(255,255,255,0.92);

    border:
        1px solid
        rgba(148,163,184,0.25);

    border-radius:
        var(--radius);

    text-align:
        center;

    box-shadow:
        var(--shadow);

    backdrop-filter:
        blur(12px);

    z-index:
        999;
}


/* ============================================================
   BALÕES DE STATUS
   ============================================================ */

.balao-verde,
.balao-vermelho {
    display:
        inline-flex;

    align-items:
        center;

    gap:
        6px;

    padding:
        5px 10px;

    border-radius:
        20px;

    font-size:
        13px;

    font-weight:
        700;
}

.balao-verde {
    color:
        #166534;

    background:
        #dcfce7;

    border:
        1px solid
        #bbf7d0;
}

.balao-vermelho {
    color:
        #991b1b;

    background:
        #fee2e2;

    border:
        1px solid
        #fecaca;
}


/* ============================================================
   CLASSE ESCONDER
   ============================================================ */

.esconder {
    display:
        none !important;
}


/* ============================================================
   RESPONSIVIDADE - TABLET
   ============================================================ */

@media screen and (max-width: 1100px) {

    #pesquisa {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .download-item {
        width:
            calc(50% - 10px);
    }

    .content-section {
        width:
            94%;
    }
}


/* ============================================================
   RESPONSIVIDADE - CELULAR
   ============================================================ */

@media screen and (max-width: 768px) {

    body {
        background-image:
            linear-gradient(
                135deg,
                rgba(7,17,31,0.35),
                rgba(8,120,249,0.08)
            ),
            url('Arquivos/Fundo/Mobile.jpeg');

        background-attachment:
            scroll;

        overflow-x:
            hidden;
    }


    /* HEADER */

    .logo-wrapper {
        min-height:
            64px;

        padding:
            8px 14px;
    }


    /* NAV */

    nav {
        justify-content:
            flex-start;

        padding:
            6px 8px;

        gap:
            4px;

        overflow-x:
            auto;

        -webkit-overflow-scrolling:
            touch;
    }

    nav a {
        flex:
            0 0 auto;

        min-height:
            40px;

        padding:
            9px 13px;

        font-size:
            14px;
    }


    /* CONTEÚDO */

    .content-section {
        width:
            calc(100% - 20px);

        margin:
            12px auto;

        padding:
            15px;

        border-radius:
            15px;
    }


    /* PESQUISA */

    #pesquisa {
        grid-template-columns:
            1fr;

        gap:
            10px;
    }


    /* CARDS */

    .download-item {
        display:
            block;

        width:
            100%;

        margin:
            0 0 12px;

        padding:
            15px;
    }


    .download-item img {
        width:
            50px;

        height:
            50px;

        margin-right:
            13px;
    }


    /* LINKS */

    .link-list {
        grid-template-columns:
            1fr;
    }


    /* TABELAS */

    table {
        display:
            block;

        overflow-x:
            auto;

        white-space:
            nowrap;
    }


    th,
    td {
        padding:
            10px 12px;

        font-size:
            14px;
    }


    /* CONTADOR */

    .contador-box {
        position:
            relative;

        top:
            auto;

        right:
            auto;

        width:
            100%;

        margin:
            10px 0;

        min-height:
            auto;
    }


    /* POPUPS */

    .popup {
        width:
            calc(100% - 30px);

        padding:
            20px;
    }


    /* LOGIN */

    #dialog-overlay {
        padding:
            15px;
    }

    #dialog-box {
        width:
            100%;

        max-width:
            390px;

        padding:
            28px 20px;

        border-radius:
            20px;
    }


    /* ABAS */

    .tablinks {
        width:
            100%;

        margin:
            0 0 7px;
    }


    /* LISTAS */

    .lista-dinamica li {
        align-items:
            flex-start;
    }


    /* FOOTER */

    footer {
        position:
            relative;

        padding:
            15px;
    }
}


/* ============================================================
   CELULARES PEQUENOS
   ============================================================ */

@media screen and (max-width: 480px) {

    .content-section {
        width:
            calc(100% - 14px);

        padding:
            12px;
    }


    .download-item {
        min-height:
            auto;

        padding:
            13px;
    }


    .download-item h3 {
        font-size:
            16px;
    }


    .download-button,
    .uploadButton,
    .pesquisar-btn,
    .botao {
        width:
            100%;
    }


    .confirm-buttons {
        flex-direction:
            column;
    }


    .confirm-buttons button {
        width:
            100%;
    }


    #dialog-box {
        padding:
            24px 16px;
    }


    input,
    select,
    textarea {
        font-size:
            16px;
    }
}


/* ============================================================
   ACESSIBILIDADE
   ============================================================ */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline:
        3px solid
        rgba(56,189,248,0.45);

    outline-offset:
        2px;
}


/* ============================================================
   REDUÇÃO DE ANIMAÇÕES
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior:
            auto !important;

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;

        transition-duration:
            0.01ms !important;
    }
}


/* ============================================================
   FREE FILE — REFINAMENTO PROFISSIONAL DO LAYOUT
   Mantém IDs/classes existentes e melhora:
   - alinhamento
   - hierarquia visual
   - área de upload
   - tabelas
   - navegação
   - responsividade
   ============================================================ */

/* ---------- Estrutura geral ---------- */

html,
body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
}

/* ---------- Cabeçalho ---------- */

header {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
}

.logo-wrapper {
    min-height: 72px;
    flex: 0 0 auto;
    padding: 8px 0;
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

header nav {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    justify-content: flex-start;
    border: 0;
    background: transparent;
    padding: 6px 0;
}

header nav a {
    min-height: 40px;
    padding: 8px 13px;
}

header nav a:first-child {
    background: rgba(8, 120, 249, 0.16);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.30);
}

header nav a:first-child::after {
    width: 55%;
}

/* Campo de pesquisa que eventualmente estiver no header */
header input[type="search"],
header input[placeholder*="Pesquisar"],
header input[placeholder*="pesquisar"] {
    flex: 0 1 260px;
    width: min(260px, 22vw);
    min-height: 40px;
    margin-left: auto;
    color: #e8f1fb;
    background: rgba(7, 17, 31, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

header input[type="search"]::placeholder,
header input[placeholder*="Pesquisar"]::placeholder,
header input[placeholder*="pesquisar"]::placeholder {
    color: rgba(226, 232, 240, 0.58);
}

/* ---------- Conteúdo principal ---------- */

.content-section {
    width: min(1500px, calc(100% - 40px)) !important;
    max-width: 1500px;
    margin: 24px auto;
    padding: 26px;
    background: rgba(248, 250, 252, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    box-shadow:
        0 24px 70px rgba(2, 12, 27, 0.20),
        0 4px 18px rgba(15, 23, 42, 0.08);
}

/* Evita elementos largos de estourarem o container */
.content-section > *,
.tabcontent,
.tabcontent > *,
.tabcontent .box {
    max-width: 100%;
}

/* ---------- Abas administrativas ---------- */

.tablinks {
    min-height: 40px;
    margin: 0 6px 8px 0;
    padding: 8px 15px;
    border-radius: 10px;
    color: #526174;
    background: #eef3f8;
}

.tablinks:hover {
    background: #e2edf8;
}

.tablinks.active {
    background: linear-gradient(135deg, #0878f9, #0757b8);
    color: #fff;
}

/* ---------- Área de upload ---------- */

.uploadButton {
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
    border-radius: 10px;
}

input[type="file"] {
    min-height: 44px;
    padding: 7px 10px;
    cursor: pointer;
    background: #f8fafc;
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 13px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, #0878f9, #0ea5e9);
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

textarea {
    resize: vertical;
}

/* Formulários internos ficam organizados sem alterar o PHP/HTML */
.content-section form {
    width: 100%;
}

.content-section form > input,
.content-section form > select,
.content-section form > textarea,
.content-section form > .uploadButton {
    margin-bottom: 10px;
}

/* ---------- Indicadores de espaço ---------- */

.content-section .balao-verde,
.content-section .balao-vermelho {
    vertical-align: middle;
}

/* ---------- Pesquisa ---------- */

#pesquisa {
    align-items: end;
    margin: 18px 0 8px;
}

#pesquisa input,
#pesquisa select,
#pesquisa button {
    min-height: 44px;
}

/* ---------- Tabelas ---------- */

table {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
}

th {
    padding: 13px 14px;
    white-space: nowrap;
}

td {
    padding: 12px 14px;
    vertical-align: middle;
}

td:first-child {
    max-width: 360px;
    overflow-wrap: anywhere;
}

table select {
    min-width: 78px;
    min-height: 38px;
    padding: 7px 10px;
}

table .botao,
table button,
table a {
    white-space: nowrap;
}

/* ---------- Caixa visual dos conteúdos ---------- */

.tabcontent .box {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 14px;
    padding: 20px;
}

.tabcontent h1,
.tabcontent h2,
.tabcontent h3 {
    margin-top: 0;
    color: #0f2035;
}

/* ---------- Melhor comportamento para listas ---------- */

.lista-dinamica li {
    min-width: 0;
}

.lista-dinamica li > * {
    min-width: 0;
}

/* ---------- Contador ---------- */

.contador-box {
    z-index: 900;
}

/* ---------- Pequenas telas ---------- */

@media screen and (max-width: 1100px) {
    header {
        padding: 0 16px;
    }

    header input[type="search"],
    header input[placeholder*="Pesquisar"],
    header input[placeholder*="pesquisar"] {
        width: 220px;
        flex-basis: 220px;
    }

    .content-section {
        width: calc(100% - 28px) !important;
        padding: 22px;
    }
}

@media screen and (max-width: 768px) {
    header {
        min-height: auto;
        flex-wrap: wrap;
        gap: 0;
        padding: 7px 10px 0;
    }

    .logo-wrapper {
        min-height: 54px;
        padding: 5px 4px;
    }

    header nav {
        order: 3;
        flex: 1 1 100%;
        width: 100%;
        margin-top: 3px;
        padding: 5px 0 7px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    header nav::-webkit-scrollbar {
        display: none;
    }

    header nav a {
        flex: 0 0 auto;
        min-height: 38px;
        padding: 8px 12px;
        font-size: 13px;
    }

    header input[type="search"],
    header input[placeholder*="Pesquisar"],
    header input[placeholder*="pesquisar"] {
        width: min(42vw, 220px);
        flex: 0 1 220px;
        margin-left: auto;
    }

    .content-section {
        width: calc(100% - 20px) !important;
        margin: 12px auto;
        padding: 16px;
        border-radius: 16px;
    }

    #pesquisa {
        margin-top: 12px;
    }

    .tabcontent .box {
        padding: 15px;
    }

    /* Tabela continua íntegra e pode ser rolada horizontalmente */
    table {
        min-width: 720px;
    }

    /* Mantém a área da tabela navegável no celular */
    .content-section table {
        display: table;
    }

    .content-section {
        overflow-x: hidden;
    }

    .content-section > div:has(> table),
    .content-section .tabcontent:has(> table),
    .content-section .box:has(> table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media screen and (max-width: 560px) {
    header {
        padding-left: 8px;
        padding-right: 8px;
    }

    header input[type="search"],
    header input[placeholder*="Pesquisar"],
    header input[placeholder*="pesquisar"] {
        width: 42vw;
        min-width: 130px;
        flex-basis: 42vw;
    }

    .content-section {
        width: calc(100% - 12px) !important;
        padding: 12px;
        margin: 7px auto;
        border-radius: 14px;
    }

    .tablinks {
        width: 100%;
        margin-right: 0;
    }

    input,
    select,
    textarea {
        max-width: 100%;
    }

    .uploadButton {
        min-height: 46px;
    }

    .contador-box {
        width: 100%;
    }
}

@media screen and (max-width: 380px) {
    .logo-wrapper {
        max-width: 48%;
    }

    header input[type="search"],
    header input[placeholder*="Pesquisar"],
    header input[placeholder*="pesquisar"] {
        max-width: 48%;
        min-width: 110px;
    }

    .content-section {
        padding: 10px;
    }
}

/* ---------- Acessibilidade / toque ---------- */

@media (hover: none) {
    .download-item:hover,
    .lista-dinamica li:hover,
    .tablinks:hover,
    .botao:hover,
    .uploadButton:hover,
    .pesquisar-btn:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    header nav a,
    .tablinks,
    .download-item,
    .botao,
    .uploadButton,
    .pesquisar-btn {
        transition: none !important;
    }
}


/* ============================================================
   FREE FILE — TEMA MODERNO / ALTO CONTRASTE
   Correção da tela "Atualização"
   ============================================================ */

/* Paleta moderna */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #06b6d4;

    --dark: #0f172a;
    --dark-2: #111827;
    --dark-3: #1e293b;

    --text: #e5e7eb;
    --text-light: #94a3b8;
}

/* Fundo geral */
body {
    background:
        radial-gradient(circle at 15% 10%, rgba(99,102,241,.18), transparent 32%),
        radial-gradient(circle at 85% 20%, rgba(6,182,212,.12), transparent 30%),
        linear-gradient(135deg, #07111f 0%, #0b1220 48%, #111827 100%);
    color: #e5e7eb;
}

/* Área principal */
.content-section {
    background: rgba(248, 250, 252, 0.97) !important;
    color: #172033;
}

/* Títulos */
.content-section h1,
.content-section h2,
.content-section h3,
.content-section h4,
.content-section p,
.content-section label {
    color: #172033;
}

/* ============================================================
   PAINEL DE ATUALIZAÇÃO
   ============================================================ */

.content-section .box,
.tabcontent .box {
    color: #e5e7eb;
}

/* Caixa escura central */
.content-section .box > div,
.tabcontent .box > div {
    color: #e5e7eb;
}

/* Corrige especificamente textos dentro de áreas escuras */
.content-section .box h1,
.content-section .box h2,
.content-section .box h3,
.content-section .box h4,
.content-section .box p,
.content-section .box span,
.content-section .box label,
.content-section .box strong,
.content-section .box li {
    color: #e5e7eb;
}

/* Títulos dentro do painel */
.tabcontent h1,
.tabcontent h2,
.tabcontent h3 {
    color: #0f172a;
}

/* ============================================================
   TABS: PROGRAMAS / APKS / ISO / ATIVADORES
   ============================================================ */

.tabcontent .tablinks,
.tabcontent button.tablinks,
button.tablinks {
    color: #475569 !important;
    background: #f8fafc !important;
    border: 1px solid #dbe3ef !important;
    font-weight: 700;
}

.tabcontent .tablinks:hover,
button.tablinks:hover {
    color: #312e81 !important;
    background: #eef2ff !important;
    border-color: #a5b4fc !important;
}

.tabcontent .tablinks.active,
button.tablinks.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    border-color: transparent !important;
    box-shadow: 0 8px 22px rgba(79,70,229,.28);
}

/* ============================================================
   LISTA DE PROGRAMAS
   ============================================================ */

/* O seletor abaixo cobre cards/listas usados dentro do painel */
.tabcontent .lista-dinamica li,
.tabcontent .download-item,
.tabcontent .item,
.tabcontent .card {
    color: #e5e7eb;
    background: linear-gradient(135deg, #172033, #1e293b);
    border: 1px solid rgba(148,163,184,.18);
}

/* Nomes dos programas — branco e bem visível */
.tabcontent .lista-dinamica li *,
.tabcontent .download-item *,
.tabcontent .item *,
.tabcontent .card * {
    color: #f8fafc;
}

/* Nome principal do programa */
.tabcontent .lista-dinamica li strong,
.tabcontent .lista-dinamica li span,
.tabcontent .download-item h3,
.tabcontent .item h3,
.tabcontent .card h3 {
    color: #f8fafc !important;
    font-weight: 700;
}

/* Descrições */
.tabcontent .lista-dinamica li small,
.tabcontent .download-item small,
.tabcontent .item small,
.tabcontent .card small {
    color: #a5b4fc !important;
}

/* Hover dos itens */
.tabcontent .lista-dinamica li:hover,
.tabcontent .download-item:hover,
.tabcontent .item:hover,
.tabcontent .card:hover {
    background: linear-gradient(135deg, #1e293b, #273449);
    border-color: rgba(99,102,241,.55);
    box-shadow: 0 10px 30px rgba(2,6,23,.28);
    transform: translateY(-2px);
}

/* ============================================================
   BOTÕES EDITAR / EXCLUIR
   ============================================================ */

.tabcontent .botao,
.tabcontent button,
.tabcontent a.button,
.tabcontent .editar,
.tabcontent .btn-editar {
    color: #ffffff !important;
}

/* Botão editar */
.tabcontent .editar,
.tabcontent .btn-editar {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    border: 0;
}

/* Botão excluir */
.tabcontent .excluir,
.tabcontent .btn-excluir {
    color: #ffffff !important;
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border: 0;
}

/* ============================================================
   CAMPO DE PESQUISA
   ============================================================ */

.tabcontent input[type="text"],
.tabcontent input[type="search"],
.tabcontent input[placeholder*="Pesquisar"],
.tabcontent input[placeholder*="pesquisar"] {
    color: #e5e7eb !important;
    background: #0f172a !important;
    border: 1px solid #334155 !important;
}

.tabcontent input::placeholder {
    color: #94a3b8 !important;
}

.tabcontent input:focus {
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,.18) !important;
}

/* Botão pesquisar */
.tabcontent .pesquisar-btn,
.tabcontent button[type="submit"] {
    color: #ffffff !important;
    background: linear-gradient(135deg, #6366f1, #06b6d4) !important;
}

/* ============================================================
   NOVO / BOTÕES SUPERIORES
   ============================================================ */

.tabcontent .novo,
.tabcontent .btn-novo,
.tabcontent button:first-child {
    color: #ffffff !important;
    background: linear-gradient(135deg, #6366f1, #818cf8) !important;
    border: 0 !important;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media screen and (max-width: 768px) {
    .content-section {
        background: #f8fafc !important;
    }

    .tabcontent .box {
        padding: 12px;
    }

    .tabcontent .tablinks,
    button.tablinks {
        min-height: 42px;
    }

    .tabcontent .lista-dinamica li,
    .tabcontent .download-item,
    .tabcontent .item,
    .tabcontent .card {
        padding: 13px;
    }
}

/* ============================================================
   FREE FILE — TEMA TECNOLÓGICO + ALTO CONTRASTE
   Correção definitiva de textos quase invisíveis
   ============================================================ */

:root{
    --ff-tech-bg:#07111f;
    --ff-tech-bg-2:#0b1730;
    --ff-tech-surface:#101c33;
    --ff-tech-surface-2:#162642;
    --ff-tech-primary:#22d3ee;
    --ff-tech-primary-2:#6366f1;
    --ff-tech-text:#172033;
    --ff-tech-text-soft:#475569;
    --ff-tech-white:#f8fafc;
    --ff-tech-border:#cbd5e1;
}

/* Fundo geral: azul petróleo/índigo tecnológico */
body{
    color:var(--ff-tech-white)!important;
    background:
      radial-gradient(circle at 10% 5%,rgba(34,211,238,.16),transparent 30%),
      radial-gradient(circle at 90% 10%,rgba(99,102,241,.20),transparent 34%),
      linear-gradient(135deg,#06101e 0%,#0a1730 52%,#10152f 100%)!important;
}

/* Cabeçalho */
header{
    background:rgba(5,15,30,.92)!important;
    border-bottom:1px solid rgba(34,211,238,.18)!important;
    box-shadow:0 8px 30px rgba(0,0,0,.30)!important;
}

nav a{
    color:#a8b6ca!important;
}
nav a:hover,
nav a:focus-visible{
    color:#fff!important;
    background:linear-gradient(135deg,rgba(34,211,238,.14),rgba(99,102,241,.16))!important;
}

/* Área branca central */
.content-section{
    color:var(--ff-tech-text)!important;
    background:rgba(248,250,252,.98)!important;
    border:1px solid rgba(255,255,255,.8)!important;
    border-radius:20px!important;
    box-shadow:0 25px 70px rgba(0,0,0,.25)!important;
}

/* Títulos e textos da área clara */
.content-section h1,
.content-section h2,
.content-section h3,
.content-section h4,
.content-section p,
.content-section label,
.content-section b,
.content-section strong{
    color:var(--ff-tech-text)!important;
}

/* Descrição do upload */
#upload > .box > p,
#uploadedFiles > p{
    color:#475569!important;
}

/* Caixa de upload */
#upload .box{
    color:var(--ff-tech-white)!important;
    background:linear-gradient(145deg,#101c33,#162642)!important;
    border:1px solid rgba(34,211,238,.16)!important;
    box-shadow:0 18px 50px rgba(2,8,23,.22)!important;
}

/* Título dentro da caixa escura */
#upload .box h2,
#upload .box .search-title{
    color:#f8fafc!important;
}

/* Textos dentro da caixa escura */
#upload .box p,
#upload .box label,
#upload .box b{
    color:#dbeafe!important;
}

/* Inputs */
#upload input[type="text"],
#upload input[type="search"],
#upload input[type="file"],
#upload select{
    color:#e5e7eb!important;
    background:#091426!important;
    border:1px solid #334155!important;
}

#upload input::placeholder{
    color:#94a3b8!important;
}

#upload input[type="file"]::file-selector-button{
    color:#fff!important;
    background:linear-gradient(135deg,#0891b2,#6366f1)!important;
    border:0!important;
    border-radius:8px!important;
}

/* Botão Upload */
#upload .uploadButton{
    color:#fff!important;
    background:linear-gradient(90deg,#0891b2,#2563eb,#6366f1)!important;
    border:0!important;
    box-shadow:0 8px 22px rgba(37,99,235,.25)!important;
}

/* Indicadores de espaço */
#uploadedFiles .balao-verde{
    color:#047857!important;
    background:#d1fae5!important;
    border:1px solid #86efac!important;
}

#uploadedFiles .balao-vermelho{
    color:#b91c1c!important;
    background:#fee2e2!important;
    border:1px solid #fca5a5!important;
}

/* Pesquisa */
.search-title{
    color:#f8fafc!important;
    font-weight:800!important;
}

.search-box{
    color:#f8fafc!important;
    background:#091426!important;
    border:1px solid #334155!important;
}

.search-box::placeholder{
    color:#94a3b8!important;
}

.custom-file-filter-container{
    color:#dbeafe!important;
}

.custom-file-filter{
    color:#e5e7eb!important;
    background:#091426!important;
    border:1px solid #334155!important;
}

/* ============================================================
   TABELA — CORREÇÃO PRINCIPAL DA FONTE
   ============================================================ */

#fileList{
    color:#172033!important;
}

/* Cabeçalho */
#fileList table thead th,
#fileList th{
    color:#ffffff!important;
    background:linear-gradient(135deg,#0f3d63,#155e75)!important;
    border-color:#2b5877!important;
    font-weight:800!important;
}

/* Linhas */
#fileList table tbody td,
#fileList td{
    color:#1e293b!important;
    background:#e8f3ff!important;
    border-color:#c5d8ea!important;
    font-weight:600!important;
}

/* Nome do arquivo */
#fileList td:first-child,
#fileList td:first-child *,
#fileList td a{
    color:#0f2942!important;
    font-weight:700!important;
}

/* Descrição */
#fileList td:nth-child(2){
    color:#475569!important;
}

/* Tamanho */
#fileList td:nth-child(3){
    color:#047857!important;
    font-weight:800!important;
}

/* Data */
#fileList td:nth-child(4){
    color:#1d4ed8!important;
    font-weight:700!important;
}

/* Usuário */
#fileList td:nth-child(5){
    color:#dc2626!important;
    font-weight:800!important;
}

/* Select Visível */
#fileList select{
    color:#172033!important;
    background:#ffffff!important;
    border:1px solid #b8c9da!important;
}

/* Ações */
#fileList td:last-child,
#fileList td:last-child a{
    color:#2563eb!important;
    font-weight:700!important;
}

#fileList td:last-child a:hover{
    color:#0891b2!important;
}

/* Hover da linha */
#fileList tbody tr:hover td{
    background:#d9efff!important;
    color:#172033!important;
}

/* ============================================================
   ABAS ADMINISTRATIVAS
   ============================================================ */

.tablinks{
    color:#334155!important;
    background:#f8fafc!important;
    border:1px solid #cbd5e1!important;
    font-weight:700!important;
}

.tablinks:hover{
    color:#0f3d63!important;
    background:#ecfeff!important;
    border-color:#67e8f9!important;
}

.tablinks.active{
    color:#fff!important;
    background:linear-gradient(135deg,#0891b2,#6366f1)!important;
    border-color:transparent!important;
    box-shadow:0 7px 20px rgba(8,145,178,.25)!important;
}

/* Caixa escura da Atualização */
#Atualização .box,
#atualizacao .box{
    color:#e5e7eb!important;
    background:linear-gradient(145deg,#0f1b31,#162642)!important;
}

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */

@media(max-width:768px){
    .content-section{
        width:calc(100% - 14px)!important;
        padding:14px!important;
        border-radius:16px!important;
    }

    #upload .box{
        padding:14px!important;
    }

    #fileList{
        overflow-x:auto;
        -webkit-overflow-scrolling:touch;
    }

    #fileList table{
        min-width:850px;
    }

    #upload .uploadButton{
        min-height:46px;
    }
}

/* ============================================================
   FINAL UI PATCH — CONTRASTE + DESIGN SYSTEM PROFISSIONAL
   Corrige textos apagados e moderniza a interface sem alterar
   IDs/classes existentes ou exigir mudanças no HTML.
   ============================================================ */

:root {
    --primary: #4f46e5 !important;
    --primary-dark: #3730a3 !important;
    --primary-light: #818cf8 !important;
    --secondary: #0891b2 !important;

    --text: #0f172a !important;
    --text-light: #64748b !important;
    --dark: #0f172a !important;
    --dark-2: #111827 !important;
    --dark-3: #1e293b !important;

    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-muted: #f1f5f9;
    --border: #dbe3ef !important;
    --focus: rgba(79, 70, 229, .18);
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, .08);
    --shadow-card: 0 18px 45px rgba(15, 23, 42, .10);
}

/* Base mais limpa e consistente */
body {
    color: #e2e8f0 !important;
    background:
        radial-gradient(circle at 12% 8%, rgba(79,70,229,.22), transparent 28%),
        radial-gradient(circle at 88% 16%, rgba(8,145,178,.16), transparent 26%),
        linear-gradient(135deg, #07111f 0%, #0b1426 50%, #111827 100%) !important;
}

/* Conteúdo principal */
.content-section {
    color: #0f172a !important;
    background: rgba(248,250,252,.98) !important;
    border: 1px solid rgba(255,255,255,.85) !important;
    box-shadow: 0 25px 70px rgba(2,8,23,.22) !important;
}

.content-section h1,
.content-section h2,
.content-section h3,
.content-section h4,
.content-section p,
.content-section label,
.content-section strong,
.content-section b {
    color: #0f172a !important;
}

/* Inputs — contraste alto */
input,
select,
textarea {
    color: #0f172a !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

input::placeholder,
textarea::placeholder {
    color: #64748b !important;
    opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 4px var(--focus) !important;
}

/* ============================================================
   TABELA DE ARQUIVOS — CONTRASTE DEFINITIVO
   Funciona tanto se #fileList estiver no container quanto na
   própria tabela.
   ============================================================ */

#fileList,
#fileList table,
table#fileList {
    color: #0f172a !important;
    background: #ffffff !important;
    border: 1px solid #d8e2ee !important;
    box-shadow: 0 14px 35px rgba(15,23,42,.07) !important;
}

#fileList thead th,
#fileList th,
table#fileList th,
.content-section table thead th {
    color: #f8fafc !important;
    background: linear-gradient(135deg, #173b68 0%, #155e75 100%) !important;
    border-bottom: 1px solid #24577a !important;
    font-weight: 800 !important;
    letter-spacing: .01em;
    text-shadow: 0 1px 1px rgba(0,0,0,.15);
}

#fileList tbody td,
#fileList td,
table#fileList td,
.content-section table tbody td {
    color: #1e293b !important;
    background: #f8fbff !important;
    border-bottom: 1px solid #d8e2ee !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

#fileList tbody tr:nth-child(even) td,
table#fileList tbody tr:nth-child(even) td {
    background: #f1f7fc !important;
}

#fileList tbody tr:hover td,
table#fileList tbody tr:hover td,
.content-section table tbody tr:hover td {
    color: #0f172a !important;
    background: #e8f2ff !important;
}

/* Cada coluna recebe uma hierarquia visual clara */
#fileList td:first-child,
table#fileList td:first-child {
    color: #0f2942 !important;
    font-weight: 750 !important;
}

#fileList td:nth-child(2),
table#fileList td:nth-child(2) {
    color: #475569 !important;
}

#fileList td:nth-child(3),
table#fileList td:nth-child(3) {
    color: #166534 !important;
    font-weight: 800 !important;
}

#fileList td:nth-child(4),
table#fileList td:nth-child(4) {
    color: #334155 !important;
    font-weight: 600 !important;
}

#fileList td:nth-child(5),
table#fileList td:nth-child(5) {
    color: #475569 !important;
    font-weight: 650 !important;
}

#fileList td a,
table#fileList td a {
    color: #2563eb !important;
    font-weight: 750 !important;
    text-decoration: none !important;
}

#fileList td a:hover,
table#fileList td a:hover {
    color: #4f46e5 !important;
    text-decoration: underline !important;
}

#fileList select,
table#fileList select {
    color: #0f172a !important;
    background: #ffffff !important;
    border: 1px solid #b8c7d9 !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}

#fileList select:focus,
table#fileList select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,.14) !important;
}

#fileList td:last-child,
table#fileList td:last-child {
    color: #2563eb !important;
    font-weight: 700 !important;
}

/* Evita que algum estilo herdado deixe células com opacity baixa */
#fileList td,
#fileList th,
#fileList a,
#fileList span,
#fileList strong,
table#fileList td,
table#fileList th {
    opacity: 1 !important;
}

/* ============================================================
   PESQUISA / FILTROS
   ============================================================ */

.search-box,
.custom-file-filter,
#pesquisa input,
#pesquisa select {
    color: #0f172a !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}

.search-box::placeholder,
#pesquisa input::placeholder {
    color: #64748b !important;
}

/* ============================================================
   BOTÕES — visual mais premium
   ============================================================ */

.botao,
.pesquisar-btn,
.uploadButton {
    color: #ffffff !important;
    background: linear-gradient(135deg, #4f46e5 0%, #0891b2 100%) !important;
    border: 0 !important;
    box-shadow: 0 8px 22px rgba(79,70,229,.22) !important;
}

.botao:hover,
.pesquisar-btn:hover,
.uploadButton:hover {
    color: #ffffff !important;
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(79,70,229,.28) !important;
}

.download-button {
    color: #ffffff !important;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
}

/* Abas */
.tablinks {
    color: #334155 !important;
    background: #ffffff !important;
    border: 1px solid #d5deea !important;
}

.tablinks:hover {
    color: #3730a3 !important;
    background: #eef2ff !important;
    border-color: #a5b4fc !important;
}

.tablinks.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #4f46e5, #0891b2) !important;
    border-color: transparent !important;
}

/* ============================================================
   BOXES / CARDS
   ============================================================ */

.tabcontent .box {
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-soft);
}

.download-item {
    background: #ffffff !important;
    border-color: #dbe3ef !important;
    box-shadow: var(--shadow-soft) !important;
}

.download-item:hover {
    border-color: #a5b4fc !important;
    box-shadow: var(--shadow-card) !important;
}

/* Links e textos genéricos */
.content-section a {
    color: #2563eb;
}

.content-section a:hover {
    color: #4f46e5;
}

/* Status */
.balao-verde {
    color: #166534 !important;
    background: #dcfce7 !important;
}

.balao-vermelho {
    color: #991b1b !important;
    background: #fee2e2 !important;
}

/* Mobile: tabela permanece legível e navegável */
@media (max-width: 768px) {
    #fileList table,
    table#fileList {
        min-width: 850px;
    }

    #fileList td,
    #fileList th,
    table#fileList td,
    table#fileList th {
        font-size: 13px;
        padding: 11px 12px;
    }
}

/* ============================================================
   CORREÇÃO FINAL — CAMPOS TABELA COM TEXTO QUASE INVISÍVEL
   Alguns elementos internos (span, small, strong, a etc.) podem
   possuir cor própria. Por isso a cor é aplicada também aos
   descendentes das células.
   ============================================================ */

#fileList td:nth-child(3),
#fileList td:nth-child(3) *,
table#fileList td:nth-child(3),
table#fileList td:nth-child(3) {
    color: #334155 !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

#fileList td:nth-child(4),
#fileList td:nth-child(4) *,
table#fileList td:nth-child(4),
table#fileList td:nth-child(4) * {
    color: #334155 !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

#fileList td:nth-child(5),
#fileList td:nth-child(5) *,
table#fileList td:nth-child(5),
table#fileList td:nth-child(5) * {
    color: #334155 !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Garante contraste para qualquer estrutura intermediária */
#fileList tbody td:nth-child(3) span,
#fileList tbody td:nth-child(3) small,
#fileList tbody td:nth-child(3) strong,
#fileList tbody td:nth-child(3) b,
#fileList tbody td:nth-child(4) span,
#fileList tbody td:nth-child(4) small,
#fileList tbody td:nth-child(4) strong,
#fileList tbody td:nth-child(4) b,
#fileList tbody td:nth-child(5) span,
#fileList tbody td:nth-child(5) small,
#fileList tbody td:nth-child(5) strong,
#fileList tbody td:nth-child(5) b {
    color: #334155 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Caso #fileList seja um container da tabela */
#fileList table tbody td:nth-child(3),
#fileList table tbody td:nth-child(3) *,
#fileList table tbody td:nth-child(4),
#fileList table tbody td:nth-child(4) *,
#fileList table tbody td:nth-child(5),
#fileList table tbody td:nth-child(5) * {
    color: #334155 !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-shadow: none !important;
}

/* Mantém as ações em azul, sem herdar a cor das colunas */
#fileList td:last-child,
#fileList td:last-child *,
table#fileList td:last-child,
table#fileList td:last-child * {
    color: #2563eb !important;
    font-weight: 700 !important;
    opacity: 1 !important;
}

/* Select da coluna Visível */
#fileList td select,
#fileList td select option,
table#fileList td select,
table#fileList td select option {
    color: #0f172a !important;
    background: #ffffff !important;
    opacity: 1 !important;
}

/* ============================================================
   UPLOAD — BARRA DE PROGRESSO MODERNA
   Correção da porcentagem cortada + visual premium
   ============================================================ */
#progressBar {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 34px !important;
    margin: 18px 0 8px !important;
    padding: 3px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: rgba(15, 23, 42, 0.88) !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    border-radius: 999px !important;
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.35),
        0 6px 18px rgba(2, 8, 23, 0.18) !important;
}

#progressBarFill {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: 0;
    min-width: 48px !important;
    height: 100% !important;
    padding: 0 10px !important;
    overflow: visible !important;
    white-space: nowrap !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: .15px !important;
    text-align: center !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45) !important;
    background: linear-gradient(
        90deg,
        #06b6d4 0%,
        #0ea5e9 42%,
        #6366f1 100%
    ) !important;
    border-radius: 999px !important;
    box-shadow:
        0 0 14px rgba(34, 211, 238, .32),
        inset 0 1px 0 rgba(255, 255, 255, .28) !important;
    transition: width .25s ease, min-width .25s ease !important;
}

/* Brilho discreto em movimento durante o upload */
#progressBarFill::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(
        110deg,
        transparent 20%,
        rgba(255,255,255,.22) 45%,
        transparent 70%
    ) !important;
    transform: translateX(-100%) !important;
    animation: progressShine 1.8s linear infinite !important;
    pointer-events: none !important;
}

@keyframes progressShine {
    to { transform: translateX(100%); }
}

#loadingMessage {
    margin-top: 10px !important;
    color: #cbd5e1 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-align: center !important;
}

@media (max-width: 600px) {
    #progressBar {
        height: 32px !important;
    }

    #progressBarFill {
        min-width: 50px !important;
        font-size: 12px !important;
        padding: 0 8px !important;
    }
}


/* ============================================================
   PATCH FINAL — CONTRASTE DOS POPUPS E BOTÕES DE CONFIRMAÇÃO
   ============================================================ */

#confirmPopup.confirm-popup,
.confirm-popup {
    color: #f8fafc !important;
    background: linear-gradient(135deg, #172554 0%, #1e3a5f 55%, #0f766e 140%) !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    box-shadow: 0 24px 60px rgba(2,8,23,.42), 0 0 0 1px rgba(34,211,238,.08) !important;
}

#confirmPopup.confirm-popup p,
.confirm-popup p {
    color: #f8fafc !important;
    font-weight: 700 !important;
}

#confirmPopup .confirm-buttons,
.confirm-popup .confirm-buttons {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
}

#confirmPopup .confirm-buttons button,
.confirm-popup .confirm-buttons button {
    min-width: 76px !important;
    min-height: 40px !important;
    padding: 9px 18px !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    box-shadow: 0 6px 16px rgba(2,8,23,.18) !important;
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease !important;
}

/* SIM */
#confirmPopup .confirmDelete,
.confirm-popup .confirmDelete {
    background: linear-gradient(135deg, #06b6d4, #2563eb) !important;
    color: #ffffff !important;
    border-color: rgba(125,211,252,.45) !important;
}

/* NÃO — escuro para não haver branco sobre branco */
#confirmPopup .cancelDelete,
.confirm-popup .cancelDelete {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: #334155 !important;
    background-image: none !important;
    color: #f8fafc !important;
    border-color: #64748b !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

#confirmPopup .confirm-buttons button:hover,
.confirm-popup .confirm-buttons button:hover {
    transform: translateY(-2px) !important;
    filter: brightness(1.08) !important;
    box-shadow: 0 9px 22px rgba(2,8,23,.28) !important;
}

#confirmPopup .confirm-buttons button:active,
.confirm-popup .confirm-buttons button:active {
    transform: translateY(0) !important;
}

#confirmPopup .confirm-buttons button:focus-visible,
.confirm-popup .confirm-buttons button:focus-visible {
    outline: 3px solid rgba(34,211,238,.42) !important;
    outline-offset: 2px !important;
}

#popup-upload,
#confirmPopup,
#popup-upload *,
#confirmPopup * {
    text-shadow: none !important;
    opacity: 1 !important;
}

/* Reforço final contra regras antigas */
#confirmPopup .confirm-buttons .cancelDelete {
    background-color: #334155 !important;
    background-image: none !important;
    color: #f8fafc !important;
}

#confirmPopup .confirm-buttons .confirmDelete {
    background-image: linear-gradient(135deg, #06b6d4, #2563eb) !important;
    color: #ffffff !important;
}
