/* ==========================================================================
   Sarrai operator inbox — 4-panel layout (inboxes · conversaties · chat · aside)
   Bouwt voort op tokens uit app-shell.css.
   ========================================================================== */

/* ---------- Locale tokens (niet in app-shell.css) ---------- */
.inbox-page {
    --neutral-25: #FBFBFD;
    --neutral-50: #F6F7FA;
    --neutral-100: #ECEEF4;
    --neutral-200: #DCDFE9;
    --neutral-300: #CBCED9;
    --border-subtle: #E5E7EE;
    --border-default: #CBCED9;
    --shadow-xs: 0 1px 2px rgba(37, 43, 72, 0.06);
    --shadow-md: 0 4px 12px rgba(37, 43, 72, 0.10);
    --shadow-lg: 0 12px 28px rgba(37, 43, 72, 0.14);
    --shadow-xl: 0 22px 54px rgba(37, 43, 72, 0.18);
    --shadow-focus: 0 0 0 3px rgba(63, 73, 127, 0.18);
    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 12px;
    --brand-navy-200: #B2B9D2;
    --brand-orange-50: #FEF6EC;
    --brand-orange-200: #F8C788;
    --brand-orange-700: #B85B07;
    --success: #1F9D6A;
    --success-bg: #E4F4ED;
    --success-fg: #0F6E47;
    --warning: #D89A1F;
    --warning-bg: #FCF1D7;
    --warning-fg: #8C6210;
    --ease-out: cubic-bezier(0.2, 0, 0, 1);
    /* Force Inter overal binnen de inbox — geen JetBrains Mono. */
    --font-mono: var(--font-sans);
}

.inbox-page code,
.inbox-page kbd,
.inbox-page samp,
.inbox-page pre {
    font-family: var(--font-sans);
}

.inbox-page {
    display: grid;
    gap: 0;
    margin: 0;
    color: var(--fg-1);
    font-family: var(--font-sans);
}

/* Inbox title is shown in the app topbar; keep h1 accessible but visually hidden */
.inbox-header {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.inbox-shell {
    display: grid;
    grid-template-columns: 252px 380px minmax(0, 1fr);
    /* Topbar (52px) + topbar margin (20px) + content padding-bottom (28px) */
    height: calc(100vh - var(--topbar-h, 52px) - 20px - 28px);
    min-height: 0;
    overflow: hidden;
    background: white;
    position: relative;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-xs);
}

.inbox-shell.is-upgrade-locked {
    opacity: 0.55;
    filter: grayscale(0.24);
    pointer-events: none;
}

.inbox-upgrade-banner {
    border: 1px solid rgba(101, 163, 121, 0.95);
    border-radius: 0.95rem;
    padding: 0.95rem 1rem;
    background: linear-gradient(180deg, #edf9f0 0%, #e3f5e9 100%);
    box-shadow: 0 8px 20px rgba(35, 87, 51, 0.12);
    display: grid;
    gap: 0.45rem;
    justify-items: start;
    margin: 0.5rem;
}

.inbox-upgrade-banner h2 {
    margin: 0;
    font-size: 1.05rem;
    color: #1f5a2f;
}

.inbox-upgrade-banner p {
    margin: 0;
    color: #244d30;
}

/* ==========================================================================
   KOLOM 1 — Inboxen (mailboxes)
   ========================================================================== */
.inbox-mailboxes {
    background: white;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.inbox-mailboxes-head {
    padding: 18px 16px 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.inbox-mailboxes-head h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--fg-1);
    letter-spacing: -0.005em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.inbox-mailboxes-head .meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-3);
    margin-top: 4px;
    letter-spacing: 0.02em;
}

.inbox-mailboxes-body {
    flex: 1;
    overflow: auto;
    padding: 8px 8px 80px;
}

.inbox-mailbox-section {
    margin-bottom: 6px;
}

.inbox-mailbox-section-header {
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-4);
    font-weight: 600;
    padding: 14px 10px 6px;
}

.inbox-mailbox-section-header strong {
    font-weight: 600;
    color: inherit;
}

.inbox-mailbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 34px;
    padding: 0 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    color: var(--fg-2);
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: var(--font-sans);
    font-weight: 500;
}

.inbox-mailbox-item:hover {
    background: var(--neutral-50);
    color: var(--fg-1);
}

.inbox-mailbox-item.is-active {
    background: var(--brand-navy-50);
    color: var(--brand-navy-800);
    font-weight: 600;
}

.inbox-mailbox-item.is-active i {
    color: var(--brand-navy);
}

.inbox-mailbox-item i {
    width: 18px;
    height: 18px;
    flex: none;
    display: grid;
    place-items: center;
    color: var(--fg-3);
    font-size: 16px;
}

.inbox-mailbox-item-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-mailbox-item-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-4);
    font-weight: 500;
}

