/* /Components/Chat/ChatAssistant.razor.rz.scp.css */
/* ============================================================
   ChatAssistant — scoped styles
   All position/layout uses var(--hb-*) or MudBlazor theme vars
   to ensure dark mode compatibility.
   ============================================================ */

/* ---------- FAB ---------- */
.chat-fab-container[b-g8uppyse1i] {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1200;
}

/* ---------- Panel container ---------- */
.chat-panel-container[b-g8uppyse1i] {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1200;
    width: 380px;
    max-height: 560px;
    display: flex;
    flex-direction: column;
}

.chat-panel[b-g8uppyse1i] {
    display: flex;
    flex-direction: column;
    height: 560px;
    border-radius: 12px !important;
    overflow: hidden;
}

/* ---------- Header ---------- */
.chat-header[b-g8uppyse1i] {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    /* WingBlue → OwlBlue gradient per spec */
    background: linear-gradient(135deg, var(--hb-wing-blue), var(--hb-owl-blue));
    flex-shrink: 0;
}

.chat-header-avatar[b-g8uppyse1i] {
    width: 28px !important;
    height: 28px !important;
    background: rgba(255, 255, 255, 0.2) !important;
}

.chat-header-owl[b-g8uppyse1i] {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ---------- Messages ---------- */
.chat-messages[b-g8uppyse1i] {
    flex: 1;
    min-height: 0;          /* critical: without this, flex child won't shrink below content → no scroll */
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scroll-behavior: smooth;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .chat-messages[b-g8uppyse1i] {
        scroll-behavior: auto;
    }

    .typing-dot[b-g8uppyse1i] {
        animation: none !important;
        opacity: 0.6;
    }
}

.chat-empty-state[b-g8uppyse1i] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 1.5rem 1rem;
    gap: 0.25rem;
}

.chat-empty-owl[b-g8uppyse1i] {
    width: 72px;
    height: 72px;
    object-fit: contain;
    opacity: 0.9;
}

.chat-suggestion-chips[b-g8uppyse1i] {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 0.75rem;
}

.chat-chip[b-g8uppyse1i] {
    font-size: 0.75rem !important;
    cursor: pointer;
}

/* ---------- Individual message rows ---------- */
.chat-message[b-g8uppyse1i] {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    max-width: 100%;
}

.chat-message--user[b-g8uppyse1i] {
    flex-direction: row-reverse;
}

.chat-message--assistant[b-g8uppyse1i] {
    flex-direction: row;
}

.chat-msg-avatar[b-g8uppyse1i] {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0;
    background: rgba(74, 144, 217, 0.15) !important;
}

