/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Layout */
body {
    font-family: Arial, sans-serif;
    background: #f4f6f9;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: linear-gradient(90deg, #004080);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    display: flex;
    align-items: center;
}

header .logo img {
    height: 50px;
    margin-right: 10px;
}

header nav a {
    margin-left: 20px;
    text-decoration: none;
    color: white;
    font-weight: bold;
}

header nav a:hover {
    color: orange;
}

main {
    flex: 1;
    padding: 20px;
}

footer {
    text-align: center;
    padding: 15px;
    background: #004080;
    color: #eee;
}

/* Tabelas */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

table th, table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

table th {
    background: #ff6600;
    color: white;
}

tr:nth-child(even) {
    background: #f9f9f9;
}


/* Formulários */
.form-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    max-width: 400px;
}

.form-card label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

.form-card input, .form-card select {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.btn {
    display: inline-block;
    padding: 8px 15px;
    margin-top: 15px;
    border-radius: 4px;
    background: #004080;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.btn:hover {
    background: #003366;
}

.btn-danger {
    background: #cc0000;
}

.btn-danger:hover {
    background: #990000;
}

/* Alertas */
.alert {
    margin-top: 15px;
    padding: 10px;
    background: #ffcccc;
    color: #990000;
    border-radius: 4px;
    font-weight: bold;
}

/* Badges */
.badge {
    padding: 5px 10px;
    border-radius: 12px;
    color: white;
    font-size: 0.9em;
}

.badge-success { background: #28a745; }
.badge-warning { background: #ffc107; }
.badge-danger { background: #dc3545; }

/* Paginação */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination .btn {
    margin: 0 5px;
    padding: 6px 12px;
    border-radius: 4px;
    background: #007bff;
}

.pagination .btn.active {
    background: #333;
    cursor: default;
}

/* Excluído */
.excluido { background: #ffe6e6; }
.excluido-texto { color: #990000; font-style: italic;
}

/* Centralizar o conteúdo da página */
.container-center {
    display: flex;
    justify-content: center;  /* Centraliza na horizontal */
    align-items: center;      /* Centraliza na vertical */
    min-height: 70vh;         /* Altura mínima para centralização */
}

.container-center2 {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;
    margin: 20px auto;
    max-width: 1000px;
    width: 90%;
}

/* Card padrão */
.card {
    background: #fff;
    padding: 25px 35px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 450px;
    width: 100%;
}

.card2 {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 100%;
    overflow-x: auto; /* rolagem se a tabela for muito larga */
}
/* Títulos dentro do card */
.card h1 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #003366;
}

.card2 h1 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #003366;
}

/* Labels e inputs */
.card label {
    font-weight: bold;
    display: block;
    margin-top: 12px;
    margin-bottom: 5px;
}

.card input, 
.card select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Botão padrão */
.card .btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: #ff6600;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
}

.card .btn:hover {
    background: #e65c00;
}

/* Container das mensagens */
#flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* Mensagem */
.flash-message {
    padding: 12px 18px;
    margin-bottom: 10px;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    animation: fadeOut 5s forwards;
}

/* Estilos */
.flash-message.success {
    background-color: #28a745; /* verde */
}

.flash-message.error {
    background-color: #dc3545; /* vermelho */
}

/* Animação para desaparecer */
@keyframes fadeOut {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; display: none; }
}

.container {
    max-width: 900px;
    margin: 30px auto;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

h1, h2 {
    color: #003366;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

label {
    font-weight: bold;
    color: #333;
}

input[type="text"] {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.input-data {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    color: #333;
    background: #fff;
    cursor: pointer;
}

.tabela-estoque {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.tabela-estoque th, .tabela-estoque td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.tabela-estoque th {
    background-color: #ff6600;
    color: white;
}

.input-qtd {
    width: 80px;
    padding: 5px;
    text-align: center;
}

.botoes {
    text-align: center;
    margin-top: 25px;
}

.btn-principal, .btn-secundario {
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-principal {
    background-color: #ff6600;
    color: white;
}

.btn-principal:hover {
    background-color: #d35502;
}

.btn-secundario {
    background-color: #e0e0e0;
}

.btn-secundario:hover {
    background-color: #bdbdbd;
}


/* Botão gerador de PDF (histórico) */
.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(90deg, #ff6600 0%, #ff6600 100%);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(30,136,229,0.16);
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s;
}
.btn-pdf:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(30,136,229,0.18);
    opacity: 0.98;
}
.btn-pdf:active {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

/* Ícone dentro do botão */
.btn-pdf svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
}

/* Input mês alinhado ao botão */
.input-month {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d0d7e0;
    background: #fff;
    color: #222;
    font-weight: 600;
    margin-right: 8px;
}

/* Container do form no histórico para alinhar itens */
.historico-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.outro-supri-box {
    margin-top: 30px;
    padding: 20px;
    background: #f9fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.outro-supri-box h3 {
    margin-bottom: 15px;
    color: #2d3748;
    font-size: 1.2em;
}

.outro-supri-box .info {
    font-size: 0.9em;
    color: #555;
    margin-top: 10px;
}

/* Modal de confirmação */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeInOverlay 0.2s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 35px 40px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.modal-titulo {
    font-size: 20px;
    color: #003366;
    margin-bottom: 10px;
}

.modal-texto {
    color: #555;
    font-size: 14px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-botoes {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.btn-excluir-modal {
    background-color: #e53935;
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.2s;
    margin-top: 0;
}

.btn-excluir-modal:hover {
    background-color: #c62828;
}


/* ================================================
   TEMA ESCURO
   ================================================ */

/* Variáveis do tema escuro */
body.dark {
    --bg-base:      #111318;
    --bg-card:      #1c1f28;
    --bg-surface:   #23273a;
    --bg-input:     #2a2e3e;
    --border:       #2f3347;
    --text-primary: #f0f2f8;
    --text-muted:   #8b93ad;
    --accent:       #ff6600;
    --accent-dim:   rgba(255,102,0,0.15);
    background: var(--bg-base);
    color: var(--text-primary);
}

/* Transição suave global */
body, body * {
    transition: background-color 0.3s ease, color 0.2s ease,
                border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ── Header & Footer ── */
body.dark header {
    background: #0d0f16;
    border-bottom: 1px solid #ff660033;
    box-shadow: 0 2px 16px rgba(0,0,0,0.5);
}

body.dark footer {
    background: #0d0f16;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

body.dark header nav a {
    color: #c9d1e8;
}

body.dark header nav a:hover {
    color: #ff8833;
}

/* ── Cards ── */
body.dark .card,
body.dark .card2 {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0,0,0,0.35);
    color: var(--text-primary);
}

/* ── Títulos ── */
body.dark h1,
body.dark h2,
body.dark h3,
body.dark .card h1,
body.dark .card2 h1,
body.dark .card2 h2 {
    color: #e8eaf6;
}

/* ── Labels e textos ── */
body.dark label {
    color: #a8b4cc;
}

body.dark p {
    color: #b0b8cc;
}

/* ── Inputs, selects, textareas ── */
body.dark input,
body.dark select,
body.dark textarea {
    background: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
}

body.dark input:focus,
body.dark select:focus,
body.dark textarea:focus {
    border-color: #ff6600 !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,102,0,0.15) !important;
}

body.dark input::placeholder,
body.dark textarea::placeholder {
    color: #4a5068;
}

/* ── Tabelas ── */
body.dark table {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

body.dark table th {
    background: #cc5200;
    color: #fff;
}

body.dark table td {
    border-color: var(--border);
    color: #c8d0e4;
}

body.dark tr:nth-child(even) {
    background: #1f2333;
}

body.dark tr:hover td {
    background: #272c3f;
    color: #f0f2f8;
}

/* ── Modais ── */
body.dark .modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

body.dark .modal-titulo { color: #e8eaf6; }
body.dark .modal-texto  { color: #9aa3bc; }

body.dark .btn-secundario {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

body.dark .btn-secundario:hover {
    background: #2f3448;
}

/* ── Flash messages ── */
body.dark .flash-message.success { background: #1a4731; border: 1px solid #2d6a4f; }
body.dark .flash-message.error   { background: #4a1a1a; border: 1px solid #7a2a2a; }

/* ── Paginação ── */
body.dark .pagination .btn {
    background: var(--bg-surface);
    color: #c8d0e4;
    border: 1px solid var(--border);
}

body.dark .pagination .btn:hover {
    background: #2f3448;
}

body.dark .pagination .btn.active {
    background: #ff6600;
    color: #fff;
    border-color: #ff6600;
}

/* ── Fundos inline via style= ── */
body.dark [style*="background:#f4f7fb"],
body.dark [style*="background:#f8f9fa"],
body.dark [style*="background:#f9fafc"] {
    background: var(--bg-surface) !important;
}

body.dark [style*="background:#f4f6f9"],
body.dark [style*="background: #f4f6f9"] {
    background: var(--bg-base) !important;
}

body.dark [style*="background:#fff"] {
    background: var(--bg-card) !important;
}

body.dark [style*="background:#e9ecef"] {
    background: #2a2e3e !important;
}

body.dark [style*="background:#fff4f4"] {
    background: #2d1515 !important;
    border-color: #5c2020 !important;
}

/* ── Cores de texto inline ── */
body.dark [style*="color:#003366"],
body.dark [style*="color: #003366"] {
    color: #7ea8d8 !important;
}

body.dark [style*="color:#555"],
body.dark [style*="color:#777"],
body.dark [style*="color:#aaa"],
body.dark [style*="color:#888"] {
    color: var(--text-muted) !important;
}

body.dark [style*="color:#333"] {
    color: #c8d0e4 !important;
}

/* ── Cards de estatística do dashboard ── */
body.dark [style*="border-top:4px"] {
    background: var(--bg-card) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35) !important;
}

/* ── Barra lateral dos itens adicionados ── */
body.dark [style*="border-left:4px solid #ff6600"] {
    background: #221a10 !important;
}

/* ── Botão flutuante de tema ── */
#btn-tema {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #004080;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

#btn-tema:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    background: #ff6600;
}

body.dark #btn-tema {
    background: #ff6600;
    box-shadow: 0 4px 20px rgba(255,102,0,0.35);
}

body.dark #btn-tema:hover {
    background: #e65c00;
    box-shadow: 0 8px 28px rgba(255,102,0,0.45);
}