.inbox-mailbox-item.is-active .inbox-mailbox-item-count {
    color: var(--brand-orange-700);
    font-weight: 600;
}

.inbox-mailbox-item:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ==========================================================================
   KOLOM 2 — Conversatielijst
   ========================================================================== */
.inbox-queue {
    background: var(--neutral-25);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.inbox-queue-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border-subtle);
    background: white;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inbox-queue-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.inbox-queue-title strong {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--fg-1);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inbox-queue-count {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--fg-3);
    white-space: nowrap;
}

.inbox-queue-count b {
    color: var(--brand-orange-700);
    font-weight: 700;
}

.inbox-queue-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inbox-queue-search {
    position: relative;
    flex: 1;
    min-width: 0;
}

.inbox-queue-search .form-control,
.inbox-queue-search input {
    width: 100%;
    height: 32px;
    border: 1px solid var(--border-subtle);
    background: var(--neutral-50);
    border-radius: var(--r-md);
    padding: 0 32px 0 32px;
    font-size: 12.5px;
    color: var(--fg-1);
    outline: none;
    font-family: var(--font-sans);
}

.inbox-queue-search .form-control::placeholder,
.inbox-queue-search input::placeholder {
    color: var(--fg-4);
}

.inbox-queue-search .form-control:focus,
.inbox-queue-search input:focus {
    background: white;
    border-color: var(--brand-navy-300);
    box-shadow: var(--shadow-focus);
}

.inbox-queue-search::before {
    content: "\F52A"; /* bi-search */
    font-family: "bootstrap-icons";
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fg-4);
    pointer-events: none;
    font-size: 13px;
}

.inbox-queue-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: var(--fg-4);
    border-radius: var(--r-sm);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.inbox-queue-search-clear:hover {
    background: var(--neutral-100);
    color: var(--fg-1);
}

.inbox-queue-toolbar .form-select {
    height: 32px;
    width: auto;
    min-width: 110px;
    border: 1px solid var(--border-subtle);
    background-color: var(--neutral-50);
    border-radius: var(--r-md);
    font-size: 12px;
    font-family: var(--font-sans);
    color: var(--fg-1);
    padding: 0 28px 0 10px;
}

.inbox-queue-toolbar .form-select:focus {
    background-color: white;
    border-color: var(--brand-navy-300);
    box-shadow: var(--shadow-focus);
}

.inbox-queue-refresh {
    height: 32px;
    width: 32px;
    border: 1px solid var(--border-subtle);
    background: white;
    color: var(--fg-3);
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex: none;
}

.inbox-queue-refresh:hover {
    background: var(--neutral-50);
    color: var(--fg-1);
}

.inbox-queue-refresh:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.inbox-queue-list {
    flex: 1;
    overflow: auto;
    padding: 8px 8px 80px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inbox-empty {
    padding: 24px 18px;
    color: var(--fg-3);
    font-size: 13px;
    text-align: center;
}

.inbox-empty-conversation {
    align-self: center;
    margin: auto;
}

/* ---------- Conversatiekaart ---------- */
.inbox-queue-item {
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    padding: 14px 16px 14px 22px;
    cursor: pointer;
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    width: 100%;
    text-align: left;
    font-family: var(--font-sans);
    transition: background 100ms var(--ease-out), border-color 100ms var(--ease-out);
}

.inbox-queue-item:hover {
    background: var(--neutral-25);
    border-color: var(--neutral-200);
}

.inbox-queue-item.is-active {
    background: var(--brand-navy-50);
    border-color: var(--brand-navy-100);
    border-left: 3px solid var(--brand-orange);
    padding-left: 19px;
}

.inbox-queue-item.is-active .inbox-queue-subject {
    color: var(--brand-navy-800);
}

.inbox-queue-item:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Unread orange dot */
.inbox-queue-item.has-unread::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 20px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-orange);
    box-shadow: 0 0 0 3px rgba(235, 120, 14, 0.18);
}

.inbox-queue-item.is-active.has-unread::before {
    left: 7px;
}

.inbox-queue-item-row1 {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.inbox-queue-channel {
    width: 16px;
    height: 16px;
    flex: none;
    display: grid;
    place-items: center;
    color: var(--fg-4);
    font-size: 14px;
}

.inbox-queue-item.has-unread .inbox-queue-channel {
    color: var(--brand-orange-700);
}

.inbox-queue-customer-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin: 0;
}

.inbox-queue-item.has-unread .inbox-queue-customer-name {
    color: var(--fg-1);
    font-weight: 700;
}

.inbox-queue-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-4);
    white-space: nowrap;
    flex: none;
}

.inbox-queue-item.has-unread .inbox-queue-time {
    color: var(--brand-navy);
    font-weight: 600;
}

.inbox-queue-subject {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--fg-1);
    letter-spacing: -0.005em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.inbox-queue-item.has-unread .inbox-queue-subject {
    font-weight: 700;
}

