:root {
    --app-bg: #f4f6f8;
    --app-surface: #ffffff;
    --app-surface-soft: #f8fafc;
    --app-border: #d9e0e8;
    --app-border-strong: #c7d0db;
    --app-text: #0f172a;
    --app-muted: #64748b;
    --app-primary: #ff5a00;
    --app-primary-dark: #d94d00;
    --app-blue: #2563eb;
    --app-green: #12805c;
    --app-red: #dc2626;
    --app-yellow: #f59e0b;
    --app-shadow: 0 12px 34px rgba(15, 23, 42, .08);
    --app-shadow-soft: 0 7px 20px rgba(15, 23, 42, .06);
}

:root[data-theme="dark"] {
    --app-bg: #0f172a;
    --app-surface: #111827;
    --app-surface-soft: #182235;
    --app-border: #2b3a52;
    --app-border-strong: #42526b;
    --app-text: #e5e7eb;
    --app-muted: #9aa8bc;
    --app-shadow: 0 18px 40px rgba(0, 0, 0, .34);
    --app-shadow-soft: 0 10px 26px rgba(0, 0, 0, .26);
}

html {
    background: var(--app-bg);
}

.app-body {
    background:
        radial-gradient(circle at top left, rgba(255, 90, 0, .08), transparent 28rem),
        linear-gradient(180deg, #fbfcfd 0, var(--app-bg) 21rem);
    color: var(--app-text);
    min-height: 100vh;
    font-size: 15px;
}

:root[data-theme="dark"] .app-body {
    background:
        linear-gradient(180deg, #121a2b 0, var(--app-bg) 23rem);
    color: var(--app-text);
}

.app-container {
    max-width: 1540px;
    padding-left: clamp(16px, 3vw, 32px);
    padding-right: clamp(16px, 3vw, 32px);
}

.app-footer {
    border-top: 1px solid var(--app-border);
    color: var(--app-muted);
    font-size: .86rem;
    margin-top: 28px;
    padding: 16px 0;
}

.app-footer .app-container {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: space-between;
}

.app-footer-copy {
    font-weight: 600;
}

.app-footer-author {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 999px;
    box-shadow: var(--app-shadow-soft);
    padding: 6px 12px;
}

.app-footer a {
    color: var(--app-primary);
    font-weight: 700;
    text-decoration: none;
}

.app-footer a:hover {
    color: var(--app-primary-dark);
    text-decoration: underline;
}

.app-navbar {
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 1px 18px rgba(15, 23, 42, .04);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 1030;
}

:root[data-theme="dark"] .app-navbar {
    background: rgba(15, 23, 42, .94);
    border-bottom-color: var(--app-border);
}

.app-brand {
    align-items: center;
    display: inline-flex;
    font-weight: 700;
    gap: 10px;
    letter-spacing: 0;
}

.app-brand-mark {
    align-items: center;
    background: transparent;
    border-radius: 8px;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    overflow: hidden;
    width: 38px;
}

.app-brand-mark img {
    display: block;
    height: 38px;
    object-fit: contain;
    width: 38px;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.login-logo {
    display: block;
    height: auto;
    max-height: 154px;
    max-width: min(260px, 82%);
    object-fit: contain;
    width: auto;
}

.app-nav-actions .btn,
.btn {
    border-radius: 7px;
    font-weight: 600;
}

:root[data-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #64748b;
}

:root[data-theme="dark"] .btn-outline-secondary:hover,
:root[data-theme="dark"] .btn-outline-secondary:focus {
    color: #0f172a;
    background: #cbd5e1;
    border-color: #cbd5e1;
}

.btn-primary {
    background: var(--app-blue);
    border-color: var(--app-blue);
}

.btn-primary:hover,
.btn-primary:focus {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-success {
    background: var(--app-green);
    border-color: var(--app-green);
}

.btn-outline-primary {
    color: var(--app-blue);
    border-color: var(--app-blue);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--app-blue);
    border-color: var(--app-blue);
}

.card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: var(--app-shadow-soft);
    color: var(--app-text);
}

.license-summary {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(255, 90, 0, .14), rgba(37, 99, 235, .08)),
        var(--app-surface);
    border: 1px solid var(--app-border);
    border-left: 5px solid var(--app-primary);
    border-radius: 8px;
    box-shadow: var(--app-shadow-soft);
    color: var(--app-text);
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(240px, .8fr) minmax(0, 1.6fr);
    padding: 18px;
}

.license-eyebrow {
    color: var(--app-muted);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.license-number {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 850;
    letter-spacing: 0;
    margin-top: 4px;
}

.license-meta {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.license-meta div {
    background: rgba(255, 255, 255, .58);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 10px 12px;
}

.license-meta span {
    color: var(--app-muted);
    display: block;
    font-size: .78rem;
    font-weight: 700;
}

.license-meta strong {
    display: block;
    margin-top: 3px;
}

:root[data-theme="dark"] .license-meta div {
    background: rgba(15, 23, 42, .52);
}

.card-header {
    background: var(--app-surface-soft);
    border-bottom-color: var(--app-border);
}

.alert {
    border-radius: 8px;
    box-shadow: var(--app-shadow-soft);
}

.page-heading h1 {
    color: var(--app-text);
    font-weight: 800;
}

.page-heading p {
    color: var(--app-muted) !important;
}

.form-control,
.form-select {
    background-color: var(--app-surface);
    border-color: var(--app-border-strong);
    border-radius: 7px;
    color: var(--app-text);
    min-height: 42px;
}

:root[data-theme="dark"] .form-control::placeholder {
    color: #7f8ea5;
}

:root[data-theme="dark"] .form-control:disabled,
:root[data-theme="dark"] .form-select:disabled {
    background-color: #1f2937;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--app-surface);
    color: var(--app-text);
    border-color: var(--app-blue);
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .14);
}

.table {
    --bs-table-bg: transparent;
}

.table thead th {
    background: var(--app-surface-soft);
    border-bottom: 1px solid var(--app-border-strong);
    color: var(--app-muted);
    font-size: .78rem;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.table tbody tr:hover {
    background: #f8fafc;
}

:root[data-theme="dark"] .table {
    --bs-table-color: var(--app-text);
    --bs-table-hover-color: var(--app-text);
}

:root[data-theme="dark"] .table tbody tr:hover {
    background: #162033;
}

.badge {
    border-radius: 6px;
    font-weight: 700;
}

#live-status {
    border-radius: 999px;
    padding: .42rem .65rem;
}

.list-group {
    border-radius: 8px;
}

.list-group-item {
    background: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-text);
}

.list-group-item.active {
    background: var(--app-blue);
    border-color: var(--app-blue);
}

#conversation-status-filters .list-group-item,
#conversation-type-filters .list-group-item {
    font-weight: 600;
}

