:root {
    --primary-purple: #8B5CF6;
    --light-purple: #F5F3FF;
    --text-dark: #333;
}

body {
    background-color: #F8F9FA;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
}

.page-dashboard {
    background-color: #f1f5f9;
    background-image:
        radial-gradient(ellipse 100% 60% at 100% -20%, rgba(139, 92, 246, 0.07), transparent 55%),
        radial-gradient(ellipse 80% 50% at 0% 100%, rgba(99, 102, 241, 0.05), transparent 50%);
    min-height: 100vh;
}

.letter-spacing-1 {
    letter-spacing: 0.08em;
}

/* Dashboard hero */
.dashboard-hero {
    background: linear-gradient(125deg, #4c1d95 0%, #6d28d9 42%, #7c3aed 78%, #5b21b6 100%);
    box-shadow: 0 16px 48px -20px rgba(76, 29, 149, 0.45);
}

.dashboard-hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.15' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.dashboard-hero-kicker {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.85;
}

.dashboard-hero-title {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-weight: 700;
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.dashboard-hero-lead {
    max-width: 36rem;
}

.dashboard-quick-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    padding: 1rem 1rem 1.1rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.dashboard-quick-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px -12px rgba(76, 29, 149, 0.2);
    border-color: rgba(139, 92, 246, 0.35);
}

.dashboard-quick-card:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.dq-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-purple);
    color: var(--primary-purple);
    font-size: 1.15rem;
    margin-bottom: 0.65rem;
}

.dq-icon-teal {
    background: #ccfbf1;
    color: #0d9488;
}

.dq-icon-blue {
    background: #dbeafe;
    color: #2563eb;
}

.dq-icon-amber {
    background: #fef3c7;
    color: #d97706;
}

.dq-icon-slate {
    background: #f1f5f9;
    color: #475569;
}

.dq-icon-rose {
    background: #ffe4e6;
    color: #e11d48;
}

.dq-title {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: #0f172a;
    line-height: 1.25;
}

.dq-desc {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.15rem;
}

/* Check-in diário — checklist premium */
.habit-checkin-card {
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
    box-shadow: 0 4px 24px -8px rgba(15, 23, 42, 0.08) !important;
}

.habit-checkin-accent {
    height: 4px;
    background: linear-gradient(90deg, #f59e0b 0%, #8b5cf6 50%, #6366f1 100%);
}

.habit-checkin-brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #b45309;
    background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.habit-checkin-title {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.habit-progress-label {
    color: #64748b;
    font-weight: 500;
}

.habit-streak-badge {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.35rem 0.65rem;
    background: var(--light-purple) !important;
    color: #6d28d9 !important;
    border: 1px solid #e9d5ff;
}

.habit-checklist {
    --habit-radius: 14px;
}

.habit-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    margin: 0;
    border: 1px solid #e2e8f0;
    border-radius: var(--habit-radius);
    background: #fafbfc;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.habit-item:hover {
    border-color: #c4b5fd;
    background: #fff;
    box-shadow: 0 4px 16px -6px rgba(109, 40, 217, 0.15);
}

.habit-item:has(.habit-check:checked) {
    border-color: #a78bfa;
    background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.12);
}

.habit-item:has(.habit-check:checked) .habit-item-icon {
    transform: scale(1.05);
}

.habit-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.habit-item--water .habit-item-icon {
    background: #e0f2fe;
    color: #0369a1;
}

.habit-item--move .habit-item-icon {
    background: #dcfce7;
    color: #15803d;
}

.habit-item--sleep .habit-item-icon {
    background: #ede9fe;
    color: #6d28d9;
}

.habit-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.habit-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f172a;
    line-height: 1.25;
}

.habit-item-hint {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.35;
}

.habit-item .habit-check {
    width: 1.2rem;
    height: 1.2rem;
    margin: 0;
    flex-shrink: 0;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    cursor: pointer;
    accent-color: #7c3aed;
}

.habit-item .habit-check:focus {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.habit-progress-bar {
    background: #e2e8f0;
}

.habit-progress-fill {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    transition: width 0.35s ease;
}

.habit-btn-save {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    color: #fff !important;
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 50%, #8b5cf6 100%);
    border: none;
    box-shadow: 0 4px 14px -2px rgba(91, 33, 182, 0.45);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.habit-btn-save:hover {
    color: #fff !important;
    filter: brightness(1.06);
    box-shadow: 0 8px 22px -4px rgba(91, 33, 182, 0.5);
    transform: translateY(-1px);
}

.habit-btn-save:active {
    transform: translateY(0);
}

@supports not selector(:has(*)) {
    .habit-item.habit-item--checked {
        border-color: #a78bfa;
        background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
    }
}

.text-purple { color: var(--primary-purple); }
.bg-purple { background-color: var(--primary-purple) !important; }
.text-orange { color: #f97316; }

/* Navbar UI */
.logo-icon {
    width: 35px;
    height: 35px;
}

.subtitulo_navbar {
    margin-bottom: 0;
}

.streak-badge {
    background-color: #FFF7ED;
    border: 1px solid #FFEDD5;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #9A3412;
    font-weight: 600;
}

/* Tabs custom */
.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    padding: 10px 20px;
}

.nav-tabs .nav-link.active {
    background: transparent;
    color: var(--primary-purple) !important;
    border-bottom: 3px solid var(--primary-purple);
}

/* Achievement Cards */
.achievement-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    transition: transform 0.2s;
    height: 100%;
    border: 1px solid #eee;
}

.achievement-card:hover {
    transform: translateY(-5px);
}

.achievement-card.locked {
    opacity: 0.6;
    background-color: #fafafa;
}

.icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
}