.inbox-queue-item-row3 {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-top: 2px;
}

.inbox-queue-preview {
    font-size: 12.5px;
    color: var(--fg-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    line-height: 1.4;
    margin: 0;
}

.inbox-queue-item.has-unread .inbox-queue-preview {
    color: var(--fg-2);
}

.inbox-queue-assignee {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 9.5px;
    font-weight: 700;
    color: white;
    font-family: var(--font-sans);
    letter-spacing: 0.02em;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--neutral-200);
    background: linear-gradient(135deg, #5C6699 0%, #3F497F 100%);
    overflow: hidden;
}

.inbox-queue-assignee img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.inbox-queue-assignee-initial {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}

.inbox-queue-item.is-active .inbox-queue-assignee {
    box-shadow: 0 0 0 1px var(--brand-navy-200);
}

.inbox-status-badge {
    font-family: var(--font-mono);
    font-size: 9.5px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--neutral-100);
    color: var(--fg-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.inbox-status-badge.is-snoozed {
    background: var(--brand-orange-50);
    color: var(--brand-orange-700);
}

.inbox-status-badge.is-closed {
    background: var(--success-bg);
    color: var(--success-fg);
}

.inbox-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--brand-orange);
    color: white;
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 700;
    flex: none;
}

.inbox-queue-item.is-incoming {
    animation: inboxIncomingPulse 1500ms var(--ease-out) 1;
}

@keyframes inboxIncomingPulse {
    0% { background: var(--brand-orange-50); }
    100% { background: white; }
}

/* ==========================================================================
   KOLOM 3 — Chat
   ========================================================================== */
.inbox-conversation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 296px;
    min-height: 0;
    background: var(--neutral-25);
    position: relative;
    overflow: hidden;
}

.inbox-shell.is-aside-collapsed .inbox-conversation {
    grid-template-columns: minmax(0, 1fr);
}

.inbox-conversation-layout {
    display: contents;
}

.inbox-conversation-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    position: relative;
    background: var(--neutral-25);
    overflow: hidden;
}

.inbox-conversation-header {
    background: white;
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.inbox-conversation-header > div:not(.inbox-conversation-actions) {
    flex: 1;
    min-width: 0;
}

.inbox-conversation-actions {
    margin-left: auto;
}

.inbox-conversation-header strong {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--fg-1);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.inbox-conversation-header .text-muted {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    margin-top: 2px;
}

.inbox-conversation-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success-fg);
    font-weight: 600;
    font-size: 10.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.inbox-conversation-status-pill::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--success);
}

.inbox-conversation-status-pill.is-snoozed {
    background: var(--brand-orange-50);
    color: var(--brand-orange-700);
}

.inbox-conversation-status-pill.is-snoozed::before {
    background: var(--brand-orange);
}

.inbox-conversation-status-pill.is-closed {
    background: var(--neutral-100);
    color: var(--fg-3);
}

.inbox-conversation-status-pill.is-closed::before {
    background: var(--neutral-300);
}

/* ---------- Header tools ---------- */
.inbox-conversation-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    position: relative;
}

.inbox-conversation-actions-primary,
.inbox-conversation-actions-secondary {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.inbox-tool {
    height: 32px;
    padding: 0 11px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-subtle);
    background: white;
    color: var(--fg-2);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    position: relative;
}

.inbox-tool:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-300);
    color: var(--fg-1);
}

.inbox-tool:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.inbox-tool.is-icon {
    width: 32px;
    padding: 0;
    justify-content: center;
}

.inbox-tool.is-active {
    background: var(--brand-navy-50);
    border-color: var(--brand-navy-200);
    color: var(--brand-navy);
}

.inbox-tool i {
    font-size: 14px;
}

/* Snooze split-button */
.inbox-snooze-group {
    display: inline-flex;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    overflow: hidden;
    background: white;
    height: 32px;
    position: relative;
}

.inbox-snooze-group:hover {
    border-color: var(--neutral-300);
}

.inbox-snooze-group .main {
    border: 0;
    background: transparent;
    padding: 0 11px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--fg-2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.inbox-snooze-group .main:hover {
    background: var(--neutral-50);
    color: var(--fg-1);
}

.inbox-snooze-group .split {
    width: 1px;
    background: var(--border-subtle);
    align-self: stretch;
}

.inbox-snooze-group .chev {
    border: 0;
    background: transparent;
    width: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--fg-3);
}

.inbox-snooze-group .chev:hover {
    background: var(--neutral-50);
    color: var(--fg-1);
}

.inbox-snooze-group .main:disabled,
.inbox-snooze-group .chev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dropdown menu (used for snooze + more menu) */
.inbox-popmenu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 8;
    animation: inboxFadeIn 140ms var(--ease-out);
}

