/* Variáveis baseadas na Paleta de Cores e Requisitos do Projeto  */
:root {
    --brand-red: #ed1c24;
    --brand-black: #231f20;
    --white: #ffffff;
    --bg-light: #f8fafc;
    --slate-500: #64748b;
    --radius: 12px;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

/* --- TELA DE LOGIN --- */
body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(rgba(35, 31, 32, 0.8), rgba(35, 31, 32, 0.8)),
                url('../assets/bgImgPrincipal.png') no-repeat center center fixed;
    background-size: cover;
}

.login-card {
    background: var(--white);
    padding: 3.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.login-card h1 {
    color: var(--brand-red);
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-card p {
    color: var(--brand-black);
    text-align: center;
    opacity: 0.8;
    margin-top: -1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--brand-black);
}

.form-group input {
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus { border-color: var(--brand-red); }

button {
    width: 100%;
    padding: 1rem;
    background: var(--brand-red);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: filter 0.2s, transform 0.1s;
}

button:hover  { filter: brightness(0.9); }
button:active { transform: scale(0.98); }

@media (max-width: 768px) {
    .login-card { padding: 2rem 1.5rem; max-width: 90%; }
    .login-card h1 { font-size: 1.5rem; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .login-card { max-width: 400px; }
}

/* --- DASHBOARD --- */
body.dashboard-page {
    background: linear-gradient(rgba(248, 250, 252, 0.94), rgba(248, 250, 252, 0.94)),
                url('../assets/bgImgPrincipal.png');
    background-size: cover;
    background-attachment: fixed;
    display: flex;
    height: 100vh;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* --- SIDEBAR --- */
.sidebar {
    background-color: var(--brand-black);
    width: 260px;
    min-width: 260px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.main-logo { max-width: 100%; height: auto; }

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }

.nav-group {
    padding: 1.5rem 2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--slate-500);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-link {
    padding: 0.85rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: rgba(255,255,255,0.07);
    color: white;
}

.nav-link.active {
    color: var(--brand-red);
    background: rgba(237, 28, 36, 0.1);
    border-right: 4px solid var(--brand-red);
}

/* FIX: Sidebar footer — classe ausente no original */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.partner-box {
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    text-align: center;
}

.partner-logo {
    max-width: 110px;
    filter: brightness(1.2);
}

/* FIX: btn-logout — botão de sair na sidebar */
.btn-logout {
    width: 100%;
    padding: 0.65rem;
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background 0.2s, color 0.2s;
}

.btn-logout:hover {
    background: rgba(237, 28, 36, 0.15);
    color: var(--brand-red);
    border-color: var(--brand-red);
}

/* --- CONTEÚDO --- */
.content {
    flex: 1;
    background-color: var(--bg-light);
    overflow-y: auto;
    padding: 2rem;
}

.content-section { display: block; }

/* FIX: section-header — layout do cabeçalho das seções */
.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-titles h1 { font-size: 1.5rem; color: var(--brand-black); }
.header-titles p  { color: var(--slate-500); font-size: 0.9rem; margin-top: 0.25rem; }

/* FIX: btn-primary — botão de ação principal (ausente no original) */
.btn-primary {
    width: auto;
    padding: 0.7rem 1.25rem;
    background: var(--brand-red);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.2s, transform 0.1s;
}

.btn-primary:hover  { filter: brightness(0.9); }
.btn-primary:active { transform: scale(0.98); }

/* --- CARDS --- */
.card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-top: 1.5rem;
}

/* --- FILTROS --- */
.filter-bar {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    align-items: center;
    margin-top: 0;
}

.filter-group { flex: 1; }

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.filter-group input:focus,
.filter-group select:focus { border-color: var(--brand-red); }

/* --- TABELAS --- */
table { width: 100%; border-collapse: collapse; }

th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid #f1f5f9;
    color: var(--slate-500);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td { padding: 1rem; border-bottom: 1px solid #f1f5f9; font-size: 0.95rem; }
tr:nth-child(even) { background-color: #f8fafc; }
tr:hover { background-color: #f1f5f9; }

/* FIX: badge — ausente no original */
.badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-ok  { background: #dcfce7; color: #16a34a; }
.badge-off { background: #fee2e2; color: #dc2626; }

/* Botões de ação na tabela */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: transform 0.2s;
    width: auto;
}

.btn-icon:hover { transform: scale(1.2); filter: none; }
.btn-del:hover  { filter: hue-rotate(150deg); }

/* --- MODAIS --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(35, 31, 32, 0.6);
    display: flex;            /* flex: permite centralização */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* Estado inicial: oculto via style="display:none" no HTML */
}

.modal-content {
    background: var(--white);
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: modalFadeIn 0.2s ease;
}

.modal-content h2 {
    color: var(--brand-black);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.modal-content label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--brand-black);
    margin-bottom: 0.35rem;
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.modal-content input:focus,
.modal-content select:focus { border-color: var(--brand-red); }

/* --- LAYOUT DE FORMULÁRIO --- */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-end;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* Botões auxiliares */
.btn-secondary {
    background: var(--brand-black);
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-cancel {
    background: #e2e8f0;
    color: var(--brand-black);
    width: auto;
    padding: 0.7rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.2s;
}

.btn-cancel:hover { background: #cbd5e1; }

/* --- ESTADOS --- */
.loading-state {
    text-align: center;
    padding: 2rem;
    color: var(--brand-red);
    font-weight: 600;
}

.input-error {
    border-color: var(--brand-red) !important;
    background-color: #fff5f5;
}

/* --- ANIMAÇÕES --- */
@keyframes modalFadeIn {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}