.icon-yellow { background-color: #FEF9C3; color: #CA8A04; }
.icon-blue { background-color: #DBEAFE; color: #2563EB; }
.icon-green { background-color: #DCFCE7; color: #16A34A; }
.icon-gray { background-color: #F3F4F6; color: #9CA3AF; }

/* Status Badges */
.badge-confirmada { background-color: #DCFCE7; color: #16A34A; }
.badge-confirmar { background-color: #FEF9C3; color: #CA8A04; }
.badge-pontos { background-color: #DCFCE7; color: #16A34A; font-weight: bold; }

/* Appointment Cards */
.appointment-item {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.btn-confirm {
    background-color: #A855F7;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 0;
    width: 100%;
}

.btn-reschedule {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 15px;
}

/* Ranking Styles */
.ranking-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.ranking-item.me {
    background-color: #F5F3FF;
    border: 1px solid #DDD6FE;
}

.rank-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
}

.btn-purple {
    background-color: var(--primary-purple);
    color: #fff !important;
    border: none;
}

.btn-purple:hover {
    background-color: #7c3aed;
    color: #fff !important;
}

.btn-purple:disabled {
    opacity: 0.65;
}

/* Login — layout premium (escopo .login-body) */
.login-body {
    margin: 0;
    font-family: "Inter", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.login-wrap {
    background: #eceff3;
    background-image:
        radial-gradient(ellipse 120% 80% at 100% 0%, rgba(139, 92, 246, 0.08), transparent 50%),
        radial-gradient(ellipse 80% 60% at 0% 100%, rgba(99, 102, 241, 0.06), transparent 45%);
}

.login-aside {
    flex: 0 0 auto;
    position: relative;
    background: linear-gradient(145deg, #4c1d95 0%, #6d28d9 38%, #7c3aed 72%, #5b21b6 100%);
    min-height: 240px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.login-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 1;
    pointer-events: none;
}

.login-aside-glow {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.45) 0%, transparent 70%);
    top: -80px;
    right: -100px;
    pointer-events: none;
}

@media (min-width: 992px) {
    .login-aside {
        flex: 0 0 44%;
        max-width: 520px;
        min-height: 100vh;
    }
}

.login-kicker {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.72;
}

.login-brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    font-size: 1.35rem;
}

.login-brand-title {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 2.5vw, 1.85rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.login-brand-tag {
    font-size: 0.8125rem;
    font-weight: 500;
    opacity: 0.78;
    margin-top: 0.2rem;
}

.login-lead {
    font-size: 0.9375rem;
    line-height: 1.55;
    font-weight: 400;
    opacity: 0.88;
    max-width: 26rem;
}

.login-features {
    font-size: 0.875rem;
    line-height: 1.45;
}

.login-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    opacity: 0.92;
}

.login-features li:last-child {
    margin-bottom: 0;
}

.login-feature-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    margin-top: 0.1rem;
}

.login-main {
    min-height: 60vh;
}

.login-main-inner {
    max-width: 440px;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 12px 40px -12px rgba(15, 23, 42, 0.12),
        0 24px 64px -24px rgba(76, 29, 149, 0.08);
}

.login-card-title {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-weight: 700;
    font-size: 1.375rem;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.login-card-sub {
    font-size: 0.8125rem;
    line-height: 1.5;
}

.login-role-switch {
    display: flex;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    gap: 4px;
}

.login-role-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.login-role-btn:hover {
    color: #475569;
    background: rgba(255, 255, 255, 0.7);
}

.login-role-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 50%, #8b5cf6 100%);
    box-shadow: 0 4px 14px -3px rgba(109, 40, 217, 0.55);
}

.login-role-btn:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.login-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.4rem;
}

.login-input-group .input-group-text {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
    border-radius: 10px 0 0 10px;
    padding-left: 0.9rem;
    padding-right: 0.65rem;
}

.login-input-group .login-input {
    border-radius: 0 10px 10px 0;
    border-left: none;
}

.login-input-group:focus-within .input-group-text {
    border-color: #c4b5fd;
    color: #6d28d9;
}

.login-input-group:focus-within .login-input {
    border-color: #c4b5fd;
    box-shadow: none;
}

.login-input.form-control {
    border-color: #e2e8f0;
    padding: 0.65rem 0.85rem;
    font-size: 0.9375rem;
    border-radius: 10px;
}

.login-input.form-control:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.login-check .form-check-input:checked {
    background-color: #7c3aed;
    border-color: #7c3aed;
}

.login-check .form-check-label {
    font-size: 0.8125rem;
    color: #64748b;
}

.login-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff !important;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 45%, #8b5cf6 100%);
    box-shadow: 0 4px 16px -2px rgba(91, 33, 182, 0.45);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.login-btn-submit:hover {
    color: #fff !important;
    filter: brightness(1.05);
    box-shadow: 0 8px 24px -4px rgba(91, 33, 182, 0.5);
    transform: translateY(-1px);
}

.login-btn-submit:active {
    transform: translateY(0);
}

.login-trust {
    font-size: 0.75rem;
    color: #94a3b8 !important;
    padding-top: 0.25rem;
    border-top: 1px solid #f1f5f9;
}

.login-footer .text-muted {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.login-alert {
    border: none;
    border-radius: 10px;
}

.login-alert--warn {
    background: #fffbeb;
    color: #92400e;
}

.login-alert--info {
    background: #eff6ff;
    color: #1e40af;
}

/* Marca compacta na navbar (index / médico) */
.navbar .login-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 55%, #8b5cf6 100%);
    border-radius: 12px !important;
    box-shadow: 0 4px 14px -2px rgba(91, 33, 182, 0.35);
}

.logo-icon-wrap {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.bg-light-purple {
    background: var(--light-purple) !important;
}

.border-purple-soft {
    border: 1px solid #e9d5ff !important;
}

/* Agenda — calendário compacto */
.agenda-cal-title {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    letter-spacing: -0.02em;
}

.agenda-cal-card {
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
}

.agenda-sidebar {
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
    position: sticky;
    top: 5.5rem;
}

@media (max-width: 991.98px) {
    .agenda-sidebar {
        position: static;
    }
}

.agenda-selected-list {
    max-height: 320px;
    overflow-y: auto;
}

.agenda-side-item {
    background: #fafafa;
    border-color: #e2e8f0 !important;
}

.min-w-cal-label {
    min-width: 7.5rem;
}

.agenda-view-toggle .btn.active {
    background: var(--light-purple);
    color: #5b21b6;
    border-color: #c4b5fd;
    font-weight: 600;
}

.patient-calendar {
    overflow-x: auto;
}

.patient-cal-grid-month {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: minmax(58px, auto);
    gap: 5px;
    max-width: 640px;
}

.patient-cal-dow {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 2px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b !important;
}

.patient-cal-cell.patient-cal-empty {
    visibility: hidden;
    min-height: 0;
    padding: 0;
    border: none;
}

.patient-cal-cell-btn {
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    text-align: left;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: 0.75rem;
    padding: 5px 6px;
    min-height: 58px;
    max-height: 88px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.patient-cal-cell-btn:hover {
    border-color: #c4b5fd;
    background: #fafaff;
}

.patient-cal-cell-btn:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
    z-index: 1;
}

.patient-cal-num {
    font-weight: 700;
    font-size: 0.8rem;
    color: #334155;
    line-height: 1.2;
}

.patient-cal-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    min-height: 0;
    overflow: hidden;
}

.patient-cal-ev {
    display: block;
    font-size: 0.62rem;
    line-height: 1.25;
    color: #475569;
    padding: 1px 0;
}

.patient-cal-more {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--primary-purple);
}

.patient-cal-has {
    background: linear-gradient(180deg, #faf5ff 0%, #f5f3ff 100%);
    border-color: #ddd6fe;
}

.patient-cal-has .patient-cal-num {
    color: #5b21b6;
}

.patient-cal-today {
    box-shadow: inset 0 0 0 2px var(--primary-purple);
}

.patient-cal-selected {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.35);
    background: #fff !important;
}

/* Semana */
.patient-cal-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    max-width: 100%;
}

.patient-cal-week-col {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.patient-cal-week-today {
    box-shadow: inset 0 0 0 2px var(--primary-purple);
}

.patient-cal-week-selected {
    border-color: #a78bfa;
    background: #faf5ff;
}

.patient-cal-week-head {
    padding: 8px 6px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
}

.patient-cal-week-dow {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.patient-cal-week-daybtn {
    font-size: 1.15rem !important;
    line-height: 1.2;
}

.patient-cal-week-body {
    padding: 6px;
    flex: 1;
    overflow-y: auto;
    max-height: 200px;
}

.patient-cal-week-empty {
    display: block;
    padding: 0.5rem;
}

.patient-cal-week-ev {
    background: #f5f3ff;
    border: 1px solid #e9d5ff !important;
    cursor: pointer;
    transition: background 0.15s ease;
}

.patient-cal-week-ev:hover {
    background: #ede9fe;
}

@media (max-width: 767.98px) {
    .patient-cal-week {
        grid-template-columns: 1fr;
    }

    .patient-cal-week-col {
        min-height: auto;
    }

    .patient-cal-week-body {
        max-height: none;
    }
}

.cal-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--light-purple);
    border: 1px solid #c4b5fd;
    vertical-align: middle;
    margin-right: 6px;
}

/* Calendário médico (mini) */
.calendar-grid-medico {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-dow {
    padding: 4px 0;
}

.cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.75rem;
    background: #fff;
    border: 1px solid #eee;
}

.cal-empty {
    visibility: hidden;
}

.cal-cell.cal-has {
    background: var(--light-purple);
    font-weight: 600;
    color: var(--primary-purple);
}

.cal-cell.cal-today {
    outline: 2px solid var(--primary-purple);
}

/* Alto contraste (config) */
.theme-high-contrast {
    --primary-purple: #5b21b6;
    --light-purple: #ede9fe;
    --text-dark: #0f172a;
}

.theme-high-contrast .navbar,
.theme-high-contrast .card {
    border: 1px solid #94a3b8 !important;
}

/* Portal médico */
.medico-nav-pills .nav-link {
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 0.45rem 0.85rem;
    background: #fff;
}

.medico-nav-pills .nav-link:hover {
    border-color: #c4b5fd;
    color: #5b21b6;
}

.medico-nav-pills .nav-link.active {
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
    border-color: transparent;
    color: #fff !important;
}

.medico-kpi {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    padding: 1rem 1.15rem;
    background: #fff;
    height: 100%;
}

.medico-kpi-value {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.medico-bar {
    height: 8px;
    border-radius: 99px;
    background: #e2e8f0;
    overflow: hidden;
}

.medico-bar > span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.medico-msg-item {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.medico-msg-item:hover {
    border-color: #ddd6fe;
    background: #fafaff;
}

.medico-doc-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem;
    height: 100%;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.medico-doc-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 8px 24px -12px rgba(109, 40, 217, 0.2);
}

/* Navbar portal médico — data + perfil */
.doctor-nav-datewrap {
    width: 100%;
}

@media (min-width: 992px) {
    .doctor-nav-datewrap {
        width: auto;
    }
}

.doctor-nav-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.9rem 0.45rem 0.55rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #faf5ff 0%, #f8fafc 55%, #eef2ff 100%);
    border: 1px solid rgba(124, 58, 237, 0.18);
    box-shadow: 0 2px 12px -4px rgba(91, 33, 182, 0.15);
}

.doctor-nav-chip-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #5b21b6, #7c3aed);
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.doctor-nav-chip-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    min-width: 0;
}

.doctor-nav-chip-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.doctor-nav-chip-date {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
}

.doctor-nav-profile {
    border-radius: 14px !important;
    padding: 0.35rem 0.5rem 0.35rem 0.35rem !important;
    transition: background 0.18s ease, box-shadow 0.18s ease;
}

.doctor-nav-profile:hover,
.doctor-nav-profile:focus-visible,
.doctor-nav-profile.show {
    background: rgba(245, 243, 255, 0.95) !important;
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.2);
}

