/* ------------------------------------------------------------------
   Bug Report — RTL enterprise theme
   ------------------------------------------------------------------ */

@font-face {
    font-family: 'Kahroba';
    src: url('../font/Kahroba-FD-RG.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

/* Kahroba ships in two weights only; 500/600 map onto the bold face. */
@font-face {
    font-family: 'Kahroba';
    src: url('../font/Kahroba-FD-B.woff2') format('woff2');
    font-weight: 500 900;
    font-display: swap;
}

:root {
    --br-font: 'Kahroba', 'Segoe UI', Tahoma, sans-serif;
    /* Desktop type scale; the mobile override lives just below. */
    --br-font-size: 16px;
    --br-font-size-sm: 14px;
    --br-sidebar-width: 250px;
    --br-topbar-height: 80px;
    --br-surface: #ffffff;
    --br-canvas: #f4f6fa;
    --br-border: #e4e8f0;
    --br-text: #1f2937;
    --br-muted: #6b7280;
    --br-accent: #1a4fb3;
    --br-accent-hover: #163f8f;
    --br-accent-soft: #e9eefb;
    --br-radius: 12px;
    --br-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .04);
}

@media (max-width: 767.98px) {
    :root {
        --br-font-size: 14px;
        --br-font-size-sm: 12px;
    }
}

html {
    font-size: var(--br-font-size);
}

body {
    font-family: var(--br-font);
    font-size: 1rem;
    background-color: var(--br-canvas);
    color: var(--br-text);
    min-height: 100dvh;
}

/* Secondary text keeps an exact size instead of Bootstrap's 0.875em ratio. */
.small,
small {
    font-size: var(--br-font-size-sm);
}

a {
    text-decoration: none;
}

/* Persian digits everywhere numbers are rendered as text */
.br-num {
    font-feature-settings: "ss01";
}

/* ---------- App shell ---------- */

.br-shell {
    display: flex;
    min-height: 100dvh;
}

.br-sidebar {
    width: var(--br-sidebar-width);
    flex: 0 0 var(--br-sidebar-width);
    background: var(--br-surface);
    border-inline-start: 1px solid var(--br-border);
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .3s ease, flex-basis .3s ease;
}

/* Desktop collapse: the sidebar keeps its layout but shrinks out of view. */
.br-sidebar-collapsed .br-sidebar {
    width: 0;
    flex-basis: 0;
    border-inline-start-width: 0;
    overflow: hidden;
}

.br-sidebar-toggle {
    flex: 0 0 auto;
    line-height: 1;
    font-size: 1.15rem;
    padding: .35rem .6rem;
}

.br-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.br-topbar {
    height: var(--br-topbar-height);
    background: var(--br-surface);
    border-bottom: 1px solid var(--br-border);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.br-content {
    flex: 1 1 auto;
    padding: 1.5rem;
}

.br-footer {
    border-top: 1px solid var(--br-border);
    background: var(--br-surface);
    color: var(--br-muted);
    font-size: .82rem;
    padding: .85rem 1.5rem;
}

/* Name + role stacked inside the topbar account button. */
.br-user-chip {
    display: flex;
    align-items: center;
    gap: .6rem;
    max-width: 250px;
    padding: .3rem .7rem;
}

.br-user-chip__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    row-gap: .50rem;
    min-width: 0;
}

.br-user-chip__caret {
    flex: 0 0 auto;
    font-size: .75rem;
    line-height: 1;
    color: var(--br-muted);
    transition: transform .15s ease;
}

.br-user-chip[aria-expanded="true"] .br-user-chip__caret {
    transform: rotate(180deg);
}

.br-user-chip__name {
    display: block;
    max-width: 100%;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.1;
}

.br-user-chip__role {
    display: block;
    max-width: 100%;
    font-size: .7rem;
    line-height: 1.1;
    color: var(--br-muted);
}

@media (max-width: 991.98px) {
    .br-sidebar {
        display: none;
    }

    .br-content {
        padding: 1rem;
    }
}

/* ---------- Brand + navigation ---------- */

.br-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 0 1.1rem;
    height: var(--br-topbar-height);
    border-bottom: 1px solid var(--br-border);
}

.br-brand__mark {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    object-fit: contain;
}

.br-brand__title {
    font-weight: 700;
    font-size: .95rem;
    line-height: 1.2;
}

.br-brand__subtitle {
    font-size: .72rem;
    color: var(--br-muted);
}

