:root {
    color-scheme: light;
    --ink: #17202a;
    --muted: #607080;
    --line: #d7dee6;
    --panel: #ffffff;
    --surface: #f5f7fa;
    --brand: #145c9e;
    --brand-dark: #0f477a;
    --ok: #147c4c;
    --warn: #9b5a00;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f8f9fa;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

h3 {
    font-size: 17px;
    margin: 0 0 12px;
}

h1,
h2 {
    margin-top: 0;
}

a {
    color: var(--brand);
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 24px;
    justify-content: space-between;
    padding: 16px 24px;
}

.brand {
    font-size: 19px;
    font-weight: 700;
}

.topbar-actions {
    align-items: center;
    display: flex;
    gap: 12px;
}

.topbar-link {
    background: #eef4ff;
    border: 1px solid #c8ddf5;
    border-radius: 6px;
    color: var(--brand);
    font-weight: 700;
    padding: 7px 10px;
    text-decoration: none;
}

.topbar-link:hover,
.topbar-link:focus {
    background: #dce9ff;
}

.user-profile-link {
    align-items: center;
    color: var(--ink);
    display: flex;
    gap: 9px;
    min-width: 0;
    text-decoration: none;
}

.user-profile-link > i {
    color: var(--brand);
    font-size: 25px;
}

.user-profile-copy {
    display: grid;
    line-height: 1.2;
}

.user-profile-copy strong,
.user-profile-copy small {
    white-space: nowrap;
}

.user-profile-copy small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.container {
    margin: 0 auto;
    max-width: 1120px;
    padding: 28px 24px;
}

.admin-shell {
    max-width: 1440px;
}

.platform-shell {
    max-width: 1540px;
}

.platform-titlebar {
    align-items: flex-start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.platform-titlebar h1 {
    margin-bottom: 4px;
}

.platform-owner-badge {
    background: #17202a;
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 11px;
    white-space: nowrap;
}

.platform-summary-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    margin-bottom: 18px;
}

.platform-summary-card {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid #5d6b7a;
    border-radius: 8px;
    padding: 18px;
}

.platform-summary-primary {
    border-left-color: var(--brand);
}

.platform-summary-success {
    border-left-color: var(--ok);
}

.platform-panel {
    padding: 0;
}

.platform-health-panel {
    margin-bottom: 18px;
}

.platform-create-tenant-panel {
    margin-bottom: 18px;
}

.platform-health-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.platform-health-card {
    border: 1px solid var(--line);
    border-left: 4px solid #5d6b7a;
    border-radius: 8px;
    padding: 12px;
}

.platform-health-card-ok {
    border-left-color: var(--ok);
}

.platform-health-card-warn {
    border-left-color: var(--warn);
}

.platform-health-card-fail {
    border-left-color: #b42318;
}

.platform-health-card strong {
    display: block;
    margin: 8px 0 4px;
}

.platform-panel .panel-heading-row {
    padding: 22px 22px 14px;
}

.platform-tenant-table th,
.platform-tenant-table td {
    vertical-align: top;
}

.platform-tenant-table select,
.platform-tenant-table textarea {
    min-width: 145px;
}

.platform-tenant-table textarea {
    min-width: 220px;
    resize: vertical;
}

.platform-tenant-form {
    margin: 0;
}

.platform-actions {
    min-width: 132px;
}

.platform-actions form {
    margin-top: 8px;
}

@media (max-width: 980px) {
    .platform-summary-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

.dashboard-shell {
    margin: 0 auto;
    max-width: 1440px;
    padding: 24px;
}

.auth-container {
    margin: 64px auto;
    max-width: 420px;
}

.auth-security-icon {
    align-items: center;
    background: #e8f1fb;
    border-radius: 50%;
    color: var(--brand);
    display: flex;
    font-size: 25px;
    height: 48px;
    justify-content: center;
    margin-bottom: 14px;
    width: 48px;
}

.auth-secondary-action {
    margin-top: 10px;
}

.auth-secondary-action button {
    width: 100%;
}

.mfa-code-input {
    font-family: Consolas, "Courier New", monospace;
    font-size: 20px;
    letter-spacing: 0;
}

.profile-shell {
    max-width: 1240px;
}

.profile-titlebar {
    align-items: flex-start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.profile-titlebar h1,
.profile-section-heading h2,
.security-setting h3 {
    margin-bottom: 4px;
}

.page-kicker {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.profile-security-panel,
.profile-activity-panel,
.recovery-code-panel {
    margin-top: 18px;
}

.recovery-code-panel {
    border-color: #e0b658;
    box-shadow: inset 4px 0 #d89a16;
}

.profile-section-heading {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.profile-section-heading > i {
    color: var(--brand);
    font-size: 23px;
    margin-top: 1px;
}

.profile-section-heading p,
.security-setting-title p {
    margin: 0;
}

.current-role-callout {
    align-items: center;
    background: #f2f7fc;
    border-left: 4px solid var(--brand);
    display: grid;
    gap: 2px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 14px;
    padding: 12px 14px;
}

.current-role-callout > span:first-child {
    color: var(--muted);
    font-size: 12px;
    grid-column: 1;
}

.current-role-callout > strong {
    grid-column: 1;
}

.current-role-callout > .status {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.membership-list {
    display: grid;
}

.membership-row {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 11px 0;
}

.security-settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.security-setting {
    min-width: 0;
    padding: 0 24px;
}

.security-setting:first-child {
    border-right: 1px solid var(--line);
    padding-left: 0;
}

.security-setting:last-child {
    padding-right: 0;
}

.security-setting-title {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.security-setting-title .status {
    flex: 0 0 auto;
    white-space: nowrap;
}

.mfa-setup-steps {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.mfa-setup-steps > div {
    align-items: center;
    display: flex;
    gap: 9px;
}

.mfa-setup-steps span {
    align-items: center;
    background: #e8f1fb;
    border-radius: 50%;
    color: var(--brand);
    display: inline-flex;
    flex: 0 0 25px;
    font-size: 12px;
    font-weight: 700;
    height: 25px;
    justify-content: center;
}

.mfa-qr-wrap {
    align-items: center;
    background: #f7f9fb;
    border: 1px solid var(--line);
    display: flex;
    gap: 18px;
    margin-bottom: 18px;
    padding: 14px;
}

.mfa-qr {
    background: #fff;
    flex: 0 0 204px;
    min-height: 204px;
    padding: 10px;
}

.mfa-qr img,
.mfa-qr canvas {
    display: block;
    height: 184px;
    width: 184px;
}

.mfa-secret {
    display: block;
    font-size: 14px;
    margin-top: 6px;
    overflow-wrap: anywhere;
}

.mfa-enabled-summary {
    align-items: flex-start;
    background: #eef8f2;
    border-left: 4px solid var(--ok);
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px;
}

.mfa-enabled-summary > i {
    color: var(--ok);
    font-size: 24px;
}

.security-action-details {
    border-top: 1px solid var(--line);
    padding: 13px 0;
}

.security-action-details summary {
    color: var(--brand);
    cursor: pointer;
    font-weight: 700;
}

.security-action-details form {
    margin-top: 14px;
}

.security-danger-details summary {
    color: #991b1b;
}

.recovery-code-grid {
    display: grid;
    gap: 9px 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.recovery-code-grid code {
    background: #fff;
    border: 1px solid #ecd394;
    font-size: 15px;
    padding: 9px 11px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
}

.panel-heading-row {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.panel-heading-row h2 {
    margin-bottom: 4px;
}

.panel-heading-row p {
    margin-bottom: 0;
}

.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.metric {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.metric-label {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 6px;
}

.mail-delivery-panel .metric-value {
    overflow-wrap: anywhere;
}

.mail-delivery-panel .mail-metric-value {
    font-size: 22px;
    line-height: 1.3;
    word-break: break-word;
}

.launch-readiness-header {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.launch-readiness-header h2 {
    margin-bottom: 4px;
}

.launch-readiness-panel {
    background:
        linear-gradient(135deg, rgba(20, 92, 158, 0.08), rgba(20, 124, 76, 0.07) 42%, rgba(255, 255, 255, 0) 72%),
        var(--panel);
}

.readiness-summary {
    border-radius: 6px;
    font-weight: 700;
    padding: 8px 12px;
    white-space: nowrap;
}

.readiness-summary-ok {
    background: #e8f5ee;
    color: var(--ok);
}

.readiness-summary-fail {
    background: #fff1f2;
    color: #b42318;
}

.readiness-stats {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    margin: 18px 0;
}

.readiness-stat {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
}

.readiness-stat span {
    display: block;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.readiness-stat strong {
    display: block;
    font-size: 12px;
    letter-spacing: 0.03em;
    margin-top: 7px;
    text-transform: uppercase;
}

.readiness-stat-ok {
    background: #e8f5ee;
    color: var(--ok);
}

.readiness-stat-warn {
    background: #fff7e6;
    color: var(--warn);
}

.readiness-stat-fail {
    background: #fff1f2;
    color: #b42318;
}

.readiness-groups {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.readiness-group h3 {
    color: #2f3a4a;
    font-size: 14px;
    letter-spacing: 0.04em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.readiness-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.readiness-check {
    background: #fff;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 8px;
    padding: 12px;
}

.readiness-check-ok {
    border-left-color: var(--ok);
}

.readiness-check-warn {
    border-left-color: var(--warn);
}

.readiness-check-fail {
    border-left-color: #b42318;
}

.readiness-check-top {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.readiness-badge {
    background: #eef2f6;
    border-radius: 999px;
    color: #26323f;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
}

.readiness-check-ok .readiness-badge {
    background: #e8f5ee;
    color: var(--ok);
}

.readiness-check-warn .readiness-badge {
    background: #fff7e6;
    color: var(--warn);
}

.readiness-check-fail .readiness-badge {
    background: #fff1f2;
    color: #b42318;
}

.readiness-action {
    align-items: center;
    background: #eef4ff;
    border-radius: 6px;
    color: #174ea6;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    margin-top: 10px;
    padding: 6px 9px;
    text-decoration: none;
}

.readiness-action:hover {
    background: #dce9ff;
}

.readiness-note {
    margin-bottom: 0;
    margin-top: 14px;
}

.dashboard-titlebar {
    align-items: flex-start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dashboard-titlebar h1 {
    font-size: 31px;
    margin-bottom: 4px;
}

.dashboard-actions {
    display: flex;
    gap: 12px;
    padding-top: 5px;
}

.si-card {
    background: #fff;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    margin-bottom: 16px;
}

.period-card {
    border-left: 4px solid #0d6efd;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(260px, 1fr) 2fr;
    padding: 12px 16px;
}

.period-label {
    font-size: 24px;
    font-weight: 700;
}

.period-timezone {
    color: var(--muted);
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
}

.period-meta {
    align-content: center;
    color: #6c757d;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: flex-end;
}

.overview-snapshot-grid {
    align-items: stretch;
}

.sla-snapshot-card .card-header,
.executive-brief-card .card-header {
    align-items: center;
    display: flex;
    gap: 8px;
}

.sla-snapshot-body {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr auto;
}

.sla-target-value {
    font-size: 28px;
    font-weight: 700;
    margin: 4px 0 8px;
}

.sla-met-block {
    text-align: right;
}

.resolution-ownership-list {
    display: grid;
    gap: 10px;
}

.ownership-row {
    align-items: center;
    border: 1px solid var(--line);
    border-left: 4px solid #6c757d;
    border-radius: 8px;
    color: inherit;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 11px 12px;
    text-decoration: none;
}

.ownership-row:hover {
    background: #f8fafc;
    text-decoration: none;
}

.ownership-row small {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.ownership-count {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;
}

.ownership-count b {
    font-size: 22px;
}

.ownership-count em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.ownership-primary {
    border-left-color: #0d6efd;
}

.ownership-success {
    border-left-color: #198754;
}

.ownership-danger {
    border-left-color: #dc3545;
}

.filter-card {
    padding: 16px;
}

.filter-grid {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(240px, 1.4fr) minmax(220px, 1.2fr) minmax(170px, .8fr) repeat(2, minmax(150px, .7fr)) minmax(120px, auto);
}

.form-label {
    color: #343a40;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

.filter-control {
    border: 1px solid #ced4da;
    border-radius: 6px;
    color: #343a40;
    min-height: 40px;
    padding: 9px 12px;
}

.filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    max-height: 92px;
    overflow: auto;
}

.filter-check {
    align-items: center;
    display: flex;
    font-weight: 400;
    gap: 6px;
    white-space: nowrap;
}

.filter-check input {
    height: 15px;
    margin: 0;
    padding: 0;
    width: 15px;
}

.filter-card .filter-control {
    background: #fff;
}

.group-multiselect {
    min-height: 104px;
    overflow: auto;
    padding: 8px;
    width: 100%;
}

.group-multiselect option {
    padding: 5px 7px;
}

.brand-multiselect {
    min-height: 42px;
    max-height: 84px;
}

.custom-date-field.is-hidden {
    display: none;
}

.group-picker {
    position: relative;
}

.group-picker summary {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    min-height: 42px;
    padding: 10px 12px;
    user-select: none;
}

.group-picker summary::after {
    content: "▾";
    color: #475569;
    font-size: 12px;
}

.group-picker[open] summary::after {
    content: "▴";
}

.group-picker-menu {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .14);
    display: grid;
    gap: 7px;
    left: 0;
    max-height: 260px;
    min-width: 100%;
    overflow: auto;
    padding: 10px;
    position: absolute;
    top: calc(100% + 6px);
    z-index: 20;
}

.group-picker-menu .filter-check {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: flex-start;
    line-height: 1.25;
    min-width: 0;
    white-space: nowrap;
}

.group-picker-menu .filter-check input {
    flex: 0 0 auto;
    height: 15px;
    margin: 0;
    padding: 0;
    width: 15px;
}

.group-picker-menu .filter-check-label {
    display: block;
    font-weight: 400;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-groups-line {
    color: var(--muted);
    font-size: 12px;
    grid-column: 1 / -1;
    margin-top: -4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drilldown-filter-line {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 6px;
    grid-column: 1 / -1;
    margin-top: -6px;
}

.filter-chip {
    background: #eef2f6;
    border: 1px solid #d8e0ea;
    border-radius: 999px;
    color: #26323f;
    display: inline-flex;
    font-weight: 700;
    padding: 3px 8px;
}

body.drawer-open {
    overflow: hidden;
}

body.modal-open {
    overflow: hidden;
}

.ticket-drawer {
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity .16s ease;
    z-index: 1000;
}

.ticket-drawer.is-open {
    opacity: 1;
    pointer-events: auto;
}

.ticket-drawer-backdrop {
    background: rgba(15, 23, 42, .38);
    inset: 0;
    position: absolute;
}

.ticket-drawer-panel {
    background: #fff;
    box-shadow: -18px 0 40px rgba(15, 23, 42, .18);
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-left: auto;
    max-width: min(1240px, 96vw);
    position: relative;
    transform: translateX(24px);
    transition: transform .16s ease;
    width: 1240px;
}

.ticket-drawer.is-open .ticket-drawer-panel {
    transform: translateX(0);
}

.ticket-drawer-header {
    align-items: flex-start;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 22px 24px;
    position: sticky;
    top: 0;
    z-index: 4;
}

.ticket-drawer-header h2 {
    font-size: 24px;
    margin: 4px 0 6px;
}

.ticket-drawer-body {
    overflow: auto;
    padding: 20px 24px 28px;
}

.ticket-drawer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.ticket-drawer-toolbar {
    align-items: end;
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    z-index: 3;
}

.ticket-drawer-toolbar label {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.ticket-drawer-toolbar span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.ticket-drawer-toolbar select {
    min-width: 84px;
}

.ticket-drawer-search {
    margin-left: auto;
    min-width: min(320px, 100%);
}

.ticket-drawer-search input {
    width: 100%;
}

.ticket-drawer-pagination {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
}

.ticket-drawer-table-wrap {
    overflow-x: auto;
}

.ticket-drawer-table {
    min-width: 980px;
}

.ticket-drawer-table thead th {
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}

.ticket-drawer-row-meta {
    align-items: center;
    color: #6c757d;
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    gap: 5px 8px;
    line-height: 1.35;
    margin-top: 5px;
}

.ticket-drawer-row-meta .external-link-list {
    display: inline-flex;
    min-width: 0;
}

.ticket-meta-separator {
    background: #cbd5e1;
    border-radius: 999px;
    display: inline-block;
    height: 4px;
    width: 4px;
}

.admin-modal {
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity .16s ease;
    z-index: 1100;
}

.admin-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.admin-modal-backdrop {
    background: rgba(15, 23, 42, .58);
    inset: 0;
    position: absolute;
}

.admin-modal-panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .24);
    left: 50%;
    max-height: calc(100vh - 48px);
    max-width: min(620px, calc(100vw - 32px));
    overflow: auto;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -48%);
    transition: transform .16s ease;
    width: 100%;
}

.admin-modal.is-open .admin-modal-panel {
    transform: translate(-50%, -50%);
}

.admin-modal-header {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 18px 20px;
}

.admin-modal-header h2 {
    margin: 0;
}

.admin-modal-close {
    align-items: center;
    background: transparent;
    border: 0;
    color: #6c757d;
    cursor: pointer;
    display: inline-flex;
    font-size: 34px;
    height: 40px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 40px;
}

.admin-modal-close:hover {
    background: transparent;
    color: var(--ink);
}

.admin-modal-body {
    padding: 20px;
}

.admin-modal-actions {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin: 4px -20px -20px;
    padding: 16px 20px;
}

@media (max-width: 720px) {
    .panel-heading-row {
        align-items: stretch;
        flex-direction: column;
    }
}

.filter-card .filter-checkboxes {
    align-content: flex-start;
    max-height: 88px;
}

.ticket-filter-grid .filter-checkboxes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: 104px;
    overflow: auto;
}

.filter-checkboxes .filter-check {
    align-items: center;
    display: flex;
    flex-direction: row;
    font-weight: 400;
    gap: 8px;
    justify-content: flex-start;
    line-height: 1.25;
    min-width: 0;
    white-space: nowrap;
}

.filter-checkboxes .filter-check input {
    flex: 0 0 auto;
}

.filter-check-label {
    display: inline;
    font-weight: 400;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-checkboxes .filter-check span,
.filter-checkboxes .filter-check-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-button {
    text-align: center;
}

.dashboard-tabs {
    border-bottom: 1px solid #dee2e6;
    display: flex;
    gap: 2px;
    margin: 18px 0 16px;
}

.dashboard-tabs a {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 6px 6px 0 0;
    color: #0d6efd;
    display: inline-flex;
    gap: 6px;
    font-weight: 600;
    padding: 10px 14px;
    text-decoration: none;
}

.dashboard-tabs a:hover {
    background: #eef4ff;
    color: #084298;
}

.dashboard-tabs a.active {
    background: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
    border-bottom: 3px solid #0d6efd;
    color: #17202a;
    font-weight: 700;
}

.dashboard-panel-hidden {
    display: none !important;
}

.dashboard-panel-group-hidden {
    display: none !important;
}

.kpi-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.metric-card {
    border-left: 4px solid transparent;
    min-height: 158px;
    padding: 18px 20px;
    position: relative;
    transition: .2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-link-card {
    color: inherit;
    display: block;
    text-decoration: none;
}

.metric-link-card:hover {
    color: inherit;
    text-decoration: none;
}

.metric-card-icon {
    color: #2f9b68;
    font-size: 24px;
    line-height: 1;
    opacity: 0.9;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
}

.metric-card .kpi-title,
.metric-card .metric-value,
.metric-card .small-muted,
.metric-card .metric-badges {
    padding-right: 42px;
}

.kpi-created .metric-card-icon {
    color: #0d6efd;
}

.kpi-solved .metric-card-icon {
    color: #2f9b68;
}

.kpi-rate .metric-card-icon {
    color: #f0ad00;
}

.kpi-escalated .metric-card-icon {
    color: #dc3545;
}

.table-count-link {
    color: #315ca5;
    font-weight: 700;
    text-decoration: none;
}

.table-count-link:hover {
    text-decoration: underline;
}

.agent-count-link {
    display: inline-flex;
    text-decoration: none;
}

.agent-count-link:hover .agent-count-badge {
    box-shadow: inset 0 0 0 1px currentColor;
}

.agent-count-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    justify-content: center;
    line-height: 1;
    min-width: 28px;
    padding: 6px 8px;
    white-space: nowrap;
}

.agent-count-primary {
    background: #eef4ff;
    color: #315ca5;
}

.agent-count-info {
    background: #eff8ff;
    color: #0277a8;
}

.agent-count-success {
    background: #edf8f1;
    color: #2f8f5b;
}

.agent-count-danger {
    background: #fff1f2;
    color: #c8424b;
}

.agent-count-warning {
    background: #fff7df;
    color: #9a6700;
}

.agent-count-neutral {
    background: #f3f5f7;
    color: #344054;
}

.agent-count-muted {
    background: #f1f3f5;
    color: #6c757d;
}

.sla-drilldown-cell {
    min-width: 360px;
    max-width: 520px;
}

.sla-drilldown-cell .metric-badges {
    margin: 4px 0 6px;
}

.sla-classification-note {
    background: #f8fafc;
    border-left: 3px solid #0d6efd;
    border-radius: 4px;
    color: #344054;
    font-size: 13px;
    line-height: 1.35;
    margin-top: 6px;
    padding: 7px 9px;
}

.table-total-row {
    background: #f8f9fa;
    font-weight: 700;
}

.report-table-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.report-table-header {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.report-table-header .report-table-toolbar {
    margin-bottom: 0;
}

.report-header-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.report-table-search {
    display: grid;
    flex: 1 1 300px;
    gap: 6px;
    max-width: 420px;
}

.report-table-search span {
    color: #6c757d;
    font-size: 13px;
    font-weight: 700;
}

.report-column-menu {
    position: relative;
}

.report-column-menu summary {
    cursor: pointer;
    list-style: none;
}

.report-column-menu summary::-webkit-details-marker {
    display: none;
}

.report-column-options {
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .16);
    min-width: 190px;
    padding: 8px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 10;
}

.report-column-options label {
    align-items: center;
    display: flex;
    gap: 6px;
    padding: 6px;
    white-space: nowrap;
}

.sortable-heading a,
.sortable-heading button {
    align-items: center;
    background: transparent;
    border: 0;
    color: #2f3b4f;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    gap: 4px;
    padding: 0;
    text-decoration: none;
    white-space: nowrap;
}

.sortable-heading a:hover,
.sortable-heading button:hover {
    color: var(--brand);
    text-decoration: underline;
}

.sortable-heading.is-active a,
.sortable-heading.is-active button {
    color: var(--brand);
}

.sort-indicator {
    color: inherit;
    font-size: 11px;
    text-transform: uppercase;
}

.brand-cell {
    min-width: 220px;
}

.brand-org-line {
    margin-top: 4px;
    max-width: 520px;
}

.metric-card .metric-value {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 6px;
}

.kpi-title {
    color: #6c757d;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.kpi-created {
    border-left-color: #0d6efd;
}

.kpi-solved {
    border-left-color: #198754;
}

.kpi-rate {
    border-left-color: #ffc107;
}

.kpi-escalated {
    border-left-color: #dc3545;
}

.dashboard-two-col {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 16px;
}

.dashboard-stack {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.analytics-secondary-grid {
    align-items: start;
    grid-template-columns: minmax(420px, .9fr) minmax(520px, 1.1fr);
}

.analytics-secondary-grid > .si-card:last-child {
    grid-column: 1 / -1;
}

.analytics-secondary-grid > [data-dashboard-panel]:not(.dashboard-panel-hidden) {
    grid-column: 1 / -1;
}

.agent-chart-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 16px;
}

.overview-chart-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.agent-chart-window-note {
    color: #64748b;
    font-size: 14px;
    grid-column: 1 / -1;
}

.agent-chart-card .card-body {
    padding-top: 14px;
}

.agent-line-chart {
    min-height: 260px;
}

.agent-chart-svg {
    display: block;
    height: auto;
    max-width: 100%;
    overflow: visible;
    width: 100%;
}

.agent-chart-axis,
.agent-chart-gridline {
    stroke: #d7dee6;
    stroke-width: 1;
}

.agent-chart-gridline {
    opacity: .75;
}

.agent-chart-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.agent-chart-point {
    stroke: #fff;
    stroke-width: 1.5;
}

.agent-chart-axis-label {
    fill: #6c757d;
    font-size: 12px;
}

.agent-chart-y-title {
    fill: #6c757d;
    font-size: 12px;
    transform: rotate(-90deg);
    transform-box: fill-box;
    transform-origin: center;
}

.agent-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 8px;
}

.agent-chart-legend-item {
    align-items: center;
    color: #6c757d;
    display: inline-flex;
    font-size: 13px;
    gap: 6px;
}

.agent-chart-legend-item i {
    border-radius: 999px;
    display: inline-block;
    height: 10px;
    width: 22px;
}

.product-chart-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 16px 0;
}

.organization-chart-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.organization-chart-grid .horizontal-bar-row {
    gap: 8px;
    grid-template-columns: minmax(84px, 1fr) minmax(68px, 1fr) minmax(28px, auto);
}

.organization-chart-grid .bar-value {
    min-width: 24px;
}

.product-chart-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-width: 0;
    padding: 14px 16px;
}

.chart-card-title {
    color: #1f2937;
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 12px;
}

.horizontal-bar-chart {
    display: grid;
    gap: 10px;
}

.horizontal-bar-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(120px, 180px) minmax(140px, 1fr) minmax(46px, auto);
}

.bar-label {
    color: #344054;
    font-size: 13px;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    background: #e8eef5;
    border-radius: 999px;
    display: block;
    height: 11px;
    overflow: hidden;
}

.dual-bar-track {
    align-items: center;
    display: grid;
    gap: 3px;
    grid-template-columns: 1fr 1fr;
    height: auto;
    padding: 2px;
}

.bar-fill {
    border-radius: 999px;
    display: block;
    height: 11px;
    min-width: 2px;
}

.bar-fill-current {
    background: #315ca5;
}

.bar-fill-new,
.bar-fill-reported {
    background: #2f8f5b;
}

.bar-fill-solved {
    background: #6f42c1;
}

.bar-fill-escalated {
    background: #b23b45;
}

.bar-value {
    color: #344054;
    font-size: 13px;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.chart-legend span {
    align-items: center;
    color: #64748b;
    display: inline-flex;
    font-size: 13px;
    gap: 6px;
}

.legend-dot {
    border-radius: 999px;
    display: inline-block;
    height: 9px;
    width: 18px;
}

.legend-current {
    background: #315ca5;
}

.legend-new {
    background: #2f8f5b;
}

.legend-solved {
    background: #6f42c1;
}

.mini-kpi-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 16px;
}

.mini-kpi {
    padding: 18px 20px;
}

.compact-kpi-grid {
    gap: 10px;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    margin: 0 0 14px;
}

.soft-kpi {
    background: #f8fafc;
    border: 1px solid #e5ebf1;
    box-shadow: none;
    margin-bottom: 0;
    padding: 12px;
}

.agent-kpi-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.agent-kpi-grid .soft-kpi {
    min-height: 104px;
    padding: 10px 12px;
}

.agent-kpi-grid .metric-label {
    font-size: 12px;
}

.agent-kpi-grid .small-muted {
    font-size: 13px;
    line-height: 1.25;
}

.mini-kpi .metric-value {
    font-size: 34px;
}

.agent-kpi-grid .metric-value {
    font-size: 28px;
}

.agent-name-with-signals {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.agent-analytics-table th:first-child,
.agent-analytics-table td:first-child,
.agent-analytics-table .agent-name-with-signals {
    white-space: nowrap;
}

.agent-analytics-table .agent-name-with-signals {
    flex-wrap: nowrap;
}

.agent-availability-icons {
    align-items: center;
    flex: 0 0 auto;
    display: inline-flex;
    gap: 4px;
}

.agent-availability-icon {
    align-items: center;
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    font-size: 10px;
    font-weight: 800;
    height: 22px;
    justify-content: center;
    letter-spacing: .02em;
    line-height: 1;
    min-width: 26px;
    padding: 0 6px;
}

.agent-availability-holiday {
    background: #17202a;
}

.agent-availability-icon .bi {
    font-size: 13px;
    line-height: 1;
}

.agent-availability-vacation {
    background: #0d6efd;
}

.agent-availability-vacation::before {
    content: "V";
}

.agent-availability-sick {
    background: #ffc107;
    color: #17202a;
}

.agent-availability-sick::before {
    content: "+";
    font-size: 15px;
}

.operational-signals-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    margin-top: 16px;
}

.metric-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.metric-badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    padding: 5px 9px;
    width: fit-content;
}

.metric-badge-good {
    background: #198754;
    color: #fff;
}

.metric-badge-bad {
    background: #dc3545;
    color: #fff;
}

.metric-badge-warning {
    background: #ffc107;
    color: #17202a;
}

.metric-badge-info {
    background: #0d6efd;
    color: #fff;
}

.metric-badge-neutral {
    background: #6c757d;
    color: #fff;
}

.trend-line {
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
}

.trend-good {
    color: #157347;
}

.trend-bad {
    color: #b42318;
}

.trend-muted {
    color: #6c757d;
}

.visually-hidden {
    border: 0;
    clip: rect(0, 0, 0, 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.card-header {
    border-bottom: 1px solid #e9ecef;
    font-weight: 700;
    padding: 12px 16px;
}

.card-header-row {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.card-header-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.card-header-actions .report-table-toolbar {
    margin-bottom: 0;
}

.card-body {
    padding: 16px;
}

.table-sm th,
.table-sm td {
    padding: 9px 10px;
}

.table-sm th {
    color: #334155;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}

.table-sm td {
    font-size: 14px;
}

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

.text-end {
    text-align: right !important;
}

.badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
}

.badge-primary {
    background: #0d6efd;
    color: #fff;
}

.badge-danger {
    background: #dc3545;
    color: #fff;
}

.badge-success {
    background: #198754;
    color: #fff;
}

.badge-warning {
    background: #fff4df;
    color: var(--warn);
}

.badge-muted {
    background: #6c757d;
    color: #fff;
}

.badge-light {
    background: #eef2f6;
    color: #26323f;
    margin: 0 4px 4px 0;
}

.badge-link {
    text-decoration: none;
}

.badge-link:hover {
    background: #dde6f0;
    color: #26323f;
    text-decoration: none;
}

.external-link-list {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 96px;
}

.external-link-list .badge {
    text-decoration: none;
    white-space: nowrap;
}

.external-link-list .badge:hover {
    background: #475569;
    color: #fff;
    text-decoration: none;
}

.csat-template-table th,
.csat-template-table td {
    vertical-align: middle;
}

.csat-body-preview {
    color: var(--muted);
    max-width: 520px;
    min-width: 280px;
    white-space: pre-wrap;
}

.sla-policy-table th,
.sla-policy-table td {
    vertical-align: middle;
}

.sla-target-lines {
    min-width: 240px;
}

.sla-order-badge {
    align-items: center;
    background: #e7f0ff;
    border: 1px solid #a9c8f5;
    border-radius: 999px;
    color: var(--brand-dark);
    display: inline-flex;
    font-weight: 700;
    height: 30px;
    justify-content: center;
    min-width: 30px;
    padding: 0 8px;
}

.sla-trust-panel {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin: 0 0 14px;
}

.sla-tab-trust-panel {
    margin-top: 4px;
}

.sla-trust-item {
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #dce6f2;
    border-left: 4px solid #0d6efd;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    padding: 11px 12px;
}

.sla-trust-item i {
    font-size: 20px;
    line-height: 1;
    margin-top: 1px;
}

.sla-trust-item strong {
    color: #17202a;
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}

.sla-trust-item span {
    color: #59677a;
    display: block;
    font-size: 13px;
    line-height: 1.35;
}

.sla-trust-order {
    border-left-color: #0d6efd;
}

.sla-trust-order i {
    color: #0d6efd;
}

.sla-trust-events {
    border-left-color: #198754;
}

.sla-trust-events i {
    color: #198754;
}

.sla-trust-fallback {
    border-left-color: #f0ad00;
}

.sla-trust-fallback i {
    color: #b77900;
}

.sla-policy-context {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 18px;
}

.sla-policy-context-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-bottom: 10px;
}

.sla-policy-context-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.sla-policy-context-title {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.sla-target-list {
    color: var(--muted);
    margin: 10px 0 0;
    padding-left: 18px;
}

.sla-policy-matrix th,
.sla-policy-matrix td {
    vertical-align: top;
}

.sla-policy-name-cell {
    min-width: 260px;
}

.sla-policy-matrix td:nth-child(3),
.sla-policy-matrix td:nth-child(4) {
    min-width: 150px;
}

.sla-snapshot-table td:first-child {
    min-width: 280px;
}

.sla-policy-overview-table td {
    vertical-align: top;
}

.sla-target-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.sla-target-chip {
    background: #e7f0ff;
    border: 1px solid #a9c8f5;
    border-radius: 999px;
    color: var(--brand-dark);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    padding: 3px 8px;
}

.sla-policy-performance {
    background: #f8fafc;
    border-top: 1px solid #dce6f2;
    border-radius: 6px;
    margin-top: 8px;
    padding: 8px;
}

.sla-kpi-card {
    border-left: 4px solid #0d6efd;
    position: relative;
}

.sla-kpi-card .metric-label,
.sla-kpi-card .metric-value,
.sla-kpi-card .small-muted {
    padding-right: 34px;
}

.sla-kpi-icon {
    font-size: 22px;
    opacity: 0.9;
    position: absolute;
    right: 12px;
    top: 14px;
}

.sla-kpi-info {
    border-left-color: #0d6efd;
}

.sla-kpi-info .sla-kpi-icon {
    color: #0d6efd;
}

.sla-kpi-success {
    border-left-color: #198754;
}

.sla-kpi-success .sla-kpi-icon {
    color: #198754;
}

.sla-kpi-danger {
    border-left-color: #dc3545;
}

.sla-kpi-danger .sla-kpi-icon {
    color: #dc3545;
}

.sla-kpi-neutral {
    border-left-color: #6c757d;
}

.sla-kpi-neutral .sla-kpi-icon {
    color: #6c757d;
}

.table-caption {
    color: var(--muted);
    caption-side: top;
    font-size: 13px;
    padding: 14px 0 8px;
    text-align: left;
}

.capacity-admin-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin: 16px 0 18px;
}

.capacity-admin-summary > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.capacity-admin-summary strong {
    display: block;
    font-size: 24px;
    margin-top: 4px;
}

.admin-compact-metric-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-top: 14px;
}

.admin-compact-metric {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    min-height: 72px;
    padding: 10px 12px;
}

.admin-compact-metric .metric-label {
    font-size: 11px;
    line-height: 1.2;
}

.admin-compact-metric .metric-value {
    font-size: 18px;
    line-height: 1.2;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.capacity-time-off-table {
    margin-top: 16px;
}

.capacity-time-off-table input,
.capacity-time-off-table select {
    min-width: 120px;
}

.capacity-time-off-table .input-small {
    min-width: 80px;
    width: 90px;
}

.table .input-small {
    min-width: 80px;
    width: 90px;
}

.table .input-time {
    min-width: 105px;
    width: 115px;
}

.row-actions {
    white-space: nowrap;
}

.row-actions form {
    display: inline-block;
    margin: 0 6px 0 0;
}

.weekday-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.weekday-picker label {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: inline-flex;
    gap: 6px;
    padding: 8px 10px;
}

.weekday-picker.weekday-picker-compact {
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
    white-space: nowrap;
}

.weekday-picker.weekday-picker-compact label {
    border-radius: 4px;
    font-size: 13px;
    gap: 4px;
    min-width: 42px;
    padding: 5px 6px;
}

.capacity-period-line {
    margin-bottom: 12px;
}

.capacity-forecast-note {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-left: 4px solid #1f6fbf;
    border-radius: 6px;
    color: #32465a;
    font-size: 14px;
    margin-bottom: 12px;
    padding: 10px 12px;
}

.capacity-timeline-card {
    border-top: 1px solid var(--line);
    margin: 2px 0 16px;
    padding-top: 14px;
}

.capacity-timeline-header {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 10px;
}

.capacity-timeline {
    background: #eef2f6;
    border: 1px solid #d7e0ea;
    border-radius: 999px;
    height: 16px;
    overflow: hidden;
    position: relative;
}

.capacity-timeline-segment {
    bottom: 0;
    display: block;
    position: absolute;
    top: 0;
}

.capacity-timeline-covered {
    background: #198754;
}

.capacity-timeline-gap {
    background: #dc3545;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.capacity-timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.capacity-timeline-legend span {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: 13px;
    gap: 5px;
}

.legend-dot {
    border-radius: 999px;
    display: inline-block;
    height: 9px;
    width: 9px;
}

.legend-covered {
    background: #198754;
}

.legend-gap {
    background: #dc3545;
}

.capacity-coverage-grid {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    margin: 6px 0 16px;
    padding-top: 14px;
}

.capacity-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.capacity-signal-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
    max-width: 360px;
}

.capacity-upcoming-row {
    opacity: 0.9;
}

.capacity-window-row {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.capacity-window-row span {
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
}

.text-danger {
    color: #b42318;
}

.text-success {
    color: #147c4c;
}

.text-warning {
    color: #9b5a00;
}

.text-truncate {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-cell {
    min-width: 280px;
}

.theme-subject {
    max-width: 520px;
}

.product-team-pill-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 170px;
}

.data-quality-note {
    background: #fff8e1;
    border: 1px solid #f0c36a;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    color: #4b3a00;
    margin-bottom: 14px;
    padding: 12px 14px;
}

.classification-warning-row {
    background: #fffdf5;
}

.small-muted {
    color: #6c757d;
    font-size: 13px;
    margin-top: 6px;
}

.status-list {
    display: grid;
}

.status-row {
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
}

.status-row:last-child {
    border-bottom: 0;
}

.executive-brief-card {
    border-left: 4px solid #0d6efd;
}

.executive-brief-card h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.ticket-number {
    display: inline-block;
    font-weight: 700;
    min-width: 62px;
}

.ticket-link {
    color: #1f5fae;
    text-decoration: none;
}

.ticket-link:hover {
    color: #174a87;
    text-decoration: underline;
}

.organization-table-wrapper {
    max-height: 620px;
    overflow: auto;
}

.organization-table-wrapper thead th {
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}

.partner-column {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-heading,
.section-heading {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.sync-summary {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 3px;
    min-width: 220px;
    padding: 12px 14px;
}

.sync-progress-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 18px 0;
    padding: 16px;
}

.sync-progress-header {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.sync-progress-header h3 {
    margin: 0 0 4px;
}

.sync-current-state {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    min-width: 220px;
    padding: 10px 12px;
}

.sync-current-label,
.sync-stage-badge {
    color: #68717d;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.sync-current-state span:last-child {
    color: #68717d;
    font-size: 13px;
}

.sync-stage-list {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-top: 14px;
}

.sync-stage {
    border: 1px solid var(--line);
    border-left: 4px solid #9aa4b2;
    border-radius: 8px;
    padding: 12px;
}

.sync-stage-complete {
    border-left-color: #198754;
}

.sync-stage-running {
    border-left-color: #0d6efd;
}

.sync-stage-waiting {
    border-left-color: #b7791f;
}

.sync-stage-top {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.sync-stage-badge {
    background: #eef2f7;
    border-radius: 999px;
    padding: 3px 8px;
}

.sync-stage-complete .sync-stage-badge {
    background: #e8f5ee;
    color: #087342;
}

.sync-stage-running .sync-stage-badge {
    background: #e8f1ff;
    color: #0b5ed7;
}

.sync-stage-waiting .sync-stage-badge {
    background: #fff4dc;
    color: #9a6700;
}

.sync-stage-bar {
    background: #eef2f7;
    border-radius: 999px;
    height: 8px;
    margin: 10px 0;
    overflow: hidden;
}

.sync-stage-bar span {
    background: #0d6efd;
    display: block;
    height: 100%;
}

.sync-stage-complete .sync-stage-bar span {
    background: #198754;
}

.sync-stage-waiting .sync-stage-bar span {
    background: #b7791f;
}

.sync-stage-detail {
    color: #1d2733;
    font-size: 14px;
}

.dashboard-panel {
    margin-top: 18px;
}

.form-stack {
    display: grid;
    gap: 14px;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

input,
select,
textarea {
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    padding: 10px 11px;
}

textarea {
    resize: vertical;
}

button,
.button {
    background: var(--brand);
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-weight: 700;
    padding: 10px 13px;
    text-decoration: none;
}

button:hover,
.button:hover {
    background: var(--brand-dark);
}

button:disabled,
button:disabled:hover {
    background: #eef2f6;
    color: #94a3b8;
    cursor: not-allowed;
}

.button-muted {
    background: #e9eef4;
    color: var(--ink);
}

.button-muted:hover {
    background: #dbe4ee;
}

.button-danger {
    background: #fee2e2;
    color: #991b1b;
}

.button-danger:hover {
    background: #fecaca;
}

.inline-form {
    align-items: center;
    display: flex;
    gap: 8px;
}

.inline-role-form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-role-form select {
    min-width: 170px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.button-row form {
    margin: 0;
}

.mapping-grid {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-top: 20px;
    padding-top: 18px;
}

.checkbox-list,
.admin-group-list {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    max-height: 260px;
    overflow: auto;
}

.checkbox-row {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    font-weight: 400;
    gap: 10px;
    padding: 10px;
}

.checkbox-row:last-child {
    border-bottom: 0;
}

.checkbox-row input {
    margin: 0;
    padding: 0;
    width: 16px;
    height: 16px;
}

.check-row {
    align-items: center;
    display: flex;
    font-weight: 600;
    gap: 10px;
}

.check-row input {
    margin: 0;
}

.checkbox-row span {
    min-width: 0;
}

.admin-group-row {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 64px 68px minmax(0, 1fr);
    font-weight: 400;
    gap: 12px;
    padding: 10px 12px;
}

.admin-group-row:last-child {
    border-bottom: 0;
}

.admin-group-row input {
    height: 16px;
    margin: 0;
    padding: 0;
    width: 16px;
}

.admin-group-head {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    position: sticky;
    text-transform: uppercase;
    top: 0;
    z-index: 1;
}

.nav {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
}

.admin-jump-nav {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.admin-jump-nav a {
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--brand);
    font-weight: 700;
    padding: 8px 10px;
    text-decoration: none;
}

.admin-jump-nav a:hover,
.admin-jump-nav a:focus {
    background: #eef5ff;
    border-color: #c8ddf5;
}

.admin-jump-nav a.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.admin-section-hidden {
    display: none;
}

.section-subheader {
    align-items: end;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 16px;
}

.table {
    border-collapse: collapse;
    width: 100%;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.agent-analytics-table {
    min-width: 1860px;
}

.agent-contribution-table {
    min-width: 1320px;
}

.agent-analytics-table th:first-child,
.agent-analytics-table td:first-child,
.agent-contribution-table th:first-child,
.agent-contribution-table td:first-child {
    background: #fff;
    left: 0;
    position: sticky;
    z-index: 2;
}

.agent-analytics-table th:first-child,
.agent-contribution-table th:first-child {
    z-index: 3;
}

.agent-analytics-table .table-total-row td:first-child,
.agent-contribution-table .table-total-row td:first-child {
    background: #f8f9fa;
}

.si-card,
.card-body {
    min-width: 0;
}

.table th,
.table td {
    border-bottom: 1px solid var(--line);
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

.ticket-subject {
    max-width: 360px;
}

.ticket-subject-wide {
    min-width: 360px;
    max-width: 620px;
}

.ticket-subject-compact {
    max-width: 420px;
    min-width: 220px;
}

.ticket-subject-compact {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-subject-compact .ticket-drawer-row-meta {
    white-space: normal;
}

.ticket-filter-grid {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(260px, 1.35fr) minmax(230px, 1.15fr) minmax(170px, .8fr) repeat(2, minmax(150px, .7fr)) minmax(170px, auto);
}

.ticket-filter-field {
    min-width: 0;
}

.ticket-filter-groups,
.ticket-filter-brand {
    grid-column: span 1;
}

.ticket-filter-period {
    grid-column: span 1;
}

.ticket-filter-primary-button {
    grid-column: span 1;
}

.ticket-filter-page-size,
.ticket-filter-status,
.ticket-filter-priority,
.ticket-filter-escalated {
    grid-column: span 1;
}

.ticket-filter-search {
    grid-column: span 2;
}

.ticket-filter-grid input,
.ticket-filter-grid select {
    width: 100%;
}

.ticket-filter-grid .filter-button {
    align-self: end;
    min-height: 42px;
    width: 100%;
}

@media (max-width: 1450px) {
    .ticket-filter-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .ticket-filter-groups,
    .ticket-filter-brand,
    .ticket-filter-search {
        grid-column: span 2;
    }

    .ticket-filter-period,
    .ticket-filter-page-size,
    .ticket-filter-status,
    .ticket-filter-priority,
    .ticket-filter-escalated,
    .ticket-filter-start,
    .ticket-filter-end,
    .ticket-filter-grid .filter-button {
        grid-column: span 1;
    }
}

@media (max-width: 820px) {
    .ticket-filter-grid {
        grid-template-columns: 1fr;
    }

    .ticket-filter-field,
    .ticket-filter-grid .filter-button {
        grid-column: auto;
    }
}

.pagination-row {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

.action-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.action-cell form {
    margin: 0;
}

.status {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
}

.status-active {
    background: #e6f4ec;
    color: var(--ok);
}

.status-disabled {
    background: #f1f3f5;
    color: var(--muted);
}

.status-warning {
    background: #fff4df;
    color: var(--warn);
    margin-left: 6px;
    white-space: nowrap;
}

.muted {
    color: var(--muted);
}

.alert {
    background: #fff4df;
    border: 1px solid #f1c983;
    border-radius: 8px;
    color: #5d3900;
    margin-bottom: 16px;
    padding: 12px;
}

.alert-success {
    background: #e6f4ec;
    border-color: #a8dabc;
    color: #0f5132;
}

.auth-link {
    margin: 14px 0 0;
}

.copy-link-box {
    margin-bottom: 14px;
}

.copy-link-input,
.copy-link-box input {
    margin-top: 8px;
    width: 100%;
}

@media (max-width: 1200px) {
    .agent-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .overview-chart-grid,
    .organization-chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .topbar,
    .topbar-actions,
    .page-heading,
    .section-heading,
    .dashboard-titlebar {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-titlebar,
    .security-setting-title {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-grid,
    .security-settings-grid {
        grid-template-columns: 1fr;
    }

    .security-setting,
    .security-setting:first-child,
    .security-setting:last-child {
        border: 0;
        padding: 0;
    }

    .security-setting + .security-setting {
        border-top: 1px solid var(--line);
        margin-top: 24px;
        padding-top: 24px;
    }

    .mfa-qr-wrap {
        align-items: flex-start;
        flex-direction: column;
    }

    .recovery-code-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-shell {
        padding: 16px;
    }

    .period-card,
    .filter-grid,
    .ticket-filter-grid,
    .kpi-grid,
    .mini-kpi-grid,
    .operational-signals-grid,
    .dashboard-two-col,
    .agent-chart-grid,
    .product-chart-grid {
        grid-template-columns: 1fr;
    }

    .period-meta {
        justify-content: flex-start;
    }

    .dashboard-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }
}
