/* Nexobiz Enterprise Chat System */
:root {
    --nbx-chat-primary: #2563EB;
    --nbx-chat-navy: #0F172A;
    --nbx-chat-nav-text: #0F172A;
    --nbx-chat-nav-text-muted: #334155;
    --nbx-chat-nav-text-subtle: #475569;
    --nbx-chat-bg: #F8FAFC;
    --nbx-chat-border: #E2E8F0;
    --nbx-chat-success: #16A34A;
    --nbx-chat-warning: #F59E0B;
    --nbx-chat-danger: #DC2626;
    --nbx-chat-ai: #7C3AED;
    --nbx-chat-white: #ffffff;
    --nbx-chat-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --nbx-chat-radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
.nbx-chat-body { margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--nbx-chat-navy); background: var(--nbx-chat-bg); }
.nbx-chat-app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.nbx-chat-sidebar { background: var(--nbx-chat-white); border-right: 1px solid var(--nbx-chat-border); padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.nbx-chat-brand { display: flex; gap: .75rem; align-items: center; text-decoration: none; color: inherit; }
.nbx-chat-brand__logo { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #2563EB, #1D4ED8); color: #fff; display: grid; place-items: center; font-weight: 800; }
.nbx-chat-brand strong { display: block; font-size: .95rem; color: var(--nbx-chat-nav-text); }
.nbx-chat-brand span { color: var(--nbx-chat-nav-text-muted); font-size: .75rem; }
.nbx-chat-nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.nbx-chat-nav__item { display: flex; justify-content: space-between; align-items: center; padding: .65rem .75rem; border-radius: 10px; color: var(--nbx-chat-nav-text); text-decoration: none; font-size: .875rem; font-weight: 500; transition: .15s ease; }
.nbx-chat-nav__item:hover { background: #EFF6FF; color: var(--nbx-chat-nav-text); }
.nbx-chat-nav__item.is-active { background: #EFF6FF; color: var(--nbx-chat-nav-text); font-weight: 700; box-shadow: inset 3px 0 0 var(--nbx-chat-primary); }
.nbx-chat-nav__badge { background: var(--nbx-chat-primary); color: #fff; font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; }
.nbx-chat-sidebar__card { background: linear-gradient(180deg, #F5F3FF, #EFF6FF); border: 1px solid var(--nbx-chat-border); border-radius: var(--nbx-chat-radius); padding: 1rem; }
.nbx-chat-sidebar__card strong { color: var(--nbx-chat-nav-text); }
.nbx-chat-sidebar__card p { font-size: .8rem; color: var(--nbx-chat-nav-text-muted); }

.nbx-chat-main { display: flex; flex-direction: column; min-width: 0; }
.nbx-chat-header { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 1rem; align-items: center; padding: .85rem 1.25rem; background: var(--nbx-chat-white); border-bottom: 1px solid var(--nbx-chat-border); }
.nbx-chat-header__left, .nbx-chat-header__right { display: flex; align-items: center; gap: .75rem; }
.nbx-chat-header__right { justify-content: flex-end; }
.nbx-chat-breadcrumb { display: flex; gap: .35rem; align-items: center; font-size: .85rem; color: var(--nbx-chat-nav-text-muted); }
.nbx-chat-breadcrumb strong { color: var(--nbx-chat-nav-text); font-weight: 700; }
.nbx-chat-search-global, .nbx-chat-list-search input, .nbx-chat-composer textarea, .nbx-chat-settings-form input, .nbx-chat-settings-form textarea, .nbx-chat-settings-form select { width: 100%; border: 1px solid var(--nbx-chat-border); border-radius: 10px; padding: .65rem .85rem; font: inherit; background: #fff; }
.nbx-chat-search-global:focus, .nbx-chat-list-search input:focus, .nbx-chat-composer textarea:focus { outline: none; border-color: var(--nbx-chat-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.nbx-chat-icon-btn { position: relative; width: 38px; height: 38px; border: 1px solid var(--nbx-chat-border); border-radius: 10px; background: #fff; cursor: pointer; display: grid; place-items: center; }
.nbx-chat-badge { position: absolute; top: -4px; right: -4px; background: var(--nbx-chat-danger); color: #fff; font-size: .65rem; border-radius: 999px; padding: .1rem .35rem; }
.nbx-chat-profile { display: flex; gap: .6rem; align-items: center; }
.nbx-chat-profile__avatar { width: 36px; height: 36px; border-radius: 999px; background: #DBEAFE; color: var(--nbx-chat-primary); display: grid; place-items: center; font-weight: 700; }
.nbx-chat-profile strong { display: block; font-size: .85rem; color: var(--nbx-chat-nav-text); }
.nbx-chat-profile span { font-size: .75rem; color: var(--nbx-chat-nav-text-muted); }
.nbx-chat-mobile-toggle { display: none; border: 0; background: transparent; cursor: pointer; }
.nbx-chat-flash { margin: .75rem 1.25rem 0; padding: .75rem 1rem; border-radius: 10px; background: #ECFDF5; color: #166534; border: 1px solid #BBF7D0; }
.nbx-chat-content { padding: 1rem 1.25rem 1.25rem; flex: 1; min-height: 0; }

.nbx-chat-inbox__tabs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .75rem; }
.nbx-chat-tab { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .85rem; border-radius: 999px; border: 1px solid var(--nbx-chat-border); background: #fff; color: var(--nbx-chat-nav-text); text-decoration: none; font-size: .82rem; font-weight: 500; white-space: nowrap; transition: .15s; }
.nbx-chat-tab:hover { border-color: #BFDBFE; background: #EFF6FF; color: var(--nbx-chat-nav-text); }
.nbx-chat-tab.is-active { background: #EFF6FF; border-color: #93C5FD; color: var(--nbx-chat-nav-text); font-weight: 700; box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .12); }
.nbx-chat-tab__count { background: #E2E8F0; color: var(--nbx-chat-nav-text); padding: .05rem .4rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.nbx-chat-tab.is-active .nbx-chat-tab__count { background: #DBEAFE; color: var(--nbx-chat-nav-text); }
.nbx-chat-tab:not(.is-active) .nbx-chat-tab__count { background: #F1F5F9; color: var(--nbx-chat-nav-text-muted); }

.nbx-chat-inbox__grid { display: grid; grid-template-columns: 320px 1fr 300px; gap: 1rem; min-height: calc(100vh - 180px); }
.nbx-chat-inbox__grid--rooms { grid-template-columns: 280px 1fr 260px; }
.nbx-chat-list-panel, .nbx-chat-panel, .nbx-chat-details { background: #fff; border: 1px solid var(--nbx-chat-border); border-radius: var(--nbx-chat-radius); box-shadow: var(--nbx-chat-shadow); min-height: 0; display: flex; flex-direction: column; }
.nbx-chat-list-panel__toolbar { padding: .85rem; border-bottom: 1px solid var(--nbx-chat-border); display: flex; flex-direction: column; gap: .5rem; }
.nbx-chat-list-panel__toolbar strong { color: var(--nbx-chat-nav-text); }
.nbx-chat-list-search { display: flex; gap: .5rem; }
.nbx-chat-select { border: 1px solid var(--nbx-chat-border); border-radius: 10px; padding: .5rem .65rem; background: #fff; font: inherit; color: var(--nbx-chat-nav-text); }

.nbx-chat-list { overflow: auto; flex: 1; }
.nbx-chat-list-item { display: grid; grid-template-columns: 44px 1fr auto; gap: .75rem; padding: .85rem; border-bottom: 1px solid var(--nbx-chat-border); text-decoration: none; color: var(--nbx-chat-nav-text); transition: .15s; cursor: pointer; }
.nbx-chat-list-item:hover { background: #EFF6FF; box-shadow: inset 3px 0 0 #93C5FD; color: var(--nbx-chat-nav-text); }
.nbx-chat-list-item.is-active { background: #EFF6FF; box-shadow: inset 4px 0 0 var(--nbx-chat-primary); color: var(--nbx-chat-nav-text); }
.nbx-chat-list-item.is-active strong { font-weight: 700; color: var(--nbx-chat-nav-text); }
.nbx-chat-list-item__avatar { position: relative; width: 44px; height: 44px; border-radius: 999px; background: #E2E8F0; display: grid; place-items: center; font-size: .78rem; font-weight: 700; color: var(--nbx-chat-nav-text-muted); }
.nbx-chat-online-dot { position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; border-radius: 999px; background: var(--nbx-chat-success); border: 2px solid #fff; }
.nbx-chat-list-item__top { display: flex; justify-content: space-between; gap: .5rem; font-size: .82rem; color: var(--nbx-chat-nav-text); }
.nbx-chat-list-item__top time { color: var(--nbx-chat-nav-text-muted); }
.nbx-chat-list-item__body p { margin: .25rem 0; color: #64748B; font-size: .8rem; line-height: 1.35; }
.nbx-chat-list-item__meta { display: flex; flex-wrap: wrap; gap: .35rem; }
.nbx-chat-list-item__unread { align-self: start; background: var(--nbx-chat-primary); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: .72rem; font-weight: 700; }

.nbx-chat-panel__head { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--nbx-chat-border); }
.nbx-chat-panel__head h1 { margin: 0; font-size: 1.05rem; }
.nbx-chat-panel__head p { margin: .25rem 0 0; color: #64748B; font-size: .82rem; }
.nbx-chat-panel__actions { display: flex; gap: .5rem; align-items: center; }

.nbx-chat-messages { flex: 1; overflow: auto; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; background: linear-gradient(180deg, #FAFBFC, #F8FAFC); }
.nbx-chat-date-sep { align-self: center; font-size: .72rem; color: #64748B; background: #fff; border: 1px solid var(--nbx-chat-border); padding: .2rem .65rem; border-radius: 999px; }
.nbx-chat-message { display: flex; }
.nbx-chat-message.is-in { justify-content: flex-start; }
.nbx-chat-message.is-out { justify-content: flex-end; }
.nbx-chat-message__bubble { max-width: min(78%, 620px); padding: .75rem .9rem; border-radius: 14px; border: 1px solid var(--nbx-chat-border); background: #fff; }
.nbx-chat-message.is-out .nbx-chat-message__bubble { background: #DBEAFE; border-color: #BFDBFE; }
.nbx-chat-message.is-internal .nbx-chat-message__bubble { background: #FFFBEB; border-color: #FDE68A; }
.nbx-chat-message__note-label { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; color: #B45309; margin-bottom: .25rem; }
.nbx-chat-message__meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .45rem; font-size: .72rem; color: #64748B; }
.nbx-chat-read { color: var(--nbx-chat-primary); font-weight: 700; }
.nbx-chat-attachment { display: block; margin-top: .5rem; padding: .5rem; border-radius: 8px; background: rgba(255,255,255,.7); text-decoration: none; color: inherit; border: 1px dashed #CBD5E1; }

.nbx-chat-composer { border-top: 1px solid var(--nbx-chat-border); padding: .85rem; display: flex; flex-direction: column; gap: .65rem; }
.nbx-chat-composer__toolbar, .nbx-chat-composer__footer { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.nbx-chat-action-bar { display: flex; flex-wrap: wrap; gap: .5rem; padding: .85rem; border-top: 1px solid var(--nbx-chat-border); background: #FAFBFC; }

.nbx-chat-details { overflow: auto; padding: .85rem; gap: .75rem; }
.nbx-chat-details__card { border: 1px solid var(--nbx-chat-border); border-radius: 10px; padding: .85rem; margin-bottom: .75rem; background: #fff; }
.nbx-chat-details__card h3 { margin: 0 0 .65rem; font-size: .9rem; }
.nbx-chat-details__card dl { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .75rem; margin: 0; font-size: .82rem; }
.nbx-chat-details__card dt { color: #64748B; }
.nbx-chat-details__card--notes { background: #FFFBEB; }
.nbx-chat-details__card--ai { background: #F5F3FF; border-color: #DDD6FE; }
.nbx-chat-sla { color: var(--nbx-chat-danger); font-weight: 600; }
.nbx-chat-muted { color: #64748B; font-size: .82rem; }

.nbx-chat-btn { border: 0; border-radius: 10px; padding: .55rem .9rem; font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; transition: .15s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.nbx-chat-btn:hover { filter: brightness(.96); }
.nbx-chat-btn--primary { background: var(--nbx-chat-primary); color: #fff; }
.nbx-chat-btn--ghost { background: #fff; color: var(--nbx-chat-nav-text); border: 1px solid var(--nbx-chat-border); }
.nbx-chat-btn--success { background: var(--nbx-chat-success); color: #fff; }
.nbx-chat-btn--warning { background: var(--nbx-chat-warning); color: #fff; }
.nbx-chat-btn--ai { background: var(--nbx-chat-ai); color: #fff; }
.nbx-chat-pill { display: inline-flex; padding: .15rem .45rem; border-radius: 999px; background: #EFF6FF; color: #1D4ED8; font-size: .68rem; font-weight: 600; }
.nbx-chat-pill--source { background: #F1F5F9; color: #475569; }
.nbx-chat-pill--danger { background: #FEE2E2; color: #B91C1C; }
.nbx-chat-pill--warning { background: #FEF3C7; color: #B45309; }
.nbx-chat-pill--primary { background: #DBEAFE; color: #1D4ED8; }
.nbx-chat-pill--muted { background: #F1F5F9; color: #64748B; }
.nbx-chat-pill--teal { background: #F0FDFA; color: #0D9488; }

.nbx-chat-dropdown { position: relative; }
.nbx-chat-dropdown summary { list-style: none; }
.nbx-chat-dropdown__menu { position: absolute; right: 0; top: calc(100% + .35rem); min-width: 180px; background: #fff; border: 1px solid var(--nbx-chat-border); border-radius: 10px; box-shadow: var(--nbx-chat-shadow); padding: .35rem; z-index: 20; }
.nbx-chat-dropdown__menu button, .nbx-chat-dropdown__menu a { width: 100%; text-align: left; border: 0; background: transparent; padding: .55rem .65rem; border-radius: 8px; cursor: pointer; font: inherit; color: var(--nbx-chat-nav-text); text-decoration: none; }
.nbx-chat-dropdown__menu button:hover { background: #F8FAFC; }
.nbx-chat-dropdown__menu--form { padding: .75rem; display: flex; flex-direction: column; gap: .5rem; min-width: 240px; }

.nbx-chat-empty { padding: 2rem; text-align: center; color: #64748B; }
.nbx-chat-empty--hero { display: grid; place-content: center; min-height: 360px; gap: .5rem; }
.nbx-chat-page__head h1 { margin: 0 0 .35rem; }
.nbx-chat-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.nbx-chat-metric { background: #fff; border: 1px solid var(--nbx-chat-border); border-radius: 12px; padding: 1rem; box-shadow: var(--nbx-chat-shadow); }
.nbx-chat-metric span { display: block; color: #64748B; font-size: .78rem; }
.nbx-chat-metric strong { font-size: 1.35rem; }
.nbx-chat-table-wrap { overflow: auto; background: #fff; border: 1px solid var(--nbx-chat-border); border-radius: 12px; }
.nbx-chat-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.nbx-chat-table th, .nbx-chat-table td { padding: .75rem; border-bottom: 1px solid var(--nbx-chat-border); text-align: left; }
.nbx-chat-table th { background: #F8FAFC; color: #64748B; font-size: .75rem; text-transform: uppercase; }
.nbx-chat-reports-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.nbx-chat-stat-list { list-style: none; margin: 0; padding: 0; }
.nbx-chat-stat-list li { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px solid #F1F5F9; font-size: .85rem; }
.nbx-chat-settings-form { display: grid; gap: 1rem; max-width: none; }
.nbx-chat-settings-form label { display: grid; gap: .35rem; font-size: .85rem; font-weight: 600; }
.nbx-chat-check { display: flex !important; align-items: center; gap: .5rem; font-weight: 500 !important; }

.nbx-chat-settings-page .nbx-chat-page__head p { color: #64748B; margin: 0; max-width: 720px; }

.nbx-chat-settings-card {
    background: #fff;
    border: 1px solid var(--nbx-chat-border);
    border-radius: 14px;
    box-shadow: var(--nbx-chat-shadow);
    padding: 1.15rem 1.25rem 1.25rem;
}

.nbx-chat-settings-card__head { margin-bottom: 1rem; }
.nbx-chat-settings-card__head h3 { margin: 0 0 .25rem; font-size: 1rem; }
.nbx-chat-settings-card__head p { margin: 0; color: #64748B; font-size: .84rem; font-weight: 400; }

.nbx-chat-settings-toggles { display: grid; gap: .55rem; }
.nbx-chat-settings-toggles--compact { margin-bottom: 1rem; }

.nbx-chat-settings-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem .85rem;
    border: 1px solid #EEF2F6;
    border-radius: 10px;
    background: #F8FAFC;
    font-weight: 500 !important;
    cursor: pointer;
}

.nbx-chat-settings-toggle span { flex: 1; line-height: 1.4; color: #0F172A; font-size: .88rem; }

.nbx-chat-settings-toggle input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 2.35rem;
    height: 1.3rem;
    border-radius: 999px;
    background: #CBD5E1;
    position: relative;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    transition: background .18s ease;
}

.nbx-chat-settings-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(1.3rem - 4px);
    height: calc(1.3rem - 4px);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .15);
    transition: transform .18s ease;
}

.nbx-chat-settings-toggle input[type="checkbox"]:checked { background: #2563EB; }
.nbx-chat-settings-toggle input[type="checkbox"]:checked::after { transform: translateX(1.05rem); }

.nbx-chat-settings-toggle--footer {
    margin-top: .75rem;
    background: #FFFBEB;
    border-color: #FDE68A;
}

.nbx-chat-settings-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem 1rem;
}

.nbx-chat-settings-fields--inline { margin-top: .25rem; }
.nbx-chat-settings-field { display: grid; gap: .4rem; min-width: 0; }
.nbx-chat-settings-field--full { grid-column: 1 / -1; }
.nbx-chat-settings-field > span { font-size: .82rem; font-weight: 600; color: #334155; }

.nbx-chat-settings-color {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .65rem;
    border: 1px solid var(--nbx-chat-border);
    border-radius: 10px;
    background: #fff;
}

.nbx-chat-settings-color__swatch {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, .08);
    flex-shrink: 0;
}

.nbx-chat-settings-color input[type="color"] {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.nbx-chat-settings-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.nbx-chat-settings-color input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(15, 23, 42, .08); border-radius: 8px; }

.nbx-chat-settings-color__hex {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .82rem;
    color: #475569;
    letter-spacing: .02em;
}

.nbx-chat-settings-savebar {
    position: sticky;
    bottom: .75rem;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--nbx-chat-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
    backdrop-filter: blur(8px);
}

.nbx-chat-settings-savebar p {
    margin: 0;
    color: #64748B;
    font-size: .82rem;
    max-width: 520px;
}

.nbx-chat-settings-savebar .nbx-chat-btn--primary {
    min-width: 160px;
    padding: .75rem 1.25rem;
}

@media (max-width: 768px) {
    .nbx-chat-settings-fields { grid-template-columns: 1fr; }
    .nbx-chat-settings-savebar { flex-direction: column; align-items: stretch; }
    .nbx-chat-settings-savebar .nbx-chat-btn--primary { width: 100%; }
}
.nbx-chat-member-list { list-style: none; margin: 0; padding: 0; }
.nbx-chat-member-list li { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; font-size: .85rem; }

/* Tenant support reuse */
.tenant-shell .tenant-shell-main > main:has(.nbx-tenant-support-page) {
    padding: .65rem .85rem 1.25rem !important;
    background: #f6f8fb !important;
}

.nbx-tenant-support-page { max-width: none; }

.nbx-tenant-support-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .85rem;
}

.nbx-tenant-support-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.nbx-tenant-support {
    display: grid;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(220px, 280px);
    gap: .85rem;
    min-height: calc(100vh - 220px);
    align-items: stretch;
}

.nbx-tenant-support__sidebar,
.nbx-tenant-support__main,
.nbx-tenant-support__details {
    background: #fff;
    border: 1px solid var(--nbx-chat-border, #E2E8F0);
    border-radius: 12px;
    box-shadow: var(--nbx-chat-shadow);
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.nbx-tenant-support__sidebar { overflow: hidden; }
.nbx-tenant-support__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--nbx-chat-border);
}
.nbx-tenant-support__panel-head h2 { margin: 0; font-size: .95rem; font-weight: 700; color: var(--nbx-chat-nav-text); }

.nbx-tenant-support__list {
    flex: 1;
    overflow: auto;
    max-height: 340px;
}

.nbx-tenant-support__empty-list {
    padding: 1.5rem 1rem;
    text-align: center;
}
.nbx-tenant-support__empty-list p { color: #64748B; font-size: .875rem; margin: 0 0 .75rem; }

.nbx-tenant-support__conv-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .85rem;
    color: #fff;
    flex-shrink: 0;
}
.nbx-tenant-support__conv-icon--hris-payroll { background: linear-gradient(135deg, #7C3AED, #6D28D9); }
.nbx-tenant-support__conv-icon--crm { background: linear-gradient(135deg, #2563EB, #1D4ED8); }
.nbx-tenant-support__conv-icon--billing { background: linear-gradient(135deg, #16A34A, #15803D); }
.nbx-tenant-support__conv-icon--zkteco { background: linear-gradient(135deg, #0D9488, #0F766E); }
.nbx-tenant-support__conv-icon--general { background: linear-gradient(135deg, #64748B, #475569); }

.nbx-tenant-support__ticket-id {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    color: #64748B;
    margin-bottom: .25rem;
}

.nbx-tenant-support__section {
    padding: .85rem 1rem;
    border-top: 1px solid var(--nbx-chat-border);
}
.nbx-tenant-support__section h3 {
    margin: 0 0 .5rem;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--nbx-chat-nav-text-muted);
}

.nbx-tenant-support__categories {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.nbx-tenant-support__category {
    font-size: .72rem;
    padding: .25rem .5rem;
    border-radius: 999px;
    background: #F1F5F9;
    color: var(--nbx-chat-nav-text);
    border: 1px solid #E2E8F0;
}

.nbx-tenant-support__quick-links {
    display: grid;
    gap: .4rem;
}
.nbx-tenant-support__quick-links a {
    font-size: .84rem;
    color: var(--nbx-chat-nav-text);
    text-decoration: none;
    font-weight: 500;
}
.nbx-tenant-support__quick-links a:hover { text-decoration: underline; color: var(--nbx-chat-nav-text); }

.nbx-tenant-support__main { min-width: 0; }
.nbx-tenant-support__chat-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--nbx-chat-border);
}
.nbx-tenant-support__chat-head h2 { margin: 0; font-size: 1.05rem; }
.nbx-tenant-support__chat-head p { margin: .25rem 0 0; font-size: .82rem; color: #64748B; }

.nbx-tenant-support__messages { flex: 1; min-height: 280px; }

.nbx-tenant-support__welcome {
    flex: 1;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
    padding: 2rem;
    gap: .65rem;
}
.nbx-tenant-support__welcome-icon {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: #EFF6FF;
    color: #2563EB;
    display: grid;
    place-items: center;
    margin-bottom: .5rem;
}
.nbx-tenant-support__welcome h2 { margin: 0; font-size: 1.25rem; }
.nbx-tenant-support__welcome p { margin: 0; max-width: 28rem; color: #64748B; font-size: .9rem; }

.nbx-tenant-support__quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .65rem 1rem 0;
}
.nbx-tenant-support__quick-reply {
    border: 1px solid #E2E8F0;
    background: #fff;
    border-radius: 999px;
    padding: .35rem .75rem;
    font-size: .78rem;
    color: var(--nbx-chat-nav-text);
    cursor: pointer;
    transition: .15s;
}
.nbx-tenant-support__quick-reply:hover { background: #EFF6FF; border-color: #BFDBFE; color: var(--nbx-chat-nav-text); }

.nbx-tenant-support__composer { border-top: 1px solid var(--nbx-chat-border); }
.nbx-tenant-support__attach {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    color: #64748B;
    cursor: pointer;
}
.nbx-tenant-support__attach input { font-size: .75rem; }

/* Beat tenant-shell global button reset — composer send must stay readable */
.tenant-shell .nbx-tenant-support__composer .nbx-chat-btn--primary,
.tenant-shell .nbx-tenant-support__composer button.nbx-chat-btn--primary {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1.5px solid #2563eb !important;
    -webkit-text-fill-color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(37, 99, 235, .12);
    font-weight: 700;
}
.tenant-shell .nbx-tenant-support__composer .nbx-chat-btn--primary:hover,
.tenant-shell .nbx-tenant-support__composer button.nbx-chat-btn--primary:hover {
    background: #eff6ff !important;
    color: #0f172a !important;
    border-color: #1d4ed8 !important;
    -webkit-text-fill-color: #0f172a !important;
}

.nbx-tenant-support__resolved-note {
    padding: 1rem;
    border-top: 1px solid var(--nbx-chat-border);
    background: #F8FAFC;
    font-size: .85rem;
    color: #64748B;
    text-align: center;
}

.nbx-tenant-support__details {
    overflow: auto;
    padding: .85rem;
    gap: .65rem;
}
.nbx-tenant-support__detail-card {
    border: 1px solid var(--nbx-chat-border);
    border-radius: 10px;
    padding: .85rem;
    margin-bottom: .65rem;
}
.nbx-tenant-support__detail-card h3 { margin: 0 0 .65rem; font-size: .9rem; }
.nbx-tenant-support__detail-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem .65rem;
    margin: 0;
    font-size: .82rem;
}
.nbx-tenant-support__detail-list dt { color: #64748B; margin: 0; }
.nbx-tenant-support__detail-list dd { margin: 0; font-weight: 600; }

.nbx-tenant-support__attachments {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .5rem;
}
.nbx-tenant-support__attachments li {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    font-size: .82rem;
    padding: .5rem;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
}
.nbx-tenant-support__attachments a { color: #2563EB; text-decoration: none; }

.nbx-tenant-support__detail-actions { display: grid; gap: .5rem; }
.nbx-chat-btn--block { width: 100%; }

.nbx-tenant-support__steps {
    margin: 0;
    padding-left: 1.1rem;
    font-size: .84rem;
    color: #475569;
    line-height: 1.5;
}

.nbx-chat-btn--sm { padding: .4rem .75rem; font-size: .78rem; }

.nbx-tenant-support__dialog {
    border: 0;
    border-radius: 16px;
    padding: 0;
    max-width: 520px;
    width: calc(100% - 2rem);
    box-shadow: 0 25px 50px rgba(15,23,42,.2);
}
.nbx-tenant-support__dialog::backdrop { background: rgba(15,23,42,.45); }
.nbx-tenant-support__dialog-form { display: flex; flex-direction: column; }
.nbx-tenant-support__dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding: 1.25rem 1.25rem .75rem;
    border-bottom: 1px solid #E2E8F0;
}
.nbx-tenant-support__dialog-head h2 { margin: .25rem 0 0; font-size: 1.15rem; }
.nbx-tenant-support__dialog-close {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #64748B;
}
.nbx-tenant-support__dialog-body {
    padding: 1rem 1.25rem;
    display: grid;
    gap: .75rem;
}
.nbx-tenant-support__dialog-body label {
    display: grid;
    gap: .35rem;
    font-size: .84rem;
    font-weight: 600;
    color: #334155;
}
.nbx-tenant-support__dialog-body input,
.nbx-tenant-support__dialog-body select,
.nbx-tenant-support__dialog-body textarea {
    font-weight: 400;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: .65rem .75rem;
    font-size: .875rem;
}
.nbx-tenant-support__dialog-body input:focus,
.nbx-tenant-support__dialog-body select:focus,
.nbx-tenant-support__dialog-body textarea:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.nbx-tenant-support__dialog-foot {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: .75rem 1.25rem 1.25rem;
    border-top: 1px solid #E2E8F0;
}

.nbx-tenant-support__pagination { padding: .5rem 1rem; border-top: 1px solid #E2E8F0; }

@media (max-width: 1100px) {
    .nbx-tenant-support { grid-template-columns: minmax(240px, 280px) minmax(0, 1fr); }
    .nbx-tenant-support__details { display: none; }
}
@media (max-width: 768px) {
    .nbx-tenant-support { grid-template-columns: 1fr; min-height: auto; }
    .nbx-tenant-support__list { max-height: 220px; }
    .nbx-tenant-support-hero__actions { width: 100%; }
    .nbx-tenant-support-hero__actions .nbx-chat-btn { flex: 1; }
}

/* Public widget */
.nbx-chat-widget { position: fixed; z-index: 9999; font-family: Inter, system-ui, sans-serif; }
.nbx-chat-widget--br { right: 20px; bottom: 20px; }
.nbx-chat-widget--bl { left: 20px; bottom: 20px; }
.nbx-chat-widget__bubble { width: 60px; height: 60px; border-radius: 999px; background: var(--nbx-widget-color, #2563EB); color: #fff; border: 0; cursor: pointer; box-shadow: 0 12px 30px rgba(37,99,235,.35); position: relative; }
.nbx-chat-widget__bubble-dot { position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 999px; background: #16A34A; border: 2px solid #fff; }
.nbx-chat-widget__panel { width: min(380px, calc(100vw - 24px)); background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(15,23,42,.18); overflow: hidden; display: none; }
.nbx-chat-widget.is-open .nbx-chat-widget__panel { display: block; }
.nbx-chat-widget.is-open .nbx-chat-widget__bubble { display: none; }
.nbx-chat-widget__head { background: var(--nbx-widget-color, #2563EB); color: #fff; padding: 1rem; display: flex; justify-content: space-between; align-items: start; }
.nbx-chat-widget__body { padding: 1rem; display: grid; gap: .65rem; max-height: 420px; overflow: auto; }
.nbx-chat-widget__body input, .nbx-chat-widget__body select, .nbx-chat-widget__body textarea { width: 100%; border: 1px solid #E2E8F0; border-radius: 10px; padding: .6rem .75rem; font: inherit; }
.nbx-chat-widget__messages { display: grid; gap: .5rem; }
.nbx-chat-widget__msg { padding: .6rem .75rem; border-radius: 12px; max-width: 85%; font-size: .88rem; }
.nbx-chat-widget__msg.is-in { background: #F1F5F9; }
.nbx-chat-widget__msg.is-out { background: #DBEAFE; margin-left: auto; }

@media (max-width: 1100px) {
    .nbx-chat-inbox__grid { grid-template-columns: 280px 1fr; }
    .nbx-chat-details { display: none; }
}
@media (max-width: 860px) {
    .nbx-chat-app { grid-template-columns: 1fr; }
    .nbx-chat-sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: .2s; z-index: 40; }
    .nbx-chat-sidebar.is-open { transform: translateX(0); }
    .nbx-chat-mobile-toggle { display: grid; place-items: center; }
    .nbx-chat-header { grid-template-columns: 1fr auto; }
    .nbx-chat-header__center { display: none; }
    .nbx-chat-inbox__grid, .nbx-tenant-support { grid-template-columns: 1fr; }
    .nbx-chat-list-panel { max-height: 240px; }
    .nbx-chat-reports-grid { grid-template-columns: 1fr; }
}