@keyframes inboxFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.inbox-popmenu-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-4);
    font-weight: 600;
    padding: 8px 10px 4px;
}

.inbox-popmenu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--fg-1);
    text-align: left;
    font-family: var(--font-sans);
    font-weight: 500;
}

.inbox-popmenu-item:hover {
    background: var(--neutral-50);
}

.inbox-popmenu-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.inbox-popmenu-item i {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: var(--fg-3);
    flex: none;
    font-size: 15px;
}

.inbox-popmenu-hint {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--fg-4);
    font-weight: 500;
}

.inbox-popmenu-check {
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--neutral-300);
    border-radius: 3px;
    flex: none;
    display: grid;
    place-items: center;
    color: white;
    background: white;
    font-size: 10px;
}

.inbox-popmenu-item.is-on .inbox-popmenu-check {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
}

.inbox-popmenu-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0;
}

.inbox-popmenu-backdrop,
.inbox-conversation-menu-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 7;
    border: 0;
    padding: 0;
    margin: 0;
}

/* ---------- Thread ---------- */
.inbox-thread-messages {
    flex: 1;
    overflow: auto;
    padding: 22px 32px 200px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inbox-thread-day {
    align-self: center;
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-3);
    background: white;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    font-weight: 600;
    margin-top: 4px;
    margin-bottom: 4px;
}

/* Message bubble */
.inbox-message-row {
    max-width: 76%;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.inbox-message-row.customer {
    align-self: flex-start;
}

.inbox-message-row.assistant {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.inbox-message-row.operator {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.inbox-message-row.internal-note {
    align-self: flex-end;
    flex-direction: row-reverse;
    max-width: 80%;
}

.inbox-message-row.system {
    align-self: end;
    max-width: 100%;
}

.inbox-message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 10.5px;
    font-weight: 700;
    color: white;
    overflow: hidden;
}

.inbox-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inbox-message-avatar span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}

.inbox-message-row.customer .inbox-message-avatar {
    background: var(--brand-navy-300);
}

.inbox-message-row.operator .inbox-message-avatar {
    background: linear-gradient(135deg, #5C6699 0%, #3F497F 100%);
}

.inbox-message-row.assistant .inbox-message-avatar {
    background: linear-gradient(135deg, #FFD89A 0%, #EB780E 100%);
    color: white;
}

.inbox-message-row.internal-note .inbox-message-avatar {
    background: #F5DC73;
    color: #6A4F00;
    box-shadow: 0 0 0 2px #FFF6D6;
}

.inbox-message {
    min-width: 0;
    flex: 1;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
}

.inbox-message header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 11.5px;
}

.inbox-message-row.operator .inbox-message header,
.inbox-message-row.internal-note .inbox-message header,
.inbox-message-row.assistant .inbox-message header {
    justify-content: flex-end;
}

.inbox-message header strong {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fg-1);
}

.inbox-message header time {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--fg-4);
}

.inbox-message-header-meta {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.inbox-message-type-badge {
    font-family: var(--font-mono);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #B5841C;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(245, 220, 115, 0.4);
}

.inbox-message-body {
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--fg-1);
    box-shadow: var(--shadow-xs);
    position: relative;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.inbox-message-body p:last-child { margin-bottom: 0; }
.inbox-message-body p:first-child { margin-top: 0; }

.inbox-message-row.customer .inbox-message-body {
    border-top-left-radius: 4px;
}

.inbox-message-row.operator .inbox-message-body {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
    color: white;
    border-top-right-radius: 4px;
}

.inbox-message-row.operator .inbox-message-body em {
    color: #FFD89A;
    font-style: normal;
    font-weight: 600;
}

.inbox-message-row.operator .inbox-message-body a {
    color: #FFD89A;
}

.inbox-message-row.assistant .inbox-message-body {
    background: var(--brand-orange-50);
    border-color: var(--brand-orange-200);
    border-top-right-radius: 4px;
    color: var(--brand-navy-800);
}

.inbox-message-row.assistant .inbox-message-body ul {
    margin: 8px 0;
    padding-left: 20px;
    font-size: 13.5px;
    line-height: 1.6;
}

.inbox-message-row.assistant .inbox-message-body em {
    color: var(--brand-orange-700);
    font-style: italic;
    font-weight: 500;
    font-size: 12.5px;
    display: block;
    margin-top: 6px;
}

/* Internal note — amber post-it */
.inbox-message-row.internal-note .inbox-message-body {
    background: #FFF6D6;
    border: 1px dashed #C49A1F;
    border-top-right-radius: 4px;
    color: #5C4400;
    position: relative;
}

.inbox-message-row.internal-note .inbox-message-body strong,
.inbox-message-row.internal-note .inbox-message-body b {
    color: #3F2D00;
    font-weight: 700;
}

.inbox-typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 6px 0;
}