.br-nav {
    padding: 1rem .7rem 2rem;
}

.br-nav__section {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--br-muted);
    padding: 1rem .55rem .4rem;
    text-transform: uppercase;
}

.br-nav__link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .65rem;
    border-radius: 10px;
    color: #475467;
    font-size: .88rem;
    font-weight: 400;
    margin-bottom: .15rem;
    transition: background-color .12s ease, color .12s ease;
}

    .br-nav__link i {
        font-size: 1.5rem;
        width: 1.5rem;
        line-height: 1;
        text-align: center;
    }

    .br-nav__link:hover {
        background: #f3f5f9;
        color: var(--br-text);
    }

    .br-nav__link.active,
    .br-nav__link.active:hover {
        background: rgba(26, 79, 179, .12);
        color: var(--br-accent);
        font-weight: 700;
    }

.br-nav__badge {
    margin-inline-start: auto;
    font-size: .7rem;
}

/* ---------- Cards / panels ---------- */

.br-card {
    background: var(--br-surface);
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    box-shadow: var(--br-shadow);
}

.br-card__header {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--br-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

/* Tab strip that replaces a card header when one card holds several panels. */
.br-tabs {
    border-bottom: 1px solid var(--br-border);
    padding: 0 .6rem;
    gap: .2rem;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.br-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: .85rem .8rem;
    font-size: .88rem;
    font-weight: 500;
    color: var(--br-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.br-tabs .nav-link:hover {
    color: var(--br-accent);
}

.br-tabs .nav-link.active {
    color: var(--br-accent);
    font-weight: 700;
    border-bottom-color: var(--br-accent);
    background: transparent;
}

.br-tabs__count {
    background: var(--br-accent-soft);
    color: var(--br-accent);
    border-radius: 999px;
    padding: 0 .45rem;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.45;
}

.br-card__title {
    font-size: .95rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .45rem;
}

.br-card__body {
    padding: 1.1rem;
}

.br-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

/* ---------- Stat cards ---------- */

.br-stat {
    background: var(--br-surface);
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    box-shadow: var(--br-shadow);
    transition: transform .12s ease, box-shadow .12s ease;
}

a.br-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(16, 24, 40, .08);
}

.br-stat__icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    flex: 0 0 auto;
}

/* Clickable cards are anchors, so without this the number picks up the link colour while the
   label next to it stays grey. */
.br-stat__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--br-text);
}

.br-stat__label {
    font-size: .8rem;
    color: var(--br-muted);
}

/* ---------- Tables ---------- */

.br-table {
    margin: 0;
    font-size: .86rem;
}

    .br-table > :not(caption) > * > * {
        padding: .7rem .85rem;
        vertical-align: middle;
    }

    .br-table thead th {
        background: #fafbfd;
        color: var(--br-muted);
        font-weight: 700;
        font-size: .78rem;
        white-space: nowrap;
        border-bottom: 1px solid var(--br-border);
    }

    .br-table tbody tr:hover {
        background: #fafbfd;
    }

.br-ticket {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .8rem;
    font-weight: 600;
    color: var(--br-accent);
    direction: ltr;
    display: inline-block;
}

/* ---------- Badges ---------- */

.br-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .22rem .55rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.br-badge--primary {
    background: #e9eefb;
    color: #1a4fb3;
    border-color: #d3dff6;
}

.br-badge--secondary {
    background: #f2f4f7;
    color: #475467;
    border-color: #e4e7ec;
}

.br-badge--success {
    background: #e7f7ee;
    color: #067647;
    border-color: #cfeedd;
}

.br-badge--danger {
    background: #fdecec;
    color: #b42318;
    border-color: #fbd7d5;
}

.br-badge--warning {
    background: #fff5e6;
    color: #b54708;
    border-color: #fdebd0;
}

.br-badge--info {
    background: #e8f4fd;
    color: #0e6ba8;
    border-color: #d2e9fa;
}

.br-badge--dark {
    background: #eceef2;
    color: #1f2937;
    border-color: #dfe3ea;
}

/* ---------- Avatar ---------- */

.br-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--br-accent-soft);
    color: var(--br-accent);
    display: inline-grid;
    place-items: center;
    font-size: .78rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.br-avatar--sm {
    width: 26px;
    height: 26px;
    font-size: .68rem;
}

.br-avatar--lg {
    width: 42px;
    height: 42px;
    font-size: .95rem;
}

