/* ==========================
   Variáveis globais (palette + mappings)
========================== */
:root {
    --font-size: 1rem;

    /* Paleta fixa - Tema Escuro (padrão) */
    --bg-color: #0a0a0f;        /* Fundo geral */
    --text-color: #ffffff;      /* Texto */
    --primary-color: #ff8009;   /* Botões */
    --secondary-color: #1a1a24; /* Caixa / painel */
    --header-color: #744100;    /* Header */
    --success-color: #10b981;   /* Verde sucesso */
    --warning-color: #f59e0b;   /* Amarelo aviso */
    --danger-color: #ef4444;    /* Vermelho erro */
    --info-color: #3b82f6;      /* Azul informação */

    /* Mapeamentos */
    --bg-page: var(--bg-color);
    --bg-panel: var(--secondary-color);
    --text: var(--text-color);
    --subtext: rgba(255,255,255,0.7);
    --primary-start: var(--primary-color);
    --primary-end: #ff6b00;
    --accent: var(--primary-color);
    --border: #2a2a3a;
    --header-bg: linear-gradient(135deg, #744100 0%, #ff8009 100%);
    --row-alt: rgba(255,255,255,0.03);
    --row-hover: rgba(255,255,255,0.08);
    --input-bg: #13131a;
    --input-border: rgba(255,255,255,0.15);
    --button-shadow: 0 4px 12px rgba(255,128,9,0.25);
    --card-shadow: 0 4px 20px rgba(0,0,0,0.5);
    --transition-speed: 0.3s;
}

/* Tema Claro */
[data-theme="light"] {
    --bg-color: #f8f9fa;        /* Fundo geral claro */
    --text-color: #1a1a1a;      /* Texto escuro */
    --primary-color: #ff6b00;   /* Botões laranja */
    --secondary-color: #ffffff; /* Caixa / painel branco */
    --header-color: #ff8009;    /* Header laranja */
    --success-color: #059669;   /* Verde escuro */
    --warning-color: #d97706;   /* Amarelo escuro */
    --danger-color: #dc2626;    /* Vermelho escuro */
    --info-color: #2563eb;      /* Azul escuro */

    /* Mapeamentos para tema claro */
    --bg-page: var(--bg-color);
    --bg-panel: var(--secondary-color);
    --text: var(--text-color);
    --subtext: rgba(0,0,0,0.65);
    --primary-start: var(--primary-color);
    --primary-end: #ff8009;
    --accent: var(--primary-color);
    --border: #e5e7eb;
    --header-bg: linear-gradient(135deg, #ff6b00 0%, #ff8009 100%);
    --row-alt: rgba(0,0,0,0.03);
    --row-hover: rgba(0,0,0,0.06);
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --button-shadow: 0 4px 12px rgba(255,107,0,0.2);
    --card-shadow: 0 4px 20px rgba(0,0,0,0.1);
    --transition-speed: 0.3s;
}

/* Desativamos variação automática do modo escuro (sem sobrescritas aqui) */
@media (prefers-color-scheme: dark) {
    /* noop: preferimos controlar tema via botão/JS */
}

/* ==========================
   Reset básico
========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--font-size);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Transição suave de tema */
html.theme-transition,
html.theme-transition *,
html.theme-transition *:before,
html.theme-transition *:after {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease,
                box-shadow 0.3s ease !important;
}

#theme-toggle {
    transition: transform 0.3s ease !important;
}

/* ==========================
   Base do body e containers
========================== */
body {
    background-color: var(--bg-page);
    background-image: 
        linear-gradient(rgba(10,10,15,0.95), rgba(10,10,15,0.95)),
        url('../image/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    transition: background-color var(--transition-speed) ease;
}

[data-theme="light"] body {
    background-image: 
        linear-gradient(rgba(248,249,250,0.95), rgba(248,249,250,0.95)),
        url('../image/background.jpg');
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 30px;
    background-color: var(--bg-panel);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
    transition: all var(--transition-speed) ease;
    animation: fadeIn 0.5s ease;
    backdrop-filter: blur(10px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================
   Títulos e textos
========================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; text-align: center; }
h3 { font-size: 1.5rem; margin-top: 2rem; }

p {
    color: var(--subtext);
    margin-bottom: 1rem;
}

/* ==========================
   Header
========================== */
header {
    background: var(--header-bg);
    color: #fff;
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    transition: all var(--transition-speed) ease;
}

header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

header strong {
    color: #fff;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 6px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo img {
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    padding: 5px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

#theme-toggle {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

#theme-toggle:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

header a {
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 600;
}

header a:hover {
    background: rgba(0,0,0,0.35);
    transform: translateY(-2px);
}

/* ==========================
   Tabelas
========================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

th, td {
    border: 1px solid var(--border);
    padding: 14px 18px;
    text-align: left;
    vertical-align: middle;
    color: var(--text);
    transition: all 0.2s ease;
}

th {
    background: var(--header-bg);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: #fff;
}

tr:nth-child(even) { 
    background: var(--row-alt); 
}

tr:hover { 
    background: var(--row-hover);
    transform: scale(1.01);
}

td b { 
    color: var(--primary-start);
    font-weight: 700;
}

/* Responsividade de tabelas */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    th, td {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}
/* ==========================
   Estilos específicos para view_banco.php
========================== */

/* Linha de totais do mês/banco */
.totais {
    margin-top: 25px;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    background: var(--secondary-color);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

/* Link "Voltar ao Dashboard" */
.view-back-link,
p > a {
    display: inline-block;
    margin-top: 10px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--primary-color);
    color: #fff !important;
    transition: filter .22s ease, transform .08s ease;
}
.view-back-link:hover,
p > a:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

/* Colunas da tabela — centralizar conteúdo importante */
table td:nth-child(1), /* Dia */
table td:nth-child(2), /* Data */
table td:nth-child(3)  /* Semana */ {
    text-align: center;
}

/* Classe para ações futuras caso queira editar/excluir registros */
.action-links a {
    color: var(--primary-color);
    padding: 4px 6px;
    border-radius: 4px;
    transition: filter .2s ease;
}
.action-links a:hover {
    filter: brightness(1.2);
}

/* Ajuste visual para entrada/saída colunas */
td {
    white-space: nowrap;
}

/* Melhor apresentação da tabela no modo mobile */
@media (max-width: 720px) {
    table {
        display: block;
        overflow-x: auto;
        border-radius: 8px;
    }
    th, td {
        font-size: 0.85rem;
        padding: 8px;
    }
    .totais {
        font-size: 0.95rem;
        padding: 10px;
    }
}

/* ==========================
   Formulários
========================== */
form, .form-container {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    margin: 5px 0 15px 0;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    color: var(--text);
    border-radius: 10px;
    transition: all 0.2s ease;
    font-size: 1rem;
}

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

/* foco visível para acessibilidade */
input:focus, select:focus, textarea:focus, button:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255,128,9,0.15);
}

input::placeholder {
    color: var(--subtext);
    opacity: 0.6;
}

/* Mensagens de validação */
.msg {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-success {
    background: rgba(16,185,129,0.15);
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

.msg-error {
    background: rgba(239,68,68,0.15);
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
}

.msg-warning {
    background: rgba(245,158,11,0.15);
    border: 2px solid var(--warning-color);
    color: var(--warning-color);
}

.msg-info {
    background: rgba(59,130,246,0.15);
    border: 2px solid var(--info-color);
    color: var(--info-color);
}

/* ==========================
   Botões
========================== */
button, .btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: var(--button-shadow);
    transition: all var(--transition-speed) ease;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

button:hover, .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255,128,9,0.4);
}

button:active, .btn:active {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Variantes de botões */
.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16,185,129,0.25);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239,68,68,0.25);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 4px 12px rgba(107,114,128,0.25);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* ==========================
   Links
========================== */
a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
}

