/* Styles specific to the Dashboard page */

/* Metric cards and panels */
.metric-card, .saas-panel {
    border-radius: 20px;
    background: rgba(17,24,39,.84);
    border: 1px solid rgba(148,163,184,.16);
    box-shadow: 0 20px 50px rgba(0,0,0,.22);
}

.metric-card {
    padding: 22px;
    min-height: 120px;
}

.metric-card span {
    color: #93C5FD;
    font-weight: 800;
}

.metric-card strong {
    display: block;
    font-size: 36px;
    margin: 8px 0;
    letter-spacing: -.05em;
    color: #F9FAFB;
}

.metric-card small {
    color: #9CA3AF;
}

/* Panel titles and section headers */
.panel-title {
    font-weight: 800;
    color: #F9FAFB;
    margin-bottom: 14px;
    font-size: 18px;
}

.row-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Recent items list */
.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(148,163,184,.12);
}

.recent-item span {
    color: #9CA3AF;
    font-size: 13px;
}

/* Chart placeholder for dashboard bar chart */
.chart-placeholder {
    height: 310px;
    display: flex;
    align-items: end;
    gap: 22px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg,rgba(30,41,59,.65),rgba(15,23,42,.65));
    border: 1px solid rgba(148,163,184,.10);
}

.chart-bar {
    flex: 1;
    min-height: 44px;
    border-radius: 14px 14px 6px 6px;
    background: linear-gradient(180deg,#3B82F6,#1E3A8A);
    display: flex;
    align-items: end;
    justify-content: center;
    padding: 8px;
    color: #BFDBFE;
    font-size: 12px;
    font-weight: 700;
}
.recent-item small {
    display: block;
    max-width: 520px;
    color: #CBD5E1;
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.35;
}
/* Light mode dashboard overrides */

.light-mode .metric-card,
.light-mode .saas-panel {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
}

    .light-mode .metric-card span {
        color: #2563EB;
    }

    .light-mode .metric-card strong {
        color: #111827;
    }

    .light-mode .metric-card small {
        color: #64748B;
    }

.light-mode .panel-title {
    color: #111827;
}

.light-mode .recent-item {
    border-bottom: 1px solid #E5E7EB;
}

    .light-mode .recent-item span {
        color: #64748B;
    }

    .light-mode .recent-item small {
        color: #334155;
    }

.light-mode .chart-placeholder {
    background: linear-gradient(180deg, #F8FAFC, #EEF2FF);
    border: 1px solid #E5E7EB;
}

.light-mode .chart-bar {
    background: linear-gradient(180deg, #60A5FA, #2563EB);
    color: #FFFFFF;
}
/* Fix top empty space after removing global search */

.topbar {
    min-height: 56px !important;
    height: 56px !important;
    padding: 0 24px !important;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.topbar-no-search {
    min-height: 56px !important;
    height: 56px !important;
    justify-content: flex-end !important;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-content {
    padding-top: 0 !important;
}

    .main-content .mud-container {
        padding-top: 24px !important;
    }

.dashboard-header {
    align-items: flex-start;
    margin-bottom: 18px;
}

.dashboard-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
}

    .dashboard-actions .mud-button-root {
        white-space: nowrap;
        min-width: max-content;
    }

@media (max-width: 1200px) {
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* Dashboard header fix */

.dashboard-header {
    align-items: flex-start;
    margin-bottom: 18px;
}

.dashboard-title {
    min-width: 260px;
}

.dashboard-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
}

    .dashboard-actions .mud-button-root {
        white-space: nowrap;
        min-width: max-content;
    }

/* Light mode button contrast */
.light-mode .dashboard-actions .mud-button-outlined {
    color: #111827 !important;
    border-color: #334155 !important;
    background: #FFFFFF !important;
}

.light-mode .dashboard-actions .mud-button-filled-primary {
    background: #2563EB !important;
    color: #FFFFFF !important;
}

/* Range buttons light mode */
.light-mode .range-button {
    background: #FFFFFF !important;
    color: #111827 !important;
    border: 1px solid #CBD5E1 !important;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .12);
}

    .light-mode .range-button.active,
    .light-mode .range-button.mud-button-filled-primary {
        background: #2563EB !important;
        color: #FFFFFF !important;
        border-color: #2563EB !important;
    }

/* If screen is smaller, actions go under title cleanly */
@media (max-width: 1200px) {
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

.trend-chart {
    height: 260px;
    width: 100%;
    border-radius: 18px;
    background: rgba(15, 23, 42, .42);
    border: 1px solid rgba(148, 163, 184, .14);
    padding: 8px;
    overflow: hidden;
}

    .trend-chart svg {
        width: 100%;
        height: 100%;
        display: block;
    }

.chart-grid-line {
    stroke: rgba(148, 163, 184, .18);
    stroke-width: 1;
}

.trend-area {
    fill: url(#trendFill);
}

.trend-line {
    fill: none;
    stroke: #8B5CF6;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 8px 18px rgba(139, 92, 246, .35));
}

.trend-dot {
    fill: #A78BFA;
    stroke: #0B1220;
    stroke-width: 3;
}

.trend-label {
    fill: #CBD5E1;
    font-size: 13px;
    font-weight: 700;
}

.light-mode .trend-chart {
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
}

.light-mode .chart-grid-line {
    stroke: #E2E8F0;
}

.light-mode .trend-dot {
    stroke: #FFFFFF;
}

.light-mode .trend-label {
    fill: #475569;
}
.trend-chart {
    height: 260px;
    width: 100%;
    border-radius: 18px;
    background: rgba(15, 23, 42, .42);
    border: 1px solid rgba(148, 163, 184, .14);
    padding: 8px 12px 10px;
    overflow: hidden;
}

    .trend-chart svg {
        width: 100%;
        height: 220px;
        display: block;
    }

.trend-label-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: -2px;
}

    .trend-label-row span {
        text-align: center;
        color: #CBD5E1;
        font-size: 12px;
        font-weight: 700;
    }

.chart-grid-line {
    stroke: rgba(148, 163, 184, .18);
    stroke-width: 1;
}

.trend-area {
    fill: url(#trendFill);
}

.trend-line {
    fill: none;
    stroke: #8B5CF6;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 8px 18px rgba(139, 92, 246, .35));
}

.trend-dot {
    fill: #A78BFA;
    stroke: #0B1220;
    stroke-width: 3;
}

.light-mode .trend-chart {
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
}

.light-mode .chart-grid-line {
    stroke: #E2E8F0;
}

.light-mode .trend-dot {
    stroke: #FFFFFF;
}

.light-mode .trend-label-row span {
    color: #475569;
}
/* Action dashboard / operational overview */
.action-rules-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, .55);
    border: 1px solid rgba(148, 163, 184, .18);
    color: #cbd5e1;
}

.action-rules-strip span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(30, 41, 59, .7);
    border: 1px solid rgba(148, 163, 184, .14);
    font-size: .82rem;
}

.action-panel {
    min-height: 100%;
}

.action-panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.action-task-list,
.compact-action-list,
.timeline-mini-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.action-task-row,
.compact-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 13px 14px;
    border-radius: 16px;
    color: inherit;
    text-decoration: none;
    background: rgba(15, 23, 42, .62);
    border: 1px solid rgba(148, 163, 184, .15);
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.action-task-row:hover,
.compact-action-row:hover {
    transform: translateY(-1px);
    background: rgba(30, 41, 59, .78);
    border-color: rgba(59, 130, 246, .45);
}

.action-task-main {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.action-task-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.action-task-title b,
.compact-action-row b,
.timeline-mini-row b,
.team-action-card b {
    color: #f8fafc;
}

.action-task-main span,
.compact-action-row small,
.timeline-mini-row span,
.timeline-mini-row small,
.team-action-card small {
    color: #94a3b8;
}

.action-task-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
    text-align: right;
    min-width: 190px;
}

.action-task-meta small {
    width: 100%;
    color: #fbbf24;
}

.compact-action-row {
    justify-content: flex-start;
}

.compact-action-row div {
    display: grid;
    gap: 3px;
}

.dashboard-empty-state {
    padding: 18px;
    border-radius: 16px;
    color: #94a3b8;
    background: rgba(15, 23, 42, .45);
    border: 1px dashed rgba(148, 163, 184, .2);
    margin-top: 12px;
}

.dashboard-empty-state.compact {
    padding: 12px;
}

.timeline-mini-row {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 11px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(15, 23, 42, .62);
    border: 1px solid rgba(148, 163, 184, .15);
}

.timeline-mini-row .mud-icon-root {
    color: #60a5fa;
    padding: 7px;
    border-radius: 12px;
    background: rgba(59, 130, 246, .12);
}

.timeline-mini-row div {
    display: grid;
    gap: 3px;
}

.team-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.team-action-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(15, 23, 42, .62);
    border: 1px solid rgba(148, 163, 184, .15);
}

.light-mode .action-rules-strip,
.light-mode .action-task-row,
.light-mode .compact-action-row,
.light-mode .timeline-mini-row,
.light-mode .team-action-card,
.light-mode .dashboard-empty-state {
    background: #ffffff !important;
    border-color: #e5e7eb !important;
    color: #334155 !important;
}

.light-mode .action-rules-strip span {
    background: #f8fafc !important;
    border-color: #e5e7eb !important;
    color: #475569 !important;
}

.light-mode .action-task-title b,
.light-mode .compact-action-row b,
.light-mode .timeline-mini-row b,
.light-mode .team-action-card b {
    color: #0f172a !important;
}

.light-mode .action-task-main span,
.light-mode .compact-action-row small,
.light-mode .timeline-mini-row span,
.light-mode .timeline-mini-row small,
.light-mode .team-action-card small {
    color: #64748b !important;
}
