/* ============================================================
   REDE DRAGON — SERVIDOR CENTRAL DE ATUALIZAÇÕES
   Arquivo: /central-updates/admin/style.css
   Tema: Dark moderno — grafite/slate com acento "brasa" (ember)
   Totalmente responsivo (mobile-first breakpoints)
   ============================================================ */

:root {
    --bg:             #0b0d12;
    --bg-elevated:    #12151d;
    --bg-panel:       #171b25;
    --bg-panel-hover: #1d222f;
    --bg-input:       #0f1219;
    --border:         #262c3a;
    --border-soft:    #1b202b;

    --text:           #edeff4;
    --text-muted:     #939bb0;
    --text-faint:     #5b6478;

    --accent:         #ff6a3d;
    --accent-2:       #ff3d5a;
    --accent-soft:    rgba(255, 106, 61, 0.14);
    --accent-grad:    linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);

    --ok:             #2dd4a7;
    --ok-soft:        rgba(45, 212, 167, 0.14);
    --warn:           #ffb84d;
    --warn-soft:      rgba(255, 184, 77, 0.14);
    --danger:         #ff5470;
    --danger-soft:    rgba(255, 84, 112, 0.14);

    --shadow-sm:  0 1px 2px rgba(0,0,0,.3);
    --shadow-md:  0 8px 24px rgba(0,0,0,.35);
    --shadow-lg:  0 20px 60px rgba(0,0,0,.45);

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;

    --font-display: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --sidebar-w: 240px;
    --topbar-h:  64px;

    --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
}

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); color: var(--accent); }

/* Scrollbar (Webkit + Firefox) */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 20px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

img, svg { max-width: 100%; }

/* ============================================================
   LOGIN (tela sem sidebar)
   ============================================================ */

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(700px circle at 15% 15%, rgba(255,106,61,0.10), transparent 60%),
        radial-gradient(600px circle at 90% 85%, rgba(255,61,90,0.08), transparent 55%),
        var(--bg);
    padding: 24px;
}
.login-box {
    width: 100%;
    max-width: 380px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: clamp(28px, 6vw, 40px) clamp(22px, 6vw, 34px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: rise .35s var(--ease);
}
@keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.login-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}
.login-mark svg { width: 30px; height: 30px; flex-shrink: 0; color: var(--accent); }
.login-mark-text { font-family: var(--font-display); font-weight: 700; letter-spacing: .5px; font-size: 16px; }
.login-box .subtitulo { text-align: center; color: var(--text-muted); font-size: 12.5px; margin: 0 0 26px; letter-spacing: .4px; text-transform: uppercase; }
.marca-rodape { text-align: center; color: var(--text-faint); font-size: 12px; margin-top: 22px; }

/* ============================================================
   APP SHELL — sidebar + topbar + conteúdo
   ============================================================ */

.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 20;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid var(--border-soft);
}
.sidebar-brand svg { width: 26px; height: 26px; flex-shrink: 0; color: var(--accent); }
.sidebar-brand-text { line-height: 1.15; }
.sidebar-brand-text strong { font-family: var(--font-display); font-size: 14px; letter-spacing: .3px; display: block; }
.sidebar-brand-text span { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .8px; }

/* Botão hambúrguer (fica na topbar do conteúdo) e fundo escurecido atrás do
   menu no mobile - os dois só existem visualmente abaixo de 880px (ver
   @media mais abaixo neste arquivo) */
.topbar-titulo-area { display: flex; align-items: center; gap: 0; min-width: 0; }
.topbar-titulo-area > div { min-width: 0; }
.topbar-toggle-btn { display: none; background: none; border: none; padding: 0; }
.sidebar-backdrop { display: none; }

.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.sidebar-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-faint); padding: 14px 10px 6px; }
.sidebar-section-label:first-child { padding-top: 4px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .8; transition: opacity .15s var(--ease); }
.nav-item:hover { background: var(--bg-panel-hover); color: var(--text); }
.nav-item:hover svg { opacity: 1; }
.nav-item.ativo { background: var(--accent-soft); color: var(--accent); }
.nav-item.ativo svg { opacity: 1; }

.sidebar-footer { padding: 14px 20px 18px; border-top: 1px solid var(--border-soft); }
.sidebar-footer .nav-item { color: var(--text-faint); padding-left: 0; }
.sidebar-footer .nav-item:hover { color: var(--danger); background: none; }

.app-main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(11,13,18,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar h1 { font-size: 16px; font-weight: 600; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.topbar-user { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-muted); }
.avatar-dot {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent-grad);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: 12px; color: #fff;
    flex-shrink: 0;
}

