/* Dashboard */

.dashboard-shell {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.95fr;
    gap: 18px;
    align-items: start;
}

.dash-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
    margin-top: 2px;
}

/* Generic interactive reset */

.dash-proj-row,
.dash-note-card,
.dash-prompt-row,
.btn-icon-sm {
    font: inherit;
    color: inherit;
    text-align: left;
}

.dash-proj-row,
.dash-note-card,
.dash-prompt-row {
    appearance: none;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
}

.dash-proj-row:focus-visible,
.dash-note-card:focus-visible,
.dash-prompt-row:focus-visible,
.btn-icon-sm:focus-visible,
.btn-link:focus-visible,
.btn-primary:focus-visible {
    outline: 2px solid rgba(127, 143, 255, 0.9);
    outline-offset: 2px;
}

/* Intro / Hero */

.dash-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-xl);
    border: 1px solid rgba(79, 104, 232, 0.16);
    background:
        radial-gradient(circle at top right, rgba(79, 104, 232, 0.16) 0%, transparent 34%),
        radial-gradient(circle at left center, rgba(28, 184, 112, 0.08) 0%, transparent 26%),
        linear-gradient(135deg, #1a2a40 0%, #111e30 100%);
    padding: 22px 22px 20px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.dash-hero::after {
    content: "";
    position: absolute;
    inset: auto -60px -60px auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.10) 0%, transparent 68%);
    pointer-events: none;
}

.dash-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.dash-hero-copy h2 {
    margin-bottom: 6px;
}

.dash-hero-copy p {
    margin: 0;
    color: var(--text-3);
    max-width: 560px;
    line-height: 1.45;
}

.dash-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dash-mini-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.dash-mini-pill {
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.dash-mini-pill strong {
    color: var(--text-1);
    margin-right: 5px;
}

/* Insight tiles */

.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 124px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 16px 15px;
    border-radius: var(--r-lg);
    border: 1px solid rgba(var(--sc-rgb, 127, 143, 255), 0.20);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.00) 100%),
        linear-gradient(160deg, rgba(var(--sc-rgb, 127, 143, 255), 0.15) 0%, rgba(37, 48, 65, 0.95) 68%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 10px 22px rgba(0, 0, 0, 0.14);
    transition:
        transform 0.14s ease,
        box-shadow 0.14s ease,
        border-color 0.14s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 16px 28px rgba(0, 0, 0, 0.18);
    border-color: rgba(var(--sc-rgb, 127, 143, 255), 0.34);
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: rgba(var(--sc-rgb, 127, 143, 255), 0.95);
}

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

.stat-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 18px;
    line-height: 1;
    color: rgba(var(--sc-rgb, 127, 143, 255), 1);
    background: rgba(var(--sc-rgb, 127, 143, 255), 0.14);
    border: 1px solid rgba(var(--sc-rgb, 127, 143, 255), 0.18);
}

.stat-card-kicker {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -0.04em;
    line-height: 1.08;
}

.stat-card-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-3);
}

.stat-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.stat-card-trend {
    font-size: 11.5px;
    color: var(--text-4);
}

/* Today panel */

.dash-today-panel {
    overflow: hidden;
}

.dtp-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    align-items: start;
}

.dtp-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.dtp-ring {
    --ring-pct: 0;
    position: relative;
    width: 156px;
    height: 156px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, #152030 0 57%, transparent 58%),
        conic-gradient(var(--accent) calc(var(--ring-pct) * 1%), rgba(255, 255, 255, 0.07) 0);
    box-shadow:
        inset 0 0 0 10px rgba(255, 255, 255, 0.02),
        0 8px 20px rgba(0, 0, 0, 0.26);
}

.dtp-ring.overload {
    background:
        radial-gradient(circle at 50% 50%, #152030 0 57%, transparent 58%),
        conic-gradient(var(--danger) calc(var(--ring-pct) * 1%), rgba(255, 255, 255, 0.08) 0);
}

.dtp-ring-inner {
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%),
        #131e2e;
    border: 1px solid rgba(255, 255, 255, 0.04);
    text-align: center;
}

.dtp-ring-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--text-1);
    letter-spacing: -0.04em;
}

.dtp-ring-sub {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dtp-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.dtp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.dtp-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dtp-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.dtp-count-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--success-soft);
    border: 1px solid rgba(28, 184, 112, 0.26);
    color: var(--success);
}

.dtp-type-badge {
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--danger-soft);
    border: 1px solid rgba(224, 78, 100, 0.26);
    color: var(--danger);
}

.dtp-type-badge--andere {
    background: var(--warning-soft);
    border-color: rgba(212, 149, 46, 0.26);
    color: var(--warning);
}

.dtp-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.dtp-metric {
    padding: 12px 12px 11px;
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.dtp-metric-label {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-4);
    margin-bottom: 6px;
}

.dtp-metric-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -0.03em;
}

.dtp-stream {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dtp-step {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.015) 100%);
    transition:
        transform 0.12s ease,
        border-color 0.12s ease,
        background 0.12s ease;
}

.dtp-step:hover {
    transform: translateY(-1px);
    border-color: rgba(79, 104, 232, 0.22);
    background: linear-gradient(180deg, rgba(79, 104, 232, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.dtp-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.95;
}

.dtp-step-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dtp-step--done .dtp-step-title {
    color: var(--text-4);
    text-decoration: line-through;
}

.dtp-step--done .dtp-step-dot {
    opacity: 0.45;
}

.dtp-step-h {
    font-size: 11.5px;
    color: var(--text-4);
    padding-left: 4px;
}

.dtp-step-more {
    padding-top: 4px;
    font-size: 12px;
    color: var(--text-4);
    font-style: italic;
}

/* Projects */

.dash-proj-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dash-proj-row {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    padding: 14px 15px 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--border-soft);
    background:
        radial-gradient(circle at right top, rgba(var(--proj-rgb, 79, 104, 232), 0.12) 0%, transparent 24%),
        linear-gradient(180deg, #1a2b40 0%, #152336 100%);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transition:
        transform 0.14s ease,
        box-shadow 0.14s ease,
        border-color 0.14s ease;
}

.dash-proj-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.24);
    border-color: rgba(var(--proj-rgb, 79, 104, 232), 0.22);
}

