﻿/* Total BS AI â€” Metronic v9 brand overrides */

:root,
:host {
    --tbs-red: #9b1415;
    --tbs-red-hover: #851112;
    --tbs-red-soft: #fdf2f2;
    --tbs-dark: #0f0f0f;
    --tbs-bg-soft: #f5f5f3;
    --primary: #9b1415;
    --primary-foreground: #ffffff;
    --ring: color-mix(in oklab, #9b1415 35%, transparent);
    --font-sans: "proxima-nova", "Proxima Nova", ui-sans-serif, system-ui, sans-serif;
    --mono: #0f0f0f;
}

.dark {
    --primary: #b01819;
    --primary-foreground: #ffffff;
}

body,
.kt-wrapper,
.kt-sidebar,
.kt-header {
    font-family: "proxima-nova", "Proxima Nova", ui-sans-serif, system-ui, sans-serif;
}

.tbs-heading,
h1.tbs-heading,
.page-title.tbs-heading {
    font-family: "bebas-neue-pro", "Bebas Neue Pro", sans-serif;
    letter-spacing: 0.02em;
    font-weight: 400;
}

.tbs-brand-logo {
    width: 140px;
    max-width: 100%;
    height: auto;
    display: block;
}

.tbs-brand-logo-sm {
    width: 36px;
    height: auto;
}

.tbs-tagline {
    margin: 0.35rem 0 0;
    font-size: 10px;
    color: var(--muted-foreground);
}

.kt-menu-item.here > .kt-menu-link,
.kt-menu-link.active {
    background-color: var(--tbs-red-soft) !important;
    border-radius: 0.5rem;
}

.kt-menu-item.here > .kt-menu-link .kt-menu-title,
.kt-menu-item.here > .kt-menu-link .kt-menu-icon,
.kt-menu-link.active .kt-menu-title,
.kt-menu-link.active .kt-menu-icon {
    color: var(--tbs-red) !important;
}

.kt-btn-primary,
.kt-btn.bg-primary {
    background-color: var(--tbs-red);
    border-color: var(--tbs-red);
}

.kt-btn-primary:hover,
.kt-btn.bg-primary:hover {
    background-color: var(--tbs-red-hover);
    border-color: var(--tbs-red-hover);
}

.text-primary,
.link:not(.kt-btn) {
    --tw-text-opacity: 1;
}

.link {
    color: var(--tbs-red);
}

.tbs-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.tbs-status-pill.active {
    background: #edf7f0;
    color: #2a7a4a;
}

.tbs-status-pill.inactive {
    background: var(--tbs-red-soft);
    color: var(--tbs-red);
}

.tbs-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.tbs-toast {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1100;
    min-width: 260px;
}

.tbs-metric-label {
    font-size: 11px;
    font-weight: 600;
    color: #888888;
    letter-spacing: 0.02em;
    text-transform: none;
}

.tbs-metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--tbs-dark);
    line-height: 1.1;
}

.tbs-page-bg {
    background: linear-gradient(180deg, #f5f5f3 0%, #ffffff 100%);
}

.tbs-outcome-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.tbs-section-label {
    font-size: 11px;
    font-weight: 600;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    margin-bottom: 10px;
}

.tbs-back-link {
    display: inline-block;
    font-size: 12px;
    color: #888888;
    text-decoration: none;
    margin-bottom: 12px;
}

.tbs-back-link:hover {
    color: #9b1415;
}

.tbs-viewing-as {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    background: #fdf2f2;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 12px;
    color: #9b1415;
}

.tbs-sidebar-toggle {
    min-width: 32px;
    min-height: 32px;
}

.tbs-sidebar-toggle:hover {
    background: rgba(155, 20, 21, 0.08);
}

.tbs-sortable-row.is-dragging {
    opacity: 0.55;
    background: #fdf2f2;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.tbs-sortable-active {
    cursor: grabbing;
    user-select: none;
}

body.tbs-sortable-active .tbs-drag-handle {
    cursor: grabbing;
}

.tbs-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #aaaaaa;
    cursor: grab;
    padding: 0;
}

