:root {
    /* Fallbacks (serão sobrescritos pelo theme.js) */
    --primary: #D4AF37;
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --border-color: #dee2e6;
    --text-main: #333333;
    --text-muted: #6c757d;
    --color-success: #28a745;
    --color-danger: #dc3545;
    --color-warning: #ffc107;
}

* { box-sizing: border-box; outline: none; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-body);
    margin: 0;
    color: var(--text-main);
}

/* Utilitários */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.5s ease-in; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Botões */
.btn-main {
    background-color: var(--primary);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}
.btn-main:hover { filter: brightness(0.9); }

.btn-sec {
    background-color: rgba(0,0,0,0.05);
    color: var(--text-main);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

/* Header Global */
.app-header {
    background-color: var(--bg-card);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-brand { font-size: 1.2rem; font-weight: bold; color: var(--primary); display: flex; align-items: center; gap: 10px; }
.app-brand img { height: 35px; }

.app-user { display: flex; align-items: center; gap: 15px; }
.user-info { text-align: right; line-height: 1.2; }
.user-name { font-weight: bold; font-size: 0.9rem; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }
.btn-logout { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; }
.btn-logout:hover { color: var(--color-danger); }

/* Context Switcher (Dropdown no Header) */
.context-badge {
    background: rgba(0,0,0,0.05);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}
.context-badge:hover { background: rgba(0,0,0,0.1); }

/* Cards de Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.dash-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid transparent;
}
.dash-card:hover { transform: translateY(-5px); border-color: var(--primary); }
.dash-card i { font-size: 2rem; color: var(--primary); margin-bottom: 15px; }
.dash-card h3 { margin: 0; font-size: 1.1rem; color: var(--text-main); }

/* TOAST NOTIFICATIONS */
.toast-container {
    position: fixed;
    top: 90px; /* Abaixo do header */
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Permite clicar através do container */
}

.toast {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 5px solid var(--primary);
    min-width: 300px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideInRight 0.3s ease-out;
    font-size: 0.95rem;
    pointer-events: auto;
}

.toast.success { border-left-color: var(--color-success); }
.toast.error { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 15px;
}
.toast-close:hover { color: var(--text-main); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}