.inbox-sidebar > .card {
    position: sticky;
    top: 82px;
}

.inbox-grid > aside,
.inbox-grid > section {
    min-width: 0;
}

#conversation-list {
    max-height: calc(100vh - 168px);
    overflow: auto;
}

#conversation-list .list-group-item {
    padding: 14px 16px;
}

#conversation-list .conversation-unread {
    background: var(--app-surface);
    border: 2px solid var(--app-primary);
    border-left-width: 2px;
    border-radius: 8px;
    box-shadow:
        0 0 0 1px rgba(255, 90, 0, .16),
        0 0 18px rgba(255, 90, 0, .38);
    position: relative;
    z-index: 1;
}

#conversation-list .list-group-item.active {
    background: linear-gradient(135deg, var(--app-blue), #1d4ed8);
    border-color: #1d4ed8;
}

#conversation-list .conversation-unread.active {
    border-color: #ffb000;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .22),
        0 0 22px rgba(255, 176, 0, .55);
}

#conversation-list .list-group-item:not(.active):hover {
    background: #f8fafc;
}

:root[data-theme="dark"] #conversation-list .list-group-item:not(.active):hover {
    background: #162033;
}

#selected-conversation-pane {
    position: sticky;
    top: 82px;
    align-self: flex-start;
}

