/* ── Overlay ─────────────────────────────────────────────────────────────── */
.solid-ai-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 999;
}
.solid-ai-overlay--visible {
    display: block;
}

/* ── Painel deslizante ───────────────────────────────────────────────────── */
.solid-ai-panel {
    position: fixed;
    top: 0;
    right: -845px;
    width: 825px;
    height: 100vh;
    background: var(--rz-base-background-color, #fff);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    border-left: 1px solid var(--rz-border-disabled-color, #e5e5e5);
}
.solid-ai-panel--open {
    right: 0;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.solid-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--rz-border-disabled-color, #e5e5e5);
    background: var(--rz-primary, #2a4783);
    color: #fff;
    flex-shrink: 0;
}
.solid-ai-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}
.solid-ai-icon {
    font-family: 'Material Icons', sans-serif;
    font-size: 20px;
}
.solid-ai-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(255,255,255,0.25);
    border-radius: 4px;
    padding: 2px 6px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.solid-ai-badge.header{
    margin-left: 10px;
    margin-top: 15px;
    display: inline-block;
}
.solid-ai-close-btn {
    color: #fff !important;
    opacity: 0.85;
}
.solid-ai-close-btn:hover {
    opacity: 1;
}

/* ── Área de mensagens ───────────────────────────────────────────────────── */
.solid-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* ── Tela de boas-vindas ─────────────────────────────────────────────────── */
.solid-ai-welcome {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 4px;
}

.solid-ai-welcome-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--rz-primary, #2a4783) 0%, #3d5fa0 100%);
    border-radius: 10px;
    color: #fff;
}
.solid-ai-welcome-sparkle {
    font-size: 28px !important;
    opacity: 0.9;
    flex-shrink: 0;
}
.solid-ai-welcome-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 2px;
    letter-spacing: 0.02em;
}
.solid-ai-welcome-sub {
    font-size: 0.78rem;
    margin: 0;
    opacity: 0.85;
    line-height: 1.4;
}

