.insights-studio-page {
    --insights-accent: #0f766e;
    --insights-accent-soft: rgba(15, 118, 110, 0.12);
    --insights-border: rgba(15, 23, 42, 0.08);
    --insights-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
    --insights-surface: #ffffff;
    --insights-surface-alt: #f4f7f8;
    --insights-text-soft: #5f6d7d;
}

.insights-studio-header {
    align-items: flex-start;
    gap: 16px;
}

.insights-studio-header-copy {
    max-width: 760px;
}

.insights-studio-kicker {
    color: var(--insights-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.insights-studio-header-copy .page-title {
    margin-bottom: 8px;
}

.insights-studio-header-copy p {
    color: var(--insights-text-soft);
    margin: 0;
    max-width: 680px;
}

.insights-studio-actions {
    flex-wrap: wrap;
}

.insights-studio-shell {
    display: grid;
    gap: 18px;
    grid-template-columns: 280px minmax(0, 1fr) 320px;
    min-height: calc(100vh - 260px);
}

.insights-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 248, 0.92));
    border: 1px solid var(--insights-border);
    border-radius: 24px;
    box-shadow: var(--insights-shadow);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.insights-panel-empty {
    align-items: center;
    justify-content: center;
}

.insights-panel-head {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 22px 22px 18px;
}

.insights-panel-head h2,
.insights-section-head h3 {
    font-family: "Montserrat", "Inter", sans-serif;
    margin: 0 0 8px;
}

.insights-panel-head p,
.insights-section-note,
.insights-directory-item p,
.insights-source-row p,
.insights-function-row p,
.insights-empty p {
    color: var(--insights-text-soft);
    margin: 0;
}

.insights-panel-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.insights-panel-kicker,
.insights-widget-order {
    color: var(--insights-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.insights-metric-chip {
    align-items: baseline;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    display: inline-flex;
    gap: 8px;
    padding: 8px 12px;
}

.insights-metric-chip span {
    color: var(--insights-text-soft);
    font-size: 12px;
}

.insights-metric-chip strong {
    font-size: 13px;
}

.insights-metric-chip.is-attention {
    border-color: rgba(217, 119, 6, 0.25);
    color: #92400e;
}

.insights-metric-chip.is-muted {
    background: rgba(15, 23, 42, 0.03);
}

.insights-directory-toolbar,
.insights-catalog-toolbar {
    padding: 0 22px 16px;
}

.insights-directory-templates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 22px 18px;
}

.insights-template-chip,
.insights-path-chip {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    color: #0f172a;
    cursor: pointer;
    font-size: 12px;
    padding: 9px 12px;
    transition: border-color 160ms ease, transform 160ms ease;
}

.insights-template-chip:hover,
.insights-path-chip:hover,
.insights-directory-item:hover {
    border-color: rgba(15, 118, 110, 0.28);
    transform: translateY(-1px);
}

.insights-directory-list,
.insights-catalog-section,
.insights-workspace-panel {
    min-height: 0;
}

.insights-directory-list {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    padding: 0 18px 18px;
}

.insights-directory-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    cursor: pointer;
    padding: 14px;
    text-align: left;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.insights-directory-item.is-active {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.98));
    border-color: rgba(15, 118, 110, 0.28);
}

.insights-directory-item-head,
.insights-directory-item-meta,
.insights-widget-card-head,
.insights-widget-card-body,
.insights-source-meta,
.insights-widget-actions,
.insights-line-labels,
.insights-empty-actions {
    display: flex;
    gap: 10px;
}

.insights-directory-item-head,
.insights-widget-card-head {
    align-items: flex-start;
    justify-content: space-between;
}

.insights-directory-item-meta,
.insights-source-meta {
    color: var(--insights-text-soft);
    flex-wrap: wrap;
    font-size: 12px;
    margin: 8px 0;
}

.insights-workspace-panel {
    padding-bottom: 16px;
}

