:root {
    --agenda-bg: #f5f7fb;
    --agenda-surface: #ffffff;
    --agenda-primary: #2454d6;
    --agenda-primary-dark: #173a9a;
    --agenda-sidebar: #111827;
    --agenda-sidebar-2: #0b1220;
    --agenda-text: #182033;
    --agenda-muted: #6b7280;
    --agenda-border: #e5e7eb;
    --agenda-shadow: 0 18px 50px rgba(15, 23, 42, .08);
    --agenda-radius: 18px;
    --sidebar-width: 264px;
    --sidebar-collapsed: 78px;
    --topbar-height: 64px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body.agenda-layout {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--agenda-bg);
    color: var(--agenda-text);
    overflow-x: hidden;
}

.app-shell { min-height: 100vh; }

.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--topbar-height);
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid rgba(226, 232, 240, .85);
    backdrop-filter: blur(14px);
    transition: left .25s ease;
}

body.sidebar-collapsed .topbar { left: var(--sidebar-collapsed); }

.btn-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--agenda-border);
    background: #fff;
    color: var(--agenda-text);
}

.topbar-title { line-height: 1.1; }
.topbar-title strong { display: block; font-size: 1rem; }
.app-kicker { display: block; font-size: .72rem; color: var(--agenda-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.main-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--agenda-sidebar), var(--agenda-sidebar-2));
    color: #fff;
    transition: width .25s ease, transform .25s ease;
    box-shadow: 16px 0 42px rgba(15, 23, 42, .18);
}

.brand-link {
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    font-weight: 800;
    letter-spacing: -.02em;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .12);
}

.sidebar-nav { padding: 14px 10px; overflow-y: auto; flex: 1; }
.sidebar-footer { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }

.main-sidebar .nav-link {
    height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 14px;
    padding: 0 14px;
    margin-bottom: 5px;
    color: rgba(255,255,255,.76);
    text-decoration: none;
    font-weight: 650;
    transition: .18s ease;
}

.main-sidebar .nav-link:hover,
.main-sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,.12);
}