.tbs-drag-handle:hover {
    background: rgba(155, 20, 21, 0.08);
    color: #9b1415;
}

.tbs-drag-handle:active {
    cursor: grabbing;
}

.tbs-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 767px) {
    .tbs-kpi-row {
        grid-template-columns: 1fr;
    }
}

.tbs-kpi-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1023px) {
    .tbs-kpi-row-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 639px) {
    .tbs-kpi-row-4 {
        grid-template-columns: 1fr;
    }
}

.tbs-prompt-textarea {
    min-height: 280px;
    resize: vertical;
    line-height: 1.5;
}

.tbs-hidden-radio,
.tbs-model-card input[type="radio"],
.voice-card input[type="radio"],
[data-model-card] input[type="radio"],
[data-voice-card] input[type="radio"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.tbs-toggle {
    width: 42px;
    height: 24px;
    border-radius: 999px;
    border: none;
    background: #ddd;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.tbs-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.tbs-toggle.on {
    background: var(--tbs-red);
}

.tbs-toggle.on::after {
    transform: translateX(18px);
}

.tbs-transcript-box {
    background: var(--tbs-bg-soft);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.tbs-transcript-box .speaker-ai {
    color: var(--tbs-red);
    font-weight: 500;
}

.tbs-settings-tab.active {
    color: var(--tbs-red);
    border-bottom: 2px solid var(--tbs-red);
}

.tbs-model-card.selected {
    border-color: var(--tbs-red) !important;
    background: var(--tbs-red-soft) !important;
}

.tbs-voice-card.selected {
    border-color: var(--tbs-red) !important;
    background: var(--tbs-red-soft) !important;
}

.tbs-health-overall {
    border-radius: 10px;
    border: none;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    color: #ffffff;
}

.tbs-health-overall-ok {
    background: #15803d;
}

.tbs-health-overall-warn {
    background: #b45309;
}

.tbs-health-overall-fail {
    background: #9b1415;
}

.tbs-health-overall-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.92;
}

.tbs-health-overall-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 0.35rem;
}

.tbs-health-overall-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    opacity: 0.9;
}

.tbs-health-spinner {
    display: none;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: tbs-health-spin 0.7s linear infinite;
}

.tbs-health-spinner.is-active {
    display: inline-block;
}

@keyframes tbs-health-spin {
    to {
        transform: rotate(360deg);
    }
}

.tbs-health-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tbs-health-badge-ok {
    background: #dcfce7;
    color: #166534;
}

.tbs-health-badge-warn {
    background: #fef3c7;
    color: #92400e;
}

.tbs-health-badge-fail {
    background: #fee2e2;
    color: #991b1b;
}

.tbs-health-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 1280px) {
    .tbs-health-layout {
        grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
        gap: 1.75rem;
        align-items: start;
    }
}

.tbs-health-groups {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tbs-health-group {
    overflow: hidden;
}

.tbs-health-group-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border, #e5e5e5);
}

.tbs-health-group-ok .tbs-health-group-header {
    background: rgba(22, 101, 52, 0.04);
}

.tbs-health-group-warn .tbs-health-group-header {
    background: rgba(180, 83, 9, 0.06);
}

.tbs-health-group-fail .tbs-health-group-header {
    background: rgba(155, 20, 21, 0.06);
}

.tbs-health-group-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.tbs-health-group-desc {
    font-size: 0.75rem;
    color: var(--secondary-foreground, #737373);
    margin: 0.25rem 0 0;
    line-height: 1.45;
}

.tbs-health-group-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex-shrink: 0;
}

.tbs-health-group-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.tbs-health-group-pill-ok {
    background: #dcfce7;
    color: #166534;
}

.tbs-health-group-pill-warn {
    background: #fef3c7;
    color: #92400e;
}

.tbs-health-group-pill-fail {
    background: #fee2e2;
    color: #991b1b;
}

.tbs-health-group-body {
    padding: 0;
}

.tbs-health-check-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border, #e5e5e5);
}