.doctor-nav-profile.dropdown-toggle::after {
    display: none;
}

.doctor-nav-avatar {
    position: relative;
    overflow: hidden;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(145deg, #4c1d95 0%, #7c3aed 45%, #a78bfa 100%);
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    box-shadow: 0 6px 18px -6px rgba(91, 33, 182, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.doctor-nav-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    z-index: 1;
}

.doctor-nav-avatar--sm {
    width: 40px;
    height: 40px;
    font-size: 0.72rem;
    border-radius: 11px;
}

.doctor-nav-identity {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    max-width: 12.5rem;
}

@media (min-width: 1200px) {
    .doctor-nav-identity {
        max-width: 16rem;
    }
}

.doctor-nav-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.doctor-nav-crm {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
}

.doctor-nav-caret {
    font-size: 0.85rem;
    opacity: 0.65;
}

.doctor-dropdown-menu {
    min-width: min(100vw - 2rem, 300px);
    border-radius: 16px !important;
    box-shadow: 0 16px 48px -12px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.04) !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.doctor-dropdown-header {
    background: linear-gradient(180deg, rgba(245, 243, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 0 0 12px 12px;
}

.doctor-dropdown-header-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-bottom: 0.15rem;
}

.doctor-dropdown-item {
    display: flex !important;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 1rem !important;
    border-radius: 0 !important;
}

.doctor-dropdown-item:hover,
.doctor-dropdown-item:focus {
    background: #f5f3ff !important;
}

.doctor-dropdown-ico {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    background: rgba(124, 58, 237, 0.1);
    color: #5b21b6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.doctor-dropdown-item.text-danger .doctor-dropdown-ico {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

/* ========== Página config médico (v2) ========== */
.page-config-medico {
    background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 35%, #eef2ff 100%);
}

.page-config-medico .cfgm-sheen {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 58, 237, 0.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(99, 102, 241, 0.08), transparent);
}

.page-config-medico .site-layout > main,
.page-config-medico > main {
    position: relative;
    z-index: 1;
}

.cfgm-main {
    padding-top: 1.25rem;
    padding-bottom: 2.5rem;
}

.cfgm-toolbar {
    position: relative;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
}

.cfgm-save-ico {
    flex-shrink: 0;
    line-height: 1;
    font-size: 1.1rem;
    margin-top: 1px;
}

.cfgm-switch-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: #f8fafc;
}

.cfgm-switch-card__body {
    flex: 1;
    min-width: 0;
}

.cfgm-switch-card__title {
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    line-height: 1.3;
}

.cfgm-switch-card__hint {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.35rem;
    line-height: 1.35;
}

.cfgm-switch-card__control {
    flex-shrink: 0;
}

.cfgm-tele-switch {
    padding-left: 0 !important;
    min-height: 0 !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.cfgm-tele-switch .form-check-input {
    float: none;
    margin-left: 0 !important;
    margin-top: 0;
    width: 2.75em;
    height: 1.45em;
    cursor: pointer;
}

@media (max-width: 575.98px) {
    .cfgm-switch-card {
        flex-direction: column;
        align-items: stretch;
    }

    .cfgm-tele-switch {
        justify-content: flex-start;
    }
}

.cfgm-preview-card {
    border-radius: 22px;
    background: linear-gradient(165deg, #fff 0%, #fafaff 100%);
    border: 1px solid rgba(124, 58, 237, 0.12);
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.04),
        0 24px 48px -24px rgba(91, 33, 182, 0.18);
    padding: 1.5rem;
    top: 1rem;
}

.cfgm-preview-avatar-wrap {
    width: 96px;
    height: 96px;
    margin: 0 auto 1rem;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #4c1d95, #a78bfa);
    box-shadow: 0 12px 32px -8px rgba(91, 33, 182, 0.45);
    border: 3px solid rgba(255, 255, 255, 0.85);
}

.cfgm-preview-foto {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cfgm-preview-ini {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.06em;
}

.cfgm-preview-nome {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: 0.35rem;
}

.cfgm-preview-crm {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.cfgm-preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}

.cfgm-preview-tags .badge {
    font-weight: 600;
    padding: 0.4em 0.65em;
    border-radius: 999px;
}

.cfgm-toc {
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    padding: 0.65rem 0;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.cfgm-toc a {
    display: block;
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.cfgm-toc a:hover,
.cfgm-toc a:focus {
    color: #5b21b6;
    background: rgba(245, 243, 255, 0.8);
}

.cfgm-toc a.cfgm-toc-active {
    color: #5b21b6;
    border-left-color: #7c3aed;
    background: linear-gradient(90deg, rgba(245, 243, 255, 0.95), transparent);
}

.cfgm-hero-strip {
    border-radius: 20px;
    background: linear-gradient(118deg, #312e81 0%, #5b21b6 38%, #7c3aed 72%, #c4b5fd 160%);
    color: #fff;
    padding: 1.35rem 1.5rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.25rem;
    box-shadow: 0 16px 40px -16px rgba(76, 29, 149, 0.55);
}

.cfgm-hero-strip::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.22) 0%, transparent 42%);
    pointer-events: none;
}

.cfgm-hero-strip > .row {
    position: relative;
    z-index: 1;
}

.cfgm-hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    color: #4c1d95;
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.cfgm-hero-badge i {
    opacity: 0.9;
}

.cfgm-section {
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.035);
    padding: 1.35rem 1.35rem 1.5rem;
    margin-bottom: 1rem;
    scroll-margin-top: 5.5rem;
}

.cfgm-section-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.cfgm-section-ico {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.15), rgba(99, 102, 241, 0.08));
    color: #5b21b6;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.cfgm-section-title {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
}

.cfgm-section-desc {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0.2rem 0 0;
    line-height: 1.35;
}

.cfgm-foto-drop {
    border: 2px dashed rgba(124, 58, 237, 0.28);
    border-radius: 16px;
    padding: 1.25rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(245, 243, 255, 0.5), #fff);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.cfgm-foto-drop:hover,
.cfgm-foto-drop.cfgm-foto-drop--drag {
    border-color: #7c3aed;
    background: rgba(245, 243, 255, 0.85);
}

.cfgm-foto-thumb {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
    margin: 0 auto 0.5rem;
    display: block;
    box-shadow: 0 8px 20px rgba(91, 33, 182, 0.2);
}

.cfgm-input-hint {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.cfgm-section .form-control:focus,
.cfgm-section .form-select:focus {
    border-color: rgba(124, 58, 237, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(124, 58, 237, 0.12);
}

.cfgm-section .form-control.is-invalid,
.cfgm-section .form-select.is-invalid {
    border-color: #dc2626;
}

.theme-high-contrast .cfgm-preview-card,
.theme-high-contrast .cfgm-section,
.theme-high-contrast .cfgm-toc {
    border: 2px solid #0f172a;
    box-shadow: none;
}

.theme-high-contrast .cfgm-hero-strip {
    background: #1e1b4b;
    border: 2px solid #0f172a;
}

.theme-high-contrast .doctor-nav-chip {
    border-color: #64748b;
    background: #fff;
}

.theme-high-contrast .doctor-nav-profile.show,
.theme-high-contrast .doctor-nav-profile:hover {
    background: #fff !important;
    box-shadow: 0 0 0 2px #0f172a;
}

/* ========== Footer global ========== */
.site-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-layout > main {
    flex: 1 0 auto;
}

.site-footer {
    flex-shrink: 0;
    position: relative;
    margin-top: auto;
    background: linear-gradient(168deg, #0f0a1a 0%, #1e1b4b 42%, #312e81 88%, #1e1036 100%);
    color: rgba(255, 255, 255, 0.78);
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.site-footer-glow {
    position: absolute;
    width: min(90vw, 520px);
    height: min(90vw, 520px);
    right: -15%;
    top: -60%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.45) 0%, transparent 68%);
    pointer-events: none;
}

.site-footer .container {
    z-index: 1;
}

.site-footer-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 8px 24px rgba(91, 33, 182, 0.45);
}

.site-footer-brand-text {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    letter-spacing: -0.02em;
}

.site-footer-desc {
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.55;
    max-width: 22rem;
}

.site-footer-icon {
    opacity: 0.55;
}

.site-footer-h {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 1rem;
}

.site-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer-links li {
    margin-bottom: 0.5rem;
}

.site-footer-links a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease, transform 0.15s ease;
    display: inline-block;
}

.site-footer-links a:hover {
    color: #fff;
}

.site-footer-social {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.site-footer-social:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-2px);
}

.site-footer-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.site-footer-meta,
.site-footer-meta a {
    color: rgba(255, 255, 255, 0.45);
}

.site-footer-top {
    color: rgba(255, 255, 255, 0.65) !important;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.site-footer-top:hover {
    color: #fff !important;
}

/* Login: footer fixo ao fim da página */
.site-layout-login {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-layout-login .login-wrap {
    flex: 1 0 auto;
}

.site-footer--login {
    padding-top: 0.5rem;
}

.site-footer--login .site-footer-inner {
    padding: 1.25rem 0;
}

.site-footer--login .site-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1.25rem;
}

.site-footer--login .site-footer-links li {
    margin-bottom: 0;
}

.site-footer--login .site-footer-divider {
    margin: 0.75rem 0 !important;
}

.modal-sucesso-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 10, 26, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: 1rem;
    animation: sucesso-fade-in 0.22s ease;
}

@keyframes sucesso-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-sucesso-content {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow:
        0 2px 4px rgba(15, 23, 42, 0.04),
        0 16px 48px -12px rgba(76, 29, 149, 0.28),
        0 32px 72px -24px rgba(15, 23, 42, 0.16);
    animation: sucesso-slide-up 0.28s cubic-bezier(0.34, 1.48, 0.64, 1);
}

@keyframes sucesso-slide-up {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)  scale(1); }
}