.inbox-detail-column > .card:first-child {
    border-top: 4px solid var(--app-blue);
}

.conversation-messages {
    padding-right: 4px;
    scrollbar-color: #b6c2d2 transparent;
}

.conversation-messages > .card,
.conversation-messages .d-flex > .card {
    border-radius: 8px;
    box-shadow: none;
}

.conversation-messages .border-primary {
    background: #fff;
    border-color: #93c5fd !important;
}

.conversation-messages .border-success {
    background: #ecfdf5;
    border-color: #86efac !important;
}

.conversation-messages .border-warning {
    background: #fffbeb !important;
    border-color: #fbbf24 !important;
}

.conversation-messages .border-info {
    background: #eff6ff !important;
    border-color: #60a5fa !important;
}

:root[data-theme="dark"] .conversation-messages .border-primary {
    background: #111827;
}

:root[data-theme="dark"] .conversation-messages .border-success {
    background: #062d25;
}

:root[data-theme="dark"] .conversation-messages .border-warning {
    background: #35260b !important;
}

:root[data-theme="dark"] .conversation-messages .border-info {
    background: #10233f !important;
}

.conversation-messages .card-body {
    line-height: 1.48;
}

.live-toast-stack {
    bottom: 18px;
    display: grid;
    gap: 10px;
    max-width: min(380px, calc(100vw - 24px));
    position: fixed;
    right: 18px;
    z-index: 1080;
}

.live-toast {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-left: 5px solid var(--app-primary);
    border-radius: 8px;
    box-shadow: var(--app-shadow);
    color: var(--app-text);
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    text-decoration: none;
    transform: translateY(0);
    transition: opacity .2s ease, transform .2s ease;
}

.live-toast:hover {
    border-color: var(--app-primary);
    color: var(--app-text);
}

.live-toast span {
    color: var(--app-muted);
    font-size: .9rem;
}

.live-toast.is-hiding {
    opacity: 0;
    transform: translateY(8px);
}

.theme-toggle {
    min-width: 72px;
}

.dashboard-hero {
    background:
        linear-gradient(135deg, #ff5a00 0%, #f97316 42%, #0f172a 100%);
    border-radius: 8px;
    box-shadow: var(--app-shadow);
    color: #fff;
    padding: clamp(22px, 4vw, 34px);
}

:root[data-theme="dark"] .dashboard-hero {
    background:
        linear-gradient(135deg, #ea580c 0%, #1d4ed8 52%, #0f172a 100%);
}

.dashboard-hero h1 {
    font-weight: 850;
    letter-spacing: 0;
}

.dashboard-hero-logo {
    display: block;
    filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .24));
    height: auto;
    max-height: 96px;
    max-width: min(300px, 78vw);
    object-fit: contain;
    width: auto;
}

.dashboard-hero p {
    color: rgba(255, 255, 255, .78);
}

.eyebrow {
    color: rgba(255, 255, 255, .75);
    font-size: .77rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.metric-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: var(--app-shadow-soft);
    color: var(--app-text);
    display: block;
    min-height: 128px;
    overflow: hidden;
    padding: 18px;
    position: relative;
}

.metric-card::before {
    content: "";
    display: block;
    height: 4px;
    inset: 0 0 auto;
    position: absolute;
}

.metric-primary::before { background: var(--app-blue); }
.metric-danger::before { background: var(--app-red); }
.metric-warning::before { background: var(--app-yellow); }
.metric-success::before { background: var(--app-green); }

.metric-label {
    color: var(--app-muted);
    font-weight: 700;
}

.metric-value {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.05;
    margin-top: 8px;
}

.metric-note {
    color: var(--app-muted);
    font-size: .9rem;
    margin-top: 6px;
}

.dashboard-card .card-body {
    padding: 20px;
}

.dashboard-pie-wrap {
    align-items: center;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(180px, 240px) 1fr;
}