/* ---------- Timeline ---------- */

.br-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

    .br-timeline::before {
        content: '';
        position: absolute;
        inset-inline-start: 15px;
        top: 6px;
        bottom: 6px;
        width: 2px;
        background: var(--br-border);
    }

.br-timeline__item {
    position: relative;
    padding-inline-start: 45px;
    padding-bottom: 1.15rem;
}

    .br-timeline__item:last-child {
        padding-bottom: 0;
    }

.br-timeline__dot {
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--br-surface);
    border: 2px solid var(--br-border);
    font-size: .85rem;
}

.br-timeline__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .4rem;
    font-size: .86rem;
}

.br-timeline__actor {
    font-weight: 700;
}

.br-timeline__time {
    color: var(--br-muted);
    font-size: .76rem;
    margin-inline-start: auto;
}

.br-timeline__detail {
    margin-top: .4rem;
    background: #fafbfd;
    border: 1px solid var(--br-border);
    border-radius: 10px;
    padding: .55rem .7rem;
    font-size: .84rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- Empty state ---------- */

.br-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--br-muted);
}

    .br-empty i {
        font-size: 2.2rem;
        opacity: .5;
        display: block;
        margin-bottom: .6rem;
    }

/* ---------- Forms ---------- */

.br-form-section {
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    background: var(--br-surface);
    margin-bottom: 1.1rem;
    overflow: hidden;
}

.br-form-section__header {
    padding: .75rem 1.05rem;
    background: #fafbfd;
    border-bottom: 1px solid var(--br-border);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: .45rem;
}

    .br-form-section__header .br-step {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: var(--br-accent);
        color: #fff;
        display: grid;
        place-items: center;
        font-size: .72rem;
    }

/* ---------- Multi-step wizard ---------- */

.br-wizard {
    background: var(--br-surface);
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    box-shadow: var(--br-shadow);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
}

.br-wizard__steps {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.br-wizard__step {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 0 .3rem;
}

/* Connector lines run between bullet centres; each step draws its own two halves. */
.br-wizard__step::before,
.br-wizard__step::after {
    content: '';
    position: absolute;
    top: 21px;
    width: 50%;
    height: 2px;
    background: #e3e8ef;
    transition: background-color .3s ease;
}

.br-wizard__step::before {
    inset-inline-start: 0;
}

.br-wizard__step::after {
    inset-inline-end: 0;
}

.br-wizard__step:first-child::before,
.br-wizard__step:last-child::after {
    display: none;
}

.br-wizard__bullet {
    position: relative;
    z-index: 1;
    width: 42px;
    height: 42px;
    margin: 0 auto .6rem;
    border-radius: 13px;
    background: #eef1f6;
    color: var(--br-muted);
    display: grid;
    place-items: center;
    font-size: .9rem;
    font-weight: 700;
    /* Masks the connector line where it would pass behind the bullet. */
    box-shadow: 0 0 0 5px var(--br-surface);
    transition: background-color .3s ease, color .3s ease;
}

.br-wizard__tick {
    display: none;
    font-size: 1.1rem;
}

.br-wizard__label {
    display: block;
    font-size: .86rem;
    font-weight: 700;
    color: var(--br-muted);
}

.br-wizard__hint {
    display: block;
    margin-top: .2rem;
    font-size: .74rem;
    color: var(--br-muted);
}

.br-wizard__step.is-done::before,
.br-wizard__step.is-done::after,
.br-wizard__step.is-active::before {
    background: var(--br-accent);
}

.br-wizard__step.is-done .br-wizard__bullet,
.br-wizard__step.is-active .br-wizard__bullet {
    background: var(--br-accent);
    color: #fff;
}

.br-wizard__step.is-done .br-wizard__num {
    display: none;
}

.br-wizard__step.is-done .br-wizard__tick {
    display: block;
}

.br-wizard__step.is-done .br-wizard__label,
.br-wizard__step.is-active .br-wizard__label {
    color: var(--br-text);
}

.br-wizard__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
}

.br-review {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .55rem 1rem;
    margin: 0;
}

    .br-review dt {
        color: var(--br-muted);
        font-weight: 500;
        font-size: .82rem;
    }

    .br-review dd {
        margin: 0;
        font-weight: 600;
        overflow-wrap: anywhere;
    }

