:root {
    --arta-bg: #f8fafc;
    --arta-surface: #ffffff;
    --arta-border: #e2e8f0;
    --arta-text: #0f172a;
    --arta-muted: #475569;
    --arta-accent: #dc2626;
    --arta-accent-soft: #fee2e2;
    --arta-highlight: #1d4ed8;
    --arta-danger: #dc2626;
    --arta-warning: #facc15;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dashboard-wrapper {
    min-height: 100vh;
    background: var(--arta-bg);
}

.dashboard-view {
    min-height: 100vh;
}

.dashboard-shell {
    color: var(--arta-text);
    min-height: 100vh;
    padding-bottom: 4rem;
}

.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--arta-border);
}

.dashboard-header__inner {
    margin: 0 auto;
    padding: 1.5rem 1.5rem;
    max-width: 1700px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .dashboard-header__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.dashboard-header__title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-header__badge {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1d4ed8 0%, #facc15 50%, #dc2626 100%);
}

.dashboard-header__search {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    max-width: 520px;
}

.dashboard-header__search input {
    flex: 1;
    border: 1px solid var(--arta-border);
    border-radius: 14px;
    padding: 0.55rem 0.9rem;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dashboard-header__search input:focus {
    outline: none;
    border-color: var(--arta-highlight);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.25);
}

.dashboard-header__search button {
    border: none;
    border-radius: 14px;
    background: var(--arta-accent);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.55rem 1.1rem;
    font-weight: 600;
    transition: background 0.2s;
}

.dashboard-header__search button:hover,
.dashboard-header__search button:focus {
    background: #b91c1c;
}

.dashboard-main {
    max-width: 1700px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.dashboard-card {
    background: var(--arta-surface);
    border: 1px solid var(--arta-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.card-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.dashboard-card--flat {
    box-shadow: none;
}

.kpi-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.kpi-grid--enhanced {
    align-items: stretch;
}

.kpi-summary {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.08));
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
}

.kpi-summary__header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .kpi-summary__header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
}

.kpi-summary__caption {
    color: var(--arta-muted);
    font-weight: 500;
}

.kpi-summary__meta {
    text-align: left;
}

@media (min-width: 768px) {
    .kpi-summary__meta {
        text-align: right;
    }
}

.kpi-summary__meta time {
    font-weight: 600;
}

.kpi-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover,
.kpi-card:focus {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    outline: none;
}

.kpi-card:focus-visible {
    outline: 2px solid var(--arta-highlight);
    outline-offset: 2px;
}

.kpi-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.kpi-card__avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.05em;
}

.kpi-card__value {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
}

.kpi-card__value .kpi-delta {
    font-size: 0.75rem;
}

.kpi-card__hint {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--arta-muted);
}

.kpi-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--arta-muted);
    margin-bottom: 0.4rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-delta {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
}

.kpi-delta--positive {
    color: var(--arta-highlight);
    background: rgba(29, 78, 216, 0.12);
}

.kpi-delta--negative {
    color: #b91c1c;
    background: rgba(248, 113, 113, 0.12);
}

.kpi-tab-nav {
    margin-top: 1rem;
}

.kpi-tab-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kpi-tab-nav button {
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(255, 255, 255, 0.3);
    color: var(--arta-primary, #1d4ed8);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.kpi-tab-nav button:hover {
    background: rgba(37, 99, 235, 0.12);
    color: #1e3a8a;
}

.kpi-tab-nav button.is-active {
    background: #2563eb;
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}

.kpi-tab-panel {
    margin-top: 1.5rem;
}

.kpi-tab-panel__body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.kpi-tab-panel__card {
    min-height: 180px;
}

.kpi-tab-panel__status {
    font-size: 0.85rem;
    color: var(--arta-muted);
    margin-bottom: 0;
}

.kpi-competitiveness__table {
    min-width: 720px;
}

.kpi-competitiveness__table th {
    background: rgba(37, 99, 235, 0.08);
    white-space: nowrap;
}

.kpi-competitiveness__table td,
.kpi-competitiveness__table th {
    vertical-align: middle;
}

.kpi-competitiveness__gauge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(148, 163, 184, 0.18);
    color: #1f2937;
}

.kpi-competitiveness__gauge--top {
    background: rgba(16, 185, 129, 0.18);
    color: #047857;
}

.kpi-competitiveness__gauge--middle {
    background: rgba(59, 130, 246, 0.18);
    color: #1d4ed8;
}

.kpi-competitiveness__gauge--bottom {
    background: rgba(248, 113, 113, 0.18);
    color: #b91c1c;
}

.chart-grid {
    display: grid;
    gap: 1.5rem;
}

.chart-container {
    position: relative;
    height: 320px;
}

.chart-container--sm {
    height: 260px;
}

@media (min-width: 1024px) {
    .chart-grid--two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-grid--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .chart-grid__wide {
        grid-column: span 2;
    }
}

