:root {
    /* Mesma paleta do site principal para consistência */
    --primary: #0f172a;      /* Azul Noturno - Sidebar */
    --secondary: #94a3b8;    /* Cinza Azulado */
    --accent: #d4af37;       /* Dourado - Destaques */
    --bg-light: #f1f5f9;     /* Fundo do Dashboard */
    --white: #ffffff;
    --text-dark: #1e293b;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden; /* Evita scroll na página inteira */
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

/* --- TELA DE LOGIN (OVERLAY) --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    z-index: 9999;
    display: flex; /* Flex para centralizar */
    align-items: center;
    justify-content: center;
    background-image: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.login-box {
    background: var(--white);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    margin-bottom: 2rem;
}

.login-header .logo-large {
    font-weight: 900;
    font-size: 2rem;
    color: var(--white);
    background: var(--accent);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin: 0 auto 1rem auto;
}

.login-header h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    font-size: 0.9rem;
    color: var(--secondary);
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-login:hover {
    background-color: #1e293b;
    transform: translateY(-2px);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 1rem;
    min-height: 20px;
}

/* --- Layout Grid --- */
.dashboard-container {
    display: flex;
    height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 260px;
    background-color: var(--primary);
    color: var(--white);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    flex-shrink: 0;
}

/* Estado recolhido da sidebar (Mobile/Tablet) */
.sidebar.collapsed {
    margin-left: -260px;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-small {
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--white);
    background: var(--accent);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.sidebar-nav {
    padding: 2rem 0;
    flex: 1;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.sidebar-nav a:hover, .sidebar-nav li.active a {
    background: rgba(255,255,255,0.05);
    color: var(--white);
    border-left-color: var(--accent);
}

.separator {
    margin: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-btn:hover {
    color: var(--danger) !important;
    border-left-color: var(--danger) !important;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Top Bar */
.top-bar {
    height: 80px;
    background: var(--white);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
    margin-right: 1rem;
    display: none; /* Escondido em desktop por padrão, JS controla */
}

.page-title h1 {
    font-size: 1.5rem;
    color: var(--primary);
}

.page-title p {
    font-size: 0.9rem;
    color: var(--secondary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification-badge {
    position: relative;
    font-size: 1.2rem;
    cursor: pointer;
}

.badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 50%;
    font-family: 'Lato', sans-serif;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid var(--accent);
}

/* Wrapper com Scroll */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.warning { background: #fff7ed; color: var(--warning); }
.stat-icon.info { background: #eff6ff; color: #3b82f6; }
.stat-icon.success { background: #f0fdf4; color: var(--success); }
.stat-icon.primary { background: #f1f5f9; color: var(--primary); }

.stat-info h3 {
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    color: var(--secondary);
    font-weight: 700;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
}

/* Dashboard Columns */
.dashboard-columns {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
}

.panel-section {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.2rem;
    color: var(--primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    border: 1px solid var(--secondary);
    background: transparent;
    border-radius: 6px;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.btn-sm:hover {
    background: var(--bg-light);
    border-color: var(--primary);
}

/* Task List */
.task-list {
    list-style: none;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.task-item:last-child { border-bottom: none; }

.task-date {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--secondary);
    background: var(--bg-light);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    min-width: 60px;
    text-align: center;
}

.task-item.urgent .task-date { color: var(--danger); background: #fef2f2; }
.task-item.warning .task-date { color: var(--warning); background: #fffbeb; }

.task-desc {
    flex: 1;
}

.task-desc strong {
    display: block;
    color: var(--primary);
    font-size: 0.95rem;
}

.task-desc span {
    font-size: 0.85rem;
    color: var(--secondary);
}

.btn-check {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: white;
    color: #e2e8f0;
    cursor: pointer;
    transition: var(--transition);
}

.btn-check:hover {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--secondary);
    text-transform: uppercase;
    font-weight: 700;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

.tag {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

.tag-blue { background: #eff6ff; color: #3b82f6; }
.tag-green { background: #f0fdf4; color: var(--success); }
.tag-red { background: #fef2f2; color: var(--danger); }
.tag-gray { background: #f1f5f9; color: var(--secondary); }

/* Responsividade */
@media (max-width: 1024px) {
    .dashboard-columns { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { position: absolute; height: 100%; z-index: 100; left: 0; box-shadow: 2px 0 10px rgba(0,0,0,0.1); }
    .sidebar.collapsed { margin-left: -260px; } /* Esconde por padrão no mobile se quiser, ou usa JS */
    .menu-btn { display: block; }
    .dashboard-columns { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .login-box { padding: 2rem; }
}