.tbs-health-check-row:last-child {
    border-bottom: none;
}

.tbs-health-check-row-fail {
    background: rgba(155, 20, 21, 0.04);
}

.tbs-health-check-row-warn {
    background: rgba(180, 83, 9, 0.04);
}

.tbs-log-tail-wrap {
    max-height: 240px;
    overflow: auto;
    border-radius: 8px;
    background: #0f0f0f;
}

.tbs-log-tail {
    margin: 0;
    padding: 0.85rem 1rem;
    background: transparent;
    color: #e5e5e5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.7rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-all;
}

.tbs-billing-plans-wrap {
    overflow-x: auto;
    padding-top: 0.75rem;
    margin-top: -0.75rem;
}

.tbs-billing-plans-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
}

.tbs-billing-plans-table th,
.tbs-billing-plans-table td {
    border-bottom: 1px solid var(--border, #e5e5e5);
    padding: 0.875rem 1.25rem;
    text-align: center;
    vertical-align: middle;
}

.tbs-billing-plans-table thead th {
    border-top: 1px solid var(--border, #e5e5e5);
    vertical-align: bottom;
}

.tbs-billing-feature-col {
    text-align: left !important;
    width: 220px;
    border-left: 1px solid var(--border, #e5e5e5);
}

.tbs-billing-plans-table thead .tbs-billing-feature-col {
    border-top-left-radius: 12px;
}

.tbs-billing-plans-table tbody tr:last-child .tbs-billing-feature-col {
    border-bottom-left-radius: 12px;
}

.tbs-billing-plans-table th:not(.tbs-billing-feature-col),
.tbs-billing-plans-table td:not(.tbs-billing-feature-col) {
    border-left: 1px solid var(--border, #e5e5e5);
}

.tbs-billing-plan-header-cell {
    position: relative;
    padding-top: 1.75rem !important;
    min-width: 200px;
}

.tbs-billing-plan-col-current {
    background: rgba(0, 0, 0, 0.03);
}

.tbs-billing-plan-col-last {
    border-right: 1px solid var(--border, #e5e5e5);
}

.tbs-billing-plans-table thead .tbs-billing-plan-col-last {
    border-top-right-radius: 12px;
}

.tbs-billing-plans-table tbody tr:last-child .tbs-billing-plan-col-last {
    border-bottom-right-radius: 12px;
}

.tbs-billing-current-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.tbs-billing-check {
    color: #2a7a4a;
}

.tbs-billing-support-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .tbs-billing-support-row {
        grid-template-columns: 1fr 1fr;
    }
}

.tbs-billing-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 1280px) {
    .tbs-billing-layout {
        grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
        gap: 1.75rem;
    }
}

.tbs-billing-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.tbs-billing-stat-box {
    display: grid;
    gap: 0.35rem;
    border: 1px dashed var(--border, #d4d4d4);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    min-width: 6.5rem;
}

.tbs-billing-stat-value {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    color: var(--foreground, #0f0f0f);
}

.tbs-billing-stat-label {
    font-size: 0.875rem;
    color: var(--secondary-foreground, #737373);
}

.tbs-billing-payment-placeholder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 0.75rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.02);
}

.tbs-billing-payment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    background: rgba(155, 20, 21, 0.08);
    flex-shrink: 0;
}

.tbs-billing-promo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.125rem;
    height: 3.125rem;
    border-radius: 0.75rem;
    background: rgba(155, 20, 21, 0.08);
    margin-bottom: 0.25rem;
}

.tbs-billing-promo-divider {
    display: block;
    border-bottom: 1px solid var(--border, #e5e5e5);
}

/* DataTables.net — Metronic / TBS integration */
.tbs-datatable .dataTables_wrapper {
    width: 100%;
    clear: both;
}

.tbs-datatable .dataTables_wrapper::after {
    display: none;
}

.tbs-datatable .dataTables_wrapper .dataTables_length,
.tbs-datatable .dataTables_wrapper .dataTables_filter,
.tbs-datatable .dataTables_wrapper .dt-buttons {
    float: none;
}

.tbs-dt-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 0.5px solid #f0f0ee;
}

.tbs-dt-toolbar,
.tbs-dt-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.tbs-dt-toolbar {
    margin-bottom: 1rem;
}

.tbs-dt-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 0.5px solid #f0f0ee;
}

.tbs-dt-toolbar-start,
.tbs-dt-toolbar-end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.tbs-dt-toolbar-end {
    margin-left: auto;
}

.tbs-datatable .dataTables_length label,
.tbs-datatable .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.8125rem;
    color: #888;
    font-weight: 400;
}

