:root {
    color-scheme: light;
    --ink: #101828;
    --muted: #667085;
    --line: #d9e2ec;
    --paper: #ffffff;
    --surface: #eef3f8;
    --soft: #f8fafc;
    --teal: #0f766e;
    --indigo: #4f46e5;
    --red: #dc2626;
    --amber: #b45309;
    --slate: #334155;
}

/* Data source mapping workspace */
.data-sources-shell {
    box-sizing: border-box;
    width: calc(100% - 48px);
    max-width: none;
    margin: 0 24px 48px;
}

.compact-workspace-header {
    padding-block: 18px 14px;
}

.compact-workspace-header h1 {
    font-size: clamp(1.65rem, 2vw, 2.15rem);
    line-height: 1.1;
}

.source-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--border-color, #d8e0eb);
    border-radius: 12px;
    background: #fff;
    margin-bottom: 14px;
}

.source-summary-strip > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 13px 16px;
    border-right: 1px solid var(--border-color, #d8e0eb);
}

.source-summary-strip > div:last-child { border-right: 0; }
.source-summary-strip strong { font-size: .92rem; color: #172235; }
.source-summary-strip span { font-size: .75rem; color: #6d788a; }

.mapping-layout {
    display: grid;
    grid-template-columns: minmax(260px, 20%) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.source-rail,
.mapping-workbench,
.preview-panel,
.import-history-panel { padding: 18px; }

.source-rail h2,
.mapping-workbench h2,
.preview-panel h2,
.import-history-panel h2 { font-size: 1rem; margin: 2px 0 12px; }

.source-kind-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border-radius: 9px;
    background: #eef2f7;
    margin-bottom: 14px;
}

.source-kind-switch button { border: 0; background: transparent; padding: 8px; border-radius: 7px; color: #667085; }
.source-kind-switch button.active { background: #fff; color: #182236; box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

.file-drop-zone {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 18px;
    border: 1px dashed #9aabd0;
    border-radius: 10px;
    background: #f8faff;
    cursor: pointer;
}

.file-drop-zone span,
.mapping-field { font-size: .76rem; color: #667085; }
.file-drop-zone input { margin-top: 8px; max-width: 100%; }
.profile-picker { padding-top: 16px; margin-top: 16px; border-top: 1px solid #e3e8ef; }
.compact-actions { display: flex; gap: 7px; margin-bottom: 12px; }
.compact-actions > * { flex: 1; }
.api-source-editor { margin-top: 12px; padding: 13px; border: 1px solid #dce3ed; border-radius: 9px; background: #fbfcfe; }
.api-source-editor .mapping-field { margin-bottom: 9px; }
.api-source-editor .checkbox-field { margin: 4px 0 12px; font-size: .78rem; }
.pagination-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.api-incremental-editor { margin: 10px 0 12px; padding: 10px; border: 1px solid #dce3ed; border-radius: 7px; background: #fff; }
.api-incremental-editor .checkbox-field { margin-bottom: 8px; }
.api-incremental-editor small { display: block; color: #64748b; font-size: .72rem; line-height: 1.45; }
.api-schedule-editor { display: grid; gap: 9px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #dce3ed; }
.api-schedule-editor > div { display: flex; flex-direction: column; gap: 2px; }
.api-schedule-editor > div span, .api-schedule-editor small { color: #778195; font-size: .72rem; }
.api-schedule-editor .mapping-field { margin: 0; }
.json-sample-box { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e3e8ef; }
.json-sample-box summary { cursor: pointer; color: #526077; font-size: .77rem; font-weight: 700; margin-bottom: 12px; }
.mapping-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-weight: 700; }
.mapping-field input, .mapping-field textarea, .mapping-field select,
.mapping-actions input, .mapping-table select, .mapping-table input {
    min-height: 34px;
    border: 1px solid #ced7e4;
    border-radius: 7px;
    background: #fff;
    padding: 7px 9px;
    color: #172235;
    font: inherit;
}
.mapping-field textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .75rem; }
.mapping-empty { min-height: 270px; display: grid; place-content: center; text-align: center; color: #667085; }
.mapping-empty strong { color: #29364a; }
.mapping-empty p { max-width: 440px; margin: 6px 0; font-size: .82rem; }
.mapping-table-wrap { overflow: auto; max-height: 510px; }
.mapping-table td { vertical-align: middle; }
.mapping-table td:first-child strong, .mapping-table td:first-child small { display: block; white-space: nowrap; }
.mapping-table td:first-child small { margin-top: 2px; color: #8a94a6; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.mapping-table select { min-width: 210px; width: 100%; }
.mapping-table input { width: 130px; }
.mapping-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid #e3e8ef; }
.mapping-actions input { margin-right: auto; min-width: 210px; }
.preview-panel, .import-history-panel { margin-top: 14px; }

@media (max-width: 980px) {
    .data-sources-shell { width: calc(100% - 24px); margin-inline: 12px; }
    .source-summary-strip { grid-template-columns: repeat(2, 1fr); }
    .source-summary-strip > div:nth-child(2) { border-right: 0; }
    .mapping-layout { grid-template-columns: 1fr; }
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--surface);
    color: var(--ink);
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

a,
.btn-link {
    color: var(--indigo);
}

.content {
    padding: 0;
}

.loading-shell {
    display: grid;
    min-height: 70vh;
    place-items: center;
    color: var(--muted);
}

.loading-mark {
    width: 38px;
    height: 38px;
    border: 4px solid #cbd5e1;
    border-top-color: var(--teal);
    border-radius: 999px;
    animation: spin 900ms linear infinite;
}

.login-shell {
    display: grid;
    min-height: calc(100vh - 54px);
    padding: 36px 18px;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 34%),
        linear-gradient(145deg, #e8eef5 0%, #f8fafc 55%, #e6f4f4 100%);
    place-items: start center;
}

.login-card {
    width: min(100%, 520px);
    padding: 28px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
}

.login-heading {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    margin-bottom: 24px;
}

.login-heading h1,
.access-card h1 {
    margin: 0 0 8px;
    font-size: 1.65rem;
}

.login-heading p,
.access-card p {
    margin-top: 0;
    color: var(--muted);
    line-height: 1.5;
}

.login-brand-icon {
    width: 38px;
    height: 38px;
    background:
        linear-gradient(90deg, #7aa443 0 48%, transparent 48%),
        linear-gradient(#20a8b9 0 50%, #545b66 50%);
    border-radius: 7px;
}

.login-submit {
    width: 100%;
    margin-top: 18px;
    padding: 12px 16px;
}

.external-sign-in {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
}

.development-accounts {
    display: grid;
    gap: 9px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.development-accounts div {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 9px 10px;
    background: var(--soft);
    border-radius: 8px;
    font-size: 0.78rem;
}

.development-accounts code {
    color: #334155;
}

.development-accounts small,
.route-message {
    color: var(--muted);
}

.tenant-picker-card {
    width: min(100%, 560px);
}

.tenant-choice-list {
    display: grid;
    gap: 10px;
}

.tenant-choice-list form {
    margin: 0;
}

.tenant-choice-list button {
    display: flex;
    width: 100%;
    min-height: 66px;
    padding: 12px 14px;
    align-items: center;
    justify-content: space-between;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 9px;
    text-align: left;
}

.tenant-choice-list button:hover {
    background: #f0fdfa;
    border-color: rgba(15, 118, 110, 0.45);
}

.tenant-choice-list strong,
.tenant-choice-list small {
    display: block;
}

.tenant-choice-list small {
    margin-top: 4px;
    color: var(--muted);
}

.access-card {
    margin-top: 8vh;
    text-align: center;
}

.access-card .primary-action {
    display: inline-flex;
    margin-top: 12px;
    padding: 11px 15px;
    color: white;
    text-decoration: none;
}

.route-message {
    padding: 24px;
    text-align: center;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.analytics-shell,
.studio-shell {
    display: grid;
    gap: 16px;
    padding: 16px 18px 22px;
}

.workspace-header {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.workspace-header h1 {
    margin: 0;
    font-size: 1.7rem;
    letter-spacing: 0;
}

.workspace-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.workspace-meta span,
.workspace-meta button,
.prompt-chips button,
.panel-heading button {
    padding: 8px 11px;
    color: #344054;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
}

.workspace-meta button,
.panel-heading button {
    color: white;
    background: var(--slate);
    border-color: var(--slate);
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.command-center,
.analytics-panel,
.insight-panel,
.metric-tile {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.command-center {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.prompt-bar {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 118px;
    gap: 12px;
    align-items: center;
}

.prompt-bar > span {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: white;
    background: var(--teal);
    border-radius: 8px;
    font-weight: 900;
}

.prompt-bar textarea {
    width: 100%;
    height: 48px;
    min-height: 48px;
    max-height: 96px;
    resize: vertical;
    padding: 13px 14px;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid #ccd6e2;
    border-radius: 8px;
    line-height: 1.45;
    outline: none;
}

.prompt-bar textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.primary-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 16px;
    color: white;
    background: var(--teal);
    border-radius: 8px;
    font-weight: 900;
}

.primary-action.full {
    width: 100%;
}

.prompt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.intent-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    padding: 10px 12px;
    color: var(--muted);
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.intent-summary div {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.intent-summary span {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.intent-summary strong {
    color: var(--ink);
    font-size: 0.86rem;
}

.intent-warning {
    width: 100%;
    color: var(--amber);
    font-weight: 800;
}

.selection-context {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 11px 12px;
    color: #134e4a;
    background: #ecfdf5;
    border: 1px solid #99d5cb;
    border-radius: 8px;
}

.selection-context div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.selection-context span {
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.selection-context small {
    overflow: hidden;
    color: #3f625f;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selection-context button,
.table-focus-button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 10px;
    color: var(--teal);
    background: white;
    border: 1px solid #99d5cb;
    border-radius: 7px;
    font-weight: 800;
}

.metric-tile,
.metric-card {
    display: grid;
    gap: 7px;
    padding: 16px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.metric-tile.featured {
    min-height: 220px;
    color: white;
    background: linear-gradient(160deg, #145766 0%, #19a7b8 100%);
    border-color: #145766;
}

.metric-tile.featured span,
.metric-tile.featured small {
    color: rgba(255, 255, 255, 0.82);
}

.metric-tile.featured strong {
    color: white;
    font-size: 2.1rem;
}

.mini-chart {
    align-self: end;
    width: 100%;
    height: 86px;
}

.metric-tile span,
.metric-card span,
.metric-tile small,
.metric-card small {
    color: var(--muted);
}

.metric-tile strong,
.metric-card strong {
    font-size: 1.65rem;
    line-height: 1.05;
}

.selectable-report-item {
    transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.selectable-report-item:hover,
.selectable-report-item:focus-visible {
    border-color: #50a89f;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12), 0 14px 28px rgba(15, 23, 42, 0.08);
    outline: none;
    transform: translateY(-1px);
}

.selectable-report-item.selected {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.metric-tile.featured.selectable-report-item:hover,
.metric-tile.featured.selectable-report-item:focus-visible,
.metric-tile.featured.selectable-report-item.selected {
    border-color: #99f6e4;
}

.positive {
    color: var(--teal) !important;
}

.warning {
    color: var(--amber) !important;
}

.dashboard-board {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: start;
}

.kpi-column,
.chart-board,
.insight-rail,
.action-list,
.question-list,
.source-list,
.driver-list {
    display: grid;
    gap: 12px;
}

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

.chart-board .hero-chart,
.chart-board .analytics-panel:last-child {
    grid-column: 1 / -1;
}

.split-panels,
.report-grid,
.context-grid,
.sync-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.context-grid {
    grid-template-columns: 1.05fr 1fr 1.2fr;
}

.sync-grid {
    grid-template-columns: 1.1fr 0.9fr 1fr;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.settings-card {
    display: grid;
    gap: 10px;
    min-height: 210px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.settings-card.primary {
    color: white;
    background: linear-gradient(160deg, #145766 0%, #19a7b8 100%);
    border-color: #145766;
}

.settings-card h2,
.settings-card p {
    margin: 0;
}

.settings-card p {
    color: var(--muted);
    line-height: 1.55;
}

.settings-card.primary p,
.settings-card.primary .eyebrow {
    color: rgba(255, 255, 255, 0.82);
}

.settings-card a,
.settings-card button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: end;
    min-height: 38px;
    padding: 0 13px;
    color: white;
    background: var(--slate);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 900;
}

.settings-card.primary a {
    color: #145766;
    background: white;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    min-height: 28px;
    padding: 0 10px;
    color: #065f46;
    background: #d1fae5;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
}

.settings-card.primary .status-pill {
    color: #145766;
    background: rgba(255, 255, 255, 0.88);
}

.analytics-panel,
.insight-panel {
    min-width: 0;
    padding: 16px;
}

.insight-panel.wide {
    grid-column: 1 / -1;
}

.hero-chart {
    min-height: 440px;
}

.panel-heading {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.panel-heading > div {
    min-width: 0;
}

.panel-heading button,
.workspace-meta button,
.workspace-meta span,
.prompt-chips button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    white-space: nowrap;
    line-height: 1;
}

.panel-heading h2,
.analytics-panel h2 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0;
}

.narrative,
.narrative-panel p {
    margin: 0;
    color: #344054;
    line-height: 1.65;
}

.narrative-panel h2 {
    margin-bottom: 10px;
}

.chart-surface {
    width: 100%;
    height: 300px;
}

.chart-surface.tall {
    height: 360px;
}

.compact-chart {
    height: 260px;
}

.collections-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.data-table-wrap {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e5edf5;
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: var(--soft);
}

.table-focus-button:hover,
.table-focus-button:focus-visible {
    color: white;
    background: var(--teal);
    outline: none;
}

.data-table .empty-table-state {
    padding: 28px 12px;
    color: var(--muted);
    text-align: center;
    white-space: normal;
}

.follow-up-panel h2 {
    margin-bottom: 7px;
}

.follow-up-hint {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.question-list button span,
.question-list button small {
    display: block;
}

.question-list button span {
    font-weight: 900;
}

.question-list button small {
    color: var(--muted);
}

.action-item,
.question-list button,
.driver-item,
.source-item {
    width: 100%;
    padding: 12px;
    color: #1f2937;
    background: var(--soft);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: left;
}

.action-item,
.question-list button {
    display: grid;
    gap: 4px;
    min-height: 66px;
}

.action-item:hover,
.question-list button:hover {
    border-color: rgba(15, 118, 110, 0.35);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.action-item:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.action-feedback {
    margin: 10px 0 0;
    padding: 9px 10px;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 800;
}

.action-feedback.success {
    color: #065f46;
    background: #d1fae5;
}

.action-feedback.error {
    color: #991b1b;
    background: #fee2e2;
}

.email-draft-panel {
    display: grid;
    gap: 12px;
}

.email-draft-panel label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 800;
}

.email-draft-panel input,
.email-draft-panel textarea {
    width: 100%;
    padding: 10px 11px;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid #ccd6e2;
    border-radius: 7px;
    outline: none;
}

.email-draft-panel textarea {
    min-height: 230px;
    resize: vertical;
    line-height: 1.5;
}

.email-draft-panel input:focus,
.email-draft-panel textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.email-draft-panel label small,
.email-attachment small {
    color: var(--muted);
    font-weight: 500;
}

.email-attachment {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.email-attachment > span {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: white;
    background: var(--red);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 900;
}

.email-attachment strong,
.email-attachment small {
    display: block;
}

.delivery-readiness {
    margin: 0;
    padding: 9px 10px;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 800;
}

.delivery-readiness.ready {
    color: #065f46;
    background: #d1fae5;
}

.schedule-shell {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.alert-shell {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.alert-list-panel {
    padding: 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 11px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.alert-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
    margin: 15px 0;
}

.alert-form-grid label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 800;
}

.alert-form-grid .wide-field {
    grid-column: 1 / -1;
}

.alert-form-grid input,
.alert-form-grid select {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid #ccd6e2;
    border-radius: 7px;
}

.alert-form-grid small {
    color: var(--muted);
    font-weight: 500;
}

.schedule-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: space-between;
}

.schedule-header h1 {
    margin: 3px 0 7px;
    font-size: 1.8rem;
}

.schedule-header p:last-child {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
}

.schedule-header .primary-action,
.schedule-editor .primary-action {
    padding: 11px 16px;
    color: white;
}

.schedule-editor,
.schedule-list-panel {
    padding: 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 11px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.schedule-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    padding: 24px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.58);
    place-items: start center;
}

.schedule-modal {
    width: min(100%, 880px);
    margin: auto;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.schedule-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    margin: 15px 0;
}

.schedule-form-grid label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 800;
}

.schedule-form-grid .wide-field {
    grid-column: 1 / -1;
}

.schedule-form-grid input,
.schedule-form-grid select,
.schedule-form-grid textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid #ccd6e2;
    border-radius: 7px;
    outline: none;
}

.schedule-form-grid textarea {
    min-height: 86px;
    resize: vertical;
    line-height: 1.45;
}

.schedule-form-grid input:focus,
.schedule-form-grid select:focus,
.schedule-form-grid textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.schedule-form-grid small {
    color: var(--muted);
    font-weight: 500;
}

.schedule-enabled {
    display: flex !important;
    gap: 10px !important;
    padding: 11px;
    align-items: flex-start;
    background: #f0fdfa;
    border: 1px solid #b8e1dc;
    border-radius: 8px;
}

.schedule-enabled input {
    width: 17px;
    min-height: 17px;
    margin-top: 2px;
}

.schedule-enabled strong,
.schedule-enabled small {
    display: block;
}

.schedule-list-heading {
    display: flex;
    gap: 36px;
    padding: 0 0 15px;
    border-bottom: 1px solid var(--line);
}

.schedule-list-heading div {
    display: grid;
}

.schedule-list-heading strong {
    font-size: 1.35rem;
}

.schedule-list-heading span {
    color: var(--muted);
    font-size: 0.75rem;
}

.schedule-table-wrap {
    overflow-x: auto;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.schedule-table th {
    padding: 12px 9px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
}

.schedule-table td {
    padding: 13px 9px;
    border-bottom: 1px solid #edf1f5;
    vertical-align: top;
}

.schedule-table td:first-child {
    min-width: 245px;
}

.schedule-table td strong,
.schedule-table td small {
    display: block;
}

.schedule-table td small {
    max-width: 380px;
    margin-top: 4px;
    color: var(--muted);
}

.schedule-status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 900;
}

.schedule-status.ready,
.schedule-status.delivered {
    color: #065f46;
    background: #d1fae5;
}

.schedule-status.paused {
    color: #475569;
    background: #e2e8f0;
}

.schedule-status.failed {
    color: #991b1b;
    background: #fee2e2;
}

.schedule-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
}

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

.current-environment {
    border-color: rgba(13, 129, 122, 0.48);
    box-shadow: 0 10px 24px rgba(13, 129, 122, 0.10);
}

.operations-panel {
    margin-top: 16px;
}

.pilot-owner-email {
    display: block;
    margin-top: 3px;
    color: #66758a;
    font-size: 0.78rem;
}

.schedule-actions button,
.schedule-empty button {
    padding: 6px 9px;
    color: var(--slate);
    background: white;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-weight: 800;
}

.schedule-actions .danger,
.schedule-actions .danger-link {
    color: #b42318;
}

.schedule-actions .danger {
    color: white;
    background: #b42318;
    border-color: #b42318;
}

.schedule-empty {
    padding: 42px 18px;
    color: var(--muted);
    text-align: center;
}

.schedule-empty strong {
    color: var(--ink);
    font-size: 1rem;
}

@media (max-width: 820px) {
    .schedule-header {
        display: grid;
    }

    .schedule-form-grid {
        grid-template-columns: 1fr;
    }

    .schedule-form-grid .wide-field {
        grid-column: auto;
    }

    .schedule-list-heading {
        gap: 20px;
    }
}

.delivery-readiness.blocked {
    color: #92400e;
    background: #fef3c7;
}

.action-item span,
.driver-item span {
    font-weight: 900;
}

.action-item small,
.driver-item small,
.source-item small {
    color: var(--muted);
    line-height: 1.45;
}

.driver-item {
    display: grid;
    gap: 5px;
    border-left: 4px solid var(--teal);
}

.driver-item.loss {
    border-left-color: var(--red);
}

.driver-item strong {
    color: var(--teal);
}

.driver-item.loss strong {
    color: var(--red);
}

.source-item {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
}

.source-item strong,
.source-item small {
    display: block;
}

.source-item span {
    flex: 0 0 auto;
    padding: 6px 9px;
    color: #065f46;
    background: #d1fae5;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 900;
}

.platform-service-list {
    display: grid;
    gap: 10px;
}

.platform-service-list article {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--soft);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.platform-service-list p {
    margin: 3px 0 0;
    color: var(--muted);
}

.platform-heading {
    padding: 8px 2px;
}

.platform-heading > div > p:last-child {
    max-width: 720px;
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.platform-updated,
.chart-period {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    color: #475467;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
}

.platform-kpi {
    position: relative;
    overflow: hidden;
    min-height: 112px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.platform-kpi::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--teal);
    content: "";
}

.platform-kpi.attention::before {
    background: #d97706;
}

.platform-kpi.attention strong {
    color: #b45309;
}

.platform-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.platform-dashboard-grid .wide-chart {
    grid-column: span 2;
}

.platform-chart-card,
.platform-health-card {
    min-height: 310px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.bar-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(38px, 1fr));
    gap: clamp(8px, 2vw, 22px);
    height: 225px;
    padding: 16px 10px 0;
    border-bottom: 1px solid #dfe7ef;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 54px, #edf2f7 55px);
}

.bar-chart.compact {
    gap: 10px;
}

.bar-column {
    display: grid;
    grid-template-rows: 24px minmax(0, 1fr) 26px;
    min-width: 0;
    height: 100%;
    text-align: center;
}

.bar-value {
    color: #475467;
    font-size: 0.72rem;
    font-weight: 800;
}

.bar-fill {
    align-self: end;
    width: min(100%, 46px);
    min-height: 4px;
    margin: 0 auto;
    background: linear-gradient(180deg, #14b8a6, #0f766e);
    border-radius: 5px 5px 0 0;
}

.bar-fill.cost {
    background: linear-gradient(180deg, #818cf8, #4f46e5);
}

.bar-column small {
    align-self: end;
    color: var(--muted);
    font-size: 0.72rem;
}

.breakdown-list {
    display: grid;
    gap: 22px;
    padding: 24px 4px 8px;
}

.breakdown-list > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
}

.breakdown-label {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: #344054;
    font-size: 0.84rem;
    font-weight: 800;
}

.legend-dot {
    width: 9px;
    height: 9px;
    background: #94a3b8;
    border-radius: 999px;
}

.legend-dot.healthy,
.breakdown-track i.healthy {
    background: var(--teal);
}

.legend-dot.warning,
.breakdown-track i.warning {
    background: #d97706;
}

.breakdown-track {
    grid-column: 1 / -1;
    height: 8px;
    overflow: hidden;
    background: #e8eef5;
    border-radius: 999px;
}

.breakdown-track i {
    display: block;
    height: 100%;
    background: #94a3b8;
    border-radius: inherit;
}

.status-dot.warning {
    background: #d97706;
    box-shadow: 0 0 0 5px rgba(217, 119, 6, 0.12);
}

.status-pill.warning {
    color: #92400e;
    background: #fef3c7;
}

.platform-section-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.management-card {
    display: grid;
    gap: 8px;
    min-height: 220px;
    padding: 17px;
}

.management-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.management-icon {
    display: grid;
    width: 42px;
    height: 42px;
    color: #0f766e;
    background: #dff7f3;
    border-radius: 10px;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 900;
}

.management-card h2,
.management-card p,
.provisioning-options p {
    margin: 0;
}

.management-card > p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.55;
}

.management-card button {
    align-self: end;
    justify-self: start;
}

.secondary-action {
    min-height: 40px;
    padding: 0 14px;
    color: #344054;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-weight: 850;
}

.platform-table-card {
    padding: 20px;
}

.provisioning-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.provisioning-options > div {
    min-height: 150px;
    padding: 22px;
    background: var(--soft);
    border-right: 1px solid var(--line);
}

.provisioning-options > div:last-child {
    border-right: 0;
}

.provisioning-options p {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.5;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 850;
}

.provisioning-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 14px;
    align-items: start;
}

.tenant-create-card {
    display: grid;
    gap: 20px;
    padding: 20px;
    scroll-margin-top: 18px;
}

.tenant-create-card:target {
    border-color: rgba(15, 118, 110, 0.55);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08), 0 16px 40px rgba(15, 23, 42, 0.06);
}

.tenant-create-card h2,
.tenant-create-card p {
    margin: 0;
}

.tenant-create-card .form-intro {
    margin-top: 7px;
    color: var(--muted);
    line-height: 1.5;
}

.tenant-create-card form {
    display: grid;
    gap: 18px;
}

.tenant-directory {
    margin-top: 12px;
}

.tenant-directory .data-table td {
    height: 66px;
}

.tenant-list-card {
    width: 100%;
}

.tenant-directory-feedback {
    margin-bottom: 14px;
}

.actions-heading {
    text-align: right !important;
}

.tenant-row-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 0;
    white-space: nowrap;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    overflow: hidden;
}

.table-action {
    min-height: 34px;
    padding: 0 10px;
    color: #344054;
    background: #fff;
    border: 0;
    border-right: 1px solid #d0d5dd;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 800;
}

.table-action:last-child {
    border-right: 0;
}

.table-action:hover:not(:disabled) {
    color: #0f766e;
    border-color: #5eead4;
    background: #f0fdfa;
}

.table-action.danger {
    color: #b42318;
}

.table-action.danger:hover:not(:disabled) {
    color: #912018;
    border-color: #fda29b;
    background: #fff5f4;
}

.table-action:disabled {
    color: #98a2b3;
    background: #f8fafc;
    cursor: not-allowed;
}

.tenant-identity {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 190px;
}

.tenant-identity > div {
    display: grid;
    gap: 3px;
}

.tenant-identity small {
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.tenant-avatar {
    flex: 0 0 34px;
    display: grid;
    width: 34px;
    height: 34px;
    color: #155e75;
    background: #cffafe;
    border: 1px solid #a5f3fc;
    border-radius: 9px;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 900;
}

.tenant-avatar.large {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
    border-radius: 11px;
    font-size: 0.86rem;
}

.tenant-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(3px);
}

.tenant-modal {
    width: min(520px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: #fff;
    border: 1px solid #dbe3ed;
    border-radius: 14px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

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

.tenant-modal-header h2,
.tenant-modal-header p {
    margin: 0;
}

.tenant-modal-header h2 {
    margin-top: 4px;
    font-size: 1.35rem;
}

.modal-close {
    width: 34px;
    height: 34px;
    padding: 0;
    color: #667085;
    background: transparent;
    border: 0;
    border-radius: 7px;
    font-size: 1.6rem;
    line-height: 1;
}

.modal-close:hover:not(:disabled) {
    color: #101828;
    background: #f2f4f7;
}

.tenant-modal-body {
    padding: 22px;
}

.tenant-modal form {
    display: grid;
}

.tenant-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    background: #f8fafc;
    border-top: 1px solid var(--line);
}

.modal-info-note {
    padding: 12px 14px;
    color: #475467;
    background: #f8fafc;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    font-size: 0.84rem;
    line-height: 1.5;
}

.deactivate-confirmation {
    display: flex;
    gap: 14px;
}

.deactivate-confirmation p {
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.tenant-detail-grid {
    display: grid;
    gap: 20px;
}

.tenant-detail-primary {
    display: flex;
    gap: 12px;
    align-items: center;
}

.tenant-detail-primary > div {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tenant-detail-grid dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    overflow: hidden;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 9px;
}

.tenant-detail-grid dl > div {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    background: #fff;
}

.tenant-detail-grid dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tenant-detail-grid dd {
    margin: 0;
    color: var(--ink);
    font-weight: 750;
}

.tenant-detail-grid .tenant-id-detail {
    grid-column: 1 / -1;
}

.tenant-id-detail dd {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
}

.split-actions {
    justify-content: space-between;
}

.split-actions > div {
    display: flex;
    gap: 10px;
}

.warning-mark {
    flex: 0 0 38px;
    display: grid;
    width: 38px;
    height: 38px;
    color: #b42318;
    background: #fee4e2;
    border-radius: 50%;
    place-items: center;
    font-weight: 900;
}

.danger-action {
    min-height: 40px;
    padding: 0 14px;
    color: #fff;
    background: #b42318;
    border: 1px solid #b42318;
    border-radius: 8px;
    font-weight: 850;
}

.danger-action:hover:not(:disabled) {
    background: #912018;
    border-color: #912018;
}

.danger-action.subtle-danger {
    color: #b42318;
    background: #fff;
}

.danger-action.subtle-danger:hover:not(:disabled) {
    color: #fff;
}

.danger-action:disabled,
.modal-close:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.plan-pill {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 0 9px;
    color: #3730a3;
    background: #e0e7ff;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 850;
}

.status-pill.healthy {
    color: #065f46;
    background: #d1fae5;
}

.status-pill.neutral {
    color: #475467;
    background: #e9eef5;
}

.management-card.selected-management {
    border-color: rgba(15, 118, 110, 0.55);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.07), 0 16px 40px rgba(15, 23, 42, 0.06);
}

.provider-editor {
    padding: 18px 20px;
    border-top: 3px solid var(--teal);
}

.provider-editor-heading {
    display: flex;
    gap: 16px;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.provider-editor-heading h2 {
    margin: 0;
    font-size: 1.12rem;
}

.close-editor {
    display: grid;
    width: 34px;
    height: 34px;
    color: #475467;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    place-items: center;
    font-size: 1.25rem;
}

.provider-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

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

.email-provider-grid .smtp-host-field {
    grid-column: span 2;
}

.provider-form-grid label {
    display: grid;
    align-self: start;
    align-content: start;
    gap: 7px;
    color: #475467;
    font-size: 0.82rem;
    font-weight: 800;
}

.provider-form-grid input:not([type="checkbox"]),
.provider-form-grid select {
    width: 100%;
    height: 40px;
    min-height: 40px;
    padding: 8px 11px;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.provider-form-grid .wide-field {
    grid-column: 1 / -1;
}

.provider-form-grid small {
    color: var(--muted);
    font-weight: 500;
}

.provider-form-grid .toggle-field {
    display: flex;
    flex-direction: row;
    gap: 9px;
    align-items: center;
    min-height: 38px;
}

.provider-form-grid .toggle-field input {
    width: 17px;
    height: 17px;
}

.provider-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.provider-feedback {
    margin-top: 0;
}

.security-time {
    font-size: 1.25rem !important;
}

.security-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 14px;
    align-items: start;
}

.security-audit-card,
.security-side-card {
    padding: 20px;
}

.audit-filter {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px auto auto;
    gap: 9px;
    margin: 18px 0;
}

.audit-filter input,
.audit-filter select {
    min-height: 40px;
    padding: 0 11px;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.audit-filter button {
    min-height: 40px;
}

.audit-table {
    max-height: 560px;
    overflow: auto;
    border: 1px solid #e5edf5;
    border-radius: 9px;
}

.audit-table .data-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
}

.audit-area {
    display: inline-flex;
    padding: 5px 8px;
    color: #344054;
    background: #edf2f7;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 800;
}

.security-rail {
    display: grid;
    gap: 14px;
}

.security-note {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

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

.privileged-list > div {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px 10px;
    align-items: center;
    padding: 12px;
    background: var(--soft);
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

.privileged-list .status-pill {
    grid-column: 2;
}

.privileged-list strong,
.privileged-list small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.privileged-list small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.72rem;
}

.identity-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    color: #0f766e;
    background: #dff7f3;
    border-radius: 999px;
    place-items: center;
    font-size: 0.74rem;
    font-weight: 900;
}

.inline-link {
    color: var(--teal);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 850;
}

.link-button {
    padding: 0;
    background: transparent;
}

.identity-invite-form {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 13px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 9px;
}

.identity-invite-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.identity-invite-form input,
.identity-invite-form select {
    width: 100%;
    min-height: 39px;
    padding: 8px 10px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
}

.identity-invite-form .primary-action {
    margin-top: 3px;
}

.identity-feedback {
    margin: 0 0 12px;
}

.identity-status-row {
    grid-column: 2;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.identity-action {
    padding: 5px 0;
    color: #475467;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 850;
}

.identity-action:hover {
    color: var(--teal);
}

.tenant-users-panel {
    padding: 20px;
}

.tenant-invite-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 220px auto;
    gap: 12px;
    align-items: end;
    margin: 16px 0;
    padding: 14px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 9px;
}

.tenant-invite-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.tenant-invite-form input,
.tenant-invite-form select,
.tenant-user-table select {
    min-height: 40px;
    padding: 8px 10px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
}

.tenant-user-feedback {
    margin: 14px 0;
}

.tenant-user-table {
    margin-top: 12px;
    border: 1px solid #e5edf5;
    border-radius: 9px;
}

.tenant-user-table td {
    height: 60px;
}

.tenant-user-table select {
    min-width: 150px;
}

.security-check {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 13px;
    background: #f0fdf9;
    border: 1px solid #ccf1e8;
    border-radius: 9px;
}

.security-check p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.empty-state {
    display: grid;
    min-height: 220px;
    color: var(--muted);
    text-align: center;
    place-content: center;
}

.empty-state p {
    margin: 6px 0 0;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--teal);
    border-radius: 999px;
    box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.12);
}

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

.form-stack label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.form-stack input {
    width: 100%;
    padding: 12px;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.form-stack select {
    width: 100%;
    padding: 12px;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.form-stack small {
    color: var(--muted);
    font-weight: 500;
}

.validation-message {
    color: var(--red);
    font-size: 0.78rem;
}

.tenant-connector-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.tenant-connector-grid > .insight-panel {
    height: 100%;
}

.integration-tabs {
    display: flex;
    gap: 4px;
    padding: 5px;
    overflow-x: auto;
    background: #e9eef5;
    border: 1px solid #d8e0ea;
    border-radius: 10px;
}

.integration-tabs button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 16px;
    color: #475467;
    background: transparent;
    border: 0;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 850;
}

.integration-tabs button:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.62);
}

.integration-tabs button.active {
    color: #0f766e;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.integration-single-card {
    grid-column: 1 / -1;
}

.connector-form-card {
    border-top: 4px solid var(--teal);
}

.secure-badge {
    padding: 7px 10px;
    color: #065f46;
    background: #d1fae5;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
}

.connector-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 16px;
}

.connector-actions button {
    padding: 11px 14px;
    color: #344054;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 900;
}

.connector-actions .primary-action {
    color: white;
    background: var(--teal);
    border-color: var(--teal);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.connector-feedback {
    margin-top: 14px;
    padding: 11px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 750;
}

.connector-feedback.success {
    color: #065f46;
    background: #d1fae5;
}

.connector-feedback.error {
    color: #991b1b;
    background: #fee2e2;
}

.readiness-list {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.readiness-list div {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 11px 12px;
    background: var(--soft);
    border-bottom: 1px solid var(--line);
}

.readiness-list div:last-child {
    border-bottom: 0;
}

.readiness-list span {
    color: var(--muted);
    font-size: 0.82rem;
}

.readiness-list strong {
    text-align: right;
    font-size: 0.84rem;
}

.connector-note {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.status-pill.connected {
    color: #065f46;
    background: #d1fae5;
}

.status-pill.error {
    color: #991b1b;
    background: #fee2e2;
}

.status-pill.not-configured,
.status-pill.disabled {
    color: #92400e;
    background: #fef3c7;
}

.scope-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.scope-list span {
    padding: 8px 10px;
    color: #065f46;
    background: #d1fae5;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 900;
}

.scope-list .muted {
    color: #64748b;
    background: #e2e8f0;
}

.sync-status {
    display: grid;
    gap: 8px;
}

.sync-status small {
    color: var(--muted);
}

.sync-status span {
    padding: 9px 10px;
    color: #92400e;
    background: #fef3c7;
    border-radius: 8px;
    font-size: 0.9rem;
}

.sync-history-card {
    grid-column: 1 / -1;
}

.sync-history-card .data-table td:last-child {
    min-width: 260px;
    white-space: normal;
}

.schedule-fields {
    margin-bottom: 16px;
}

.checkbox-field {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
}

.file-import-box {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px dashed #94a3b8;
    border-radius: 10px;
    background: #f8fafc;
}

.file-import-box p,
.file-import-box small {
    margin: 0;
    color: var(--muted);
}

.sync-status .import-error {
    color: #991b1b;
    background: #fee2e2;
}

.blazor-error-boundary {
    padding: 1rem;
    color: white;
    background: #991b1b;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1000;
    padding: 1rem;
    color: white;
    background: #991b1b;
    border-radius: 8px;
}

#blazor-error-ui .dismiss {
    margin-left: 1rem;
    cursor: pointer;
}

@media (max-width: 1280px) {
    .dashboard-board {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .insight-rail {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .dashboard-board,
    .settings-grid,
    .collections-layout {
        grid-template-columns: 1fr;
    }

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

    .metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-tile.featured {
        min-height: 170px;
    }

    .platform-dashboard-grid,
    .platform-section-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .workspace-header,
    .prompt-bar {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .kpi-grid,
    .kpi-column,
    .metric-strip,
    .chart-board,
    .insight-rail,
    .split-panels,
    .report-grid,
    .context-grid,
    .sync-grid {
        grid-template-columns: 1fr;
    }

    .platform-dashboard-grid,
    .platform-section-grid,
    .provisioning-options,
    .provisioning-layout,
    .provider-form-grid,
    .security-layout {
        grid-template-columns: 1fr;
    }

    .provider-form-grid .wide-field {
        grid-column: auto;
    }

    .email-provider-grid .smtp-host-field {
        grid-column: auto;
    }

    .audit-filter {
        grid-template-columns: 1fr 1fr;
    }

    .tenant-invite-form {
        grid-template-columns: 1fr;
    }

    .platform-dashboard-grid .wide-chart {
        grid-column: auto;
    }

    .provisioning-options > div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .provisioning-options > div:last-child {
        border-bottom: 0;
    }
}


@media (max-width: 720px) {
    .analytics-shell,
    .studio-shell {
        padding: 14px;
    }

    .primary-action {
        width: 100%;
    }

    .audit-filter {
        grid-template-columns: 1fr;
    }
}

/* Shared professional table language */
.data-table,
.schedule-table {
    width: 100%;
    overflow: hidden;
    border: 1px solid #d7e2ea;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    background: white;
}

.data-table thead,
.schedule-table thead,
.audit-table .data-table thead {
    color: #24465a;
    background: #e8f1f4;
}

.data-table th,
.schedule-table th {
    padding: 12px 11px;
    color: #24465a;
    border-bottom: 1px solid #cbdce4;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.055em;
    text-align: left;
    text-transform: uppercase;
}

.data-table td,
.schedule-table td {
    padding: 12px 11px;
    border-bottom: 1px solid #e3ebf0;
    color: #172b3a;
}

.data-table tbody tr:nth-child(even),
.schedule-table tbody tr:nth-child(even) {
    background: #f6f9fb;
}

.data-table tbody tr:nth-child(odd),
.schedule-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.data-table tbody tr:hover,
.schedule-table tbody tr:hover {
    background: #eaf7f5;
}

.data-table tbody tr:last-child td,
.schedule-table tbody tr:last-child td {
    border-bottom: 0;
}

.tenant-policy-panel {
    border-top: 3px solid var(--teal);
}

.tenant-policy-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.8fr 1fr;
    gap: 12px;
    margin: 15px 0;
}

.tenant-policy-grid > label,
.policy-readonly {
    display: grid;
    gap: 6px;
    padding: 12px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 800;
}

.tenant-policy-grid input[type="number"] {
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #ccd6e2;
    border-radius: 7px;
}

.policy-toggle {
    display: flex !important;
    gap: 10px !important;
    align-items: flex-start;
}

.policy-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.policy-toggle strong,
.policy-toggle small,
.policy-readonly span,
.policy-readonly strong,
.policy-readonly small {
    display: block;
}

.policy-toggle small,
.policy-readonly small {
    margin-top: 4px;
    color: var(--muted);
    font-weight: 500;
}

.policy-route-link {
    display: inline-flex;
    min-height: 42px;
    padding: 0 13px;
    align-items: center;
    justify-content: center;
    align-self: center;
    color: white;
    background: var(--slate);
    border-radius: 7px;
    font-weight: 900;
    text-decoration: none;
}

.settings-workspace {
    gap: 16px;
}

.report-library-shell {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.report-library-modal {
    width: min(100%, 820px);
}

.report-library-form {
    display: grid;
    gap: 13px;
    margin: 16px 0;
}

.report-library-form label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 800;
}

.report-library-form input,
.report-library-form textarea,
.report-library-form select {
    width: 100%;
    min-height: 41px;
    padding: 9px 10px;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid #ccd6e2;
    border-radius: 7px;
}

.report-library-form textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.5;
}

.report-library-form small {
    color: var(--muted);
    font-weight: 500;
}

.report-library-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

@media (max-width: 720px) {
    .report-library-form-row {
        grid-template-columns: 1fr;
    }
}

/* Executive dashboard and AI analysis experience */
.executive-dashboard,
.ai-analysis-workspace {
    --ai-navy: #0b1220;
    --ai-ink: #142033;
    --ai-muted: #6b7890;
    --ai-cyan: #08a9c4;
    --ai-violet: #6857e5;
    --ai-mint: #12a879;
}

.executive-dashboard {
    min-height: calc(100vh - 64px);
    padding: 34px clamp(18px, 3vw, 52px) 52px;
    background:
        radial-gradient(circle at 8% 0%, rgba(34, 211, 238, .10), transparent 25%),
        radial-gradient(circle at 92% 8%, rgba(104, 87, 229, .09), transparent 25%),
        #f4f7fb;
}

.dashboard-hero {
    display: flex;
    max-width: 1540px;
    margin: 0 auto 28px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.dashboard-kicker {
    display: flex;
    gap: 9px;
    align-items: center;
    margin-bottom: 10px;
    color: #65738a;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.dashboard-kicker span {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(16, 185, 129, .11);
}

.dashboard-hero h1 {
    max-width: 790px;
    margin: 0;
    color: var(--ai-navy);
    font-size: clamp(2rem, 3.1vw, 3.35rem);
    font-weight: 760;
    letter-spacing: -.045em;
    line-height: 1.06;
}

.dashboard-hero-copy > p {
    margin: 13px 0 0;
    color: #748198;
    font-size: .92rem;
}

.dashboard-hero-actions { display: flex; gap: 10px; }
.dashboard-hero-actions a,
.attention-action {
    display: inline-flex;
    min-height: 44px;
    padding: 0 17px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: .84rem;
    font-weight: 850;
    text-decoration: none;
}
.dashboard-primary-action { color: white; background: linear-gradient(135deg, #0c97b1, #6154df); box-shadow: 0 10px 25px rgba(78, 79, 201, .22); }
.dashboard-secondary-action { color: #344054; background: rgba(255,255,255,.8); border: 1px solid #dce3ed; }

.dashboard-pulse-grid,
.dashboard-content-grid {
    display: grid;
    max-width: 1540px;
    margin-right: auto;
    margin-left: auto;
}

.dashboard-pulse-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.pulse-card,
.dashboard-glass-panel,
.attention-panel,
.confidence-card {
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(211, 220, 232, .9);
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, .055);
}
.pulse-card { position: relative; min-height: 188px; overflow: hidden; padding: 21px; }
.pulse-card::after { content: ""; position: absolute; right: -32px; bottom: -42px; width: 110px; height: 110px; border: 22px solid rgba(8,169,196,.04); border-radius: 50%; }
.pulse-card-top { display: flex; align-items: center; justify-content: space-between; color: #68758b; font-size: .78rem; font-weight: 800; }
.pulse-icon { display: grid; width: 31px; height: 31px; place-items: center; color: #078ca5; background: #e6f8fb; border-radius: 9px; font-style: normal; }
.pulse-icon.amber { color: #c46f16; background: #fff5e8; }
.pulse-icon.violet { color: #6554d9; background: #f0edff; }
.pulse-icon.blue { color: #2767c5; background: #eaf2ff; }
.pulse-card > strong { display: block; margin: 24px 0 9px; color: var(--ai-ink); font-size: clamp(1.55rem, 2vw, 2.15rem); letter-spacing: -.04em; }
.pulse-comparison { display: flex; gap: 7px; align-items: center; color: #8590a2; font-size: .72rem; }
.pulse-comparison b { padding: 3px 6px; border-radius: 6px; font-size: .7rem; }
.pulse-comparison.positive b { color: #087b5b; background: #e7f8f1; }
.pulse-comparison.negative b { color: #b43b4b; background: #ffedf0; }
.pulse-comparison.neutral b { color: #59677e; background: #eef2f7; }
.pulse-card > small { display: block; margin-top: 7px; color: #8a96a8; font-size: .68rem; }
.dashboard-mini-chart { position: absolute; right: 10px; bottom: 5px; left: 10px; height: 50px; opacity: .52; pointer-events: none; }
.pulse-progress { height: 5px; margin-top: 19px; overflow: hidden; background: #edf1f5; border-radius: 9px; }
.pulse-progress span { display: block; height: 100%; background: linear-gradient(90deg, #f5ad45, #e86d54); border-radius: inherit; }
.customer-stack { display: flex; margin-top: 19px; }
.customer-stack i { display: grid; width: 29px; height: 29px; margin-right: -7px; place-items: center; color: white; background: linear-gradient(135deg, #3d819e, #6659d8); border: 2px solid white; border-radius: 50%; font-size: .62rem; font-style: normal; font-weight: 900; }

.dashboard-content-grid { grid-template-columns: minmax(0, 1.72fr) minmax(310px, .72fr); gap: 18px; align-items: start; }
.dashboard-main-column,
.dashboard-side-column { display: grid; gap: 18px; }
.dashboard-glass-panel,
.attention-panel { padding: 22px; }
.dashboard-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dashboard-panel-heading h2 { margin: 0; color: var(--ai-ink); font-size: 1.08rem; letter-spacing: -.02em; }
.dashboard-panel-heading a { color: #4c57bf; font-size: .76rem; font-weight: 800; text-decoration: none; }
.chart-legend { display: flex; gap: 16px; color: #7c8798; font-size: .7rem; font-weight: 750; }
.chart-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; background: #14a8be; border-radius: 50%; }
.chart-legend .prior::before { background: #c8d2df; }
.dashboard-chart { height: 310px; margin: 8px -8px 0; }
.chart-footer-note { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 15px; background: linear-gradient(90deg, #f0faff, #f5f2ff); border: 1px solid #dfe7fa; border-radius: 12px; }
.chart-footer-note > span { display: grid; width: 32px; height: 32px; place-items: center; color: white; background: linear-gradient(135deg, #08abc2, #725ce6); border-radius: 9px; }
.chart-footer-note p { max-height: 42px; margin: 0; overflow: hidden; color: #657087; font-size: .73rem; line-height: 1.45; }
.chart-footer-note p strong { display: block; color: #34425a; }
.chart-footer-note a { color: #5754c7; font-size: .74rem; font-weight: 850; text-decoration: none; white-space: nowrap; }

.executive-driver-list { display: grid; margin-top: 12px; }
.executive-driver-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(130px, .35fr); gap: 12px; align-items: center; padding: 13px 2px; border-top: 1px solid #edf1f5; }
.driver-direction { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; font-size: .85rem; font-weight: 900; }
.driver-direction.up { color: #09805f; background: #e8f8f2; }
.driver-direction.down { color: #c34958; background: #ffedf0; }
.executive-driver-row strong,
.executive-driver-row small { display: block; }
.executive-driver-row strong { color: #28364b; font-size: .8rem; }
.executive-driver-row small { margin-top: 3px; overflow: hidden; color: #8a95a6; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.driver-impact { text-align: right; }
.driver-impact b { color: #344258; font-size: .73rem; }
.driver-impact i { display: block; height: 4px; margin-top: 7px; overflow: hidden; background: #edf1f5; border-radius: 4px; }
.driver-impact i span { display: block; height: 100%; margin-left: auto; border-radius: inherit; }
.driver-impact i .up { background: #23b68d; }
.driver-impact i .down { background: #e76677; }

.attention-count { display: grid; width: 27px; height: 27px; place-items: center; color: #ba4051; background: #ffedf0; border-radius: 50%; font-size: .7rem; font-weight: 900; }
.attention-list { display: grid; margin: 12px 0; }
.attention-list > a { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 13px 0; color: inherit; border-top: 1px solid #edf1f5; text-decoration: none; }
.risk-mark { display: grid; width: 29px; height: 29px; place-items: center; color: #d15b37; background: #fff2e8; border-radius: 9px; font-weight: 900; }
.attention-list strong,
.attention-list small { display: block; }
.attention-list strong { color: #334155; font-size: .76rem; }
.attention-list small { margin-top: 3px; color: #8b96a7; font-size: .65rem; }
.attention-list b { color: #344054; font-size: .7rem; white-space: nowrap; }
.attention-action { width: 100%; min-height: 40px; color: #4251b8; background: #f0f2ff; }
.ai-briefing-card { position: relative; overflow: hidden; padding: 23px; color: white; background: radial-gradient(circle at 90% 0, rgba(34,211,238,.25), transparent 35%), linear-gradient(145deg, #111d35, #342a73); border-radius: 18px; box-shadow: 0 18px 40px rgba(31, 31, 77, .2); }
.ai-briefing-card::after { content: ""; position: absolute; right: -55px; bottom: -72px; width: 180px; height: 180px; border: 35px solid rgba(255,255,255,.035); border-radius: 50%; }
.ai-briefing-card .eyebrow { color: #7ee8f5; }
.ai-briefing-card h2 { max-width: 280px; margin: 8px 0 12px; font-size: 1.25rem; }
.ai-briefing-card > p:not(.eyebrow) { position: relative; z-index: 1; margin: 0; color: rgba(234,240,255,.74); font-size: .78rem; line-height: 1.65; }
.ai-briefing-card > a { position: relative; z-index: 1; display: flex; margin-top: 20px; align-items: center; justify-content: space-between; color: white; font-size: .76rem; font-weight: 850; text-decoration: none; }
.ai-briefing-orb { display: grid; width: 38px; height: 38px; margin-bottom: 18px; place-items: center; background: linear-gradient(135deg, #20d3df, #7966ee); border-radius: 12px; box-shadow: 0 0 24px rgba(32,211,223,.3); }
.confidence-card { display: flex; padding: 14px 16px; align-items: center; justify-content: space-between; }
.confidence-card > div { display: flex; gap: 11px; align-items: center; }
.confidence-ring { display: grid; width: 43px; height: 43px; place-items: center; color: #087c91; background: conic-gradient(#10a9bf 98%, #e6edf3 0); border-radius: 50%; font-size: .72rem; font-weight: 900; box-shadow: inset 0 0 0 5px white; }
.confidence-ring small { font-size: .5rem; }
.confidence-card p { margin: 0; }
.confidence-card p strong,
.confidence-card p small { display: block; }
.confidence-card p strong { color: #344054; font-size: .74rem; }
.confidence-card p small { margin-top: 3px; color: #8b96a8; font-size: .62rem; }
.live-badge { color: #138364; font-size: .67rem; font-weight: 850; }
.live-badge i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; background: #16b886; border-radius: 50%; }

.ai-analysis-workspace { gap: 18px; min-height: calc(100vh - 64px); padding: 30px clamp(18px, 3vw, 48px) 50px; background: radial-gradient(circle at 10% 0, rgba(20,184,205,.09), transparent 24%), radial-gradient(circle at 90% 2%, rgba(104,87,229,.09), transparent 26%), #f5f7fb; }
.ai-analysis-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.ai-analysis-heading { display: flex; gap: 17px; align-items: center; }
.ai-analysis-heading h1 { margin: 0; color: #101a2c; font-size: clamp(1.85rem, 2.8vw, 3rem); letter-spacing: -.045em; }
.ai-analysis-heading p:last-child { margin: 8px 0 0; color: #748197; font-size: .86rem; }
.ai-orb { position: relative; display: grid; flex: 0 0 auto; width: 54px; height: 54px; place-items: center; background: linear-gradient(135deg, #13bfd1, #5d57dc 65%, #a855f7); border-radius: 17px; box-shadow: 0 12px 30px rgba(70,83,202,.28); transform: rotate(-4deg); }
.ai-orb::before,
.ai-orb::after,
.ai-orb i { content: ""; position: absolute; background: white; border-radius: 50%; }
.ai-orb::before { width: 8px; height: 8px; }
.ai-orb::after { width: 4px; height: 4px; transform: translate(13px,-11px); opacity: .75; }
.ai-orb i { width: 3px; height: 3px; transform: translate(-13px,12px); opacity: .6; }
.analysis-status { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.analysis-status span { padding: 8px 11px; color: #647188; background: rgba(255,255,255,.8); border: 1px solid #dde4ed; border-radius: 999px; font-size: .69rem; font-weight: 800; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; background: #16b987; border-radius: 50%; box-shadow: 0 0 0 3px rgba(22,185,135,.12); }
.ai-command-center { gap: 9px; padding: 17px; border: 1px solid rgba(197,209,224,.9); border-radius: 17px; box-shadow: 0 15px 42px rgba(22,32,52,.07); }
.command-label { display: flex; justify-content: space-between; align-items: center; }
.command-label span { color: #4b50b6; font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.command-label small { color: #8c96a7; font-size: .68rem; }
.ai-command-center .prompt-bar { grid-template-columns: 42px minmax(0, 1fr) 132px; padding: 5px; background: #f7f9fc; border: 1px solid #dbe3ed; border-radius: 12px; }
.ai-command-center .prompt-bar textarea { height: 52px; min-height: 52px; padding: 15px 8px; background: transparent; border: 0; }
.ai-command-center .prompt-bar textarea:focus { box-shadow: none; }
.ai-command-center .prompt-bar > .prompt-spark { color: #5b55d5; background: #eeedff; border-radius: 10px; }
.ai-command-center .primary-action { background: linear-gradient(135deg, #079fb9, #6357dd); border-radius: 9px; box-shadow: 0 8px 18px rgba(81,82,199,.2); }
.ai-command-center .prompt-chips { align-items: center; }
.recipe-label { margin-right: 2px; color: #8b96a8; font-size: .66rem; font-weight: 800; }
.ai-command-center .prompt-chips button { color: #58657a; background: white; border-color: #e0e6ee; font-size: .7rem; }
.ai-analysis-workspace .dashboard-board { grid-template-columns: 250px minmax(0, 1fr) 330px; gap: 14px; }
.ai-analysis-workspace .analytics-panel,
.ai-analysis-workspace .metric-tile { border-color: #dde4ed; border-radius: 15px; box-shadow: 0 10px 30px rgba(15,23,42,.05); }
.ai-analysis-workspace .metric-tile.featured { background: radial-gradient(circle at 90% 10%, rgba(99,102,241,.55), transparent 40%), linear-gradient(145deg, #0e6677, #0f253f); border: 0; }
.ai-analysis-workspace .panel-heading h2,
.ai-analysis-workspace .narrative-panel h2 { letter-spacing: -.025em; }

@media (max-width: 1180px) {
    .dashboard-pulse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-content-grid { grid-template-columns: 1fr; }
    .dashboard-side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .confidence-card { grid-column: 1 / -1; }
    .ai-analysis-workspace .dashboard-board { grid-template-columns: 220px minmax(0, 1fr); }
}

@media (max-width: 760px) {
    .executive-dashboard,
    .ai-analysis-workspace { padding: 22px 14px 36px; }
    .dashboard-hero,
    .ai-analysis-hero { align-items: flex-start; flex-direction: column; }
    .dashboard-hero-actions { width: 100%; }
    .dashboard-hero-actions a { flex: 1; }
    .dashboard-pulse-grid,
    .dashboard-side-column { grid-template-columns: 1fr; }
    .confidence-card { grid-column: auto; }
    .dashboard-chart { height: 240px; }
    .chart-footer-note { grid-template-columns: 32px minmax(0, 1fr); }
    .chart-footer-note a { grid-column: 2; }
    .executive-driver-row { grid-template-columns: 34px minmax(0, 1fr); }
    .driver-impact { grid-column: 2; text-align: left; }
    .ai-analysis-heading { align-items: flex-start; }
    .ai-orb { width: 45px; height: 45px; border-radius: 14px; }
    .analysis-status { justify-content: flex-start; }
    .ai-command-center .prompt-bar { grid-template-columns: 38px minmax(0, 1fr); }
    .ai-command-center .primary-action { grid-column: 1 / -1; width: 100%; }
    .command-label { align-items: flex-start; flex-direction: column; gap: 3px; }
}

.settings-list-panel {
    min-width: 0;
    padding: 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-top: 3px solid var(--teal);
    border-radius: 9px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.settings-list-panel .panel-heading {
    margin-bottom: 15px;
}

.settings-list-panel .panel-heading h2,
.settings-list-panel .panel-heading p {
    margin-bottom: 4px;
}

.settings-list-panel .panel-heading > div > p:last-child {
    color: var(--muted);
    font-size: 0.84rem;
}

.settings-list-panel .primary-action,
.settings-modal .primary-action {
    padding: 10px 14px;
    color: white;
}

.settings-policy-table td:nth-child(3) {
    min-width: 340px;
    white-space: normal;
}

.settings-modal {
    width: min(100%, 720px);
}

.settings-modal-form {
    display: grid;
    gap: 13px;
    margin: 16px 0;
}

.settings-modal-form > label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 800;
}

.settings-modal-form input:not([type="checkbox"]),
.settings-modal-form select {
    width: 100%;
    min-height: 41px;
    padding: 9px 10px;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid #ccd6e2;
    border-radius: 7px;
}

.schedule-actions a {
    display: inline-flex;
    padding: 6px 9px;
    align-items: center;
    color: var(--slate);
    background: white;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-weight: 800;
    text-decoration: none;
}

@media (max-width: 900px) {
    .tenant-policy-grid,
    .alert-form-grid {
        grid-template-columns: 1fr;
    }

    .alert-form-grid .wide-field {
        grid-column: auto;
    }
}

/* Reporting layout v2: final cascade position is intentional. */
.executive-dashboard { min-height: calc(100vh - 52px); padding: 22px clamp(20px,3vw,44px) 40px; background: #f5f6f8; }
.dashboard-hero { max-width: 1440px; min-height: 44px; margin: 0 auto 16px; align-items: center; }
.dashboard-hero h1 { max-width: none; font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.dashboard-hero-copy > p { margin: 5px 0 0; font-size: .76rem; }
.dashboard-hero-actions a, .attention-action { min-height: 34px; padding: 0 13px; border-radius: 7px; font-size: .75rem; }
.dashboard-primary-action { background: #2563eb; box-shadow: none; }
.dashboard-pulse-grid, .dashboard-content-grid { max-width: 1440px; }
.dashboard-pulse-grid { gap: 0; margin-bottom: 14px; overflow: hidden; background: #fff; border: 1px solid #dfe3e8; border-radius: 10px; }
.pulse-card { min-height: 96px; padding: 15px 18px 14px; background: #fff; border: 0; border-right: 1px solid #dfe3e8; border-radius: 0; box-shadow: none; }
.pulse-card:last-child { border-right: 0; }
.pulse-card::after, .pulse-icon, .customer-stack { display: none; }
.pulse-card-top { font-size: .72rem; font-weight: 650; }
.pulse-card > strong { margin: 9px 0 7px; font-size: 1.45rem; font-weight: 700; line-height: 1; }
.dashboard-mini-chart { right: 8px; bottom: 1px; left: 55%; height: 35px; opacity: .42; }
.pulse-progress { height: 3px; margin-top: 9px; }
.dashboard-content-grid { grid-template-columns: minmax(0,2.15fr) minmax(280px,.85fr); gap: 14px; }
.dashboard-main-column, .dashboard-side-column { gap: 14px; }
.dashboard-glass-panel, .attention-panel { padding: 17px 18px; border-radius: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.dashboard-panel-heading h2 { font-size: .96rem; }
.dashboard-chart { height: 235px; margin-top: 2px; }
.chart-footer-note { grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 10px 0 0; background: transparent; border: 0; border-radius: 0; }
.chart-footer-note > span { display: none; }
.chart-footer-note p { max-height: 36px; font-size: .68rem; line-height: 1.35; }
.chart-footer-note p strong { display: inline; margin-right: 4px; }
.ai-briefing-card { padding: 18px; color: #172033; background: #fff; border: 1px solid #dfe3e8; border-left: 3px solid #2563eb; border-radius: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.ai-briefing-card::after, .ai-briefing-orb { display: none; }
.ai-briefing-card .eyebrow { color: #2563eb; }
.ai-briefing-card h2 { margin: 5px 0 8px; font-size: .95rem; }
.ai-briefing-card > p:not(.eyebrow) { color: #596579; font-size: .72rem; line-height: 1.5; }
.ai-briefing-card > a { margin-top: 12px; color: #2563eb; font-size: .7rem; }

.ai-analysis-workspace { gap: 12px; min-height: calc(100vh - 52px); padding: 18px clamp(20px,3vw,44px) 40px; background: #f5f6f8; }
.ai-analysis-hero { max-width: 1440px; width: 100%; margin: 0 auto; }
.ai-analysis-heading { gap: 0; }
.ai-orb { display: none; }
.ai-analysis-heading h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.ai-analysis-heading p:last-child { margin-top: 4px; font-size: .74rem; }
.analysis-status span { padding: 6px 9px; background: #fff; border-radius: 6px; font-size: .64rem; }
.ai-command-center { width: 100%; max-width: 1440px; margin: 0 auto; gap: 7px; padding: 12px; border-radius: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.command-label small { display: none; }
.ai-command-center .prompt-bar { grid-template-columns: 34px minmax(0,1fr) 105px; border-radius: 7px; }
.ai-command-center .prompt-bar textarea { height: 38px; min-height: 38px; padding: 9px 6px; font-size: .78rem; resize: none; }
.ai-command-center .prompt-bar > .prompt-spark { width: 30px; height: 30px; border-radius: 6px; }
.ai-command-center .primary-action { min-height: 32px; padding: 7px 10px; border-radius: 6px; box-shadow: none; font-size: .72rem; }
.ai-command-center .prompt-chips button { min-height: 26px; padding: 5px 8px; border-radius: 6px; font-size: .64rem; }
.ai-analysis-workspace .dashboard-board { grid-template-columns: minmax(0,2.2fr) minmax(280px,.8fr); gap: 12px; width: 100%; max-width: 1440px; margin: 0 auto; }
.ai-analysis-workspace .kpi-column { grid-column: 1/-1; grid-row: 1; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; overflow: hidden; background: #fff; border: 1px solid #dfe3e8; border-radius: 9px; }
.ai-analysis-workspace .chart-board { grid-column: 1; grid-row: 2; gap: 12px; }
.ai-analysis-workspace .insight-rail { grid-column: 2; grid-row: 2; gap: 12px; }
.ai-analysis-workspace .metric-tile, .ai-analysis-workspace .metric-tile.featured { min-height: 82px; padding: 13px 15px; color: #172033; background: #fff; border: 0; border-right: 1px solid #dfe3e8; border-radius: 0; box-shadow: none; }
.ai-analysis-workspace .metric-tile.featured span, .ai-analysis-workspace .metric-tile.featured small { color: #667085; }
.ai-analysis-workspace .metric-tile strong, .ai-analysis-workspace .metric-tile.featured strong { color: #172033; font-size: 1.35rem; }
.ai-analysis-workspace .mini-chart { position: absolute; visibility: hidden; }
.ai-analysis-workspace .analytics-panel { padding: 14px; border-radius: 9px; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.ai-analysis-workspace .hero-chart { min-height: 0; }
.ai-analysis-workspace .chart-surface { height: 230px; }
.ai-analysis-workspace .chart-surface.tall { height: 260px; }
.ai-analysis-workspace .compact-chart { height: 210px; }
.ai-analysis-workspace .collections-layout { grid-template-columns: 230px minmax(0,1fr); gap: 10px; }

@media (max-width: 1100px) {
    .dashboard-content-grid, .ai-analysis-workspace .dashboard-board { grid-template-columns: 1fr; }
    .ai-analysis-workspace .chart-board, .ai-analysis-workspace .insight-rail { grid-column: 1; grid-row: auto; }
}

/* Full-canvas reporting layout with readable desktop typography. */
.executive-dashboard,
.ai-analysis-workspace {
    width: 100%;
    padding-right: 24px;
    padding-left: 24px;
}

.dashboard-hero,
.dashboard-pulse-grid,
.dashboard-content-grid,
.ai-analysis-hero,
.ai-command-center,
.ai-analysis-workspace .dashboard-board {
    width: 100%;
    max-width: none;
}

.dashboard-hero h1,
.ai-analysis-heading h1 {
    font-size: 1.65rem;
}

.dashboard-hero-copy > p,
.ai-analysis-heading p:last-child {
    font-size: .84rem;
}

.eyebrow,
.command-label span {
    font-size: .72rem;
}

.pulse-card {
    min-height: 112px;
    padding: 17px 20px;
}

.pulse-card-top,
.metric-tile span {
    font-size: .82rem;
}

.pulse-card > strong,
.ai-analysis-workspace .metric-tile strong,
.ai-analysis-workspace .metric-tile.featured strong {
    font-size: 1.65rem;
}

.pulse-comparison,
.ai-analysis-workspace .metric-tile small {
    font-size: .74rem;
}

.dashboard-panel-heading h2,
.ai-analysis-workspace .panel-heading h2,
.ai-analysis-workspace .narrative-panel h2 {
    font-size: 1rem;
}

.ai-command-center {
    padding: 14px;
}

.ai-command-center .prompt-bar {
    grid-template-columns: 38px minmax(0,1fr) 118px;
}

.ai-command-center .prompt-bar textarea {
    height: 42px;
    min-height: 42px;
    font-size: .86rem;
}

.ai-command-center .prompt-bar > .prompt-spark {
    width: 34px;
    height: 34px;
}

.ai-command-center .primary-action {
    min-height: 36px;
    font-size: .78rem;
}

.ai-command-center .prompt-chips button,
.intent-summary,
.intent-summary strong {
    font-size: .74rem;
}

.ai-analysis-workspace .kpi-column {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ai-analysis-workspace .metric-tile,
.ai-analysis-workspace .metric-tile.featured {
    min-height: 102px;
    padding: 16px 18px;
}

.ai-analysis-workspace .analytics-panel {
    padding: 17px;
}

.ai-analysis-workspace .narrative-panel p,
.follow-up-hint,
.driver-item,
.question-list button,
.action-item,
.source-item {
    font-size: .82rem;
}

.ai-analysis-workspace .data-table th { font-size: .7rem; }
.ai-analysis-workspace .data-table td { font-size: .8rem; }
.chart-legend { font-size: .72rem; }

.dashboard-empty-state { display: grid; min-height: 190px; place-content: center; justify-items: center; gap: 5px; color: #667085; border-bottom: 1px solid #edf0f3; text-align: center; font-size: .75rem; }
.dashboard-empty-state strong { color: #344054; font-size: .84rem; }
.dashboard-empty-state a { margin-top: 5px; color: #2563eb; font-weight: 700; text-decoration: none; }
.compact-empty { display: grid; gap: 4px; padding: 17px 2px; color: #667085; font-size: .7rem; }
.compact-empty strong { color: #475467; font-size: .76rem; }
.ai-analysis-workspace .collections-layout.table-only { grid-template-columns: 1fr; }

.dashboard-skeleton { display: grid; gap: 14px; min-height: calc(100vh - 52px); padding: 26px clamp(20px,3vw,44px); background: #f5f6f8; }
.dashboard-skeleton * { animation: report-skeleton 1.1s ease-in-out infinite alternate; background: #e7e9ed; }
.skeleton-line { width: 220px; height: 24px; border-radius: 5px; }
.skeleton-metrics { display: grid; grid-template-columns: repeat(4,1fr); height: 98px; overflow: hidden; border-radius: 10px; }
.skeleton-metrics i { border-right: 1px solid #f5f6f8; }
.skeleton-panel { height: 330px; border-radius: 10px; }
@keyframes report-skeleton { to { background-color: #f0f1f3; } }

@media (max-width: 720px) {
    .executive-dashboard, .ai-analysis-workspace { padding: 15px 12px 28px; }
    .dashboard-pulse-grid, .ai-analysis-workspace .kpi-column, .skeleton-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); height: auto; }
    .pulse-card:nth-child(2), .ai-analysis-workspace .metric-tile:nth-child(2) { border-right: 0; }
    .pulse-card:nth-child(-n+2), .ai-analysis-workspace .metric-tile:nth-child(-n+2) { border-bottom: 1px solid #dfe3e8; }
    .ai-analysis-workspace .chart-board, .ai-analysis-workspace .insight-rail, .ai-analysis-workspace .collections-layout { grid-template-columns: 1fr; }
}

/* Navigation focuses the page heading for screen readers, without drawing a control outline. */
h1[tabindex="-1"]:focus {
    outline: none;
}