.inbox-typing-indicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-navy-300);
    animation: inboxTypingDot 1.4s infinite both;
}

.inbox-typing-indicator span:nth-child(2) { animation-delay: 0.18s; }
.inbox-typing-indicator span:nth-child(3) { animation-delay: 0.36s; }

@keyframes inboxTypingDot {
    0%, 60%, 100% { opacity: 0.35; transform: scale(0.85); }
    30% { opacity: 1; transform: scale(1); }
}

/* Event (system message) */
.inbox-event-row {
    align-self: center;
    max-width: 100%;
    display: flex;
    justify-content: center;
}

.inbox-event-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    font-size: 11px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    margin: 0;
}

.inbox-event-item i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand-navy-300);
    font-size: 0;
}

.inbox-event-item time {
    color: var(--fg-4);
}

/* ==========================================================================
   COMPOSER
   ========================================================================== */
.inbox-reply-box {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 18px;
    z-index: 2;
}

.inbox-composer {
    background: white;
    border: 1px solid var(--border-default);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.inbox-composer.is-internal-note {
    background: #FFF6D6;
    border: 1.5px dashed #C49A1F;
}

.inbox-composer-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
    padding: 6px 8px 0;
    gap: 2px;
}

.inbox-composer.is-internal-note .inbox-composer-tabs {
    border-bottom-color: #E0BD55;
}

.inbox-composer-tab {
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--fg-3);
    padding: 8px 12px 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px 6px 0 0;
    position: relative;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: var(--font-sans);
}

.inbox-composer-tab:hover {
    color: var(--fg-1);
}

.inbox-composer-tab.is-active {
    color: var(--brand-navy-800);
    border-bottom-color: var(--brand-orange);
}

.inbox-composer.is-internal-note .inbox-composer-tab.is-active {
    color: #5C4400;
    border-bottom-color: #C49A1F;
}

.inbox-composer-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.inbox-composer-meta {
    margin-left: auto;
    align-self: center;
    padding-right: 8px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--fg-4);
}

.inbox-reply-editor {
    font-size: 14px;
    color: var(--fg-1);
    min-height: 50px;
    line-height: 1.55;
    outline: none;
    font-family: var(--font-sans);
    padding: 12px 14px 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    resize: none;
}

.inbox-reply-editor:focus,
.inbox-reply-editor:focus-visible,
.inbox-reply-editor.form-control:focus {
    outline: none;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.inbox-reply-editor[contenteditable="true"]:empty::before {
    content: attr(data-placeholder);
    color: var(--fg-4);
    pointer-events: none;
}

.inbox-composer.is-internal-note .inbox-reply-editor {
    color: #5C4400;
}

.inbox-composer.is-internal-note .inbox-reply-editor[contenteditable="true"]:empty::before {
    color: #A88A2D;
}

.inbox-composer-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 8px;
    border-top: 1px dashed var(--border-subtle);
    margin-top: 4px;
}

.inbox-composer.is-internal-note .inbox-composer-bar {
    border-top-color: #E0BD55;
}

.inbox-markdown-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.inbox-markdown-btn {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    border-radius: var(--r-sm);
    cursor: pointer;
    color: var(--fg-3);
    display: grid;
    place-items: center;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
}

.inbox-markdown-btn i {
    font-size: 15px;
}

.inbox-markdown-btn:hover {
    background: var(--neutral-100);
    color: var(--fg-1);
}

.inbox-markdown-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Send split-button */
.inbox-send-split {
    margin-left: auto;
    display: inline-flex;
    border-radius: var(--r-md);
    overflow: visible;
    background: var(--brand-navy);
    position: relative;
    height: 32px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 4px 10px rgba(63, 73, 127, 0.22);
}

.inbox-send-main {
    border: 0;
    background: transparent;
    color: white;
    padding: 0 14px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-sans);
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--r-md) 0 0 var(--r-md);
    height: 32px;
}

.inbox-send-main:hover {
    background: rgba(255, 255, 255, 0.08);
}

.inbox-send-main:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.inbox-send-toggle {
    border: 0;
    background: transparent;
    color: white;
    width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0 var(--r-md) var(--r-md) 0;
    height: 32px;
}

.inbox-send-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.inbox-send-toggle:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.inbox-composer.is-internal-note .inbox-send-split {
    background: #B5841C;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 4px 10px rgba(181, 132, 28, 0.28);
}

.inbox-send-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 9;
    animation: inboxFadeIn 140ms var(--ease-out);
}

.inbox-send-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--fg-1);
    text-align: left;
    font-family: var(--font-sans);
    font-weight: 500;
}

.inbox-send-menu-item:hover {
    background: var(--neutral-50);
}

.inbox-send-menu-item i {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: var(--fg-3);
    flex: none;
    font-size: 15px;
}

.inbox-send-menu-hint {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--fg-4);
    font-weight: 500;
}