/* ── Categorias de sugestões ─────────────────────────────────────────────── */
.solid-ai-category {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.solid-ai-category-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 2px;
}
.solid-ai-category-label .solid-ai-icon {
    font-size: 16px !important;
    color: var(--rz-primary, #2a4783);
    opacity: 0.75;
}
.solid-ai-category-text {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--rz-base-700, #545e61);
}
.solid-ai-category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ── Balões de mensagem ──────────────────────────────────────────────────── */
.solid-ai-bubble {
    max-width: 92%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
}
.solid-ai-bubble--user {
    align-self: flex-end;
    background: var(--rz-primary, #2a4783);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.solid-ai-bubble--assistant {
    align-self: flex-start;
    background: var(--rz-surface-card, #f8f9fa);
    border: 1px solid var(--rz-border-disabled-color, #e5e5e5);
    border-bottom-left-radius: 4px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Resumo ─────────────────────────────────────────────────────────────── */
.solid-ai-summary {
    margin: 0;
    font-size: 0.875rem;
    color: var(--rz-text-color, #333);
}

/* ── Gráfico ─────────────────────────────────────────────────────────────── */
.solid-ai-chart-container {
    background: #fff;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid var(--rz-border-disabled-color, #e5e5e5);
}
.solid-ai-chart-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #2e4782;
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Tabela ──────────────────────────────────────────────────────────────── */
.solid-ai-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--rz-border-disabled-color, #e5e5e5);
}
.solid-ai-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.solid-ai-table th {
    background: var(--rz-primary, #2a4783);
    color: #fff;
    text-align: left;
    padding: 7px 10px;
    font-weight: 600;
    white-space: nowrap;
}
.solid-ai-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--rz-border-disabled-color, #e5e5e5);
    color: var(--rz-text-color, #333);
    white-space: nowrap;
}
.solid-ai-table tr:last-child td {
    border-bottom: none;
}
.solid-ai-table tr:hover td {
    background: rgba(0,0,0,0.02);
}
.solid-ai-table-more {
    font-size: 0.75rem;
    color: var(--rz-text-disabled-color, #999);
    text-align: center;
    padding: 6px;
    margin: 0;
    border-top: 1px solid var(--rz-border-disabled-color, #e5e5e5);
    background: #fff;
}

/* ── Insights ────────────────────────────────────────────────────────────── */
.solid-ai-insights {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.solid-ai-insight {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--rz-text-color, #333);
    line-height: 1.4;
}
.solid-ai-insight-icon {
    font-family: 'Material Icons', sans-serif;
    font-size: 16px;
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Chips de sugestão ───────────────────────────────────────────────────── */
.solid-ai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.solid-ai-chip {
    font-size: 0.78rem;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--rz-primary, #2a4783);
    background: transparent;
    color: var(--rz-primary, #2a4783);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: normal;
}
.solid-ai-chip:hover {
    background: var(--rz-primary, #2a4783);
    color: #fff;
}
.solid-ai-chip--small {
    font-size: 0.74rem;
    padding: 3px 10px;
}

/* ── Ações (CSV / PDF) ───────────────────────────────────────────────────── */
.solid-ai-actions {
    display: flex;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid var(--rz-border-disabled-color, #e5e5e5);
}
.solid-ai-action-btn {
    font-size: 0.78rem !important;
    opacity: 0.55;
    transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.solid-ai-action-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.solid-ai-action-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ── Skeleton loader ─────────────────────────────────────────────────────── */
.solid-ai-skeleton {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}
.solid-ai-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #e5e5e5 25%, #f0f0f0 50%, #e5e5e5 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
}
.solid-ai-skeleton-line--short {
    width: 60%;
}
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Área de input ───────────────────────────────────────────────────────── */
.solid-ai-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--rz-border-disabled-color, #e5e5e5);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--rz-base-background-color, #fff);
    flex-shrink: 0;
}
.solid-ai-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.solid-ai-send-btn {
    flex-shrink: 0;
    height: 3.5rem;
    width: 40px;
}
.solid-ai-clear-btn {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--rz-text-disabled-color, #999);
    cursor: pointer;
    text-align: left;
    padding: 0;
    text-decoration: underline;
    text-decoration-style: dotted;
}
.solid-ai-clear-btn:hover {
    color: var(--rz-danger, #dc2626);
}

/* ── Botão de toggle no relatório ───────────────────────────────────────── */
.solid-ai-toggle-btn {
    white-space: nowrap;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .solid-ai-panel {
        width: 100vw;
        right: -100vw;
    }
    .solid-ai-panel--open {
        right: 0;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   DESIGN COMPARTILHADO — usado por AIChat e CheckInChat
   ════════════════════════════════════════════════════════════════════════════ */

/* ── FAB (Floating Action Button) ───────────────────────────────────────── */
.solid-chat-fab {
    position: fixed;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--rz-primary);
    color: var(--rz-on-primary, #fff);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 1.4rem;
    outline: none;
}
.solid-chat-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}
.solid-chat-fab:active {
    transform: scale(0.96);
}
.solid-chat-fab--bottom-left  { bottom: 1.5rem; left:  1.5rem; }
.solid-chat-fab--bottom-right { bottom: 1.5rem; right: 1.5rem; }

/* ── Overlay compartilhado ──────────────────────────────────────────────── */
.solid-chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.solid-chat-overlay--visible {
    opacity: 1;
    pointer-events: all;
}

/* ── Drawer compartilhado ───────────────────────────────────────────────── */
.solid-chat-drawer {
    position: fixed;
    top: 0;
    right: -440px;
    width: 420px;
    height: 100vh;
    z-index: 1001;
    background: var(--rz-base-background-color);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    border-left: 1px solid var(--rz-border-color);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}
.solid-chat-drawer--open { right: 0; }

/* ── Header compartilhado ───────────────────────────────────────────────── */
.solid-chat-header {
    display: flex;
    align-items: center;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--rz-border-color);
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--rz-primary);
    color: var(--rz-on-primary, #fff);
    flex-shrink: 0;
    gap: 0.4rem;
}
.solid-chat-header__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ── Área de mensagens ──────────────────────────────────────────────────── */
.solid-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ── Bubbles compartilhadas ─────────────────────────────────────────────── */
.solid-chat-bubble {
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    max-width: 90%;
    word-break: break-word;
    line-height: 1.45;
}
.solid-chat-bubble--user {
    align-self: flex-end;
    background: var(--rz-primary);
    color: var(--rz-on-primary, #fff);
    border-bottom-right-radius: 0.2rem;
}
.solid-chat-bubble--assistant {
    align-self: flex-start;
    background: var(--rz-secondary-lighter);
    border-bottom-left-radius: 0.2rem;
}

/* ── Skeleton loader compartilhado ─────────────────────────────────────── */
.solid-chat-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.solid-chat-skeleton-line {
    height: 0.7rem;
    border-radius: 0.35rem;
    background: linear-gradient(
        90deg,
        var(--rz-border-color) 25%,
        var(--rz-secondary-lighter) 50%,
        var(--rz-border-color) 75%
    );
    background-size: 200% 100%;
    animation: solid-chat-shimmer 1.4s infinite;
}
@keyframes solid-chat-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Input area compartilhada ───────────────────────────────────────────── */
.solid-chat-input-area {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.6rem;
    border-top: 1px solid var(--rz-border-color);
    flex-shrink: 0;
}
.solid-chat-input-area .rz-textbox { flex: 1; min-width: 0; }

/* ── Tela de boas-vindas CheckIn ────────────────────────────────────────── */
.solid-chat-welcome {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 2px;
}
.solid-chat-welcome-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--rz-primary, #2a4783) 0%, #3d5fa0 100%);
    border-radius: 10px;
    color: #fff;
}
.solid-chat-welcome-sparkle {
    font-size: 1.5rem !important;
    opacity: 0.9;
    flex-shrink: 0;
}

/* ── Estado vazio (legado) ──────────────────────────────────────────────── */
.solid-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0.5rem;
    color: var(--rz-text-disabled-color);
    text-align: center;
    font-size: 0.85rem;
    padding: 1rem;
}
.solid-chat-hints {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.5rem;
    width: 100%;
}
.solid-chat-hint-chip {
    cursor: pointer;
    padding: 0.3rem 0.7rem;
    border-radius: 1rem;
    border: 1px solid var(--rz-border-color);
    font-size: 0.8rem;
    transition: background 0.15s;
    text-align: center;
}
.solid-chat-hint-chip:hover {
    background: var(--rz-secondary-lighter);
}

/* ── Tags de ação aplicada (CheckIn) ────────────────────────────────────── */
.solid-chat-action-tags {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.4rem;
}
.solid-chat-action-tag {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--rz-success-dark, #2e7d32);
}

/* ── Upload label ───────────────────────────────────────────────────────── */
.solid-chat-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    border-radius: var(--rz-border-radius);
    border: 1px solid var(--rz-border-color);
    color: var(--rz-text-color);
    flex-shrink: 0;
}
.solid-chat-upload-label:hover { background: var(--rz-secondary-lighter); }

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .solid-chat-drawer {
        width: 100vw;
        right: -100vw;
    }
    .solid-chat-fab--bottom-left,
    .solid-chat-fab--bottom-right {
        bottom: 1rem;
    }
}

.solid-ai-mic-btn {
    font-size: 0.875rem;
    height: 3.5rem;
}

.solid-ai-bubble--user {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.solid-ai-favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    opacity: 0.5;
    transition: opacity 0.15s ease, color 0.15s ease;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1;
    flex-shrink: 0;
}

.solid-ai-bubble--user:hover .solid-ai-favorite-btn {
    opacity: 1;
}

.solid-ai-favorite-btn--active {
    opacity: 1 !important;
    color: #FFD700;
}

.solid-ai-favorite-btn .material-icons {
    font-size: 16px;
}