/* ═══════════════════════════════════════════════════
   Dashboard Page
   ═══════════════════════════════════════════════════ */

/* ── Stat Cards Grid ── */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--md-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--elevation-1);
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: box-shadow var(--duration-short) var(--easing-standard);
}

.stat-card:hover {
    box-shadow: var(--elevation-2);
}

.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card__icon .material-symbols-outlined {
    font-size: 24px;
}

.stat-card__icon--primary {
    background: var(--md-primary-container);
    color: var(--md-on-primary-container);
}

.stat-card__icon--warning {
    background: #FFF8E1;
    color: #664D00;
}

.stat-card__icon--error {
    background: var(--md-error-container);
    color: var(--md-on-error-container);
}

.stat-card__icon--success {
    background: #E8F5E9;
    color: #1B5E20;
}

.stat-card__body {
    flex: 1;
    min-width: 0;
}

.stat-card__value {
    font-size: 32px;
    font-weight: 400;
    line-height: 1.1;
    color: var(--md-on-surface);
    margin-bottom: 4px;
}

.stat-card__label {
    font-size: 14px;
    color: var(--md-on-surface-variant);
}

.stat-card__trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.stat-card__trend--up {
    background: var(--md-error-container);
    color: var(--md-on-error-container);
}

.stat-card__trend--down {
    background: #E8F5E9;
    color: #1B5E20;
}

.stat-card__trend .material-symbols-outlined {
    font-size: 16px;
}

/* ── Dashboard Sections Layout ── */

.dashboard-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.dashboard-section {
    background: var(--md-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--elevation-1);
    padding: 20px;
}

.dashboard-section--full {
    grid-column: 1 / -1;
}

.dashboard-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.dashboard-section__title {
    font-size: 16px;
    font-weight: 500;
    color: var(--md-on-surface);
}

.dashboard-section__link {
    font-size: 13px;
    font-weight: 500;
    color: var(--md-primary);
}

.dashboard-section__link:hover {
    text-decoration: underline;
}

/* ── Recent Tasks List ── */

.recent-tasks {
    list-style: none;
}

.recent-task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--md-outline-variant);
}

.recent-task:last-child {
    border-bottom: none;
}

.recent-task__status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.recent-task__status-dot--new {
    background: var(--color-new);
}

.recent-task__status-dot--in-progress {
    background: var(--color-in-progress);
}

.recent-task__status-dot--review {
    background: var(--color-review);
}

.recent-task__status-dot--done {
    background: var(--color-done);
}

.recent-task__body {
    flex: 1;
    min-width: 0;
}

.recent-task__title {
    font-size: 14px;
    font-weight: 500;
    color: var(--md-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-task__meta {
    font-size: 12px;
    color: var(--md-on-surface-variant);
    margin-top: 2px;
}

.recent-task__priority {
    flex-shrink: 0;
}

.recent-task__assignee {
    flex-shrink: 0;
}

/* ── Tasks by Company (Horizontal Bars) ── */

.company-bars {
    list-style: none;
}

.company-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.company-bar:last-child {
    margin-bottom: 0;
}

.company-bar__name {
    width: 140px;
    font-size: 13px;
    font-weight: 500;
    color: var(--md-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.company-bar__track {
    flex: 1;
    height: 24px;
    background: var(--md-surface-container);
    border-radius: var(--radius-xs);
    overflow: hidden;
    display: flex;
}

.company-bar__segment {
    height: 100%;
    min-width: 2px;
    transition: width var(--duration-medium) var(--easing-standard);
}

.company-bar__segment--new {
    background: var(--color-new);
}

.company-bar__segment--in-progress {
    background: var(--color-in-progress);
}

.company-bar__segment--review {
    background: var(--color-review);
}

.company-bar__segment--done {
    background: var(--color-done);
}

.company-bar__count {
    width: 36px;
    text-align: right;
    font-size: 13px;
    font-weight: 500;
    color: var(--md-on-surface-variant);
    flex-shrink: 0;
}

/* ── Bar Legend ── */

.bar-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--md-outline-variant);
}

.bar-legend__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--md-on-surface-variant);
}

.bar-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.bar-legend__dot--new { background: var(--color-new); }
.bar-legend__dot--in-progress { background: var(--color-in-progress); }
.bar-legend__dot--review { background: var(--color-review); }
.bar-legend__dot--done { background: var(--color-done); }

/* ── SLA Stats ── */

.sla-list {
    list-style: none;
}

.sla-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--md-outline-variant);
}

.sla-item:last-child {
    border-bottom: none;
}

.sla-item__label {
    font-size: 14px;
    color: var(--md-on-surface);
}

.sla-item__value {
    font-size: 14px;
    font-weight: 500;
}

.sla-item__value--ok { color: var(--color-sla-ok); }
.sla-item__value--warn { color: var(--color-sla-warn); }
.sla-item__value--breach { color: var(--color-sla-breach); }