.inbox-send-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 5;
    border: 0;
    padding: 0;
    margin: 0;
}

/* Mention dropdown — kept from old code */
.inbox-mention-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 24px;
    right: 24px;
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 9;
    max-height: 220px;
    overflow: auto;
}

.inbox-mention-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--fg-1);
    text-align: left;
    font-family: var(--font-sans);
}

.inbox-mention-option:hover {
    background: var(--neutral-50);
}

.inbox-mention-handle {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-4);
}

/* ==========================================================================
   KOLOM 4 — Klant-aside (persistent)
   ========================================================================== */
.inbox-aside {
    position: relative;
    border-left: 1px solid var(--border-subtle);
    background: white;
    padding: 22px 22px 30px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-height: 0;
}

.inbox-shell.is-aside-collapsed .inbox-aside {
    display: none;
}

.inbox-aside h4 {
    font-size: 11px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-3);
    font-weight: 600;
    margin: 0 0 10px;
}

.inbox-aside-section {
    display: flex;
    flex-direction: column;
}

.inbox-aside-customer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inbox-aside-customer .av {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--brand-navy-300);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex: none;
}

.inbox-aside-customer .info {
    min-width: 0;
    flex: 1;
}

.inbox-aside-customer .info b {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--fg-1);
    letter-spacing: -0.005em;
    word-break: break-word;
}

.inbox-aside-customer .info small {
    display: block;
    font-size: 11.5px;
    color: var(--fg-3);
    font-family: var(--font-mono);
    margin-top: 1px;
}

.inbox-aside-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 5px 0;
    align-items: baseline;
    gap: 12px;
}

.inbox-aside-row b {
    color: var(--fg-3);
    font-weight: 500;
}

.inbox-aside-row > span {
    color: var(--fg-1);
    font-weight: 600;
    text-align: right;
}

.inbox-aside-row .mono {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 12px;
}

.inbox-aside-row .channel-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    background: var(--brand-navy-50);
    color: var(--brand-navy-800);
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.inbox-aside-assignee {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--neutral-50);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
}

.inbox-aside-assignee .av {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5C6699 0%, #3F497F 100%);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 700;
    font-size: 11px;
    flex: none;
    overflow: hidden;
}

.inbox-aside-assignee .av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inbox-aside-assignee .main {
    flex: 1;
    min-width: 0;
}

.inbox-aside-assignee .main b {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-1);
}

.inbox-aside-assignee .main small {
    display: block;
    font-size: 11px;
    color: var(--fg-3);
    font-family: var(--font-mono);
}

.inbox-aside-assignee .change {
    border: 0;
    background: transparent;
    color: var(--brand-navy);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
}

.inbox-aside-assignee .change:hover {
    background: var(--brand-navy-50);
}

.inbox-aside-assignee .change:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* History timeline */
.inbox-aside-history {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.inbox-aside-history::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: var(--neutral-200);
}

.inbox-aside-hitem {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 5px 0;
    position: relative;
    font-size: 12px;
    color: var(--fg-2);
}

.inbox-aside-hitem .hdot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--brand-navy-200);
    flex: none;
    margin-top: 2px;
    z-index: 1;
}

.inbox-aside-hitem.is-current .hdot {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px rgba(235, 120, 14, 0.18);
}

.inbox-aside-hitem b {
    color: var(--fg-1);
    font-weight: 600;
}

.inbox-aside-hitem small {
    display: block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--fg-4);
    margin-top: 1px;
}

/* Contact-koppeling sub-section binnen Klant */
.inbox-contact-panel {
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inbox-contact-panel:first-child {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.inbox-contact-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.inbox-contact-panel-head strong {
    font-size: 11px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-3);
    font-weight: 600;
}

.inbox-contact-primary {
    background: var(--neutral-50);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.inbox-contact-primary-label {
    font-family: var(--font-mono);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-orange-700);
    font-weight: 700;
}

.inbox-contact-primary strong {
    font-size: 13.5px;
    color: var(--fg-1);
    font-weight: 600;
}

.inbox-contact-primary span {
    font-size: 11.5px;
    color: var(--fg-3);
    font-family: var(--font-mono);
}

.inbox-contact-primary-actions {
    position: absolute;
    top: 6px;
    right: 6px;
}

.inbox-contact-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inbox-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    background: white;
}

.inbox-contact-item-main {
    flex: 1;
    min-width: 0;
}

.inbox-contact-item-main strong {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fg-1);
}

.inbox-contact-item-main span {
    display: block;
    font-size: 11px;
    color: var(--fg-3);
    font-family: var(--font-mono);
}

.inbox-contact-item-actions {
    display: inline-flex;
    gap: 4px;
}

.inbox-contact-search {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inbox-contact-search .form-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-4);
    font-weight: 600;
    margin: 0;
}