@media (max-width: 575.98px) {
    .br-wizard__hint {
        display: none;
    }

    .br-wizard__label {
        font-size: .74rem;
    }

    .br-wizard__bullet {
        width: 34px;
        height: 34px;
        border-radius: 11px;
        font-size: .8rem;
    }

    .br-wizard__step::before,
    .br-wizard__step::after {
        top: 17px;
    }

    .br-review {
        grid-template-columns: 1fr;
        gap: .15rem;
    }

        .br-review dd {
            margin-bottom: .5rem;
        }
}

.br-form-section__body {
    padding: 1.05rem;
}

.form-label {
    font-size: .84rem;
    font-weight: 600;
    margin-bottom: .3rem;
}

.form-control, .form-select {
    font-size: .88rem;
    border-color: #d7dce5;
    border-radius: 10px;
    padding: .5rem .7rem;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--br-accent);
        box-shadow: 0 0 0 3px rgba(26, 79, 179, .12);
    }

/* Primary actions follow the brand accent rather than the Bootstrap default. */
.btn-primary {
    --bs-btn-bg: var(--br-accent);
    --bs-btn-border-color: var(--br-accent);
    --bs-btn-hover-bg: var(--br-accent-hover);
    --bs-btn-hover-border-color: var(--br-accent-hover);
    --bs-btn-active-bg: var(--br-accent-hover);
    --bs-btn-active-border-color: var(--br-accent-hover);
    --bs-btn-disabled-bg: var(--br-accent);
    --bs-btn-disabled-border-color: var(--br-accent);
    --bs-btn-focus-shadow-rgb: 26, 79, 179;
}

.btn-outline-primary {
    --bs-btn-color: var(--br-accent);
    --bs-btn-border-color: var(--br-accent);
    --bs-btn-hover-bg: var(--br-accent);
    --bs-btn-hover-border-color: var(--br-accent);
    --bs-btn-active-bg: var(--br-accent-hover);
    --bs-btn-active-border-color: var(--br-accent-hover);
    --bs-btn-focus-shadow-rgb: 26, 79, 179;
}

.btn-link {
    --bs-btn-color: var(--br-accent);
    --bs-btn-hover-color: var(--br-accent-hover);
}

.pagination {
    --bs-pagination-color: var(--br-accent);
    --bs-pagination-hover-color: var(--br-accent-hover);
    --bs-pagination-active-bg: var(--br-accent);
    --bs-pagination-active-border-color: var(--br-accent);
    --bs-pagination-focus-color: var(--br-accent-hover);
    --bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(26, 79, 179, .25);
}

/* Bootstrap's invalid styling, driven by the classes jQuery unobtrusive
   validation puts on the field and its message span. */
.form-control.input-validation-error,
.form-select.input-validation-error {
    border-color: #d92d20;
}

    .form-control.input-validation-error:focus,
    .form-select.input-validation-error:focus {
        border-color: #d92d20;
        box-shadow: 0 0 0 3px rgba(217, 45, 32, .12);
    }

.form-check-input.input-validation-error {
    border-color: #d92d20;
}

.field-validation-error {
    display: block;
    width: 100%;
    margin-top: .3rem;
    color: #d92d20;
}

.field-validation-valid:empty {
    display: none;
}

.text-danger.field-validation-error,
.validation-summary-errors {
    font-size: .8rem;
}

.required-mark {
    color: #d92d20;
    margin-inline-start: .15rem;
}

/* ---------- Dropzone ---------- */

.br-dropzone {
    border: 2px dashed #cfd6e4;
    border-radius: var(--br-radius);
    background: #fafbfd;
    padding: 1.6rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .12s ease, background-color .12s ease;
}

    .br-dropzone:hover,
    .br-dropzone.is-dragover {
        border-color: var(--br-accent);
        background: var(--br-accent-soft);
    }

    .br-dropzone i {
        font-size: 1.8rem;
        color: var(--br-accent);
        display: block;
        margin-bottom: .4rem;
    }

.br-filelist {
    list-style: none;
    margin: .8rem 0 0;
    padding: 0;
}

    .br-filelist li {
        display: flex;
        align-items: center;
        gap: .55rem;
        padding: .45rem .65rem;
        border: 1px solid var(--br-border);
        border-radius: 10px;
        margin-bottom: .4rem;
        font-size: .83rem;
        background: var(--br-surface);
    }

        .br-filelist__thumb {
            width: 2.5rem;
            height: 2.5rem;
            flex: 0 0 auto;
            border-radius: 10px;
            border: 1px solid var(--br-border);
            object-fit: cover;
            background: var(--br-bg);
        }

        .br-filelist li .bi-x-lg {
            margin-inline-start: auto;
            cursor: pointer;
            color: var(--br-muted);
        }