.dashboard-pie {
    height: auto;
    max-width: 240px;
    overflow: visible;
    transform: rotate(-90deg);
    width: 100%;
}

.dashboard-pie circle {
    transition: stroke-dasharray .25s ease;
}

.pie-number,
.pie-caption {
    fill: var(--app-text);
    transform: rotate(90deg);
    transform-origin: center;
}

.pie-number {
    font-size: .42rem;
    font-weight: 800;
}

.pie-caption {
    fill: var(--app-muted);
    font-size: .16rem;
    font-weight: 700;
}

.dashboard-legend {
    display: grid;
    gap: 9px;
}

.legend-row,
.waiting-row {
    align-items: center;
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    color: var(--app-text);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 10px 12px;
    text-decoration: none;
}

.legend-row:hover,
.waiting-row:hover {
    border-color: var(--app-blue);
    color: var(--app-text);
}

.legend-dot {
    border-radius: 6px;
    display: inline-block;
    flex: 0 0 auto;
    height: 14px;
    width: 14px;
}

.activity-chart {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(7, minmax(42px, 1fr));
    min-height: 224px;
}

.activity-day {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: flex-end;
    min-width: 0;
}

.activity-bar {
    align-items: flex-start;
    background: linear-gradient(180deg, var(--app-blue), #22c55e);
    border-radius: 8px 8px 4px 4px;
    color: #fff;
    display: flex;
    justify-content: center;
    max-height: 170px;
    min-height: 8px;
    min-width: 28px;
    padding-top: 6px;
    width: min(100%, 54px);
}

.activity-bar span {
    font-size: .78rem;
    font-weight: 800;
}

.activity-label {
    color: var(--app-muted);
    font-size: .82rem;
    font-weight: 700;
}

.mini-stat-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
}

.mini-stat-grid > div {
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 12px;
}

.mini-stat-grid span {
    color: var(--app-muted);
    display: block;
    font-size: .84rem;
    font-weight: 700;
}

.mini-stat-grid strong {
    display: block;
    font-size: 1.75rem;
    line-height: 1.1;
    margin-top: 6px;
}

.account-row,
.type-row {
    border-top: 1px solid var(--app-border);
    padding: 13px 0;
}

.account-row:first-of-type,
.type-row:first-of-type {
    border-top: 0;
}

.slim-progress {
    background: var(--app-border);
    border-radius: 999px;
    height: 8px;
}

.waiting-row {
    align-items: flex-start;
    margin-bottom: 9px;
}

.waiting-row div {
    display: grid;
    min-width: 0;
}

.waiting-row span {
    color: var(--app-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.waiting-row small {
    color: var(--app-muted);
    flex: 0 0 auto;
}

:root[data-theme="dark"] .text-secondary {
    color: var(--app-muted) !important;
}

:root[data-theme="dark"] .text-bg-light {
    background: #223047 !important;
    color: #dbeafe !important;
}

:root[data-theme="dark"] .dropdown-menu {
    background: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-text);
}

:root[data-theme="dark"] .modal-content {
    background: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-text);
}

:root[data-theme="dark"] .modal-header,
:root[data-theme="dark"] .modal-footer {
    border-color: var(--app-border);
}

:root[data-theme="dark"] .status-filter-new:not(.active) {
    background: #10233f !important;
    color: #bfdbfe !important;
}

:root[data-theme="dark"] .status-filter-reply:not(.active) {
    background: #3b1118 !important;
    color: #fecdd3 !important;
}

:root[data-theme="dark"] .status-filter-system:not(.active) {
    background: #38260a !important;
    color: #fde68a !important;
}

:root[data-theme="dark"] .status-filter-waiting:not(.active) {
    background: #0b2d22 !important;
    color: #bbf7d0 !important;
}

:root[data-theme="dark"] .status-filter-done:not(.active) {
    background: #1f2937 !important;
    color: #cbd5e1 !important;
}

:root[data-theme="dark"] .alert-success {
    background: #063820;
    border-color: #11633c;
    color: #bbf7d0;
}

