:root {
    --primary-color: #0077b6; /* Azul clinico */
    --secondary-color: #00b4d8;
    --bg-color: #f8f9fa;
    --text-color: #333;
    --white: #ffffff;
    --error: #e63946;
    --radius: 8px;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header__logo {
    max-width: 150px;
    margin-bottom: 1rem;
}

.login-header__title {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group__label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

.form-group__input, .form-group__select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: var(--radius);
    box-sizing: border-box; /* Importante para padding não estourar */
    font-size: 1rem;
}

.form-group__input:focus, .form-group__select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn:hover {
    background-color: var(--secondary-color);
}

.alert-error {
    background-color: #ffebee;
    color: var(--error);
    padding: 10px;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* --- LAYOUT DASHBOARD --- */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr; /* Sidebar fixa, resto flexível */
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background-color: var(--white);
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar__header {
    padding: 0 20px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
}

.sidebar__logo-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    gap: 12px;
}

.nav-link:hover, .nav-link.active {
    background-color: #e3f2fd; /* Azul bem claro */
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: var(--white);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.content-wrapper {
    padding: 30px;
    overflow-y: auto;
}

/* Cards do Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info h3 {
    margin: 0;
    font-size: 2rem;
    color: var(--primary-color);
}

.stat-info p {
    margin: 5px 0 0;
    color: #777;
    font-size: 0.9rem;
}

.stat-icon {
    font-size: 2.5rem;
    color: #e0e0e0;
}

/* Mobile Responsivo Basico */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none; /* Em um sistema real, fariamos um toggle menu */
    }
}


/* --- TABELAS --- */
.table-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #f9f9f9;
    color: #666;
    font-weight: 600;
}

.data-table tr:hover {
    background-color: #f8faff;
}

/* Badges de Status/Role */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}
.badge--admin { background-color: #e3f2fd; color: #1976d2; }
.badge--dentista { background-color: #e8f5e9; color: #2e7d32; }
.badge--func { background-color: #fff3e0; color: #ef6c00; }

/* --- MODAL (Janela Flutuante) --- */
.modal {
    display: none; /* Oculto por padrão */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px; right: 15px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #999;
}

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

.fa-whatsapp {
    font-size: 1.1em;
}

/* Hover no botão de Zap */
a[href*="wa.me"]:hover {
    filter: brightness(0.9);
}
