﻿.page-wrap {
    position: relative;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.app-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: 60px;
    flex-shrink: 0;
    background: var(--surface, #fff);
    border-bottom: 1px solid var(--border, #e5e7eb);
}

    .app-bar .appbar-menu-btn,
    .app-bar .appbar-icon-button {
        color: var(--text-primary, #111827);
    }

        .app-bar .appbar-icon-button:hover {
            background: var(--surface-subtle, rgba(0,0,0,0.05));
        }

    .app-bar .appbar-user-trigger {
        border-color: var(--border, #e5e7eb);
    }

        .app-bar .appbar-user-trigger:hover {
            border-color: var(--primary, #325bb3);
            box-shadow: 0 0 0 3px rgba(50, 91, 179, 0.18);
        }

    .app-bar .appbar-user-avatar-initial {
        background: var(--primary, #325bb3);
    }

.appbar-spacer {
    flex: 1;
}

.appbar-menu-btn {
    background: transparent;
    border: none;
    border-radius: 999px;
    color: var(--text-primary, #111827);
    font-size: 1.3rem;
    cursor: pointer;
    width: 38px;
    height: 38px;
    margin-right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

    .appbar-menu-btn:hover {
        background: var(--surface-subtle, rgba(0,0,0,0.05));
    }

.appbar-logo {
    display: none;
    height: 32px;
    width: auto;
    margin-right: 12px;
}

.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.app-drawer {
    flex: 0 0 280px;
    min-width: 0;
    overflow: hidden;
    background: var(--nav-bg, #fff);
    border-right: 1px solid var(--border, #e5e7eb);
    transition: flex-basis 0.2s ease, padding 0.2s ease;
    position: relative;
}

    .app-drawer.closed {
        flex-basis: 0;
        padding: 0;
    }

.app-right {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.app-content {
    container: layout / inline-size;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 70px;
}

@media (max-width: 768px) {
    .app-drawer {
        display: none !important;
    }

    .appbar-menu-btn {
        display: none !important;
    }

    .appbar-logo {
        display: block;
    }
}

@media (max-width: 480px) {
    .app-bar {
        gap: 6px;
        padding: 0 10px;
    }

    .appbar-credit-label {
        display: none;
    }

    .appbar-credit-pill {
        gap: 0;
        margin-right: 2px;
        padding: 8px;
    }

    .appbar-theme-toggle {
        display: none !important;
    }

    .appbar-user-dropdown-item.appbar-theme-toggle-item {
        display: flex;
    }
}

@keyframes navFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes navDotBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.appbar-user-menu {
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.appbar-user-trigger {
    background: none;
    border: 2px solid var(--border, #e5e7eb);
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 50%;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 36px;
    height: 36px;
}

    .appbar-user-trigger:hover {
        border-color: var(--primary, #325bb3);
        box-shadow: 0 0 0 3px rgba(50, 91, 179, 0.18);
    }

.appbar-user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.appbar-user-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    width: 100%;
    height: 100%;
}

.appbar-user-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
}

.appbar-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 14px;
    box-shadow: 0 12px 32px var(--shadow, rgba(0, 0, 0, 0.15));
    z-index: 1000;
    padding: 8px 0;
    animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.appbar-user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    margin-bottom: 6px;
}

.appbar-user-dropdown-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.appbar-user-dropdown-header-avatar-initial {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary, #325bb3);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.appbar-user-dropdown-header-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.appbar-user-dropdown-header-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appbar-user-dropdown-header-email {
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appbar-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #111827);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    transition: background 0.12s;
    position: relative;
}

    .appbar-user-dropdown-item:hover {
        background: var(--surface-subtle, rgba(0, 0, 0, 0.05));
    }

    .appbar-user-dropdown-item::before {
        content: "";
        position: absolute;
        left: 0;
        top: 4px;
        bottom: 4px;
        width: 3px;
        border-radius: 0 3px 3px 0;
        background: transparent;
        transition: background 0.15s;
    }

    .appbar-user-dropdown-item:hover::before {
        background: var(--primary, #325bb3);
    }

    .appbar-user-dropdown-item i {
        font-size: 1.15rem;
        width: 22px;
        text-align: center;
        color: var(--text-secondary, #6b7280);
        flex-shrink: 0;
    }

    .appbar-user-dropdown-item:hover i {
        color: var(--text-primary, #111827);
    }

    .appbar-user-dropdown-item:hover span {
        color: var(--text-primary, #111827);
    }

    .appbar-user-dropdown-item span {
        flex: 1;
    }

.appbar-user-dropdown-danger {
    color: var(--error, #ef4444);
}

    .appbar-user-dropdown-danger i {
        color: var(--error, #ef4444);
    }

    .appbar-user-dropdown-danger:hover {
        background: rgba(239, 68, 68, 0.08);
    }

        .appbar-user-dropdown-danger:hover i {
            color: var(--error, #ef4444);
        }

        .appbar-user-dropdown-danger:hover::before {
            background: var(--error, #ef4444);
        }

.appbar-user-dropdown-divider {
    height: 1px;
    background: var(--border, #e5e7eb);
    margin: 4px 10px;
}

.appbar-credit-chip {
    font-weight: 600;
}

.appbar-credit-pill {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 6px;
    margin-right: 8px;
    padding: 5px 10px;
    white-space: nowrap;
}

    .appbar-credit-pill i {
        font-size: 0.82rem;
    }

    .appbar-credit-pill.credit-ok {
        background: #ecfdf5;
        border-color: #a7f3d0;
        color: #065f46;
    }

    .appbar-credit-pill.credit-low {
        background: #fffbeb;
        border-color: #fde68a;
        color: #92400e;
    }

    .appbar-credit-pill.credit-empty {
        background: #fef2f2;
        border-color: #fecaca;
        color: #991b1b;
    }

[data-theme="dark"] .appbar-credit-pill.credit-ok {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}

[data-theme="dark"] .appbar-credit-pill.credit-low {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

[data-theme="dark"] .appbar-credit-pill.credit-empty {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.appbar-menu-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 2px 6px;
}

.appbar-notification-area {
    flex-shrink: 0;
    position: relative;
}

.appbar-theme-toggle-item {
    display: none;
}

.appbar-notification-backdrop {
    background: transparent;
    border: 0;
    cursor: default;
    inset: 0;
    position: fixed;
    z-index: 1299;
}

.appbar-notification-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 24px var(--shadow);
    max-height: min(72vh, 430px);
    overflow-y: auto;
    padding: 12px;
    position: fixed;
    right: 14px;
    top: 66px;
    width: min(92vw, 390px);
    animation: appbarPanelIn 0.2s ease-out;
    z-index: 1300;
}

.appbar-icon-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    font-size: 1.15rem;
    height: 38px;
    justify-content: center;
    position: relative;
    width: 38px;
    transition: background 0.15s;
}

    .appbar-icon-button:hover {
        background: var(--surface-subtle, rgba(0,0,0,0.05));
    }

.appbar-notification-count {
    align-items: center;
    background: #ef4444;
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 700;
    height: 18px;
    justify-content: center;
    min-width: 18px;
    padding: 0 5px;
    position: absolute;
    right: -2px;
    top: 2px;
}

    .appbar-notification-count.pulse {
        animation: notif-pulse 0.6s ease-in-out 2;
    }

@keyframes notif-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.35);
        box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.6);
    }

    100% {
        transform: scale(1);
    }
}

.appbar-notification-panel.is-closing {
    animation: appbarPanelOut 0.16s ease-in forwards;
    pointer-events: none;
}

@keyframes appbarPanelIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes appbarPanelOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
}

.appbar-menu-header-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.appbar-menu-header h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.appbar-summary {
    color: var(--text-secondary);
    font-size: 0.76rem;
}

.appbar-text-action {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 6px;
}

    .appbar-text-action:hover {
        background: var(--bg-secondary);
    }

    .appbar-text-action.danger {
        color: #dc2626;
    }

.appbar-empty-state {
    align-items: center;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    justify-content: center;
    min-height: 96px;
    text-align: center;
}

.appbar-info-state {
    justify-content: flex-start;
    min-height: auto;
    padding: 0 4px 10px;
    text-align: left;
}

.appbar-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.appbar-filter-button {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
}

    .appbar-filter-button.active {
        background: var(--primary, #325bb3);
        border-color: var(--primary, #325bb3);
        color: #ffffff;
    }

.appbar-divider {
    border-top: 1px solid var(--border, #eef2f7);
    margin: 10px 0;
}

.appbar-notification-item {
    align-items: flex-start;
    border: 0;
    border-radius: 0;
    display: grid;
    gap: 10px;
    grid-template-columns: 28px 1fr;
    margin-bottom: 0;
    padding: 10px 2px;
    transition: background-color 0.15s ease;
}

    .appbar-notification-item + .appbar-notification-item {
        border-top: 1px solid var(--border, #eef2f7);
    }

    .appbar-notification-item.unread {
        box-shadow: none;
    }

    .appbar-notification-item.clickable {
        cursor: pointer;
    }

        .appbar-notification-item.clickable:hover {
            background-color: transparent;
        }

.appbar-notification-icon {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 2px;
}

.appbar-notification-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.appbar-notification-topline {
    align-items: baseline;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

    .appbar-notification-topline strong {
        color: var(--text-primary);
        font-size: 0.9rem;
        font-weight: 700;
    }

.appbar-time {
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.appbar-notification-status {
    align-items: center;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.appbar-notification-meta {
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: none;
}

.appbar-notification-description {
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    font-size: 0.82rem;
    margin: 0;
    overflow: hidden;
}

    .appbar-notification-description.expanded {
        -webkit-line-clamp: unset;
        line-clamp: unset;
        max-height: none;
    }

.appbar-text-action.expand-toggle {
    font-size: 0.78rem;
    padding: 6px 10px;
    align-self: flex-start;
    min-height: 32px;
    min-width: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.appbar-unread-dot {
    background: var(--primary, #325bb3);
    border-radius: 999px;
    display: inline-block;
    height: 8px;
    width: 8px;
}

.appbar-notification-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.appbar-empty-state i {
    font-size: 1rem;
}

.appbar-empty-state p {
    margin: 0;
}

.appbar-spinner {
    animation: appbarSpin 0.7s linear infinite;
    border: 2px solid var(--border, #e5e7eb);
    border-top-color: var(--primary, #325bb3);
    border-radius: 999px;
    height: 16px;
    width: 16px;
}

@keyframes appbarSpin {
    to {
        transform: rotate(360deg);
    }
}

.appbar-logout-button {
    margin-left: 10px;
}

@media (max-width: 640px) {
    .appbar-notification-panel {
        border-radius: 16px;
        right: 6px;
        top: 62px;
        max-height: 76vh;
        padding: 10px;
        width: min(96vw, 390px);
    }

    .appbar-menu-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .appbar-menu-header-actions {
        justify-content: flex-start;
    }

    .appbar-notification-item {
        padding: 10px 2px;
    }

    .appbar-filter-row {
        gap: 6px;
        margin-top: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .appbar-notification-panel {
        animation: none;
    }
}

.nav-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: navFadeIn 0.2s ease-out;
}

.nav-loading-box {
    background: var(--card-bg, #ffffff);
    border-radius: 16px;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.nav-loading-logo {
    height: 40px;
    width: auto;
}

.nav-loading-dots {
    display: flex;
    gap: 6px;
}

.nav-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #325bb3;
    animation: navDotBounce 1.2s ease-in-out infinite;
}

    .nav-loading-dot:nth-child(2) {
        animation-delay: 0.2s;
    }

    .nav-loading-dot:nth-child(3) {
        animation-delay: 0.4s;
    }

.nav-loading-text {
    color: var(--text-primary, #111827);
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
}

/*Assistente*/

.ab-banner {
    align-items: flex-start;
    background: rgba(50, 91, 179, 0.06);
    border: 1px solid rgba(50, 91, 179, 0.2);
    border-radius: 12px;
    display: flex;
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
}

.ab-icone {
    color: var(--primary);
    font-size: 1.3rem;
    line-height: 1.2;
}

.ab-texto {
    display: grid;
    flex: 1;
    gap: 0.2rem;
}

    .ab-texto strong {
        color: var(--text-primary);
        font-size: 0.9rem;
    }

    .ab-texto p {
        color: var(--text-secondary);
        font-size: 0.82rem;
        line-height: 1.45;
        margin: 0;
    }

.ab-fechar {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    min-height: 44px;
    min-width: 44px;
}

.aw-area {
    display: contents;
}

/* Botão igual aos .appbar-icon-button do MainLayout (o CSS scoped do layout
   não chega a componentes filhos, por isso replica-se aqui). */
.aw-btn {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--text-primary, #111827);
    cursor: pointer;
    display: inline-flex;
    font-size: 1.15rem;
    height: 38px;
    justify-content: center;
    position: relative;
    transition: background 0.15s;
    width: 38px;
}

    .aw-btn:hover {
        background: var(--surface-subtle, rgba(0, 0, 0, 0.05));
    }

/* Badge igual ao contador de notificações */
.aw-badge {
    align-items: center;
    background: var(--error, #ef4444);
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 700;
    height: 18px;
    justify-content: center;
    min-width: 18px;
    padding: 0 5px;
    position: absolute;
    right: -2px;
    top: 2px;
}

.aw-backdrop {
    background: rgba(0, 0, 0, 0.35);
    border: none;
    cursor: default;
    inset: 0;
    position: fixed;
    z-index: 1200;
}

/* Mobile-first: painel em ecrã inteiro */
.aw-painel {
    background: var(--panel-bg, #fff);
    display: flex;
    flex-direction: column;
    inset: 0;
    position: fixed;
    z-index: 1201;
}

.aw-head {
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-shrink: 0;
    justify-content: space-between;
    padding: 0.85rem 1rem;
}

    .aw-head h3 {
        align-items: center;
        color: var(--text-primary);
        display: flex;
        font-size: 1.05rem;
        gap: 0.5rem;
        margin: 0;
    }

        .aw-head h3 i {
            color: var(--primary);
        }

.aw-fechar {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    min-height: 44px;
    min-width: 44px;
}

.aw-body {
    display: grid;
    gap: 1.25rem;
    overflow-y: auto;
    padding: 1rem;
}

.aw-seccao {
    display: grid;
    gap: 0.6rem;
}

    .aw-seccao h4 {
        color: var(--text-secondary);
        font-size: 0.78rem;
        letter-spacing: 0.04em;
        margin: 0;
        text-transform: uppercase;
    }

.aw-dica {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem;
}

    .aw-dica.lida {
        opacity: 0.6;
    }

.aw-dica-icone {
    color: var(--primary);
    font-size: 1.2rem;
    line-height: 1.2;
}

.aw-dica-texto {
    display: grid;
    gap: 0.25rem;
}

    .aw-dica-texto strong {
        color: var(--text-primary);
        font-size: 0.9rem;
    }

    .aw-dica-texto p {
        color: var(--text-secondary);
        font-size: 0.82rem;
        line-height: 1.45;
        margin: 0;
    }

.aw-acao-texto {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.82rem;
    justify-self: start;
    min-height: 32px;
    padding: 0;
    text-align: left;
}

.aw-vazio {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.aw-completa {
    align-items: center;
    color: var(--primary);
    display: flex;
    font-size: 0.85rem;
    gap: 0.4rem;
    margin: 0;
}

.aw-progresso {
    align-items: center;
    display: flex;
    gap: 0.6rem;
}

    .aw-progresso span {
        color: var(--text-secondary);
        font-size: 0.8rem;
        white-space: nowrap;
    }

.aw-progresso-track {
    background: var(--border-color);
    border-radius: 999px;
    flex: 1;
    height: 8px;
    overflow: hidden;
}

.aw-progresso-fill {
    background: linear-gradient(90deg, var(--primary), #6366f1);
    border-radius: 999px;
    height: 100%;
}

.aw-rodape {
    border-top: 1px solid var(--border-color);
    display: grid;
    gap: 0.4rem;
    padding-top: 0.85rem;
}

    .aw-rodape h4 {
        color: var(--text-primary);
        font-size: 0.85rem;
        margin: 0;
    }

    .aw-rodape a {
        align-items: center;
        color: var(--primary);
        display: flex;
        font-size: 0.85rem;
        gap: 0.4rem;
        min-height: 36px;
        text-decoration: none;
    }

/* Desktop: drawer à direita */
@media (min-width: 769px) {
    .aw-painel {
        border-left: 1px solid var(--border-color);
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
        inset: 0 0 0 auto;
        width: 400px;
    }
}

.aw-tabs {
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-shrink: 0;
    overflow-x: auto;
}

.aw-tab {
    align-items: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex: 1;
    font-size: 0.78rem;
    gap: 0.3rem;
    justify-content: center;
    min-height: 44px;
    padding: 0.6rem 0.4rem;
    position: relative;
    white-space: nowrap;
}

    .aw-tab.ativo {
        border-bottom: 2px solid var(--primary);
        color: var(--primary);
        font-weight: 600;
    }

.aw-tab-badge {
    background: var(--error, #ef4444);
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    padding: 0 4px;
}

.aw-chat {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.aw-chat-historico {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.aw-chat-saudacao {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
}

.aw-chat-sugestoes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.aw-chip {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.82rem;
    min-height: 40px;
    padding: 0.5rem 0.9rem;
    text-align: left;
}

.aw-msg {
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 90%;
    padding: 0.65rem 0.85rem;
}

.aw-msg-utilizador {
    align-self: flex-end;
    background: var(--primary);
    color: #ffffff;
}

.aw-msg-bot {
    align-self: flex-start;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.aw-chat-passos {
    margin: 0;
    padding-left: 1.1rem;
}

.aw-msg-fallback a {
    align-items: center;
    color: var(--primary);
    display: inline-flex;
    gap: 0.35rem;
}

.aw-chat-input {
    display: flex;
    flex-shrink: 0;
    gap: 0.5rem;
}

    .aw-chat-input input {
        background: var(--panel-bg);
        border: 1px solid var(--border-color);
        border-radius: 999px;
        color: var(--text-primary);
        flex: 1;
        font-size: 0.85rem;
        min-height: 44px;
        padding: 0 1rem;
    }

    .aw-chat-input button {
        align-items: center;
        background: var(--primary);
        border: none;
        border-radius: 999px;
        color: #ffffff;
        cursor: pointer;
        display: flex;
        height: 44px;
        justify-content: center;
        width: 44px;
    }

        .aw-chat-input button:disabled {
            opacity: 0.5;
        }

.aw-typing {
    align-items: center;
    display: flex;
    gap: 0.3rem;
    padding: 0.75rem 0.85rem;
}

    .aw-typing span {
        animation: aw-typing-bounce 1.2s infinite ease-in-out;
        background: var(--text-secondary);
        border-radius: 999px;
        display: inline-block;
        height: 6px;
        width: 6px;
    }

        .aw-typing span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .aw-typing span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes aw-typing-bounce {
    0%, 60%, 100% {
        opacity: 0.4;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

.aw-ajuda-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--primary);
    cursor: pointer;
    display: block;
    font-size: 0.78rem;
    margin-top: 0.5rem;
    min-height: 36px;
    padding: 0.4rem 0.8rem;
    width: fit-content;
}

    .aw-ajuda-btn:disabled {
        color: var(--text-secondary);
        cursor: default;
        opacity: 0.7;
    }

.aw-ajuda-geral {
    align-items: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-shrink: 0;
    font-size: 0.78rem;
    gap: 0.35rem;
    justify-content: center;
    min-height: 32px;
    padding: 0.2rem;
}

    .aw-ajuda-geral:hover {
        color: var(--primary);
    }

/* Card com o mesmo desenho dos .dash-card do dashboard (cores via variáveis do tema) */
.oc-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e8edf4);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    padding: 24px;
}

.oc-head {
    align-items: center;
    color: var(--text-secondary, #51627f);
    display: flex;
    font-size: 0.95rem;
    font-weight: 600;
    gap: 8px;
}

    .oc-head > i {
        color: var(--primary, #325bb3);
        font-size: 1.1rem;
    }

.oc-progress-label {
    color: var(--text-secondary, #6b7280);
    font-size: 0.78rem;
    font-weight: 500;
    margin-left: auto;
}

.oc-dismiss {
    background: none;
    border: none;
    border-radius: 999px;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    font-size: 0.85rem;
    height: 30px;
    width: 30px;
}

    .oc-dismiss:hover {
        background: var(--surface-subtle, rgba(0, 0, 0, 0.05));
    }

.oc-progress-track {
    background: var(--border-color, #e5e7eb);
    border-radius: 999px;
    flex-shrink: 0;
    height: 8px;
    overflow: hidden;
}

.oc-progress-fill {
    background: linear-gradient(90deg, var(--primary, #325bb3), #6366f1);
    border-radius: 999px;
    height: 100%;
    transition: width 0.3s ease;
}

/* Lista com scroll próprio: cabe na coluna sem esticar o dashboard */
.oc-steps {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

.oc-step {
    align-items: center;
    background: none;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    text-align: left;
    width: 100%;
}

    .oc-step:hover:not(.done) {
        border-color: var(--primary, #325bb3);
    }

    .oc-step.done {
        cursor: default;
        opacity: 0.6;
    }

.oc-step-check {
    color: var(--primary, #325bb3);
    font-size: 1.1rem;
    line-height: 1;
}

.oc-step-text {
    flex: 1;
}

    .oc-step-text strong {
        color: var(--text-primary, #111827);
        font-size: 0.85rem;
        font-weight: 500;
    }

.oc-step.done .oc-step-text strong {
    text-decoration: line-through;
}

.oc-step-arrow {
    color: var(--text-secondary, #6b7280);
    font-size: 0.8rem;
}

/*Fab*/
.fab-shell {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 10px;
}

.fab-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

.fab-main {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--primary, #325bb3);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 16px rgba(50, 91, 179, 0.35);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    z-index: 2;
    position: relative;
}

    .fab-main:hover {
        transform: scale(1.06);
        box-shadow: 0 6px 20px rgba(50, 91, 179, 0.45);
    }

    .fab-main:active {
        transform: scale(0.96);
    }

.fab-main-active {
    background: #ef4444;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

    .fab-main-active:hover {
        background: #dc2626;
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
    }

.fab-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1;
}

.fab-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border: none;
    border-radius: 12px;
    background: #fff;
    color: #374151;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

    .fab-item:hover {
        transform: translateX(-4px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
        color: var(--primary, #325bb3);
    }

    .fab-item i {
        font-size: 1.15rem;
        color: var(--primary, #325bb3);
    }

@media (max-width: 768px) {
    .fab-shell {
        bottom: 80px;
        right: 16px;
    }

    .fab-main {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .fab-item {
        padding: 10px 14px;
        font-size: 0.83rem;
    }
}

[data-theme="dark"] .fab-item {
    background: var(--card-bg, #1e2538);
    color: #d1d5db;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

    [data-theme="dark"] .fab-item i {
        color: #60a5fa;
    }

    [data-theme="dark"] .fab-item:hover {
        color: #60a5fa;
    }