.modal-sucesso-header {
    background: linear-gradient(125deg, #4c1d95 0%, #6d28d9 42%, #7c3aed 78%, #5b21b6 100%);
    position: relative;
    padding: 2rem 1.5rem 2.5rem;
    overflow: hidden;
}

.modal-sucesso-header::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.3;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.15' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.modal-sucesso-icon-wrap {
    position: relative;
    z-index: 1;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: sucesso-pop 0.4s 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes sucesso-pop {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1); }
}

.modal-sucesso-title {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0;
    position: relative;
    z-index: 1;
}

.modal-sucesso-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0.35rem 0 0;
    position: relative;
    z-index: 1;
}

.modal-sucesso-body {
    padding: 1.5rem 1.75rem;
}

.modal-sucesso-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--light-purple);
    color: #5b21b6;
    border: 1px solid #e9d5ff;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    margin-bottom: 1rem;
}

.modal-sucesso-footer {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0 1.75rem 1.75rem;
}

.close-sucesso {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    z-index: 10;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
}

.close-sucesso:hover {
    background: rgba(255, 255, 255, 0.28);
}

.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.google-btn:hover {
    border-color: #c4b5fd;
    background: #fafaff;
    box-shadow: 0 4px 14px -4px rgba(109, 40, 217, 0.15);
}