.app-content { padding: 28px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ============================================================
   CARDS INDICATIVOS (dashboard)
   ============================================================ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

/* Variante com 3 cards (ex: resumo de instalações dentro de um sistema
   específico, em sistema.php) - continua respondendo aos mesmos breakpoints
   do .stat-grid normal (2 colunas em tablet, 1 em celular), porque essa
   regra fica ANTES das media queries no arquivo: mesma especificidade,
   então quem vem depois (a media query) vence quando a tela é pequena. */
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }

.stat-card {
    display: block;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.stat-card:hover { border-color: var(--text-faint); transform: translateY(-1px); }
.stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: var(--accent-grad);
    opacity: 0;
    transition: opacity .15s var(--ease);
}
.stat-card.destaque::before { opacity: 1; }
.stat-icon {
    width: 34px; height: 34px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent);
    margin-bottom: 14px;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.ok { background: var(--ok-soft); color: var(--ok); }
.stat-icon.warn { background: var(--warn-soft); color: var(--warn); }
.stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1; margin-bottom: 6px; word-break: break-word; }
.stat-label { font-size: 12.5px; color: var(--text-muted); }

.section-title {
    font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
    color: var(--text-muted); margin: 30px 0 12px;
}
.section-title:first-child { margin-top: 0; }

/* ============================================================
   PAINÉIS / FORMULÁRIOS
   ============================================================ */

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
}
.form-box { max-width: 480px; }

label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
label:first-child { margin-top: 0; }

input[type=text], input[type=password], input[type=file], textarea, select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13.5px;
    font-family: var(--font-body);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.btn-block { width: 100%; justify-content: center; }

/* Autofill do navegador não deve quebrar o tema escuro */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset;
    transition: background-color 9999s ease-in-out 0s;
}
::placeholder { color: var(--text-faint); opacity: 1; }

input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 96px; }

input[type=file] { padding: 8px 12px; cursor: pointer; }
input[type=file]::file-selector-button {
    background: var(--bg-panel-hover);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    margin-right: 12px;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s var(--ease);
}
input[type=file]::file-selector-button:hover { background: var(--bg-panel); }

a:focus-visible, .btn:focus-visible, .btn-secondary:focus-visible, .nav-item:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn, button[type=submit] {
    background: var(--accent-grad);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
    transition: filter .12s var(--ease), transform .12s var(--ease);
}
.btn:hover, button[type=submit]:hover { filter: brightness(1.08); }
.btn:active, button[type=submit]:active { transform: scale(.98); }

.btn-secondary {
    background: var(--bg-panel-hover);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s var(--ease), border-color .15s var(--ease);
}
.btn-secondary:hover { background: var(--bg-panel); border-color: var(--text-faint); }
/* Dentro de um grupo de botões lado a lado (.acoes), nenhum dos dois usa a
   margem superior do .btn "solto" (pensada pra botão único abaixo de um
   formulário) - sem isso, o botão laranja ficava alguns pixels mais baixo
   que o botão escuro ao lado, mesmo os dois tendo a mesma altura de caixa. */
.acoes .btn, .acoes .btn-secondary { margin-top: 0; }
.btn-secondary:disabled { opacity: .4; cursor: not-allowed; }
.btn-secondary:disabled:hover { background: var(--bg-panel-hover); border-color: var(--border); }
.btn-perigo { background: var(--danger); }

.paginacao {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 14px 0 4px;
    flex-wrap: wrap;
}
.paginacao-info { font-size: 12.5px; color: var(--text-faint); }

.editar-nome-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.editar-nome-form input[type=text] { width: auto; flex: 1 1 260px; }
.editar-nome-form .btn-secondary { flex-shrink: 0; padding: 8px 14px; font-size: 12.5px; }
.btn-perigo:hover { filter: brightness(1.1); }

/* Ícones dentro de botões (.btn / .btn-secondary) */
.btn svg, .btn-secondary svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Bloco de ações logo abaixo dos cards do dashboard: respiro extra
   acima/abaixo pra não colar nos stat-cards nem no título seguinte */
.acoes-dashboard { margin-top: 4px; margin-bottom: 34px; }

/* Estado vazio (painéis "nenhum registro ainda") com ícone centralizado */
.estado-vazio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
}
.estado-vazio-icon {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-faint);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.estado-vazio-icon svg { width: 20px; height: 20px; }
.estado-vazio .vazio { line-height: 1.6; }

.erro   { background: var(--danger-soft); color: var(--danger); padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px; border: 1px solid rgba(255,84,112,.25); }
.sucesso{ background: var(--ok-soft); color: var(--ok); padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px; border: 1px solid rgba(45,212,167,.25); }
.vazio  { color: var(--text-faint); font-size: 13.5px; }
.ajuda  { color: var(--text-muted); font-size: 13px; }