.insights-workspace-head {
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.insights-workspace-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 20px 22px 0;
}

.insights-section {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 20px;
    padding: 18px;
}

.insights-section-head {
    align-items: baseline;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.insights-settings-grid,
.insights-filters-grid,
.insights-widget-grid {
    gap: 14px 16px;
}

.insights-span-2 {
    grid-column: span 2;
}

.insights-widgets-section {
    margin: 18px 22px 0;
}

.insights-widgets-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.insights-widget-card {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 22px;
    overflow: hidden;
}

.insights-widget-card-head {
    padding: 16px 18px;
}

.insights-widget-card-head h4 {
    margin: 6px 0 4px;
}

.insights-widget-meta {
    color: var(--insights-text-soft);
    font-size: 12px;
}

.insights-widget-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.insights-widget-card-body {
    border-top: 1px solid rgba(15, 23, 42, 0.05);
    flex-direction: column;
    padding: 18px;
}

.insights-widget-preview {
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.04), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(15, 23, 42, 0.05);
    border-radius: 18px;
    min-height: 150px;
    padding: 16px;
}

.insights-preview-state {
    align-items: center;
    color: var(--insights-text-soft);
    display: flex;
    height: 100%;
    justify-content: center;
    min-height: 116px;
    text-align: center;
}

.insights-preview-state.is-error {
    color: #b91c1c;
}

.insights-kpi-preview {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 110px;
    justify-content: center;
}

.insights-kpi-preview span,
.insights-kpi-preview small {
    color: var(--insights-text-soft);
}

.insights-kpi-preview strong {
    font-family: "Montserrat", "Inter", sans-serif;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1;
}

.insights-bar-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.insights-bar-label,
.insights-bar-value {
    font-size: 12px;
}

.insights-bar-label {
    color: var(--insights-text-soft);
}

.insights-bar-track {
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
}

.insights-bar-fill {
    background: linear-gradient(90deg, var(--insights-accent), #14b8a6);
    border-radius: 999px;
    height: 100%;
}

.insights-line-preview svg {
    height: 164px;
    width: 100%;
}

.insights-line-preview circle {
    fill: #14b8a6;
}

.insights-line-path {
    fill: none;
    stroke: var(--insights-accent);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.insights-line-labels {
    flex-wrap: wrap;
    margin-top: 8px;
}

.insights-line-label {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 92px;
    padding: 10px 12px;
}

.insights-line-label span {
    color: var(--insights-text-soft);
    font-size: 11px;
}

.insights-preview-table {
    background: transparent;
    margin: 0;
}

.insights-catalog {
    min-height: 0;
}

.insights-catalog .insights-panel {
    height: 100%;
}

.insights-catalog-section {
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    padding: 18px 22px;
}

.insights-catalog-section h3 {
    margin: 0 0 12px;
}

.insights-source-list,
.insights-function-list,
.insights-catalog-entities {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insights-source-row,
.insights-function-row,
.insights-entity-group {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 18px;
    padding: 14px;
}

.insights-entity-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.insights-entity-head span {
    color: var(--insights-text-soft);
    font-size: 12px;
}

.insights-path-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.insights-empty {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: auto;
    max-width: 460px;
    padding: 34px 24px;
    text-align: center;
}

.insights-empty-inline {
    background: rgba(255, 255, 255, 0.76);
    border: 1px dashed rgba(15, 23, 42, 0.12);
    border-radius: 20px;
    margin: 0;
    max-width: none;
}

.insights-empty-actions {
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

@media (max-width: 1440px) {
    .insights-studio-shell {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .insights-studio-catalog {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1040px) {
    .insights-studio-shell,
    .insights-workspace-grid {
        grid-template-columns: 1fr;
    }

    .insights-span-2 {
        grid-column: span 1;
    }

    .insights-bar-row {
        grid-template-columns: 1fr;
    }
}