:root[data-theme="dark"] .alert-danger {
    background: #451a1a;
    border-color: #7f1d1d;
    color: #fecaca;
}

.status-filter {
    border-left-width: 5px !important;
}

.status-filter-new {
    background: #e8f1ff !important;
    border-left-color: var(--app-blue) !important;
    color: #084298 !important;
}

.status-filter-reply {
    background: #fdecef !important;
    border-left-color: var(--app-red) !important;
    color: #842029 !important;
}

.status-filter-system {
    background: #fff7df !important;
    border-left-color: var(--app-yellow) !important;
    color: #664d03 !important;
}

.status-filter-waiting {
    background: #e9f7ef !important;
    border-left-color: var(--app-green) !important;
    color: #0f5132 !important;
}

.status-filter-done {
    background: #eef2f7 !important;
    border-left-color: #64748b !important;
    color: #334155 !important;
}

.status-filter.active {
    color: #fff !important;
}

.status-filter-system.active {
    color: #212529 !important;
}

.pagination {
    --bs-pagination-border-radius: 7px;
    --bs-pagination-color: var(--app-blue);
    --bs-pagination-active-bg: var(--app-blue);
    --bs-pagination-active-border-color: var(--app-blue);
}

#conversation-pagination {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: var(--app-shadow-soft);
    overflow: hidden;
    padding: 10px;
}

#conversation-pagination nav {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
}

#conversation-pagination .pagination {
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin: 0;
}

#conversation-pagination .page-link {
    align-items: center;
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: 7px;
    color: var(--app-blue);
    display: inline-flex;
    font-size: .9rem;
    font-weight: 700;
    height: 34px;
    justify-content: center;
    min-width: 34px;
    padding: 0 .55rem;
}

#conversation-pagination .page-item.active .page-link {
    background: var(--app-blue);
    border-color: var(--app-blue);
    color: #fff;
}

#conversation-pagination .page-item.disabled .page-link {
    background: transparent;
    color: var(--app-muted);
    opacity: .62;
}

#conversation-pagination p {
    color: var(--app-muted);
    font-size: .82rem;
    margin: 0;
    text-align: center;
}

@media (max-width: 991.98px) {
    .app-navbar .container-fluid {
        align-items: flex-start;
        gap: 12px;
    }

    .app-nav-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .dashboard-pie-wrap {
        grid-template-columns: 1fr;
    }

    .dashboard-pie {
        justify-self: center;
        max-width: 210px;
    }

    #conversation-list {
        max-height: 460px;
    }

    #selected-conversation-pane {
        position: static;
    }

    .license-summary {
        grid-template-columns: 1fr;
    }

    .license-meta {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575.98px) {
    .app-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .app-brand span:last-child {
        display: none;
    }

    .app-footer .app-container {
        justify-content: center;
        text-align: center;
    }

    .app-nav-actions .btn {
        padding-left: .5rem;
        padding-right: .5rem;
    }

    .dashboard-hero {
        padding: 18px;
    }

    .activity-chart {
        gap: 7px;
        grid-template-columns: repeat(7, minmax(30px, 1fr));
    }

    .activity-bar {
        min-width: 22px;
        width: 100%;
    }

    .activity-bar span {
        font-size: .68rem;
    }

    .license-meta {
        grid-template-columns: 1fr;
    }
}

:root[data-theme="dark"] {
    --bs-body-bg: var(--app-bg);
    --bs-body-color: var(--app-text);
    --bs-border-color: var(--app-border);
    --bs-secondary-color: var(--app-muted);
    color-scheme: dark;
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] main,
:root[data-theme="dark"] .bg-white,
:root[data-theme="dark"] .bg-light {
    background-color: var(--app-bg) !important;
    color: var(--app-text) !important;
}

:root[data-theme="dark"] .card,
:root[data-theme="dark"] .list-group-item,
:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] input {
    background-color: var(--app-surface) !important;
    color: var(--app-text) !important;
}