.main-sidebar .nav-link.danger { color: #fecaca; }
.main-sidebar .nav-icon { width: 22px; text-align: center; }

.content-wrapper {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: calc(var(--topbar-height) + 22px) 26px 34px;
    transition: margin-left .25s ease;
}

body.sidebar-collapsed .main-sidebar { width: var(--sidebar-collapsed); }
body.sidebar-collapsed .content-wrapper { margin-left: var(--sidebar-collapsed); }
body.sidebar-collapsed .main-sidebar .menu-label,
body.sidebar-collapsed .main-sidebar .brand-text,
body.sidebar-collapsed .main-sidebar #badge-lembretes { display: none !important; }
body.sidebar-collapsed .main-sidebar .brand-link,
body.sidebar-collapsed .main-sidebar .nav-link { justify-content: center; padding-inline: 0; }

.page-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.page-title { margin: 0; font-weight: 850; letter-spacing: -.045em; }
.page-subtitle { color: var(--agenda-muted); margin: 6px 0 0; }

.agenda-card {
    background: var(--agenda-surface);
    border: 1px solid rgba(226,232,240,.85);
    border-radius: var(--agenda-radius);
    box-shadow: var(--agenda-shadow);
}

.metric-card {
    padding: 18px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-label { color: var(--agenda-muted); font-size: .88rem; font-weight: 700; }
.metric-value { font-size: 2rem; font-weight: 850; letter-spacing: -.05em; line-height: 1; }
.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #eef2ff;
    color: var(--agenda-primary);
}

.filter-bar {
    padding: 16px;
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekday {
    text-align: center;
    color: var(--agenda-muted);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.calendar-day {
    min-height: 94px;
    border: 1px solid var(--agenda-border);
    border-radius: 16px;
    background: #fff;
    padding: 8px;
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: .18s ease;
}

.calendar-day:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(15, 23, 42, .08); }
.calendar-day.outside { opacity: .42; background: #f8fafc; }
.calendar-day.today { border-color: var(--agenda-primary); box-shadow: inset 0 0 0 1px var(--agenda-primary); }
.calendar-day.selected { background: #eef2ff; border-color: #c7d2fe; }
.day-number { font-weight: 850; font-size: .94rem; }
.day-events { display: flex; flex-direction: column; gap: 4px; }
.day-pill { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 999px; padding: 2px 7px; font-size: .68rem; font-weight: 800; }
.day-more { color: var(--agenda-muted); font-size: .68rem; font-weight: 800; }

.compromisso-card {
    position: relative;
    padding: 16px 16px 14px;
    border: 1px solid var(--agenda-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
    overflow: hidden;
}

.compromisso-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--priority-color, #f59e0b);
}

.priority-alta { --priority-color: #dc2626; }
.priority-media { --priority-color: #f59e0b; }
.priority-baixa { --priority-color: #16a34a; }

.compromisso-title { font-weight: 800; margin: 0; letter-spacing: -.02em; }
.compromisso-meta { color: var(--agenda-muted); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 10px; }
.compromisso-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.badge-soft { border-radius: 999px; padding: 6px 10px; font-weight: 800; font-size: .72rem; }
.badge-priority-alta { background: #fee2e2; color: #991b1b; }
.badge-priority-media { background: #fef3c7; color: #92400e; }
.badge-priority-baixa { background: #dcfce7; color: #166534; }
.badge-status-concluido { background: #dcfce7; color: #166534; }
.badge-status-pendente { background: #e0f2fe; color: #075985; }

.form-shell { max-width: 940px; margin-inline: auto; }
.form-card { padding: 22px; }

.fab-mobile {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    box-shadow: 0 18px 36px rgba(37, 99, 235, .32);
}

.empty-state {
    padding: 34px 20px;
    text-align: center;
    color: var(--agenda-muted);
}

.empty-state i { font-size: 2.4rem; color: #cbd5e1; margin-bottom: 12px; }

@media (max-width: 991.98px) {
    .topbar { left: 0; padding-inline: 14px; }
    body.sidebar-collapsed .topbar { left: 0; }
    .main-sidebar { transform: translateX(-105%); width: var(--sidebar-width); }
    body.sidebar-expanded .main-sidebar { transform: translateX(0); }
    body.sidebar-collapsed .main-sidebar { width: var(--sidebar-width); }
    body.sidebar-collapsed .main-sidebar .menu-label,
    body.sidebar-collapsed .main-sidebar .brand-text,
    body.sidebar-collapsed .main-sidebar #badge-lembretes { display: inline !important; }
    body.sidebar-collapsed .main-sidebar .brand-link,
    body.sidebar-collapsed .main-sidebar .nav-link { justify-content: flex-start; padding-inline: 14px; }
    .content-wrapper, body.sidebar-collapsed .content-wrapper { margin-left: 0; padding: calc(var(--topbar-height) + 16px) 14px 90px; }
    .page-hero { grid-template-columns: 1fr; }
    .calendar-day { min-height: 78px; border-radius: 13px; padding: 7px; }
    .calendar-weekday { font-size: .68rem; }
    .day-pill { display: none; }
    .day-more { font-size: .64rem; }
    .fab-mobile { display: inline-flex; }
}

@media (max-width: 575.98px) {
    .metric-card { min-height: 100px; padding: 15px; }
    .metric-value { font-size: 1.65rem; }
    .filter-bar { padding: 14px; }
    .calendar-grid { gap: 5px; }
    .calendar-day { min-height: 58px; padding: 5px; border-radius: 10px; }
    .day-number { font-size: .82rem; }
    .compromisso-card { padding: 15px 12px 14px 15px; }
    .compromisso-actions .btn { flex: 1 1 auto; }
    .topbar-title strong { font-size: .92rem; }
}

/* Agenda Profissional v3 - PWA/mobile refinado */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.mobile-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 1060;
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
    backdrop-filter: blur(16px);
}

.bottom-nav-item {
    min-width: 0;
    border: 0;
    background: transparent;
    color: #64748b;
    text-decoration: none;
    border-radius: 18px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: .69rem;
    font-weight: 800;
}

.bottom-nav-item i { font-size: 1rem; }
.bottom-nav-item.active { color: var(--agenda-primary); background: #eef2ff; }
.bottom-nav-create { color: #fff; background: var(--agenda-primary); }
.bottom-nav-create.active, .bottom-nav-create:hover { color: #fff; background: var(--agenda-primary-dark); }
.bottom-nav-button { cursor: pointer; }

.alerta-profissional {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    border: 1px solid #fed7aa;
    background: linear-gradient(135deg, #fff7ed, #ffffff);
    border-radius: 18px;
    padding: 14px;
}

.alerta-profissional .alerta-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #9a3412;
    background: #ffedd5;
}

.pwa-hint {
    border: 1px dashed #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    border-radius: 18px;
    padding: 14px;
}

.quick-reminder-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-reminder-grid .btn {
    border-radius: 999px;
    font-weight: 800;
}

.priority-scale {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.priority-scale .priority-option {
    border: 1px solid var(--agenda-border);
    border-radius: 16px;
    padding: 10px;
    background: #fff;
}

.priority-option strong { display: block; font-size: .85rem; }
.priority-option small { color: var(--agenda-muted); }

.notification-center-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (display-mode: standalone) {
    #agendaInstallButton,
    #agendaInstallBottom { display: none !important; }
}

@media (max-width: 991.98px) {
    .mobile-bottom-nav { display: grid; }
    .fab-mobile { bottom: 94px; }
    .content-wrapper, body.sidebar-collapsed .content-wrapper { padding-bottom: 116px; }
    .topbar-actions .btn[title="Sair"] { display: none; }
}

@media (max-width: 575.98px) {
    .priority-scale { grid-template-columns: 1fr; }
    .topbar-actions { gap: 5px; }
    #agendaInstallButton { padding-inline: 9px; }
}


/* Agenda Profissional v4 - Mobile sem sidebar/menu lateral */
@media (max-width: 991.98px) {
    body.agenda-layout {
        --topbar-height: 60px;
    }

    .main-sidebar,
    .sidebar-backdrop,
    #sidebarToggle {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .topbar,
    body.sidebar-collapsed .topbar,
    body.sidebar-expanded .topbar {
        left: 0 !important;
        right: 0 !important;
        padding-inline: 14px;
        justify-content: space-between;
    }

    .topbar-title {
        min-width: 0;
    }

    .topbar-title strong {
        max-width: 44vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-actions {
        margin-left: 8px;
    }

    .content-wrapper,
    body.sidebar-collapsed .content-wrapper,
    body.sidebar-expanded .content-wrapper {
        margin-left: 0 !important;
        padding: calc(var(--topbar-height) + 14px) 12px calc(112px + env(safe-area-inset-bottom));
    }

    .page-hero {
        margin-bottom: 16px;
    }

    .page-hero > .d-flex {
        width: 100%;
    }

    .page-hero > .d-flex .btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .mobile-bottom-nav {
        display: grid !important;
    }

    .mobile-install-pill {
        position: fixed;
        left: 50%;
        bottom: calc(86px + env(safe-area-inset-bottom));
        transform: translateX(-50%);
        z-index: 1070;
        border: 0;
        border-radius: 999px;
        padding: 10px 16px;
        color: #fff;
        background: var(--agenda-primary);
        box-shadow: 0 18px 44px rgba(37, 99, 235, .35);
        font-weight: 800;
    }

    .mobile-install-pill.d-none {
        display: none !important;
    }

    .fab-mobile {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .topbar-actions .btn:not([title="Sair"]):not(#agendaInstallButton) {
        display: none !important;
    }

    #agendaInstallButton {
        max-width: 42px;
        overflow: hidden;
        padding-inline: 12px;
    }

    #agendaInstallButton i {
        margin: 0 !important;
    }

    #agendaInstallButton {
        font-size: 0;
    }

    #agendaInstallButton i {
        font-size: .95rem;
    }

    .page-title {
        font-size: 1.45rem;
    }

    .page-subtitle {
        font-size: .9rem;
    }
}

/* v4 fix: manter logout acessivel no mobile sem depender de sidebar */
@media (max-width: 991.98px) {
    .topbar-actions .btn[title="Sair"] {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* v4.1 - Usuários responsivo sem dependência de DataTables */
.mobile-user-card {
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 18px;
    padding: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.min-w-0 {
    min-width: 0;
}

/* v4.3 - Tela de distribuição do Agendamobily */
.app-install-hero .btn {
    border-radius: 14px;
    font-weight: 800;
}

.app-distribution-card {
    padding: 18px;
}

.app-distribution-card h2 {
    font-size: 1.08rem;
    font-weight: 850;
    letter-spacing: -.025em;
    margin-bottom: 8px;
}

.app-distribution-card p {
    color: var(--agenda-muted);
}

.app-step-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.app-link-box,
.app-code {
    border: 1px solid var(--agenda-border);
    border-radius: 14px;
    padding: 11px 12px;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 800;
    word-break: break-all;
}

.install-platform-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.install-platform-card {
    border: 1px solid var(--agenda-border);
    border-radius: 18px;
    padding: 15px;
    background: #fff;
}

.install-platform-card h3 {
    font-size: 1rem;
    font-weight: 850;
    margin-bottom: 10px;
}

.install-platform-card ol {
    padding-left: 18px;
    margin-bottom: 0;
    color: var(--agenda-muted);
}

.install-platform-card li + li {
    margin-top: 6px;
}

.checklist-grid span {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--agenda-border);
    background: #fff;
    border-radius: 14px;
    padding: 10px 12px;
    font-weight: 800;
}

.checklist-grid i {
    color: var(--agenda-primary);
}

@media (max-width: 991.98px) {
    .mobile-bottom-nav {
        grid-template-columns: repeat(5, 1fr);
    }

    .bottom-nav-item {
        padding: 7px 4px;
        font-size: .64rem;
    }

    .bottom-nav-item i {
        font-size: .95rem;
    }
}

@media (max-width: 575.98px) {
    .app-distribution-card {
        padding: 15px;
        border-radius: 18px;
    }

    .install-platform-grid {
        grid-template-columns: 1fr;
    }

    .app-install-hero .d-flex {
        width: 100%;
    }

    .app-install-hero .btn {
        width: 100%;
        justify-content: center;
    }
}

/* v4.4 - Mobile aprovado: sem sidebar, rodape Hoje/Agenda/+/Lembretes/Perfil */
@media (max-width: 991.98px) {
    body.agenda-layout {
        background: #f7f8fc;
    }

    .mobile-home-hero {
        padding: 4px 2px 0;
    }

    .mobile-home-hero .page-title {
        font-size: 1.55rem;
        letter-spacing: -.04em;
    }

    .mobile-bottom-nav.app-mobile-nav {
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        display: grid !important;
        grid-template-columns: 1fr 1fr 70px 1fr 1fr;
        align-items: center;
        gap: 4px;
        padding: 8px 10px;
        border-radius: 28px;
        background: rgba(255,255,255,.96);
    }

    .app-mobile-nav .bottom-nav-item {
        min-height: 48px;
        border-radius: 18px;
        color: #64748b;
    }

    .app-mobile-nav .bottom-nav-item.active:not(.bottom-nav-create) {
        background: #eef2ff;
        color: var(--agenda-primary);
    }

    .app-mobile-nav .bottom-nav-create {
        width: 60px;
        height: 60px;
        min-height: 60px;
        margin: -26px auto 0;
        border-radius: 999px;
        color: #fff;
        background: linear-gradient(135deg, #2454d6, #5735e8);
        box-shadow: 0 18px 34px rgba(37, 84, 214, .34);
    }

    .app-mobile-nav .bottom-nav-create i {
        font-size: 1.2rem;
    }

    .app-mobile-nav .bottom-nav-create span {
        display: none;
    }

    .metric-card {
        border-radius: 20px;
        box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
    }

    .agenda-card {
        border-radius: 22px;
        box-shadow: 0 14px 36px rgba(15, 23, 42, .07);
    }

    .filter-bar {
        display: none;
    }

    #agenda {
        scroll-margin-top: 76px;
    }

    #hoje {
        scroll-margin-top: 76px;
    }
}

@media (max-width: 575.98px) {
    .mobile-bottom-nav.app-mobile-nav {
        grid-template-columns: 1fr 1fr 62px 1fr 1fr;
        left: 8px;
        right: 8px;
        padding-inline: 7px;
    }

    .app-mobile-nav .bottom-nav-item {
        font-size: .62rem;
        padding-inline: 3px;
    }

    .app-mobile-nav .bottom-nav-create {
        width: 56px;
        height: 56px;
        min-height: 56px;
    }

    .calendar-day {
        min-height: 54px;
    }
}

.profile-avatar {
    object-fit: cover;
    border: 4px solid #eef2ff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .12);
}

.profile-mobile-card {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

/* v4.5 - Tela principal mobile em linha do tempo */
.daily-app-screen {
    max-width: 980px;
    margin: 0 auto 22px;
}

.daily-app-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.daily-kicker {
    display: block;
    color: #8a94a8;
    font-weight: 800;
    font-size: .88rem;
    margin-bottom: 4px;
}

.daily-date-block h1 {
    margin: 0;
    color: #08122b;
    font-size: clamp(1.8rem, 6vw, 3rem);
    line-height: 1.02;
    font-weight: 900;
    letter-spacing: -.055em;
}

.daily-header-actions {
    display: flex;
    gap: 10px;
}

.daily-action-button {
    position: relative;
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(226, 232, 240, .85);
    border-radius: 18px;
    color: var(--agenda-primary);
    background: #fff;
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(15, 23, 42, .06);
}

.daily-alert-dot {
    position: absolute;
    top: -5px;
    right: -4px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: 99px;
    background: #ef4444;
    color: #fff;
    font-size: .66rem;
    font-weight: 900;
    border: 2px solid #fff;
}

.filter-bar-mobile {
    display: block;
    margin: 0 0 16px;
}

.day-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(74px, 1fr);
    gap: 12px;
    overflow-x: auto;
    padding: 4px 2px 16px;
    scrollbar-width: none;
}

.day-strip::-webkit-scrollbar { display: none; }

.day-chip {
    min-height: 82px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: 22px;
    color: #5f6a82;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .045);
}

.day-chip span {
    font-size: .78rem;
    font-weight: 800;
}

.day-chip strong {
    font-size: 1.45rem;
    line-height: 1;
    color: #111c35;
    letter-spacing: -.04em;
}

.day-chip.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(145deg, #2454d6, #5b35ee);
    box-shadow: 0 18px 36px rgba(37, 84, 214, .33);
}

.day-chip.active strong { color: #fff; }
.day-chip.is-today:not(.active) { border-color: #c7d2fe; background: #f8faff; }

.daily-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 0 0 14px;
}

.daily-summary-strip div {
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, .9);
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .045);
}

.daily-summary-strip strong {
    font-size: 1.32rem;
    line-height: 1;
    font-weight: 900;
    color: #111c35;
}

.daily-summary-strip span {
    color: #6d768b;
    font-size: .68rem;
    font-weight: 850;
}

.daily-summary-strip .danger strong,
.daily-summary-strip .danger span { color: #dc2626; }

.next-focus-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, .88);
    border-radius: 24px;
    padding: 16px 16px 16px 19px;
    margin: 0 0 16px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .07);
}

.next-focus-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--priority-color, #f59e0b);
}

.next-focus-card span,
.next-focus-card small {
    display: block;
    color: #717b90;
    font-weight: 750;
}

.next-focus-card strong {
    display: block;
    color: #101b35;
    font-size: 1.05rem;
    font-weight: 900;
    margin: 2px 0;
}

.next-focus-card a {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 8px 13px;
    color: var(--agenda-primary);
    background: #eef2ff;
    font-weight: 900;
    text-decoration: none;
}

.timeline-panel {
    padding: 18px;
}

.timeline-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.timeline-heading h2 {
    margin: 0;
    color: #101b35;
    font-size: 1.05rem;
    font-weight: 900;
}

.timeline-heading p {
    margin: 3px 0 0;
    color: #79849a;
    font-weight: 700;
    font-size: .86rem;
}

.timeline-list {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0 4px;
}

.timeline-list::before {
    content: '';
    position: absolute;
    left: 82px;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: #e3e8f2;
}

.timeline-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    position: relative;
}

.timeline-row::before {
    content: '';
    position: absolute;
    left: 78px;
    top: 32px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--priority-color, #f59e0b);
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(226,232,240,.9);
    z-index: 1;
}

.time-label {
    color: #697389;
    font-size: 1rem;
    font-weight: 850;
    padding-top: 22px;
    font-variant-numeric: tabular-nums;
}

.timeline-event-card {
    position: relative;
    min-height: 118px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 14px;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 24px;
    padding: 17px 16px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .075);
    overflow: hidden;
}

.timeline-event-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--priority-color, #f59e0b);
}

.timeline-event-card.status-concluido {
    opacity: .76;
}

.event-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: #2454d6;
    background: #eef2ff;
    font-size: 1.05rem;
}

.event-icon.category-trabalho { color: #2454d6; background: #eef2ff; }
.event-icon.category-pessoal { color: #7c3aed; background: #f3e8ff; }
.event-icon.category-estudos { color: #ca8a04; background: #fef9c3; }
.event-icon.category-outros { color: #0891b2; background: #cffafe; }

.event-title-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.event-title-line h3 {
    margin: 0;
    color: #0e1933;
    font-size: 1.05rem;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: -.03em;
}

.event-status {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 5px 8px;
    font-size: .64rem;
    line-height: 1;
    font-weight: 900;
}

.event-status.pendente { color: #075985; background: #e0f2fe; }
.event-status.concluido { color: #166534; background: #dcfce7; }

.event-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 10px 0 0;
    color: #6d778d;
    font-size: .82rem;
    font-weight: 750;
}

.event-meta-line i { margin-right: 5px; color: var(--priority-color, #2454d6); }

.event-content p {
    margin: 9px 0 0;
    color: #5d687f;
    font-size: .88rem;
    line-height: 1.45;
}

.event-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
}

.event-actions-row form { margin: 0; }

.event-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    padding: 7px 11px;
    color: #2454d6;
    background: #eef2ff;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 900;
}

.event-action.success { color: #166534; background: #dcfce7; }
.event-action.whatsapp { color: #087b36; background: #dcfce7; }

.timeline-now-row {
    position: relative;
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-height: 26px;
}

.timeline-now-row .time-label.now {
    padding: 0;
    color: var(--agenda-primary);
    font-weight: 950;
}

.now-dot {
    position: absolute;
    left: 77px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--agenda-primary);
    border: 3px solid #fff;
    z-index: 2;
}

.now-line {
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--agenda-primary), #6d5df7);
}

.available-slot {
    margin-left: 90px;
    min-height: 64px;
    display: grid;
    place-items: center;
    border: 2px dashed #d7deeb;
    border-radius: 22px;
    color: #8a94a8;
    background: rgba(255, 255, 255, .65);
    text-decoration: none;
    font-weight: 900;
}

.available-slot i { margin-right: 8px; }
.available-slot.big-slot { margin-left: 0; min-height: 110px; }

.monthly-section {
    max-width: 980px;
    margin: 0 auto 22px;
    padding: 18px;
    scroll-margin-top: 84px;
}

.support-section {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 991.98px) {
    .topbar {
        display: none !important;
    }

    .content-wrapper,
    body.sidebar-collapsed .content-wrapper,
    body.sidebar-expanded .content-wrapper {
        padding: calc(18px + env(safe-area-inset-top)) 14px calc(112px + env(safe-area-inset-bottom));
    }

    .daily-app-screen,
    .monthly-section,
    .support-section {
        max-width: 100%;
    }

    .daily-app-header {
        margin-top: 2px;
    }

    .daily-date-block h1 {
        font-size: 1.72rem;
    }

    .daily-action-button {
        width: 44px;
        height: 44px;
        border-radius: 16px;
    }

    .day-strip {
        margin-inline: -2px;
        grid-auto-columns: 76px;
    }

    .timeline-panel,
    .monthly-section {
        padding: 15px;
        border-radius: 26px;
    }

    .timeline-list::before {
        left: 70px;
    }

    .timeline-row,
    .timeline-now-row {
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 14px;
    }

    .timeline-row::before {
        left: 66px;
    }

    .now-dot {
        left: 65px;
    }

    .time-label {
        font-size: .96rem;
    }

    .timeline-event-card {
        grid-template-columns: 1fr;
        gap: 10px;
        min-height: unset;
        padding: 16px 14px 15px 16px;
    }

    .event-icon {
        width: 44px;
        height: 44px;
        border-radius: 16px;
    }

    .event-title-line {
        flex-direction: column;
        gap: 7px;
    }

    .event-status {
        width: fit-content;
    }

    .available-slot {
        margin-left: 76px;
    }

    .calendar-day {
        min-height: 70px;
    }
}

@media (max-width: 575.98px) {
    body.agenda-layout {
        background: linear-gradient(180deg, #ffffff 0%, #f7f8fc 34%, #f7f8fc 100%);
    }

    .daily-app-screen {
        margin-bottom: 18px;
    }

    .daily-app-header {
        gap: 10px;
    }

    .daily-date-block h1 {
        font-size: 1.55rem;
    }

    .daily-kicker {
        font-size: .78rem;
    }

    .daily-header-actions {
        gap: 7px;
    }

    .daily-action-button {
        width: 41px;
        height: 41px;
        border-radius: 15px;
    }

    .day-strip {
        grid-auto-columns: 66px;
        gap: 10px;
        padding-bottom: 13px;
    }

    .day-chip {
        min-height: 72px;
        border-radius: 19px;
    }

    .day-chip strong {
        font-size: 1.25rem;
    }

    .daily-summary-strip {
        gap: 6px;
    }

    .daily-summary-strip div {
        min-height: 62px;
        border-radius: 17px;
    }

    .daily-summary-strip strong {
        font-size: 1.12rem;
    }

    .daily-summary-strip span {
        font-size: .6rem;
    }

    .next-focus-card {
        border-radius: 21px;
        padding: 14px 13px 14px 17px;
    }

    .timeline-panel,
    .monthly-section {
        margin-inline: -2px;
        padding: 14px 12px;
        border-radius: 24px;
    }

    .timeline-heading h2 {
        font-size: 1rem;
    }

    .timeline-list {
        gap: 14px;
    }

    .timeline-list::before {
        left: 62px;
    }

    .timeline-row,
    .timeline-now-row {
        grid-template-columns: 54px minmax(0, 1fr);
        gap: 12px;
    }

    .timeline-row::before {
        left: 58px;
        top: 28px;
    }

    .now-dot {
        left: 57px;
    }

    .time-label {
        font-size: .88rem;
        padding-top: 20px;
    }

    .timeline-event-card {
        border-radius: 21px;
        padding: 15px 12px 14px 15px;
        box-shadow: 0 14px 32px rgba(15, 23, 42, .065);
    }

    .event-title-line h3 {
        font-size: .98rem;
    }

    .event-meta-line {
        font-size: .76rem;
    }

    .event-content p {
        font-size: .82rem;
    }

    .event-actions-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .event-actions-row form,
    .event-action {
        width: 100%;
    }

    .event-action {
        justify-content: center;
        padding-inline: 8px;
    }

    .available-slot {
        margin-left: 66px;
        min-height: 56px;
        border-radius: 18px;
        font-size: .86rem;
    }
}