.tbs-datatable .dataTables_filter {
    text-align: right;
}

.tbs-datatable .dataTables_filter label::before {
    content: none;
}

.tbs-datatable .dataTables_length select,
.tbs-datatable .dataTables_filter input {
    min-height: 2.125rem;
    border: 0.5px solid #e5e5e3;
    border-radius: 0.375rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    background: #fff;
    color: #0f0f0f;
    outline: none;
    transition: border-color 0.15s ease;
}

.tbs-datatable .dataTables_filter input {
    min-width: 220px;
    margin-left: 0 !important;
}

.tbs-datatable .dataTables_length select:focus,
.tbs-datatable .dataTables_filter input:focus {
    border-color: #9b1415;
}

.tbs-datatable .dt-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tbs-datatable .dt-buttons .dt-button,
.tbs-datatable .dt-buttons button,
.tbs-datatable .dt-buttons .btn,
.tbs-datatable .dt-buttons a.dt-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 2.125rem;
    margin: 0 !important;
    border: 0.5px solid #e5e5e3 !important;
    border-radius: 0.375rem !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    background: #fff !important;
    color: #0f0f0f !important;
    box-shadow: none !important;
    cursor: pointer;
    text-decoration: none !important;
}

.tbs-datatable .dt-buttons .dt-button:hover,
.tbs-datatable .dt-buttons button:hover,
.tbs-datatable .dt-buttons .btn:hover,
.tbs-datatable .dt-buttons a.dt-button:hover {
    border-color: #9b1415 !important;
    color: #9b1415 !important;
    background: #fdf2f2 !important;
}

.tbs-datatable table.dataTable {
    width: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0;
}

.tbs-datatable table.dataTable thead th,
.tbs-datatable table.dataTable thead td {
    border-bottom: 0.5px solid #e5e5e3 !important;
    padding: 0.625rem 0.75rem !important;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #888;
    vertical-align: middle;
    white-space: nowrap;
    background: #fff;
}

.tbs-datatable table.dataTable tbody td {
    padding: 0.75rem !important;
    font-size: 0.875rem;
    color: #0f0f0f;
    vertical-align: middle;
    border-bottom: 0.5px solid #f0f0ee;
}

.tbs-datatable table.dataTable tbody tr:hover td {
    background: rgba(245, 245, 243, 0.65);
}

.tbs-datatable table.dataTable tbody tr:last-child td {
    border-bottom: 0;
}

.tbs-datatable table.dataTable thead .sorting,
.tbs-datatable table.dataTable thead .sorting_asc,
.tbs-datatable table.dataTable thead .sorting_desc {
    background-image: none !important;
    position: relative;
    padding-right: 1.25rem !important;
}

.tbs-datatable table.dataTable thead .sorting::before,
.tbs-datatable table.dataTable thead .sorting_asc::before,
.tbs-datatable table.dataTable thead .sorting_desc::before {
    content: none !important;
}

.tbs-datatable table.dataTable thead .sorting::after,
.tbs-datatable table.dataTable thead .sorting_asc::after,
.tbs-datatable table.dataTable thead .sorting_desc::after {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #bbb;
    opacity: 1;
}

.tbs-datatable table.dataTable thead .sorting::after {
    content: "↕";
}

.tbs-datatable table.dataTable thead .sorting_asc::after {
    content: "↑";
    color: #9b1415;
}

.tbs-datatable table.dataTable thead .sorting_desc::after {
    content: "↓";
    color: #9b1415;
}

