/* ===== Tokens ===== */
:root {
    --bg: #FAFAFD;
    --surface: #FFFFFF;

    --violet-50: #F4F1FD;
    --violet-100: #E9E2FC;
    --violet-200: #D6C9F7;
    --violet-500: #7C5CFC;
    --violet-600: #6A47E8;
    --violet-900: #241B38;

    --ink: #211D2C;
    --muted: #756F84;
    --border: #E9E5F2;

    --success: #2F9E6E;
    --success-bg: #E7F6EF;
    --danger: #E0546C;
    --danger-bg: #FCEBEF;
    --warning: #D89A2E;
    --warning-bg: #FBF3E1;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(36, 27, 56, 0.04), 0 4px 16px rgba(36, 27, 56, 0.06);
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--ink);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14.5px;
}

h1, h2, h3, h4, h5, .display-font {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

a { color: var(--violet-600); text-decoration: none; }
a:hover { color: var(--violet-900); }

/* ===== Layout: sidebar + content ===== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 252px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 24px 8px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.brand-text {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 700;
    font-size: 13.5px;
    line-height: 1.25;
    color: var(--ink);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 500;
    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
    background: var(--violet-50);
    color: var(--violet-900);
}

.sidebar-link.active {
    background: var(--violet-100);
    color: var(--violet-900);
    font-weight: 600;
}

.sidebar-link .bi { font-size: 16px; width: 18px; text-align: center; }

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

.sidebar-user {
    font-size: 13px;
    color: var(--muted);
    padding: 0 8px 10px 8px;
}
.sidebar-user strong { color: var(--ink); display: block; font-size: 13.5px; }

.main-content {
    flex: 1;
    padding: 32px 40px;
    min-width: 0;
}

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card { padding: 18px 20px; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-value { font-family: "Plus Jakarta Sans", sans-serif; font-size: 28px; font-weight: 700; margin-top: 2px; }

/* ===== Buttons ===== */
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: 13.5px; padding: 8px 16px; }

.btn-primary, .btn-dark {
    background: var(--violet-600);
    border-color: var(--violet-600);
    color: white;
}
.btn-primary:hover, .btn-dark:hover {
    background: var(--violet-900);
    border-color: var(--violet-900);
}

.btn-outline-secondary, .btn-outline-dark {
    border-color: var(--border);
    color: var(--ink);
    background: var(--surface);
}
.btn-outline-secondary:hover, .btn-outline-dark:hover {
    background: var(--violet-50);
    border-color: var(--violet-200);
    color: var(--violet-900);
}

.btn-outline-danger { border-color: var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); }

/* ===== Forms ===== */
.form-label { font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 4px; }
.form-control, .form-select {
    border-color: var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 14px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--violet-500);
    box-shadow: 0 0 0 3px var(--violet-100);
}
.form-check-input:checked {
    background-color: var(--violet-600);
    border-color: var(--violet-600);
}

.form-section-title {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 12px;
}

/* Discreet field (e.g. penalty count) */
.field-discreet {
    font-size: 12.5px;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: inline-block;
}

/* ===== Badges ===== */
.badge { font-weight: 600; font-size: 11.5px; padding: 5px 9px; border-radius: 999px; }

/* ===== Table ===== */
.table { font-size: 13.5px; }
.table thead th {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    background: transparent;
}
.table td { border-color: var(--border); vertical-align: middle; }

/* ===== Alerts ===== */
.alert { border-radius: var(--radius-sm); border: none; font-size: 13.5px; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info { background: var(--violet-50); color: var(--violet-900); }

/* ===== Login split screen ===== */
.login-shell {
    min-height: 100vh;
    display: flex;
}
.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    padding: 24px;
}
.login-brand-side {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--violet-50) 0%, var(--violet-100) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.login-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
}
.login-blob-1 {
    width: 380px; height: 380px;
    background: var(--violet-500);
    top: -80px; right: -80px;
}
.login-blob-2 {
    width: 300px; height: 300px;
    background: var(--violet-900);
    bottom: -100px; left: -60px;
    opacity: 0.25;
}
.login-brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 380px;
}
.login-brand-mark {
    width: 72px;
    height: 72px;
    margin: 0 auto 6px auto;
    display: block;
}
.login-institute-name {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--violet-900);
    line-height: 1.2;
    margin-bottom: 6px;
}
.login-institute-name-sub {
    margin-bottom: 18px;
}
.login-brand-content p {
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.55;
}
.login-form-card { width: 100%; max-width: 360px; }
.login-eyebrow {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--violet-600);
    margin-bottom: 6px;
}

@media (max-width: 860px) {
    .login-brand-side { display: none; }
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; overflow-x: auto; }
    .sidebar-nav { flex-direction: row; }
    .sidebar-footer { display: none; }
    .main-content { padding: 20px; }
}

/* Modalidade do atendimento (dropdown na tela do agendamento) */
.select-modalidade { min-width: 128px; }
.select-modalidade.modalidade-distancia {
    border-color: #C9975B;
    background-color: var(--warning-bg);
    font-weight: 600;
}
.select-modalidade.modalidade-salva {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px var(--success-bg);
}

/* Etapas do processo: etiqueta e linha do tempo */
.status-solicitado { --st-bg: #EEF2F7; --st-fg: #475569; --st-dot: #94A3B8; }
.status-em_triagem { --st-bg: #E0EEFF; --st-fg: #1D4ED8; --st-dot: #3B82F6; }
.status-aguardando_informacoes { --st-bg: #FBF3E1; --st-fg: #9A6A0B; --st-dot: #D89A2E; }
.status-aprovado { --st-bg: #F4F1FD; --st-fg: #5B3FD1; --st-dot: #A78BFA; }
.status-elegivel { --st-bg: #E9E2FC; --st-fg: #4B2FC0; --st-dot: #7C5CFC; }
.status-agendado { --st-bg: #DFF3F6; --st-fg: #0E6B7A; --st-dot: #22A6B8; }
.status-confirmado { --st-bg: #E7F6EF; --st-fg: #1F7A55; --st-dot: #2F9E6E; }
.status-atendido { --st-bg: #CFEFDD; --st-fg: #14603F; --st-dot: #1F8A5B; }
.status-faltou { --st-bg: #FCEBEF; --st-fg: #B4324A; --st-dot: #E0546C; }
.status-concluido { --st-bg: #E5E7EB; --st-fg: #1F2937; --st-dot: #4B5563; }
.status-rejeitado { --st-bg: #FDE8E8; --st-fg: #9B1C1C; --st-dot: #DC2626; }
.status-fora_da_fila { --st-bg: #F3E8E8; --st-fg: #7A2E2E; --st-dot: #B45F5F; }
.status-badge { background: var(--st-bg); color: var(--st-fg); font-weight: 600; }
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute; left: -26px; top: 4px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--st-dot); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border);
}