/* ---------- Detail rows ---------- */

.br-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .85rem;
}

.br-meta__item {
    min-width: 0;
}

.br-meta__label {
    font-size: .74rem;
    color: var(--br-muted);
    margin-bottom: .2rem;
}

.br-meta__value {
    font-size: .87rem;
    font-weight: 600;
    word-break: break-word;
}

.br-prose {
    font-size: .88rem;
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- Timer ---------- */

.br-timer {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.1rem;
    font-weight: 700;
    direction: ltr;
    color: var(--br-accent);
}

/* ---------- Login ---------- */

.br-login {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #eef2fb 0%, #f7f9fc 100%);
}

.br-login__card {
    width: 100%;
    max-width: 420px;
    background: var(--br-surface);
    border: 1px solid var(--br-border);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(16, 24, 40, .08);
    padding: 2rem 1.75rem;
}

.br-login__mark {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: var(--br-accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    margin: 0 auto 1rem;
}

/* Sign-in failures have to be readable at a glance, so this is deliberately larger than the
   small print used elsewhere on the card. */
.br-login__alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin-bottom: 1.1rem;
    padding: .85rem 1rem;
    border: 1px solid #f1aeb5;
    border-inline-start: 4px solid #dc3545;
    border-radius: 12px;
    background: #fdeaec;
    color: #8c1d28;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.8;
}

    .br-login__alert .bi {
        font-size: 1.15rem;
        line-height: 1.6;
        flex: 0 0 auto;
    }

.br-login__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .85rem;
    margin-top: 2.25rem;
}

.br-login__version {
    font-size: .78rem;
    color: var(--br-muted);
}

.br-login__powered {
    font-size: .7rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--br-muted);
    direction: ltr;
}

.br-login__brand-logo {
    width: 116px;
    height: auto;
}

/* ---------- Profile ---------- */

.br-profile-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.1rem;
    padding: 1.4rem 1.5rem;
    border-radius: var(--br-radius);
    box-shadow: var(--br-shadow);
    color: #fff;
    background: linear-gradient(135deg, var(--br-accent) 0%, #2f6ae0 55%, #4a86ef 100%);
}

.br-profile-hero__avatar .br-avatar {
    background: rgba(255, 255, 255, .18);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, .45);
}

.br-profile-hero__identity {
    min-width: 0;
    flex: 1 1 220px;
}

.br-profile-hero__name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.br-profile-hero__username {
    margin-top: .15rem;
    font-size: .8rem;
    opacity: .85;
}

.br-profile-hero__roles {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .6rem;
}

.br-profile-hero__role {
    padding: .1rem .55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .3);
    font-size: .72rem;
    font-weight: 600;
}

.br-profile-hero__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1.6rem;
    margin-inline-start: auto;
}

.br-profile-hero__fact {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.br-profile-hero__fact-label {
    font-size: .72rem;
    opacity: .8;
}

.br-profile-hero__fact-value {
    font-size: .86rem;
    font-weight: 700;
}

.br-datalist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.br-datalist li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem;
    padding: .6rem 0;
    border-bottom: 1px dashed var(--br-border);
}

.br-datalist li:first-child {
    padding-top: 0;
}

.br-datalist li:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.br-datalist__label {
    flex: 0 0 auto;
    width: 130px;
    color: var(--br-muted);
    font-size: .8rem;
}

.br-datalist__value {
    flex: 1 1 auto;
    min-width: 0;
    font-size: .86rem;
    font-weight: 600;
}

.br-password-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.br-password-hint {
    padding: .65rem .8rem;
    border-radius: 10px;
    background: var(--br-accent-soft);
    color: var(--br-accent);
    font-size: .78rem;
    line-height: 1.8;
}

@media (max-width: 767.98px) {
    .br-profile-hero__facts {
        margin-inline-start: 0;
        gap: 1.1rem;
    }

    .br-datalist__label {
        width: 100%;
    }
}

/* ---------- Attachment gallery ---------- */

.br-attachments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .85rem;
}

.br-attachment {
    display: flex;
    flex-direction: column;
    margin: 0;
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    overflow: hidden;
    background: var(--br-surface);
}