.tbs-datatable .dataTables_info {
    font-size: 0.8125rem;
    color: #888;
    padding-top: 0 !important;
}

.tbs-datatable .dataTables_paginate {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.tbs-datatable .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    margin: 0 !important;
    padding: 0.25rem 0.5rem !important;
    border: 0.5px solid #e5e5e3 !important;
    border-radius: 0.375rem !important;
    background: #fff !important;
    color: #0f0f0f !important;
    font-size: 0.8125rem !important;
    line-height: 1 !important;
    box-shadow: none !important;
    cursor: pointer;
}

.tbs-datatable .dataTables_paginate .paginate_button:hover {
    border-color: #9b1415 !important;
    color: #9b1415 !important;
    background: #fdf2f2 !important;
}

.tbs-datatable .dataTables_paginate .paginate_button.current,
.tbs-datatable .dataTables_paginate .paginate_button.current:hover {
    border-color: #9b1415 !important;
    background: #9b1415 !important;
    color: #fff !important;
}

.tbs-datatable .dataTables_paginate .paginate_button.disabled,
.tbs-datatable .dataTables_paginate .paginate_button.disabled:hover {
    opacity: 0.45;
    cursor: default;
    border-color: #e5e5e3 !important;
    background: #fff !important;
    color: #aaa !important;
}

.tbs-datatable .dataTables_processing {
    background: rgba(255, 255, 255, 0.95);
    border: 0.5px solid #e5e5e3;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: #666;
}

.tbs-datatable .dataTables_empty {
    padding: 2rem 0.75rem !important;
    text-align: center;
    color: #888;
}

@media (max-width: 767px) {
    .tbs-dt-toolbar-end {
        width: 100%;
        margin-left: 0;
    }

    .tbs-datatable .dataTables_filter,
    .tbs-datatable .dataTables_filter label {
        width: 100%;
    }

    .tbs-datatable .dataTables_filter input {
        width: 100%;
        min-width: 0;
    }
}

/* Customer dashboard */
.tbs-dashboard-greeting-title {
    font-size: 16px;
    font-weight: 500;
    color: #0f0f0f;
}

.tbs-dashboard-greeting-sub {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.tbs-dashboard-metric {
    background: #ffffff;
    border: 0.5px solid #e5e5e3;
    border-radius: 8px;
    padding: 14px 16px;
}

.tbs-dashboard-metric-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.tbs-dashboard-metric-value {
    font-size: 26px;
    font-weight: 500;
    line-height: 1;
}

.tbs-dashboard-metric-sub {
    font-size: 11px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.tbs-dashboard-card-link {
    font-size: 12px;
    color: #9b1415;
    font-weight: 500;
    white-space: nowrap;
}

.tbs-dashboard-card-link:hover {
    text-decoration: underline;
}

.tbs-dashboard-ai-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
}

.tbs-dashboard-ai-pill.active {
    background: #edf7f0;
    color: #2a7a4a;
}

.tbs-dashboard-ai-pill.inactive {
    background: #fdf2f2;
    color: #9b1415;
}

.tbs-dashboard-ai-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.tbs-dashboard-attention {
    background: #fafaf9;
    border: 0.5px solid #e5e5e3;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    gap: 9px;
    align-items: flex-start;
}

.tbs-dashboard-all-clear {
    background: #edf7f0;
    border: 0.5px solid #c0e0cc;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    gap: 9px;
    align-items: center;
    margin-bottom: 12px;
}

.tbs-dashboard-quick-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f5f5f3;
    border: 0.5px solid #e5e5e3;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #0f0f0f;
    text-decoration: none;
}

.tbs-dashboard-quick-link:hover {
    border-color: #9b1415;
    color: #9b1415;
}

.tbs-dashboard-playbook-tag {
    font-size: 11px;
    color: #666;
    background: #f5f5f3;
    border: 0.5px solid #e5e5e3;
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
}

.tbs-dashboard-playbook-tag.muted {
    color: #aaa;
}

.tbs-dashboard-call-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 0.5px solid #f0f0ee;
}