:root[data-theme="dark"] .card-header,
:root[data-theme="dark"] .card-footer,
:root[data-theme="dark"] .table thead th {
    background-color: var(--app-surface-soft) !important;
}

:root[data-theme="dark"] .border,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .list-group-item,
:root[data-theme="dark"] .form-control,
:root[data-theme="dark"] .form-select {
    border-color: var(--app-border) !important;
}

:root[data-theme="dark"] .status-filter-new:not(.active) {
    background: #10233f !important;
    border-left-color: var(--app-blue) !important;
    color: #bfdbfe !important;
}

:root[data-theme="dark"] .status-filter-reply:not(.active) {
    background: #3b1118 !important;
    border-left-color: var(--app-red) !important;
    color: #fecdd3 !important;
}

:root[data-theme="dark"] .status-filter-system:not(.active) {
    background: #38260a !important;
    border-left-color: var(--app-yellow) !important;
    color: #fde68a !important;
}

:root[data-theme="dark"] .status-filter-waiting:not(.active) {
    background: #0b2d22 !important;
    border-left-color: var(--app-green) !important;
    color: #bbf7d0 !important;
}

:root[data-theme="dark"] .status-filter-done:not(.active) {
    background: #1f2937 !important;
    border-left-color: #64748b !important;
    color: #cbd5e1 !important;
}

:root[data-theme="dark"] .conversation-messages .border-primary {
    background: #111827 !important;
    border-color: #3b82f6 !important;
}

:root[data-theme="dark"] .conversation-messages .border-success {
    background: #062d25 !important;
    border-color: #16a34a !important;
}

:root[data-theme="dark"] .conversation-messages .border-warning {
    background: #35260b !important;
    border-color: #f59e0b !important;
}

:root[data-theme="dark"] .conversation-messages .border-info {
    background: #10233f !important;
    border-color: #38bdf8 !important;
}

:root[data-theme="dark"] #conversation-list .conversation-unread:not(.active) {
    background: var(--app-surface) !important;
    border-color: #ffb000 !important;
    box-shadow:
        0 0 0 1px rgba(255, 176, 0, .2),
        0 0 22px rgba(255, 176, 0, .32);
}

:root[data-theme="dark"] .live-toast {
    background: #111827;
    border-color: #334155;
    border-left-color: var(--app-primary);
}

.audit-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(180px, 1fr) minmax(170px, 1fr) 150px 150px auto auto;
    gap: 10px;
    align-items: center;
}

.audit-table th {
    color: var(--app-muted);
    font-size: .75rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.audit-table td {
    vertical-align: top;
}

.audit-props {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 620px;
}

.audit-prop {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-soft);
    color: var(--app-text);
    font-size: .78rem;
    padding: 4px 7px;
}

:root[data-theme="dark"] .audit-prop {
    background: #0f172a;
}

.autoresponder-hours {
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 14px;
}

.autoresponder-days {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.autoresponder-days .btn {
    min-width: 52px;
}

.autoresponder-days .btn-check:checked + .btn {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: #fff;
}

.issue-context-card {
    border-color: var(--app-border);
}

.issue-context-image {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-soft);
}

.issue-context-meta,
.issue-context-section {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.issue-context-products {
    display: grid;
    gap: 10px;
}

.issue-context-products-title {
    color: var(--app-muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.issue-context-product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-soft);
}

.issue-context-product-matched {
    border-color: var(--app-primary);
    background: rgba(37, 99, 235, .08);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, .12);
}

.issue-context-other-products summary {
    color: var(--app-blue);
    cursor: pointer;
    font-weight: 700;
}

.issue-context-description {
    white-space: pre-wrap;
}

:root[data-theme="dark"] .issue-context-card .card-header {
    background: #152033 !important;
    border-bottom-color: #334155;
    color: var(--app-text);
}

:root[data-theme="dark"] .issue-context-product-matched {
    background: #122b4d;
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, .18);
}

@media (max-width: 1199.98px) {
    .audit-filter-bar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575.98px) {
    .audit-filter-bar {
        grid-template-columns: 1fr;
    }
}