.br-attachment__preview {
    display: grid;
    place-items: center;
    width: 100%;
    height: 150px;
    padding: .5rem;
    border: none;
    border-bottom: 1px solid var(--br-border);
    background: #eef1f6;
    cursor: pointer;
    overflow: hidden;
}

.br-attachment__preview img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}

.br-attachment__preview--file {
    cursor: default;
    font-size: 2rem;
    color: var(--br-muted);
}

.br-attachment__body {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .7rem .75rem;
    background: var(--br-surface);
}

.br-attachment__name {
    font-size: .8rem;
    font-weight: 600;
    direction: ltr;
  text-align: start;
}

.br-attachment__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    font-size: .74rem;
    color: var(--br-muted);
}

.br-attachment__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin-top: .2rem;
    padding-top: .55rem;
    border-top: 1px solid var(--br-border);
}

.br-lightbox__image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

/* ---------- Chat conversation ---------- */

.br-chat {
    display: flex;
    flex-direction: column;
}

.br-chat__body {
    display: flex;
    flex-direction: column;
    gap: .9rem;
    max-height: 520px;
    overflow-y: auto;
    padding: 1.05rem;
    background: #f7f9fc;
}

.br-chat__row {
    display: flex;
    align-items: flex-end;
    gap: .55rem;
    max-width: 78%;
}

.br-chat__row.is-start {
    align-self: flex-start;
}

.br-chat__row.is-end {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.br-chat__bubble {
    min-width: 0;
    padding: .6rem .8rem;
    border-radius: 14px;
    background: var(--br-surface);
    border: 1px solid var(--br-border);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.br-chat__row.is-start .br-chat__bubble {
    border-start-end-radius: 4px;
}

.br-chat__row.is-end .br-chat__bubble {
    background: var(--br-accent-soft);
    border-color: rgba(26, 79, 179, .18);
    border-start-start-radius: 4px;
}

.br-chat__bubble.is-internal {
    background: #fffaf0;
    border-color: #f2d8a8;
}

.br-chat__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin-bottom: .3rem;
}

.br-chat__author {
    font-weight: 700;
    font-size: .8rem;
}

.br-chat__text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: .86rem;
    line-height: 1.75;
}

.br-chat__foot {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: .3rem;
    font-size: .7rem;
    color: var(--br-muted);
}

.br-chat__composer {
    padding: .85rem 1.05rem;
    border-top: 1px solid var(--br-border);
    background: var(--br-surface);
}

/* One rounded shell holding the message box and its toolbar, so the whole composer reads as a
   single control rather than three buttons sitting next to a field. */
.br-chat__input {
    border: 1px solid var(--br-border);
    border-radius: 18px;
    background: #fff;
    padding: .75rem .9rem .6rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.br-chat__input:focus-within {
    border-color: var(--br-accent);
    box-shadow: 0 0 0 .2rem rgba(26, 79, 179, .12);
}

.br-chat__input textarea,
.br-chat__input textarea:focus {
    width: 100%;
    border: 0;
    outline: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    color: inherit;
}

.br-chat__tools {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: .6rem;
}

.br-chat__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    border: 0;
    border-radius: 50%;
    background: var(--br-accent);
    color: #fff;
    font-size: 1.05rem;
    flex: 0 0 auto;
}

.br-chat__send:hover {
    filter: brightness(1.1);
}

/* Pushed to the far end of the toolbar, opposite the send button. */
.br-chat__clip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    margin-inline-start: auto;
    border-radius: 50%;
    cursor: pointer;
    color: var(--br-muted);
    font-size: 1.05rem;
}

.br-chat__clip:hover {
    background: var(--br-bg);
    color: var(--br-accent);
}

.br-chat__files {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-top: .55rem;
}

.br-chat__file {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .35rem .5rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, .55);
    text-decoration: none;
    color: inherit;
}

    .br-chat__file:hover {
        background: rgba(255, 255, 255, .9);
    }

.br-chat__file-thumb {
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 auto;
    border-radius: 9px;
    object-fit: cover;
    background: var(--br-bg);
}

.br-chat__file-thumb--doc {
    display: grid;
    place-items: center;
    color: var(--br-muted);
}