.tbs-dashboard-call-row:last-child {
    border-bottom: 0;
}

.tbs-dashboard-mini-stat {
    text-align: center;
    background: #f5f5f3;
    border-radius: 7px;
    padding: 9px 6px;
}

.tbs-dashboard-mini-stat-value {
    font-size: 17px;
    font-weight: 500;
    color: #0f0f0f;
}

.tbs-dashboard-mini-stat-label {
    font-size: 10px;
    color: #aaa;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tbs-dashboard-outcome-bar {
    display: flex;
    height: 7px;
    border-radius: 4px;
    overflow: hidden;
    gap: 2px;
    margin-bottom: 8px;
}

.tbs-dashboard-outcome-segment {
    height: 100%;
    border-radius: 2px;
}

.tbs-dashboard-outcome-legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tbs-dashboard-outcome-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #666;
}

.tbs-dashboard-outcome-swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.tbs-dashboard-section-label {
    font-size: 10px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
    margin-bottom: 6px;
}

.tbs-dashboard-playbook-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 0.5px solid #f0f0ee;
}

.tbs-dashboard-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.tbs-dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.tbs-dashboard-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.tbs-dashboard-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    border-top: 0.5px solid #f0f0ee;
    padding-top: 12px;
    margin-top: 4px;
}

@media (max-width: 1023px) {
    .tbs-dashboard-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tbs-dashboard-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 639px) {
    .tbs-dashboard-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* AI Sandbox */
.tbs-sandbox-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.tbs-sandbox-config {
    width: 400px;
    flex-shrink: 0;
    background: #fff;
    border: 0.5px solid #e5e5e3;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tbs-sandbox-field {
    display: flex;
    flex-direction: column;
}

.tbs-sandbox-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    display: block;
}

.tbs-sandbox-label-muted {
    color: #aaa;
    font-weight: 400;
    text-transform: none;
}

.tbs-sandbox-input {
    width: 100%;
    font-size: 13px;
    padding: 7px 10px;
    border: 1px solid #e0e0de;
    border-radius: 7px;
    background: #fff;
    color: #0f0f0f;
}

.tbs-sandbox-hint {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
}

.tbs-sandbox-btn-outline {
    width: 100%;
    padding: 8px;
    font-size: 13px;
    border: 1px solid #e0e0de;
    border-radius: 7px;
    background: #fff;
    color: #0f0f0f;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tbs-sandbox-prompt-section {
    border-top: 0.5px solid #e5e5e3;
    padding-top: 14px;
}

.tbs-sandbox-prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.tbs-sandbox-link-btn {
    font-size: 11px;
    color: #9b1415;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.tbs-sandbox-prompt-viewer {
    width: 100%;
    height: 200px;
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    padding: 10px;
    border: 1px solid #e0e0de;
    border-radius: 7px;
    background: #fafaf9;
    color: #555;
    resize: vertical;
    line-height: 1.5;
    margin-bottom: 4px;
}

.tbs-sandbox-disclaimer {
    background: #fef9ec;
    border: 0.5px solid #f0d080;
    border-radius: 7px;
    padding: 10px 12px;
    font-size: 11px;
    color: #8a6200;
    line-height: 1.5;
}

.tbs-sandbox-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 0.5px solid #e5e5e3;
    border-radius: 10px;
    overflow: hidden;
    min-height: 500px;
    min-width: 0;
}

.tbs-sandbox-chat-header {
    padding: 12px 16px;
    border-bottom: 0.5px solid #e5e5e3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tbs-sandbox-chat-title {
    font-size: 13px;
    font-weight: 500;
    color: #0f0f0f;
}

.tbs-sandbox-chat-meta {
    font-size: 11px;
    color: #aaa;
}

.tbs-sandbox-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.tbs-sandbox-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tbs-sandbox-status-waiting {
    background: #f5f5f3;
    color: #888;
}

.tbs-sandbox-status-waiting .tbs-sandbox-status-dot {
    background: #ddd;
}

.tbs-sandbox-status-ready {
    background: #edf7f0;
    color: #2a7a4a;
}