.section-heading {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.leaderboard-table,
.scorecard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.leaderboard-table th,
.leaderboard-table td,
.scorecard-table th,
.scorecard-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--arta-border);
}

.leaderboard-table thead tr,
.scorecard-table thead tr {
    color: var(--arta-muted);
    background: #f1f5f9;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
}

.scorecard-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.scorecard-badge--good {
    color: var(--arta-highlight);
    background: rgba(29, 78, 216, 0.12);
}

.scorecard-badge--warn {
    color: #854d0e;
    background: rgba(250, 204, 21, 0.25);
}

.scorecard-badge--neutral {
    color: var(--arta-muted);
    background: rgba(148, 163, 184, 0.2);
}

.artemis-kpi-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.artemis-kpi-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

@media (min-width: 640px) {
    .artemis-kpi-header {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
    }
}

.artemis-kpi-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .artemis-kpi-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

.artemis-kpi-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.artemis-chart-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.artemis-chart-legend li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
}

.artemis-chart-legend__swatch {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.artemis-chart-legend__label {
    flex: 1;
    color: var(--arta-muted);
}

.artemis-chart-legend__value {
    font-weight: 600;
    color: var(--arta-text);
    white-space: nowrap;
}

.artemis-chart-legend__pct {
    color: var(--arta-muted);
    font-weight: 400;
    margin-left: 0.25rem;
}

.artemis-dialog-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .artemis-dialog-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

.artemis-dialog-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.artemis-dialog-card__header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.artemis-kpi-message {
    font-size: 0.9rem;
}

.table-scroll {
    overflow-x: auto;
}

.scorecard-toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .scorecard-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.scorecard-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.scorecard-export {
    border: 1px solid var(--arta-highlight);
    background: #fff;
    color: var(--arta-highlight);
    border-radius: 12px;
    padding: 0.45rem 1.1rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.scorecard-export:hover,
.scorecard-export:focus {
    background: var(--arta-highlight);
    color: #fff;
}

.heatmap-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .heatmap-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.heatmap-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.heatmap-filter-button {
    border: 1px solid var(--arta-border);
    background: #fff;
    color: var(--arta-muted);
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.heatmap-filter-button:hover,
.heatmap-filter-button:focus {
    color: var(--arta-text);
    border-color: var(--arta-highlight);
}

.heatmap-filter-button.is-active {
    background: var(--arta-highlight);
    color: #fff;
    border-color: transparent;
}

.chart-toolbar {
    margin-bottom: 1rem;
}

.chart-toolbar__group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.heatmap-map {
    height: 520px;
    border-radius: 20px;
    border: 1px solid var(--arta-border);
    overflow: hidden;
}

.heatmap-card {
    position: relative;
}

.heatmap-legend {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--arta-muted);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.heatmap-legend__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.heatmap-legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.tala-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626, #1d4ed8);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(29, 78, 216, 0.35);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 500;
}

.tala-button:hover,
.tala-button:focus {
    transform: translateY(-2px);
    box-shadow: 0 24px 44px rgba(220, 38, 38, 0.35);
}

.tala-panel {
    position: fixed;
    right: 24px;
    bottom: 104px;
    width: 360px;
    max-height: 70vh;
    display: none;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    border: 1px solid var(--arta-border);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    z-index: 500;
}

@media (max-width: 480px) {
    .tala-panel {
        right: 16px;
        left: 16px;
        width: auto;
    }
}

.tala-panel.is-open {
    display: flex;
}

.tala-panel__header {
    padding: 1.1rem 1.25rem;
    background: linear-gradient(135deg, #1d4ed8, #dc2626);
    color: #fff;
}

.tala-panel__body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    background: #f8fafc;
}

.tala-panel__footer {
    padding: 0.9rem 1rem;
    background: #f1f5f9;
    display: flex;
    gap: 0.75rem;
}

.tala-panel__footer input {
    flex: 1;
    border: 1px solid var(--arta-border);
    border-radius: 14px;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
}

.tala-panel__footer button {
    border: none;
    border-radius: 14px;
    background: var(--arta-accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.55rem 1.1rem;
}

.tala-msg {
    max-width: 85%;
    padding: 0.5rem 0.85rem;
    border-radius: 14px;
    font-size: 0.8rem;
    line-height: 1.35;
}

.tala-msg-wrap {
    display: flex;
    margin-bottom: 0.5rem;
}

.tala-msg-wrap.you {
    justify-content: flex-end;
}

.tala-msg-wrap.ai {
    justify-content: flex-start;
}

.tala-msg--you {
    margin-left: auto;
    background: var(--arta-accent);
    color: #fff;
}

.tala-msg--ai {
    margin-right: auto;
    background: #fff;
    border: 1px solid var(--arta-border);
    color: var(--arta-text);
}

.badge-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

@media (max-width: 768px) {
    .dashboard-main {
        padding: 2rem 1.25rem;
    }
}