.dash-proj-row::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--proj-color, var(--accent));
}

.dpr-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    min-width: 0;
}

.dpr-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--proj-color, var(--accent));
    box-shadow: 0 0 0 4px rgba(var(--proj-rgb, 79, 104, 232), 0.10);
}

.dpr-name {
    flex: 1;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dpr-pct {
    font-size: 12px;
    font-weight: 800;
    color: var(--proj-color, var(--accent));
}

.dpr-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 8px;
}

.dpr-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0%, var(--proj-color, var(--accent)) 100%);
    transition: width 0.3s ease;
}

.dpr-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 11.5px;
    color: var(--text-4);
}

.dpr-open-chip {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-3);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Notes */

.dash-notes-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.dash-note-card {
    position: relative;
    padding: 14px 15px;
    border-radius: var(--r-md);
    border: 1px solid rgba(212, 149, 46, 0.16);
    background:
        linear-gradient(180deg, var(--warning-soft) 0%, rgba(255, 255, 255, 0.01) 100%),
        var(--surface);
    cursor: pointer;
    transition:
        transform 0.14s ease,
        box-shadow 0.14s ease,
        border-color 0.14s ease;
}

.dash-note-card:hover {
    transform: translateY(-2px) rotate(-0.2deg);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
    border-color: rgba(212, 149, 46, 0.28);
}

.dash-note-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 18px 0 0 18px;
    background: var(--warning);
}

.dash-note-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-note-pin {
    font-size: 11px;
    opacity: 0.95;
}

.dash-note-preview {
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-3);
    white-space: pre-wrap;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Prompts */

.dash-prompt-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-prompt-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    cursor: pointer;
    transition:
        transform 0.12s ease,
        border-color 0.12s ease,
        background 0.12s ease;
}

.dash-prompt-row:hover {
    transform: translateX(2px);
    border-color: rgba(79, 104, 232, 0.22);
    background: linear-gradient(180deg, rgba(79, 104, 232, 0.07) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.dash-prompt-index {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-2);
    background: rgba(255, 255, 255, 0.06);
}

.dash-prompt-row-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    min-width: 0;
}

.dash-prompt-cat {
    flex-shrink: 0;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(79, 104, 232, 0.22);
    color: #c0ccf8;
}

.dash-prompt-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-prompt-model {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-4);
    white-space: nowrap;
}

/* Forecast */

.dash-forecast-panel {
    margin-top: 0;
}

.dash-forecast-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dash-forecast-total {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(79, 104, 232, 0.26);
    color: var(--accent-strong);
}

.week-nav-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.week-nav-label {
    font-size: 12.5px;
    color: var(--text-3);
    white-space: nowrap;
    min-width: 110px;
    text-align: center;
}

.btn-icon-sm {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        transform 0.12s ease;
}

.btn-icon-sm:hover {
    background: var(--surface-3);
    border-color: rgba(79, 104, 232, 0.30);
    color: var(--accent-strong);
    transform: translateY(-1px);
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    padding-top: 8px;
}

.forecast-day {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.forecast-day-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.forecast-day.today .forecast-day-name,
.forecast-day.today .forecast-day-num {
    color: var(--accent-strong);
}

.forecast-day-name {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
}

.forecast-day-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
}

.forecast-card {
    position: relative;
    min-height: 158px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
    overflow: hidden;
    padding: 12px 10px 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.forecast-day.non-work .forecast-card {
    justify-content: center;
}

.forecast-cap-line {
    position: absolute;
    left: 10px;
    right: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.16);
    z-index: 1;
}

.forecast-bar-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 112px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.forecast-bar-fill {
    width: 100%;
    max-width: 44px;
    background: linear-gradient(180deg, #7d93f4 0%, var(--accent) 100%);
    opacity: 0.96;
    border-radius: 14px 14px 10px 10px;
    transition: height 0.28s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.forecast-bar-fill.overload {
    background: linear-gradient(180deg, #f0a0ae 0%, var(--danger) 100%);
}

.forecast-blocked {
    font-size: 22px;
    color: var(--text-3);
    opacity: 0.95;
}

.forecast-day-label {
    min-height: 16px;
    font-size: 10px;
    color: var(--text-3);
    text-align: center;
}

.forecast-day-meta {
    position: relative;
    z-index: 2;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-4);
    text-align: center;
}

.forecast-legend {
    margin-top: 12px;
    font-size: 11.5px;
    color: var(--text-3);
}

/* Utility */

.dash-empty-state {
    padding: 16px 0 4px;
}

.prompt-cat-badge {
    font-size: 10.5px;
    background: var(--accent-soft);
    color: #c0ccf8;
    padding: 4px 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(79, 104, 232, 0.22);
}

/* Responsive */

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

    .dash-bottom-row {
        grid-template-columns: 1fr;
    }

    .dtp-layout {
        grid-template-columns: 1fr;
    }

    .dtp-visual {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 900px) {
    .stat-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .dash-hero-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-header {
        gap: 10px;
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }

    .dtp-metrics {
        grid-template-columns: 1fr;
    }

    .forecast-grid {
        grid-template-columns: 1fr;
    }

    .week-nav-label {
        min-width: auto;
    }
}