.tbs-sandbox-status-ready .tbs-sandbox-status-dot {
    background: #2a7a4a;
}

.tbs-sandbox-status-thinking {
    background: #fef9ec;
    color: #8a6200;
}

.tbs-sandbox-status-thinking .tbs-sandbox-status-dot {
    background: #e9a84a;
}

.tbs-sandbox-status-error {
    background: #fdf2f2;
    color: #9b1415;
}

.tbs-sandbox-status-error .tbs-sandbox-status-dot {
    background: #9b1415;
}

.tbs-sandbox-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 300px;
}

.tbs-sandbox-empty {
    text-align: center;
    color: #aaa;
    font-size: 13px;
    padding: 40px 0;
}

.tbs-sandbox-input-bar {
    padding: 12px 16px;
    border-top: 0.5px solid #e5e5e3;
    display: flex;
    gap: 8px;
}

.tbs-sandbox-send-btn {
    padding: 8px 16px;
    font-size: 13px;
    background: #9b1415;
    color: #fff;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 500;
}

.tbs-sandbox-send-btn.is-disabled,
.tbs-sandbox-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tbs-sandbox-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.tbs-sandbox-msg-row-user {
    justify-content: flex-end;
}

.tbs-sandbox-msg-row-ai {
    justify-content: flex-start;
}

.tbs-sandbox-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fdf2f2;
    border: 1px solid #f0c0c0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #9b1415;
    font-size: 14px;
}

.tbs-sandbox-bubble {
    max-width: 70%;
    padding: 9px 13px;
    font-size: 13px;
    line-height: 1.5;
}

.tbs-sandbox-bubble-user {
    background: #9b1415;
    color: #fff;
    border-radius: 12px 12px 2px 12px;
}

.tbs-sandbox-bubble-ai {
    background: #f5f5f3;
    color: #0f0f0f;
    border-radius: 12px 12px 12px 2px;
    border: 0.5px solid #e5e5e3;
}

.tbs-sandbox-system-msg {
    text-align: center;
    font-size: 11px;
    color: #9b1415;
    padding: 4px 0;
}

.tbs-sandbox-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.tbs-sandbox-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ccc;
    animation: tbs-sandbox-pulse 1s ease-in-out infinite;
}

.tbs-sandbox-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.tbs-sandbox-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@media (max-width: 1023px) {
    .tbs-sandbox-layout {
        flex-direction: column;
    }

    .tbs-sandbox-config {
        width: 100%;
    }
}

.tbs-dashboard-drilldown {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

a.tbs-dashboard-drilldown:hover {
    border-color: #f0c0c0;
    box-shadow: 0 1px 4px rgba(155, 20, 21, 0.08);
}

a.tbs-dashboard-playbook-row.tbs-dashboard-drilldown {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

a.tbs-dashboard-outcome-legend-item.tbs-dashboard-drilldown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}

a.tbs-dashboard-outcome-legend-item.tbs-dashboard-drilldown:hover {
    background: #fafaf9;
}

a.tbs-dashboard-mini-stat.tbs-dashboard-drilldown {
    border-radius: 6px;
    padding: 4px;
    margin: -4px;
}

#chart-calls {
    cursor: pointer;
}

.tbs-kpi-drilldown {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tbs-kpi-drilldown:hover {
    border-color: #f0c0c0;
    box-shadow: 0 1px 4px rgba(155, 20, 21, 0.08);
}

.tbs-call-log-filter-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: #fdf2f2;
    border: 0.5px solid #f0c0c0;
    border-radius: 8px;
    font-size: 12px;
}

.tbs-call-log-filter-banner-label {
    color: #888;
    font-weight: 500;
}

.tbs-call-log-filter-banner-value {
    color: #0f0f0f;
    font-weight: 500;
}

.tbs-call-log-filter-clear {
    margin-left: auto;
    color: #9b1415;
    font-weight: 500;
    text-decoration: none;
}

.tbs-call-log-filter-clear:hover {
    text-decoration: underline;
}
