/* Ajustes visuais do Sistemas Internos sobre o tema AdminLTE.
   Cobre também os formulários/tabelas "sem classe" das telas mais antigas,
   para que fiquem legíveis tanto no tema claro quanto no escuro. */

:root {
    --si-content-bg: #f4f6f9;
    --si-surface-bg: #ffffff;
    --si-border-color: #dee2e6;
    --si-text-color: #212529;
    --si-text-muted: #6c757d;
    --si-input-bg: #ffffff;
    --si-table-stripe: rgba(0, 0, 0, 0.03);
}

body.dark-mode {
    --si-content-bg: #181a1e;
    --si-surface-bg: #22252a;
    --si-border-color: #3a3f47;
    --si-text-color: #e9ecef;
    --si-text-muted: #adb5bd;
    --si-input-bg: #2b2f36;
    --si-table-stripe: rgba(255, 255, 255, 0.04);
}

body {
    background-color: var(--si-content-bg);
    transition: background-color .15s ease-in-out;
}

/* Sidebar/topbar/cards já ficam a cargo do AdminLTE (que aplica seu próprio
   contraste em dark-mode). Aqui só cuidamos do conteúdo "cru" das telas
   antigas: tabelas, formulários e botões sem classes do Bootstrap. */
.content h1,
.content h2 {
    color: var(--si-text-color);
}

.content table:not([class]) {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: var(--si-surface-bg);
    color: var(--si-text-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.content table:not([class]) th,
.content table:not([class]) td {
    border: 1px solid var(--si-border-color);
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
}

.content table:not([class]) thead th {
    background: rgba(0, 0, 0, 0.04);
    font-weight: 600;
}

body.dark-mode .content table:not([class]) thead th {
    background: rgba(255, 255, 255, 0.06);
}

.content table:not([class]) tbody tr:nth-child(even) {
    background: var(--si-table-stripe);
}

.content input:not([class]),
.content select:not([class]),
.content textarea:not([class]) {
    background: var(--si-input-bg);
    color: var(--si-text-color);
    border: 1px solid var(--si-border-color);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 14px;
}

.content input:not([class]):focus,
.content select:not([class]):focus,
.content textarea:not([class]):focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.content label {
    color: var(--si-text-color);
}

.content fieldset:not([class]) {
    border: 1px solid var(--si-border-color);
    border-radius: 4px;
    padding: 10px 14px;
}

.content legend {
    color: var(--si-text-color);
    font-size: 14px;
    width: auto;
    padding: 0 6px;
}

.content button:not([class]) {
    background: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 14px;
    cursor: pointer;
}

.content button:not([class]):hover {
    background: #0b5ed7;
}

/* Botão "Excluir" (identificado pelo formaction usado nas telas) fica em
   vermelho para reforçar que é uma ação destrutiva. */
.content button[formaction*="delete"]:not([class]) {
    background: #dc3545;
    margin-left: 4px;
}

.content button[formaction*="delete"]:not([class]):hover {
    background: #bb2d3b;
}

.content a:not([class]) {
    color: #0d6efd;
}

body.dark-mode .content a:not([class]) {
    color: #6ea8fe;
}

/* Botão de alternância de tema claro/escuro na navbar. */
#theme-toggle {
    cursor: pointer;
}

/* Evita "piscar" o layout enquanto o tema/estado da sidebar salvos no
   localStorage ainda não foram aplicados pelo script inline no <body>. */
.wrapper {
    transition: background-color .15s ease-in-out;
}