.chat-msg-owl[b-g8uppyse1i] {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ---------- Bubbles ---------- */
.chat-bubble[b-g8uppyse1i] {
    padding: 0.5rem 0.75rem;
    border-radius: 16px;
    max-width: 85%;
    min-width: 0;
    overflow: hidden;
    word-break: break-word;
    line-height: 1.4;
}

.chat-bubble--user[b-g8uppyse1i] {
    background-color: var(--hb-owl-blue);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Assistant bubble uses MudBlazor surface so it auto-adapts to dark mode */
.chat-bubble--assistant[b-g8uppyse1i] {
    background-color: var(--mud-palette-action-default-hover);
    border-bottom-left-radius: 4px;
}

.chat-bubble-text[b-g8uppyse1i] {
    font-size: 0.875rem !important;
    margin: 0;
}

/* --- Markdown inside assistant bubbles --- */
[b-g8uppyse1i] .chat-markdown {
    font-size: 0.875rem;
    line-height: 1.5;
}

[b-g8uppyse1i] .chat-markdown p {
    margin: 0 0 0.4rem 0;
}

[b-g8uppyse1i] .chat-markdown p:last-child {
    margin-bottom: 0;
}

[b-g8uppyse1i] .chat-markdown ul,
[b-g8uppyse1i] .chat-markdown ol {
    margin: 0.25rem 0 0.4rem 1.2rem;
    padding: 0;
}

[b-g8uppyse1i] .chat-markdown li {
    margin-bottom: 0.15rem;
}

[b-g8uppyse1i] .chat-markdown strong {
    font-weight: 600;
}

[b-g8uppyse1i] .chat-markdown a {
    color: var(--hb-owl-blue);
    text-decoration: underline;
}

[b-g8uppyse1i] .chat-markdown code {
    font-size: 0.8rem;
    background: rgba(0,0,0,0.06);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

[b-g8uppyse1i] .chat-markdown pre {
    overflow-x: auto;
    max-width: 100%;
    background: rgba(0,0,0,0.06);
    padding: 0.5rem;
    border-radius: 6px;
    margin: 0.4rem 0;
}

[b-g8uppyse1i] .chat-markdown pre code {
    background: none;
    padding: 0;
    font-size: 0.75rem;
    white-space: pre;
}

[b-g8uppyse1i] .chat-markdown table {
    border-collapse: collapse;
    margin: 0.4rem 0;
    font-size: 0.8rem;
}

[b-g8uppyse1i] .chat-markdown th,
[b-g8uppyse1i] .chat-markdown td {
    border: 1px solid rgba(0,0,0,0.12);
    padding: 0.2rem 0.4rem;
}

[b-g8uppyse1i] .chat-markdown th {
    font-weight: 600;
    background: rgba(0,0,0,0.04);
}

/* ---------- Typing dots ---------- */
.chat-bubble--typing[b-g8uppyse1i] {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.6rem 0.75rem;
}

.typing-dot[b-g8uppyse1i] {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--hb-owl-blue);
    animation: typing-bounce-b-g8uppyse1i 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

.typing-dot:nth-child(1)[b-g8uppyse1i] { animation-delay: 0s; }
.typing-dot:nth-child(2)[b-g8uppyse1i] { animation-delay: 0.2s; }
.typing-dot:nth-child(3)[b-g8uppyse1i] { animation-delay: 0.4s; }

@keyframes typing-bounce-b-g8uppyse1i {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30%            { transform: translateY(-5px); opacity: 1; }
}

/* ---------- Footer ---------- */
.chat-footer[b-g8uppyse1i] {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    border-top: 1px solid var(--mud-palette-divider);
    flex-shrink: 0;
}

.chat-input[b-g8uppyse1i] {
    flex: 1;
    font-size: 0.875rem;
}

.chat-footer-actions[b-g8uppyse1i] {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-bottom: 4px;
}

/* ---------- Minimized bar ---------- */
.chat-minimized-bar[b-g8uppyse1i] {
    position: fixed;
    bottom: 0;
    right: 1.5rem;
    z-index: 1200;
    width: 220px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.5rem 0.4rem 0.75rem;
    background: linear-gradient(135deg, var(--hb-wing-blue), var(--hb-owl-blue));
    border-radius: 10px 10px 0 0;
    cursor: pointer;
}

.chat-minimized-owl[b-g8uppyse1i] {
    width: 22px;
    height: 22px;
    object-fit: cover;
    border-radius: 50%;
}

/* ---------- Mobile: full-sheet below 600px ---------- */
@media (max-width: 599px) {
    .chat-panel-container[b-g8uppyse1i] {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 100dvh;
        border-radius: 0;
    }

    .chat-panel[b-g8uppyse1i] {
        height: 100dvh;
        border-radius: 0 !important;
    }

    .chat-fab-container[b-g8uppyse1i] {
        bottom: 1rem;
        right: 1rem;
    }

    .chat-minimized-bar[b-g8uppyse1i] {
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 0;
    }
}

/* ---------- Dark mode compatibility ----------
   We intentionally avoid hardcoded white/black.
   • Header/minimized bar use CSS vars (--hb-wing-blue/owl-blue) — same in both modes.
   • User bubble uses --hb-owl-blue with white text (readable on both modes).
   • Assistant bubble uses --mud-palette-action-default-hover (MudBlazor theme-aware).
   • All text colors via MudText Color.Secondary or inline theme vars.
   ------------------------------------------------ */
/* /Components/Layout/ReconnectModal.razor.rz.scp.css */
.components-reconnect-first-attempt-visible[b-t68yds3054],
.components-reconnect-repeated-attempt-visible[b-t68yds3054],
.components-reconnect-failed-visible[b-t68yds3054],
.components-pause-visible[b-t68yds3054],
.components-resume-failed-visible[b-t68yds3054],
.components-rejoining-animation[b-t68yds3054] {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible[b-t68yds3054],
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation[b-t68yds3054],
#components-reconnect-modal.components-reconnect-paused .components-pause-visible[b-t68yds3054],
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible[b-t68yds3054],
#components-reconnect-modal.components-reconnect-retrying[b-t68yds3054],
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible[b-t68yds3054],
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation[b-t68yds3054],
#components-reconnect-modal.components-reconnect-failed[b-t68yds3054],
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible[b-t68yds3054] {
    display: block;
}


#components-reconnect-modal[b-t68yds3054] {
    background-color: white;
    width: 20rem;
    margin: 20vh auto;
    padding: 2rem;
    border: 0;
    border-radius: 0.5rem;
    box-shadow: 0 3px 6px 2px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete;
    animation: components-reconnect-modal-fadeOutOpacity-b-t68yds3054 0.5s both;
    &[open]

{
    animation: components-reconnect-modal-slideUp-b-t68yds3054 1.5s cubic-bezier(.05, .89, .25, 1.02) 0.3s, components-reconnect-modal-fadeInOpacity-b-t68yds3054 0.5s ease-in-out 0.3s;
    animation-fill-mode: both;
}

}

#components-reconnect-modal[b-t68yds3054]::backdrop {
    background-color: rgba(0, 0, 0, 0.4);
    animation: components-reconnect-modal-fadeInOpacity-b-t68yds3054 0.5s ease-in-out;
    opacity: 1;
}

@keyframes components-reconnect-modal-slideUp-b-t68yds3054 {
    0% {
        transform: translateY(30px) scale(0.95);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes components-reconnect-modal-fadeInOpacity-b-t68yds3054 {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes components-reconnect-modal-fadeOutOpacity-b-t68yds3054 {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.components-reconnect-container[b-t68yds3054] {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#components-reconnect-modal p[b-t68yds3054] {
    margin: 0;
    text-align: center;
}

#components-reconnect-modal button[b-t68yds3054] {
    border: 0;
    background-color: #6b9ed2;
    color: white;
    padding: 4px 24px;
    border-radius: 4px;
}

    #components-reconnect-modal button:hover[b-t68yds3054] {
        background-color: #3b6ea2;
    }

    #components-reconnect-modal button:active[b-t68yds3054] {
        background-color: #6b9ed2;
    }

.components-rejoining-animation[b-t68yds3054] {
    position: relative;
    width: 80px;
    height: 80px;
}

    .components-rejoining-animation div[b-t68yds3054] {
        position: absolute;
        border: 3px solid #0087ff;
        opacity: 1;
        border-radius: 50%;
        animation: components-rejoining-animation-b-t68yds3054 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
    }

        .components-rejoining-animation div:nth-child(2)[b-t68yds3054] {
            animation-delay: -0.5s;
        }

@keyframes components-rejoining-animation-b-t68yds3054 {
    0% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    4.9% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    5% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        top: 0px;
        left: 0px;
        width: 80px;
        height: 80px;
        opacity: 0;
    }
}
/* /Components/Shared/InvoiceDocument.razor.rz.scp.css */
.hb-invoice-document[b-f5q6jtd2g2] {
    background: #ffffff;
    border: 1px solid rgba(3, 23, 61, 0.08);
    border-radius: 1.25rem;
    box-shadow: 0 1rem 2rem rgba(6, 21, 47, 0.08);
    overflow: hidden;
}

.hb-invoice-document__accent[b-f5q6jtd2g2] {
    height: 0.35rem;
    background: linear-gradient(90deg, #0d6efd, #55b2ff);
}

.hb-invoice-document__actions[b-f5q6jtd2g2] {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem 0;
    flex-wrap: wrap;
}

.hb-invoice-document__body[b-f5q6jtd2g2] {
    padding: 1.75rem;
}

.hb-invoice-document__header[b-f5q6jtd2g2] {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.hb-invoice-document__brand[b-f5q6jtd2g2] {
    min-width: 14rem;
}

.hb-invoice-document__logo[b-f5q6jtd2g2] {
    display: block;
    max-width: 11rem;
    max-height: 4.5rem;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.hb-invoice-document__company[b-f5q6jtd2g2] {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f2746;
}

.hb-invoice-document__title[b-f5q6jtd2g2] {
    text-align: right;
}

.hb-invoice-document__eyebrow[b-f5q6jtd2g2] {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #53708f;
    font-size: 0.75rem;
    font-weight: 700;
}

.hb-invoice-document__number[b-f5q6jtd2g2] {
    font-size: 2rem;
    font-weight: 700;
    color: #0d6efd;
    margin-top: 0.25rem;
}

.hb-invoice-document__meta[b-f5q6jtd2g2] {
    margin-top: 0.25rem;
    color: #53708f;
}

.hb-invoice-document__status[b-f5q6jtd2g2] {
    display: inline-flex;
    margin-top: 0.9rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hb-invoice-document__status--paid[b-f5q6jtd2g2] {
    background: rgba(25, 135, 84, 0.12);
    color: #198754;
}

.hb-invoice-document__status--sent[b-f5q6jtd2g2] {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.hb-invoice-document__status--due[b-f5q6jtd2g2] {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.hb-invoice-document__status--draft[b-f5q6jtd2g2] {
    background: rgba(83, 112, 143, 0.12);
    color: #53708f;
}

.hb-invoice-document__addresses[b-f5q6jtd2g2] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.hb-invoice-document__address-card[b-f5q6jtd2g2] {
    padding: 1rem;
    border-radius: 1rem;
    background: #f7faff;
    border: 1px solid rgba(3, 23, 61, 0.06);
    line-height: 1.6;
}

.hb-invoice-document__address-label[b-f5q6jtd2g2],
.hb-invoice-document__section-title[b-f5q6jtd2g2] {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #53708f;
    font-size: 0.74rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hb-invoice-document__address-name[b-f5q6jtd2g2] {
    font-weight: 700;
}

.hb-invoice-document__address-muted[b-f5q6jtd2g2] {
    color: #5f7b97;
}

.hb-invoice-document__table[b-f5q6jtd2g2] {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.75rem;
}

.hb-invoice-document__table th[b-f5q6jtd2g2] {
    padding: 0.85rem 1rem;
    background: #0f2746;
    color: #ffffff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hb-invoice-document__table td[b-f5q6jtd2g2] {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(15, 39, 70, 0.08);
    vertical-align: top;
}

.hb-invoice-document__table tbody tr:nth-child(even) td[b-f5q6jtd2g2] {
    background: rgba(247, 250, 255, 0.75);
}

.hb-invoice-document__table--compact[b-f5q6jtd2g2] {
    margin-top: 0.75rem;
}

.hb-invoice-document__totals[b-f5q6jtd2g2] {
    margin-left: auto;
    margin-top: 1.5rem;
    max-width: 22rem;
}

.hb-invoice-document__total-row[b-f5q6jtd2g2],
.hb-invoice-document__balance[b-f5q6jtd2g2] {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
}

.hb-invoice-document__balance[b-f5q6jtd2g2] {
    margin-top: 0.35rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: #f0f6ff;
    color: #0d6efd;
}

.hb-invoice-document__paid[b-f5q6jtd2g2] {
    color: #198754;
}

.hb-invoice-document__history[b-f5q6jtd2g2] {
    margin-top: 1.75rem;
}

.text-right[b-f5q6jtd2g2] {
    text-align: right;
}

@media (max-width: 900px) {
    .hb-invoice-document__body[b-f5q6jtd2g2] {
        padding: 1.25rem;
    }

    .hb-invoice-document__header[b-f5q6jtd2g2] {
        flex-direction: column;
    }

    .hb-invoice-document__title[b-f5q6jtd2g2] {
        text-align: left;
    }

    .hb-invoice-document__addresses[b-f5q6jtd2g2] {
        grid-template-columns: 1fr;
    }

    .hb-invoice-document__table th[b-f5q6jtd2g2],
    .hb-invoice-document__table td[b-f5q6jtd2g2] {
        padding: 0.75rem;
    }
}

@media print {
    .hb-invoice-document[b-f5q6jtd2g2] {
        box-shadow: none;
        border: none;
    }

    .hb-invoice-document__actions[b-f5q6jtd2g2] {
        display: none;
    }
}