.inbox-contact-search .form-control {
    height: 32px;
    border: 1px solid var(--border-subtle);
    background: var(--neutral-50);
    border-radius: var(--r-md);
    font-size: 12.5px;
    padding: 0 10px;
}

.inbox-contact-search .form-control:focus {
    background: white;
    border-color: var(--brand-navy-300);
    box-shadow: var(--shadow-focus);
}

.inbox-contact-search-results {
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    background: white;
    max-height: 200px;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.inbox-contact-search-result {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 0;
    background: transparent;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-sans);
}

.inbox-contact-search-result:hover {
    background: var(--neutral-50);
}

.inbox-contact-search-result strong {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fg-1);
}

.inbox-contact-search-result span {
    font-size: 11px;
    color: var(--fg-3);
    font-family: var(--font-mono);
}

.inbox-contact-create-link {
    border: 0;
    background: transparent;
    color: var(--brand-navy);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    text-align: left;
}

.inbox-contact-create-link:hover {
    text-decoration: underline;
}

.inbox-contact-quick-create {
    background: var(--neutral-50);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inbox-contact-quick-create .form-label {
    font-size: 11px;
    color: var(--fg-3);
    margin: 0;
}

.inbox-contact-quick-create .form-control {
    height: 30px;
    font-size: 12px;
    border-radius: var(--r-sm);
}

.inbox-contact-unlink-btn {
    border: 0;
    background: transparent;
    color: var(--fg-4);
    width: 24px;
    height: 24px;
    border-radius: var(--r-sm);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 13px;
}

.inbox-contact-unlink-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #d04249;
}

.inbox-contact-unlink-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ==========================================================================
   ASSIGN PANEL — slide-over (rechts)
   ========================================================================== */
.inbox-assign-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 23, 39, 0.32);
    z-index: 12;
    animation: inboxFadeIn 180ms var(--ease-out);
    border: 0;
    padding: 0;
    margin: 0;
}

.inbox-assign-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    background: white;
    z-index: 13;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 24px rgba(20, 23, 39, 0.18);
    animation: inboxSlideIn 240ms var(--ease-out);
}

@keyframes inboxSlideIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.inbox-assign-head {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.inbox-assign-head h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--fg-1);
    letter-spacing: -0.01em;
    flex: 1;
    text-transform: none;
    font-family: var(--font-sans);
}

.inbox-assign-head small {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-3);
    margin-top: 4px;
}

.inbox-assign-close {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--fg-3);
}

.inbox-assign-close:hover {
    background: var(--neutral-100);
    color: var(--fg-1);
}

.inbox-assign-body {
    flex: 1;
    overflow: auto;
    padding: 6px 12px 16px;
}

.inbox-assign-group h5 {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-4);
    font-weight: 600;
    padding: 14px 10px 6px;
}

.inbox-assign-person {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    border-radius: var(--r-md);
    cursor: pointer;
    font-family: var(--font-sans);
    border: 1px solid transparent;
    background: transparent;
    width: 100%;
    text-align: left;
}

.inbox-assign-person:hover {
    background: var(--neutral-50);
}

.inbox-assign-person.is-current {
    background: var(--brand-navy-50);
    border-color: var(--brand-navy-100);
}

.inbox-assign-person:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.inbox-assign-person .av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5C6699 0%, #3F497F 100%);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 700;
    font-size: 12px;
    flex: none;
}

.inbox-assign-person.is-team .av {
    background: var(--brand-navy-100);
    color: var(--brand-navy);
    font-size: 14px;
}

.inbox-assign-person .main {
    flex: 1;
    min-width: 0;
}

.inbox-assign-person .main b {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--fg-1);
}

.inbox-assign-person .main small {
    display: block;
    font-size: 11.5px;
    color: var(--fg-3);
    font-family: var(--font-mono);
}

.inbox-assign-person .current-mark {
    margin-left: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--brand-orange-700);
    font-weight: 700;
}

.inbox-assign-foot {
    padding: 12px 22px 20px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 8px;
}

.inbox-assign-foot .secondary {
    flex: 1;
    height: 36px;
    border: 1px solid var(--border-subtle);
    background: white;
    color: var(--fg-2);
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font-sans);
}

.inbox-assign-foot .secondary:hover {
    background: var(--neutral-50);
}

.inbox-assign-foot .secondary.is-unassign {
    color: var(--brand-orange-700);
    border-color: var(--brand-orange-200);
    background: var(--brand-orange-50);
}

.inbox-assign-foot .secondary.is-unassign:hover {
    background: #FCE8CF;
}

/* ==========================================================================
   SNOOZE MODAL (bestaand) — herstijlen
   ========================================================================== */
.inbox-snooze-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.inbox-snooze-preset {
    height: 36px;
    border: 1px solid var(--border-subtle);
    background: white;
    color: var(--fg-2);
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font-sans);
}

.inbox-snooze-preset:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-300);
}