a:hover {
    color: var(--primary-end);
    text-decoration: none;
}

a:not(.add-button):not(.btn):hover {
    text-decoration: underline;
}

/* ==========================
   Botão adicionar e cards de ação
========================== */
.add-button {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    color: #fff !important;
    border-radius: 12px;
    margin: 10px;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--button-shadow);
    font-weight: 600;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.add-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.add-button:hover::before {
    width: 300px;
    height: 300px;
}

.add-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255,128,9,0.4);
    text-decoration: none;
}

/* Grid de botões admin */
.admin-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.card-icon {
    text-align: center;
    padding: 30px 20px !important;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-icon svg {
    transition: all 0.3s ease;
}

.card-icon:hover svg {
    transform: scale(1.1) translateY(-5px);
}

/* Botões de ponto */
.ponto-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-icon svg {
    transition: transform 0.2s ease;
}

.btn-icon:hover svg {
    transform: scale(1.1);
}

.ponto-buttons button {
    padding: 16px;
    font-size: 1rem;
}

.ponto-buttons button[data-action="entrada"] {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.ponto-buttons button[data-action="saida"] {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
}

.ponto-buttons button[data-action="saida_almoco"],
.ponto-buttons button[data-action="volta_almoco"] {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
}

/* Mensagem de ponto */
#ponto-msg {
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    font-weight: 600;
    text-align: center;
    min-height: 20px;
    transition: all 0.3s ease;
}

/* ==========================
   Login box
========================== */
.login-box {
    max-width: 440px;
    margin: 60px auto;
    padding: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    animation: fadeInUp 0.6s ease;
    backdrop-filter: blur(10px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box h2 {
    margin-bottom: 30px;
    color: var(--primary-color);
}

.login-box button {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    margin-top: 10px;
}

.login-box p {
    text-align: center;
    margin-top: 15px;
}

.login-box a {
    display: inline-block;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.login-box a:hover {
    transform: translateX(5px);
}

.login-box svg {
    opacity: 0.8;
}

/* ==========================
   Responsivo
========================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container { 
        margin: 15px auto;
        padding: 20px;
        border-radius: 12px;
    }
    
    .login-box { 
        margin: 30px auto;
        padding: 25px;
    }
    
    header {
        padding: 15px;
        flex-direction: column;
        text-align: center;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.3rem; }
    
    .admin-buttons {
        grid-template-columns: 1fr;
    }
    
    .ponto-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    button, .btn {
        padding: 10px 18px;
        font-size: 0.95rem;
    }
    
    .add-button {
        padding: 12px 20px;
        margin: 8px;
    }
}

/* ==========================
   Utilitários
========================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Cards */
.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) ease;
    animation: fadeIn 0.5s ease;
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.25);
    border-color: var(--primary-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
}

.card-title svg {
    color: var(--primary-color);
}

.card-body {
    color: var(--subtext);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(16,185,129,0.2);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(239,68,68,0.2);
    color: var(--danger-color);
}

.badge-warning {
    background: rgba(245,158,11,0.2);
    color: var(--warning-color);
}

.badge-info {
    background: rgba(59,130,246,0.2);
    color: var(--info-color);
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--row-alt) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
