/* ── Portal global styles ──────────────────────────────────────────────────── */

/* ── Upload drop zone ─────────────────────────────────────────────────────── */
.upload-zone {
    display: block;
    position: relative;
    min-height: 140px;
    border: 2px dashed var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-body-bg);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone:focus-within,
.upload-zone--drag {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), .04);
}

.upload-zone__body {
    padding: 1.25rem;
    pointer-events: none;
    min-height: 140px;
}

.upload-zone__file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: .25rem 0;
    font-size: .875rem;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.upload-zone__file:last-child {
    border-bottom: none;
}

/* ── Message thread list ──────────────────────────────────────────────────── */
.msg-thread-list {
    max-height: 520px;
    overflow-y: auto;
}

/* ── Outlined badge ───────────────────────────────────────────────────────── */
.badge-outline {
    background-color: transparent;
    border: 1px solid currentColor;
    font-weight: 500;
}

/* ── Card header flex row + actions ──────────────────────────────────────── */
.card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-left: auto;
}

/* ── Ghost button variants ────────────────────────────────────────────────── */
.btn-ghost-secondary {
    background: transparent;
    border-color: transparent;
    color: var(--bs-secondary);
}
.btn-ghost-secondary:hover { background: rgba(var(--bs-secondary-rgb), .1); }

.btn-ghost-danger {
    background: transparent;
    border-color: transparent;
    color: var(--bs-danger);
}
.btn-ghost-danger:hover { background: rgba(var(--bs-danger-rgb), .1); }

.btn-ghost-white {
    background: transparent;
    border-color: transparent;
    color: rgba(255,255,255,.75);
}
.btn-ghost-white:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── text-blue utility (file icon colour) ─────────────────────────────────── */
.text-blue { color: #0d6efd; }

/* ── Chat / message stage ─────────────────────────────────────────────────── */
.msg-stage {
    flex: 1 1 0;
    min-height: 300px;
    max-height: 55vh;
    overflow-y: auto;
    padding: 1rem;
}

.chat         { display: flex; flex-direction: column; gap: .75rem; }
.chat-bubbles { display: flex; flex-direction: column; gap: .75rem; }
.chat-item    { width: 100%; }

/* ── Bubbles ──────────────────────────────────────────────────────────────── */

/* Firm message — left side */
.msg-bubble {
    display: block;
    max-width: 100%;
    padding: .5rem .875rem;
    border-radius: .375rem .75rem .75rem .375rem;   /* square top-left, rounded elsewhere */
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    border: 1px solid var(--bs-border-color, #ced4da);
    font-size: .9rem;
    line-height: 1.45;
    word-break: break-word;
}

/* Client message — right side */
.msg-bubble-me {
    border-radius: .75rem .375rem .375rem .75rem;   /* rounded left, square top-right */
    background-color: rgba(var(--bs-primary-rgb), .12);
}

.msg-bubble-title {
    font-size: .72rem;
    margin-bottom: .25rem;
    opacity: .7;
}

.chat-bubble-author { font-weight: 600; }
.chat-bubble-date   { color: inherit; opacity: .75; }
.msg-bubble-body    { white-space: pre-wrap; }

/* ── Message avatars — square with rounded corners (matches Admin site) ───── */
.msg-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: .375rem;          /* rounded square, not circle */
    font-size: .7rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    background-color: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
}

/* Constrain photo avatars to the box */
.msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.msg-avatar-blue  { background-color: #cfe2ff; color: #084298; }
.msg-avatar-green { background-color: #d1e7dd; color: #0a3622; }

