@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg:           #faf9fb;
    --card:         #ffffff;
    --text:         #1a0a2e;
    --muted:        #7c6d8a;
    --primary:      #f15a22;
    --primary-hover:#d44b18;
    --secondary:    #a3215a;
    --accent:       #5b2d8e;
    --border:       #e8e0f0;
    --shadow:       0 10px 30px rgba(91,45,142,0.08);
    --radius:       14px;
    --header-bg:    #ffffff;
}

body.dark {
    --bg:        #0e0618;
    --card:      #1a0f2e;
    --text:      #f0eaf8;
    --muted:     #9b8ab0;
    --primary:   #f15a22;
    --secondary: #c4386f;
    --accent:    #7b4db5;
    --border:    #2e1f4a;
    --shadow:    0 10px 30px rgba(0,0,0,0.5);
    --header-bg: #130d24;
}

body.high-contrast {
    --bg:       #000;
    --text:     #fff;
    --card:     #000000;
    --border:   #fff;
    --primary:  #ff6b35;
    --secondary:#ff4499;
    --accent:   #bb88ff;
    --header-bg: #000000;
}

 body.high-contrast img {
    filter: invert(1);
 }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
}

/* HEADER */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(91,45,142,0.06);
}


.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo img {
    height: 40px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

body.dark .logo img {
    filter: invert(1);
}

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

a {
    text-decoration: none;
}

/* HEADER SUBTITLE */
.header-subtitle {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}

/* HEADER USER PROFILE — perfil do usuário no header (ex.: painel admin) */
.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-user-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

/* HEADER CHIP — botões/links de navegação no header (ex.: Semanal / Diário) */
.header-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent);
    color: #fff;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.header-chip:hover { opacity: 0.82; color: #fff; }

/* BOTÃO VOLTAR — padrão único em todas as páginas */
.btn-voltar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 22px;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.18s, color 0.18s, background 0.18s;
    white-space: nowrap;
}
.btn-voltar:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(241,90,34,0.06);
    text-decoration: none;
}

/* LOGIN BTN */
.login-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    padding: 11px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
    color: #fff;
}
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(241,90,34,0.35);
}

/* MENU BTN */
.menu-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}
.menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

/* Alertas sempre acima do sidebar em todas as páginas */
#alertas-container { z-index: 9999 !important; }

/* SIDEBAR */
.sidebar {
    position: fixed;
    top: 0; right: -400px;
    width: 300px; height: 100%;
    background: var(--card);
    padding: 25px;
    padding-bottom: 100px;
    box-shadow: -10px 0 40px rgba(91,45,142,0.15);
    transition: 0.4s;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.sidebar.open { right: 0; }

.sidebar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}
.close-menu {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.2s;
}
.close-menu:hover { color: var(--primary); }

.settings-list { flex: 1; }

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.sidebar-footer {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    padding: 20px 25px;
    box-sizing: border-box;
    background: var(--card);
    border-top: 1px solid var(--border);
}
.sidebar-footer a {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    padding: 12px 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    transition: 0.3s;
}
.sidebar-footer a:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* SWITCH */
.switch {
    position: relative;
    display: inline-block;
    width: 42px; height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #cbd5e1; transition: .4s; border-radius: 24px;
}
.slider:before {
    position: absolute; content: "";
    width: 18px; height: 18px;
    left: 3px; bottom: 3px;
    background: white; transition: .4s; border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(18px); }

/* OVERLAY */
.overlay {
    position: fixed; inset: 0;
    background: rgba(26,10,46,0.45);
    opacity: 0; visibility: hidden;
    transition: 0.3s; z-index: 900;
}
.overlay.show { opacity: 1; visibility: visible; }

/* LARGE TEXT */
body.large-text { font-size: 1.15rem; }

@media (max-width: 768px) {
    .actions { gap: 16px; }
    .header { padding: 0 4%; }
}