.btn-concluir {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-family: "Inter", sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 45%, #8b5cf6 100%);
    box-shadow: 0 4px 16px -2px rgba(91, 33, 182, 0.45);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-concluir:hover {
    filter: brightness(1.06);
    box-shadow: 0 8px 24px -4px rgba(91, 33, 182, 0.5);
    transform: translateY(-1px);
}

.btn-concluir:active {
    transform: translateY(0);
}

/*Previsão de No-Show*/
 
/* ── Grid de cards ── */
.noshow-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
 
.noshow-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
 
.noshow-card:hover {
  box-shadow: 0 8px 28px -12px rgba(15, 23, 42, 0.14);
}
 
.noshow-card.noshow-risk-low  { border-left: 4px solid #16a34a; }
.noshow-card.noshow-risk-med  { border-left: 4px solid #d97706; }
.noshow-card.noshow-risk-high { border-left: 4px solid #dc2626; }
 
/* ── Card header ── */
.noshow-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
 
.noshow-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
}
 
.noshow-card-badge.noshow-risk-low  { background: #dcfce7; color: #16a34a; }
.noshow-card-badge.noshow-risk-med  { background: #fef3c7; color: #d97706; }
.noshow-card-badge.noshow-risk-high { background: #fee2e2; color: #dc2626; }
 
.noshow-card-soon {
  font-size: 0.7rem;
  font-weight: 600;
  color: #8b5cf6;
  background: #f5f3ff;
  border: 1px solid #e9d5ff;
  border-radius: 20px;
  padding: 0.2rem 0.55rem;
}
 
.noshow-risk-label { font-size: 0.72rem; font-weight: 600; color: #64748b; }
.noshow-risk-pct   { font-size: 0.8rem;  font-weight: 800; }
 
.noshow-risk-track {
  height: 7px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
}
 
.noshow-risk-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}
 
.noshow-risk-fill.noshow-risk-low  { background: linear-gradient(90deg, #16a34a, #4ade80); }
.noshow-risk-fill.noshow-risk-med  { background: linear-gradient(90deg, #d97706, #fbbf24); }
.noshow-risk-fill.noshow-risk-high { background: linear-gradient(90deg, #dc2626, #f87171); }
 
/* ── Fatores ── */
.noshow-factors-row {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
 
.noshow-factor-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
}
 
.noshow-factor-icon {
  color: #8b5cf6;
  font-size: 1rem;
  margin-top: 1px;
  flex-shrink: 0;
}
 
.noshow-factor-label { font-size: 0.78rem; font-weight: 600; color: #0f172a; }
.noshow-factor-hint  { font-size: 0.7rem;  color: #64748b; line-height: 1.3; }
 
.noshow-profile-factors { display: flex; flex-wrap: wrap; gap: 0.35rem; }
 
.noshow-pfactor-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  display: inline-flex;
  align-items: center;
}
 
/* ── Ações ── */
.noshow-confirmed-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
}
 
.noshow-empty {
  text-align: center;
  padding: 2rem;
}
 
/* ── Lembretes flutuantes ── */
.noshow-reminders-wrap {
  position: fixed;
  top: 5.5rem;
  right: 1rem;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: min(96vw, 380px);
  pointer-events: none;
}
 
.noshow-reminder-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px -12px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  pointer-events: all;
  animation: noshow-slide-in 0.38s cubic-bezier(0.34, 1.48, 0.64, 1) both;
}
 
@keyframes noshow-slide-in {
  from { opacity: 0; transform: translateX(60px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0)    scale(1); }
}
 
@keyframes noshow-slide-out {
  from { opacity: 1; transform: translateX(0)    scale(1); max-height: 400px; }
  to   { opacity: 0; transform: translateX(60px) scale(0.96); max-height: 0; padding: 0; }
}
 
.noshow-reminder-header {
  padding: 0.85rem 1rem 0.65rem;
  color: #fff;
}
 
.noshow-reminder-header--noshow-risk-low  { background: linear-gradient(135deg, #15803d, #16a34a); }
.noshow-reminder-header--noshow-risk-med  { background: linear-gradient(135deg, #b45309, #d97706); }
.noshow-reminder-header--noshow-risk-high { background: linear-gradient(135deg, #b91c1c, #dc2626); }
 
.noshow-reminder-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.5rem;
}
 
.noshow-reminder-bar {
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 99px;
  transition: width 0.6s ease;
}
 
.noshow-reminder-body {
  padding: 0.85rem 1rem;
}
 
@media (max-width: 575.98px) {
  .noshow-cards-grid    { grid-template-columns: 1fr; }
  .noshow-reminders-wrap { right: 0.5rem; left: 0.5rem; max-width: 100%; }
}
/* Trilhas */

/* Banner */
    .trilhas-banner {
      background: linear-gradient(125deg, #1e3a5f 0%, #1d4ed8 45%, #3b82f6 80%, #1e40af 100%);
      box-shadow: 0 16px 48px -20px rgba(29, 78, 216, 0.45);
    }

    /* Info callout */
    .trilhas-info-box {
      background: #eff6ff;
      border-left: 4px solid #3b82f6 !important;
    }
    .trilhas-info-icon { color: #3b82f6; }

    /* Card base */
    .trilha-card { transition: box-shadow 0.2s ease; }
    .trilha-card:hover { box-shadow: 0 12px 32px -12px rgba(0,0,0,0.15) !important; }

    /* Icons */
    .trilha-icon {
      width: 48px; height: 48px;
      border-radius: 14px;
      display: flex; align-items: center; justify-content: center;
      font-size: 1.4rem;
    }
    .trilha-icon--rosa  { background: #fce7f3; color: #db2777; }
    .trilha-icon--azul  { background: #dbeafe; color: #2563eb; }
    .trilha-icon--verde { background: #d1fae5; color: #059669; }
    .trilha-icon--amber { background: #fef3c7; color: #d97706; }

    /* Badges */
    .trilha-badge { font-size: .7rem; font-weight: 600; }
    .trilha-badge--rosa  { background: #fce7f3; color: #be185d; }
    .trilha-badge--azul  { background: #dbeafe; color: #1d4ed8; }
    .trilha-badge--verde { background: #d1fae5; color: #065f46; }
    .trilha-badge--amber { background: #fef3c7; color: #92400e; }

    /* Progress ring */
    .trilha-progress-ring { position: relative; width: 52px; height: 52px; }
    .trilha-ring-label {
      position: absolute; inset: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: .65rem; font-weight: 700; color: #374151;
    }

    /* Steps list */
    .trilha-ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; }

    .trilha-step {
      display: flex; align-items: flex-start; gap: .65rem;
      padding: .55rem .75rem;
      border-radius: 10px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      transition: background .18s, border-color .18s;
    }
    .trilha-step--gate  { background: #fff; border-color: #cbd5e1; }
    .trilha-step--return { border-style: dashed; }

    .trilha-step label {
      flex: 1; font-size: .875rem; line-height: 1.4;
      cursor: pointer; user-select: none;
      display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
    }

    /* Checkbox base */
    .trilha-chk {
      width: 1.1rem; height: 1.1rem; flex-shrink: 0;
      border-radius: 6px; cursor: pointer;
      accent-color: #8b5cf6;
      margin-top: .1rem;
    }
    .trilha-chk--rosa:checked  { accent-color: #ec4899; }
    .trilha-chk--azul:checked  { accent-color: #3b82f6; }
    .trilha-chk--verde:checked { accent-color: #10b981; }
    .trilha-chk--amber:checked { accent-color: #f59e0b; }

    /* Locked state */
    .trilha-chk--locked { opacity: .35; cursor: not-allowed; }
    .trilha-step:has(.trilha-chk--locked) { opacity: .6; }
    .trilha-step:has(.trilha-chk--locked) label { cursor: not-allowed; color: #94a3b8; }

    /* Done state */
    .trilha-step--done { background: #f0fdf4 !important; border-color: #bbf7d0 !important; }
    .trilha-step--done label { text-decoration: line-through; color: #6b7280; }

    /* Gate badge */
    .trilha-gate-badge {
      display: inline-flex; align-items: center;
      font-size: .65rem; font-weight: 600;
      padding: .2rem .5rem; border-radius: 6px;
      background: #fef3c7; color: #92400e;
      white-space: nowrap; flex-shrink: 0;
    }
    .trilha-gate-badge--azul  { background: #dbeafe; color: #1d4ed8; }
    .trilha-gate-badge--verde { background: #d1fae5; color: #065f46; }
    .trilha-gate-badge--amber { background: #fef3c7; color: #92400e; }

    /* Age tag */
    .trilha-age-tag {
      font-size: .65rem; font-weight: 600; padding: .1rem .4rem;
      border-radius: 5px; background: #fce7f3; color: #be185d;
    }
    .trilha-age-tag--azul { background: #dbeafe; color: #1d4ed8; }

    /* Selo */
    .trilha-selo {
      font-size: .8rem; font-weight: 700;
      color: #059669; background: #d1fae5;
      padding: .3rem .75rem; border-radius: 20px;
      animation: seloIn .4s cubic-bezier(.22,1,.36,1) both;
    }
    @keyframes seloIn {
      from { transform: scale(.7); opacity: 0; }
      to   { transform: scale(1);  opacity: 1; }
    }

    /* Sub-step indent */
    .trilha-step--sub { margin-left: 1.25rem; }

    /* ── Etapa detectada automaticamente ── */
    .trilha-step--auto {
      border-color: #a5b4fc !important;
      background: #f5f3ff !important;
    }
    .trilha-step--auto.trilha-step--done {
      background: #f0fdf4 !important;
      border-color: #bbf7d0 !important;
    }

    /* Badge "detectado auto" inline na etapa */
    .trilha-auto-badge {
      display: inline-flex; align-items: center;
      font-size: .6rem; font-weight: 600;
      padding: .15rem .45rem; border-radius: 5px;
      background: #ede9fe; color: #6d28d9;
      white-space: nowrap; flex-shrink: 0;
      margin-left: auto;
    }

    /* ── Painel de histórico detectado ── */
    .trilha-historico-panel {
      border-top: 1px solid #e2e8f0;
      padding-top: .75rem !important;
    }
    .trilha-hist-header {
      display: flex; align-items: center; gap: .4rem;
      font-size: .75rem; font-weight: 600; color: #6d28d9;
      margin-bottom: 0;
    }
    .trilha-hist-toggle {
      margin-left: auto; background: none; border: none; padding: 0;
      color: #6d28d9; cursor: pointer; line-height: 1;
      transition: transform .2s;
    }
    .trilha-hist-toggle:hover { color: #4c1d95; }
    .trilha-hist-body {
      margin-top: .5rem;
      display: flex; flex-direction: column; gap: .35rem;
    }
    .trilha-hist-row {
      display: flex; align-items: center; justify-content: space-between; gap: .5rem;
      padding: .4rem .6rem; border-radius: 8px;
      background: #faf5ff; border: 1px solid #e9d5ff;
      font-size: .78rem;
    }
    .trilha-hist-info { display: flex; flex-direction: column; min-width: 0; }
    .trilha-hist-medico { font-weight: 600; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .trilha-hist-esp { color: #9ca3af; font-size: .7rem; }
    .trilha-hist-badge {
      font-size: .65rem; font-weight: 700; padding: .2rem .5rem;
      border-radius: 5px; white-space: nowrap; flex-shrink: 0;
    }
    .trilha-hist-badge--realizada  { background: #d1fae5; color: #065f46; }
    .trilha-hist-badge--cancelada  { background: #fee2e2; color: #991b1b; }
    .trilha-hist-badge--proxima    { background: #dbeafe; color: #1d4ed8; }

/* ==========================================
   ACESSIVILIDADE: Foco Visível & Alto Contraste (WCAG 2.1 AA)
   ========================================== */
:focus-visible {
    outline: 3px solid #7c3aed !important; /* Roxo/Violeta de alto contraste */
    outline-offset: 3px !important;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.35) !important;
}

/* Garante contraste nos botões e links de navegação no foco */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
.trilha-chk:focus-visible {
    outline: 3px solid #7c3aed !important;
    outline-offset: 2px !important;
}

/* Foco visível específico para Alto Contraste */
.theme-high-contrast :focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px #000000 !important;
}