.inbox-snooze-preset.is-active {
    background: var(--brand-navy-50);
    border-color: var(--brand-navy-200);
    color: var(--brand-navy);
}

.inbox-snooze-preset:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.inbox-snooze-custom {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==========================================================================
   Customer waiting indicator (verschijnt in chat-header)
   ========================================================================== */
.inbox-conversation-waiting {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--brand-orange-700);
    background: var(--brand-orange-50);
    border: 1px solid var(--brand-orange-200);
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.inbox-conversation-waiting .pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-orange);
    animation: inboxPulse 1.6s infinite;
}

@keyframes inboxPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(235, 120, 14, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(235, 120, 14, 0); }
}

/* ==========================================================================
   Mobile overlays — backdrops bestaan altijd in DOM, alleen actief in mobile
   ========================================================================== */
.inbox-mailboxes-backdrop,
.inbox-conversation-backdrop {
    display: none;
    border: 0;
    margin: 0;
    padding: 0;
}

.inbox-mobile-conversation-close {
    display: none;
}

/* ==========================================================================
   Mobile breakpoints
   ========================================================================== */
@media (max-width: 1280px) {
    .inbox-shell {
        grid-template-columns: 232px 340px minmax(0, 1fr);
    }
    .inbox-conversation {
        grid-template-columns: minmax(0, 1fr) 280px;
    }
    .inbox-shell.is-aside-collapsed .inbox-conversation {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1100px) {
    .inbox-page {
        margin: 0;
        min-height: 0;
    }

    .inbox-shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        height: clamp(520px, calc(100dvh - 100px), 960px);
        min-height: 430px;
        position: relative;
        overflow: hidden;
    }
    .inbox-conversation {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
    }

    .inbox-mailboxes {
        position: absolute;
        inset: 0 auto 0 0;
        width: min(86vw, 280px);
        max-height: none;
        z-index: 18;
        transform: translateX(-104%);
        opacity: 0;
        pointer-events: none;
        transition: transform 220ms var(--ease-out), opacity 160ms ease;
        box-shadow: 12px 0 26px rgba(37, 43, 72, 0.2);
    }

    .inbox-shell.is-mailbox-open .inbox-mailboxes {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .inbox-mailboxes-backdrop {
        display: block;
        position: absolute;
        inset: 0;
        background: rgba(34, 38, 60, 0.28);
        z-index: 17;
        opacity: 0;
        pointer-events: none;
        transition: opacity 160ms ease;
    }

    .inbox-shell.is-mailbox-open .inbox-mailboxes-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .inbox-queue {
        height: 100%;
        max-height: none;
        min-height: 0;
        border-right: 0;
        border-bottom: 0;
    }

    .inbox-queue-list {
        min-height: 0;
    }

    .inbox-mailboxes-toggle {
        display: inline-flex;
    }

    .inbox-conversation {
        position: absolute;
        inset: 0 0 0 auto;
        width: 100%;
        border-left: 1px solid var(--border-subtle);
        transform: translateX(102%);
        opacity: 0;
        pointer-events: none;
        z-index: 26;
        transition: transform 240ms var(--ease-out), opacity 180ms ease;
        box-shadow: -14px 0 30px rgba(37, 43, 72, 0.2);
    }

    .inbox-shell.is-conversation-open .inbox-conversation {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .inbox-conversation-backdrop {
        display: block;
        position: absolute;
        inset: 0;
        background: rgba(34, 38, 60, 0.28);
        z-index: 25;
        opacity: 0;
        pointer-events: none;
        transition: opacity 160ms ease;
    }

    .inbox-shell.is-conversation-open .inbox-conversation-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .inbox-mobile-conversation-close {
        display: inline-flex;
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 1px solid var(--border-subtle);
        border-radius: var(--r-md);
        background: white;
        color: var(--fg-3);
        cursor: pointer;
    }

    /* Aside wordt slide-over op mobile */
    .inbox-aside {
        position: absolute;
        inset: 0 0 0 auto;
        width: min(90vw, 340px);
        z-index: 22;
        box-shadow: -12px 0 28px rgba(37, 43, 72, 0.24);
        transform: translateX(100%);
        transition: transform 240ms var(--ease-out);
    }

    .inbox-shell:not(.is-aside-collapsed) .inbox-aside {
        transform: translateX(0);
    }

    .inbox-message-row {
        max-width: 92%;
    }
}

@media (max-width: 700px) {
    .inbox-snooze-presets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .inbox-thread-messages {
        padding: 14px 16px 200px;
    }
    .inbox-reply-box {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .inbox-mailboxes,
    .inbox-conversation,
    .inbox-aside,
    .inbox-assign-panel {
        transition: none !important;
        animation: none !important;
    }
    .inbox-typing-indicator span,
    .inbox-conversation-waiting .pulse {
        animation: none !important;
    }
}