.br-chat__file-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.br-chat__file-name {
    font-size: .78rem;
    text-align: start;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.br-chat__file-size {
    font-size: .7rem;
    color: var(--br-muted);
}

/* Starts at a comfortable height, grows with the text, then scrolls instead of pushing the page. */
.br-chat__input textarea {
    resize: none;
    overflow-y: auto;
    min-height: 3.4rem;
    max-height: 11rem;
    line-height: 1.8;
}

.br-chat__option .form-control {
    width: 90px;
}

.br-chat__closed {
    padding: .85rem 1.05rem;
    border-top: 1px solid var(--br-border);
    color: var(--br-muted);
    font-size: .82rem;
}

@media (max-width: 575.98px) {
    .br-chat__row {
        max-width: 92%;
    }
}

/* ---------- Notifications page ---------- */

.br-notif-tabs {
    display: flex;
    gap: 1.4rem;
    padding: 0 1.1rem;
    border-bottom: 1px solid var(--br-border);
}

.br-notif-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .85rem .1rem;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--br-muted);
    font-size: .88rem;
}

.br-notif-tab:hover {
    color: var(--br-text);
}

.br-notif-tab.is-active {
    color: var(--br-accent);
    border-bottom-color: var(--br-accent);
    font-weight: 700;
}

.br-notif-tab__count {
    background: #eef1f6;
    color: var(--br-muted);
    border-radius: 999px;
    padding: .05rem .45rem;
    font-size: .72rem;
    font-weight: 600;
}

.br-notif-tab.is-active .br-notif-tab__count {
    background: rgba(26, 79, 179, .12);
    color: var(--br-accent);
}

.br-notif-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--br-border);
}

.br-notif-search {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
}

.br-notif-search .form-control {
    width: 230px;
    max-width: 100%;
}

.br-notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.br-notif-row {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--br-border);
}

.br-notif-row:last-child {
    border-bottom: none;
}

.br-notif-row:hover {
    background: #fafbfd;
}

.br-notif-row__dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: transparent;
}

.br-notif-row.is-unread .br-notif-row__dot {
    background: #d92d20;
}

.br-notif-row__main {
    flex: 1 1 auto;
    min-width: 0;
}

.br-notif-row__title {
    font-weight: 600;
    font-size: .88rem;
    overflow-wrap: anywhere;
}

.br-notif-row.is-unread .br-notif-row__title {
    font-weight: 700;
}

.br-notif-row__message {
    color: var(--br-muted);
    font-size: .8rem;
    overflow-wrap: anywhere;
}

.br-notif-row__type {
    flex: 0 0 auto;
    width: 110px;
    color: var(--br-muted);
    font-size: .8rem;
}

.br-notif-row__time {
    flex: 0 0 auto;
    width: 110px;
    color: var(--br-muted);
    font-size: .8rem;
    white-space: nowrap;
}

.br-notif-row__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: .5rem;
}

@media (max-width: 767.98px) {
    .br-notif-row {
        flex-wrap: wrap;
        gap: .5rem .7rem;
    }

    .br-notif-row__main {
        flex: 1 1 100%;
        order: 1;
    }

    .br-notif-row__dot {
        order: 0;
    }

    .br-notif-row__type,
    .br-notif-row__time {
        width: auto;
        order: 2;
    }

    .br-notif-row__actions {
        order: 3;
        margin-inline-start: auto;
    }

    .br-notif-search {
        flex: 1 1 100%;
    }

    .br-notif-search .form-control {
        width: auto;
        flex: 1 1 auto;
    }
}

/* ---------- Notification dropdown ---------- */

.br-notif {
    display: flex;
    gap: .6rem;
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--br-border);
    font-size: .84rem;
}

    .br-notif:last-child {
        border-bottom: none;
    }

    .br-notif.is-unread {
        background: var(--br-accent-soft);
    }

.br-notif__title {
    font-weight: 700;
    font-size: .84rem;
}

.br-notif__time {
    font-size: .73rem;
    color: var(--br-muted);
}

.br-notif-panel {
    width: 340px;
    max-width: calc(100vw - 1.5rem);
    max-height: 420px;
    overflow-y: auto;
    padding: 0;
}

/* ---------- Charts ---------- */

.br-chart {
    position: relative;
    height: 280px;
}

/* ---------- Misc ---------- */

.br-toast-stack {
    position: fixed;
    top: 1rem;
    inset-inline-start: 1rem;
    z-index: 1090;
}

.br-filter-panel .form-label {
    font-size: .78rem;
}

.br-scroll-x {
    overflow-x: auto;
}

@media print {
    .br-sidebar, .br-topbar, .br-footer, .br-no-print {
        display: none !important;
    }
}
