/* style.css - Visual Profissional Agenda Psy */
:root {
    --primary: #007bff;
    --primary-foreground: #ffffff;
    --background: #f8f9fa;
    --foreground: #212529;
    --card: #ffffff;
    --card-foreground: #212529;
    --popover: #ffffff;
    --popover-foreground: #212529;
    --muted: #f1f5f9;
    --muted-foreground: #64748b;
    --accent: #f1f5f9;
    --accent-foreground: #0f172a;
    --destructive: #ef4444;
    --destructive-foreground: #f8fafc;
    --border: #e2e8f0;
    --input: #e2e8f0;
    --ring: #3b82f6;
    --radius: 0.5rem;
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
}

/* Layout Estrutural */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 50;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-box {
    width: 32px;
    height: 32px;
    background-color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.sidebar-nav {
    flex: 1;
    padding: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--muted-foreground);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.nav-item:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

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

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--border);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background-color: var(--destructive);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s;
}

.btn-logout:hover {
    background-color: #dc2626;
}

/* Menu mobile (sanduíche) e overlay da sidebar */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--foreground);
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 55;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 860px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 60;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.15);
    }

    .sidebar.active {
        transform: translateX(0);
    }

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

    .sidebar-toggle {
        display: inline-flex;
    }

    .top-header {
        padding: 0 16px;
        gap: 12px;
    }

    .content-area {
        padding: 16px;
    }

    /* Em telas pequenas a tabela rola horizontalmente em vez de espremer o conteúdo */
    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 640px;
    }

    .modal-content {
        width: 92%;
        padding: 20px;
        max-height: 85vh;
    }
}

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

/* Header */
.top-header {
    height: 64px;
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-title {
    font-size: 1.125rem;
    font-weight: 600;
}

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

.user-info {
    text-align: right;
    line-height: 1.2;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Dashboard Cards */
.content-area {
    padding: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background-color: var(--card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.card-title {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    font-weight: 500;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 4px 0;
}

.card-desc {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.card-icon-box {
    padding: 8px;
    border-radius: 10px;
}

/* Cores dos Cards */
.bg-primary-light { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.bg-emerald-light { background-color: rgba(16, 185, 129, 0.1); color: #10b981; }
.bg-amber-light { background-color: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.bg-violet-light { background-color: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

/* Tabelas */
.table-container {
    background-color: var(--card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

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

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted-foreground);
    border-bottom: 1px solid var(--border);
    background-color: #fafafa;
}

td {
    padding: 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background-color: #dcfce7; color: #15803d; }
.badge-warning { background-color: #fef9c3; color: #a16207; }
.badge-info { background-color: #dbeafe; color: #1d4ed8; }

/* Botões */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background-color: var(--card);
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    transition: background-color .15s ease;
}

.btn-primary:hover {
    background-color: #0069d9;
}

/* Login/Cadastro Page */
.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background-color: var(--background);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 36px 32px;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 20px 40px -12px rgba(15,23,42,0.12);
}

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

.auth-logo {
    width: 44px;
    height: 44px;
    margin: 0 auto 18px;
    border-radius: 12px;
    box-shadow: 0 6px 14px rgba(0,123,255,0.28);
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--foreground);
}

.auth-subtitle {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-top: 8px;
}

.auth-links {
    text-align: center;
    margin-top: 16px;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

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

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

.auth-support {
    text-align: center;
    margin-top: 28px;
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.auth-support a {
    color: var(--muted-foreground);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-support a:hover {
    color: var(--primary);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.error-message {
    color: var(--destructive);
    font-size: 0.8125rem;
    margin-top: 8px;
    text-align: center;
}
