* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2E7D32;
    --primary-light: #E8F5E9;
    --secondary-color: #FF9800;
    --text-dark: #1A1A1A;
    --text-gray: #666666;
    --bg-light: #F5F5F5;
    --border-color: #E0E0E0;
    --white: #FFFFFF;
    --danger: #C62828;
    --success: #2E7D32;
    --warning: #F57C00;
    --info: #0288D1;
    --sidebar-width: 68px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.logo {
    margin-bottom: 40px;
    text-align: center;
}

.logo h1 {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 700;
}

.logo-ampersand {
    color: var(--secondary-color);
    font-size: 16px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.nav-item {
    width: 48px;
    height: 48px;
    border: none;
    background-color: transparent;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.nav-item.active {
    background-color: #FFE4B5;
    color: var(--primary-color);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: auto;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.main-content.no-sidebar {
    margin-left: 0;
}

.top-header {
    background-color: var(--white);
    height: 70px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 40px;
    border-bottom: 1px solid var(--border-color);
}

.user-info {
    color: var(--text-dark);
    font-weight: 500;
}

.content-area {
    flex: 1;
    padding: 40px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
}

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

.alert-success {
    background-color: #E8F5E9;
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-danger {
    background-color: #FFEBEE;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.alert-warning {
    background-color: #FFF3E0;
    color: var(--warning);
    border: 1px solid var(--warning);
}

.alert-info {
    background-color: #E3F2FD;
    color: var(--info);
    border: 1px solid var(--info);
}

.close-alert {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
    padding: 0;
    margin-left: 10px;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
}

.auth-card {
    background-color: var(--white);
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    max-width: 480px;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-gray);
    font-size: 16px;
}

.auth-form {
    margin-bottom: 24px;
}

.auth-footer {
    text-align: center;
    color: var(--text-gray);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background-color: #1B5E20;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

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

.btn-block {
    width: 100%;
    display: block;
}

.btn-link {
    background-color: transparent;
    border: none;
    color: #1976D2;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
    transition: opacity 0.3s ease;
    text-decoration: none;
    margin-right: 12px;
}

.btn-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.btn-link-add {
    color: var(--primary-color);
}

.btn-link-danger {
    color: var(--danger);
}

/* Page Layout */
.page-content {
    width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 36px;
    color: var(--text-dark);
    font-weight: 700;
}

/* Cards */
.welcome-card {
    background-color: var(--white);
    border-radius: 16px;
    padding: 48px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 40px;
}

.welcome-illustration {
    flex-shrink: 0;
}

.welcome-content h2 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-weight: 700;
}

.welcome-content p {
    color: var(--text-gray);
    font-size: 16px;
    line-height: 1.6;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.dashboard-card {
    background-color: var(--white);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-dark);
    border: 2px solid transparent;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.card-icon {
    width: 64px;
    height: 64px;
    background-color: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary-color);
}

.dashboard-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.dashboard-card p {
    color: var(--text-gray);
    font-size: 14px;
}

.form-card,
.table-card,
.profile-card {
    background-color: var(--white);
    border-radius: 16px;
    padding: 32px;
}

/* Profile */
.profile-info-section h3 {
    font-size: 20px;
    margin-bottom: 24px;
    color: var(--text-dark);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.info-item label {
    display: block;
    font-size: 12px;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.info-item p {
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 500;
}

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

.data-table thead {
    border-bottom: 2px solid var(--border-color);
}

.data-table th {
    text-align: left;
    padding: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-gray);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background-color: var(--bg-light);
}

/* Status Badges */
.status-badge {
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}

.status-scheduled {
    background-color: #FFF3E0;
    color: #F57C00;
}

.status-canceled {
    background-color: #FFEBEE;
    color: #C62828;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 40px;
}

.empty-state svg {
    margin-bottom: 24px;
}

.empty-state p {
    color: var(--text-gray);
    font-size: 16px;
    margin-bottom: 24px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 32px;
}

.page-actions {
    margin-top: 24px;
}

/* Prontuários */
.prontuarios-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.prontuario-card {
    background-color: var(--white);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
}

.prontuario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.prontuario-header h3 {
    font-size: 18px;
    color: var(--text-dark);
}

.prontuario-date {
    color: var(--text-gray);
    font-size: 14px;
}

.prontuario-content p {
    color: var(--text-dark);
    line-height: 1.6;
    white-space: pre-wrap;
}

.prontuario-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.prontuario-footer small {
    color: var(--text-gray);
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .main-content {
        margin-left: 60px;
    }

    .content-area {
        padding: 20px;
    }

    .welcome-card {
        flex-direction: column;
        padding: 32px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
    }
}