/* ============================================================
   TABELAS (com scroll horizontal responsivo)
   ============================================================ */

/* Antes o <table> ficava com display:block e thead/tbody/tr forçados em
   display:table INDEPENDENTES um do outro -- isso quebra o alinhamento
   normal de colunas (cabeçalho e linhas do corpo cada um vira uma
   "mini-tabela" separada, com larguras diferentes), dando aquele efeito
   de tabela bagunçada/desalinhada. Corrigido pra um <table> de verdade
   (com wrapper .tabela-scroll pra manter o scroll horizontal em telas
   pequenas, sem quebrar o alinhamento das colunas). */
.tabela-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.tabela, .tabela-detalhes {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-panel);
}
.tabela-scroll .tabela, .tabela-scroll .tabela-detalhes { border: none; }
.tabela th, .tabela td, .tabela-detalhes th, .tabela-detalhes td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13.5px;
    word-break: break-word;
    white-space: nowrap;
}
.tabela thead th { color: var(--text-faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; background: var(--bg-elevated); }
.tabela tbody tr:last-child td, .tabela-detalhes tr:last-child td { border-bottom: none; }
.tabela tbody tr { transition: background .12s var(--ease); }
.tabela tbody tr:hover { background: var(--bg-panel-hover); }
.tabela-detalhes th { width: 160px; background: var(--bg-elevated); color: var(--text-muted); font-weight: 600; }

.acoes-tabela { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.acoes-tabela a { color: var(--accent); font-size: 13px; font-weight: 600; }
.acoes-tabela a:hover { text-decoration: underline; }
.link-btn { background: none; border: none; padding: 0; color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.link-btn:hover { color: var(--text); text-decoration: underline; }
.link-btn-perigo { color: var(--danger); }
.link-btn-perigo:hover { color: var(--danger); }

.slug { color: var(--text-faint); font-size: 11.5px; font-family: var(--font-display); word-break: break-all; }
.apikey { font-size: 12px; color: var(--text-muted); font-family: var(--font-display); word-break: break-all; }
.acoes { margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 10px; }

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
    white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-ok .badge-dot { background: var(--ok); }
.badge-update { background: var(--warn-soft); color: var(--warn); }
.badge-update .badge-dot { background: var(--warn); }
.badge-neutro { background: var(--bg-panel-hover); color: var(--text-faint); }
.badge-neutro .badge-dot { background: var(--text-faint); }

code { font-family: var(--font-display); background: var(--bg-input); padding: 1px 6px; border-radius: 4px; font-size: .93em; }

/* Badge de número de versão (não confundir com o <code> genérico usado pra
   slug/API key/nome de arquivo, que continua neutro) - mesmo efeito visual
   do badge-ok (verde), porque uma versão publicada/instalada é sempre uma
   informação "positiva" de status, igual ao selo "Atualizado". */
.versao-badge {
    font-family: var(--font-display);
    background: var(--ok-soft);
    color: var(--ok);
    padding: 1px 8px;
    border-radius: 4px;
    font-size: .93em;
    font-weight: 600;
}

/* System picker (enviar-versao.php) */
.sistema-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.sistema-picker-item {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    transition: border-color .15s var(--ease);
}
.sistema-picker-item:hover { border-color: var(--accent); }
.sistema-picker-item strong { display: block; font-size: 14px; margin-bottom: 3px; }

/* ============================================================
   RESPONSIVO
   ============================================================ */

/* Tablets — sidebar mais estreita */
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Menu lateral vira gaveta (drawer) no mobile: fica fora da tela por
   padrão, escondida atrás da borda esquerda, e desliza por cima do
   conteúdo (sem empurrar nada) quando o admin toca no hambúrguer. */
@media (max-width: 880px) {
    :root { --sidebar-w: 0px; }

    .sidebar {
        /* Mantém position:fixed (herdado da regra base, fora do fluxo
           normal da página - por isso NÃO precisa de flex-direction:column
           no .app-shell aqui: a sidebar nunca disputa espaço com o
           .app-main, ela simplesmente fica por cima quando visível). */
        width: 280px;
        max-width: 82vw;
        transform: translateX(-100%);
        transition: transform .25s var(--ease);
        z-index: 50;
        box-shadow: var(--shadow-lg);
    }
    body.menu-mobile-aberto .sidebar { transform: translateX(0); }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(6, 7, 10, .6);
        z-index: 40;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s var(--ease);
    }
    body.menu-mobile-aberto .sidebar-backdrop { opacity: 1; pointer-events: auto; }

    /* Trava o scroll da página de fundo enquanto o menu está aberto */
    body.menu-mobile-aberto { overflow: hidden; }

    .topbar-titulo-area { gap: 14px; min-width: 0; }
    .topbar-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px; height: 36px;
        background: var(--bg-panel-hover);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        color: var(--text);
        cursor: pointer;
        flex-shrink: 0;
    }
    .topbar-toggle-btn svg { width: 20px; height: 20px; }
    .topbar-toggle-btn:hover { background: var(--bg-panel); }

    .app-main { margin-left: 0; width: 100%; }

    .topbar { padding: 0 16px; }
    .app-content { padding: 18px; }

    .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .sistema-picker { grid-template-columns: 1fr; }
}

/* Celulares pequenos */
@media (max-width: 560px) {
    html, body { font-size: 13.5px; }

    .topbar { height: auto; min-height: var(--topbar-h); padding: 12px 14px; flex-wrap: wrap; row-gap: 8px; }
    .topbar h1 { font-size: 15px; white-space: normal; }
    .topbar-right { width: 100%; justify-content: flex-start; }

    .app-content { padding: 14px; }

    .stat-grid { grid-template-columns: 1fr; gap: 10px; }
    .stat-card { padding: 16px 18px; }

    .panel { padding: 18px 16px; }
    .form-box { max-width: 100%; }

    .acoes { flex-direction: column; align-items: stretch; }
    .acoes .btn, .acoes .btn-secondary { width: 100%; }

    .sistema-picker-item { flex-direction: column; align-items: flex-start; }
    .sistema-picker-item .btn, .sistema-picker-item .btn-secondary { width: 100%; margin-top: 10px; }

    .login-box { padding: 28px 20px; }
}

/* ============================================================
   MODO CARD — tabelas viram cartões empilhados no mobile
   Abaixo de 720px o scroll horizontal de tabela (.tabela-scroll)
   deixa de ser uma boa experiência (mudo demais pra caber virando
   scroll lateral, colunas ficam apertadas). Em vez disso, cada
   linha <tr> vira um cartão, e cada célula <td> mostra seu rótulo
   (via atributo data-label="...", já adicionado no PHP de cada
   tabela) acima ou ao lado do valor. .tabela-detalhes (que já é
   th+td por linha, formato chave/valor) empilha o rótulo acima do
   valor em vez de lado a lado, pra não espremer texto longo (API
   key, slug) numa coluna estreita.
   ============================================================ */
@media (max-width: 720px) {
    .tabela-scroll {
        overflow-x: visible;
        border: none;
        border-radius: 0;
    }

    /* --- .tabela (cabeçalho + linhas de dado) --- */
    .tabela { border-collapse: separate; border-spacing: 0 12px; }
    .tabela thead { display: none; }
    .tabela tbody tr {
        display: block;
        background: var(--bg-panel);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 4px 14px;
        box-shadow: var(--shadow-sm);
    }
    .tabela tbody tr:hover { background: var(--bg-panel); }
    .tabela td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-soft);
        white-space: normal;
        text-align: right;
    }
    .tabela td:last-child { border-bottom: none; }
    .tabela td::before {
        content: attr(data-label);
        flex-shrink: 0;
        text-align: left;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .5px;
        color: var(--text-faint);
    }
    /* Célula de ações: botões ficam melhor abaixo do rótulo, ocupando a linha toda */
    .tabela td[data-label="Ações"] { flex-direction: column; align-items: stretch; text-align: left; gap: 8px; }
    .tabela td[data-label="Ações"]::before { margin-bottom: 2px; }
    .tabela td[data-label="Ações"] .btn-secondary { width: 100%; text-align: center; }

    /* Célula de Changelog: texto mais longo fica melhor empilhado (rótulo em
       cima, texto embaixo alinhado à esquerda) do que lado a lado à direita */
    .tabela td[data-label="Changelog"],
    .tabela td[data-label="Última atualização aplicada"] { flex-direction: column; align-items: stretch; text-align: left; gap: 4px; }

    /* --- .tabela-detalhes (formato chave/valor: th=rótulo, td=valor) --- */
    .tabela-detalhes { border-collapse: separate; border-spacing: 0 10px; }
    .tabela-detalhes tr {
        display: block;
        background: var(--bg-panel);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 12px 14px;
    }
    .tabela-detalhes th, .tabela-detalhes td {
        display: block;
        width: auto;
        padding: 0;
        border: none;
        white-space: normal;
        word-break: break-word;
    }
    .tabela-detalhes th {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .5px;
        margin-bottom: 4px;
    }
}

/* Telas grandes — respiro extra */
@media (min-width: 1440px) {
    .app-content { max-width: 1320px; }
}