/* Styles specific to the Reports page */

/* Header actions and range tabs */
.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.range-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.range-button {
    background: rgba(17,24,39,.86) !important;
    border: 1px solid rgba(148,163,184,.16) !important;
    border-radius: 10px !important;
}

/* Report metric cards */
.report-metric {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 112px;
}

.report-metric .metric-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    flex: 0 0 auto;
}

.report-metric.purple .metric-icon {
    background: linear-gradient(135deg,#7C3AED,#4F46E5);
}

.report-metric.green .metric-icon {
    background: linear-gradient(135deg,#22C55E,#16A34A);
}

.report-metric.red .metric-icon {
    background: linear-gradient(135deg,#EF4444,#DC2626);
}

.report-metric.blue .metric-icon {
    background: linear-gradient(135deg,#38BDF8,#2563EB);
}

.report-metric.orange .metric-icon {
    background: linear-gradient(135deg,#F59E0B,#EA580C);
}

.good {
    color: #22C55E !important;
    font-weight: 700;
}

.bad {
    color: #EF4444 !important;
    font-weight: 700;
}

.report-panel {
    min-height: 330px;
}

.tiny-select {
    width: 110px;
}

/* Line chart */
.line-chart {
    height: 250px;
    display: flex;
    align-items: end;
    gap: 14px;
    padding: 22px 10px 36px;
    border-radius: 16px;
    background: linear-gradient(180deg,rgba(30,41,59,.35),rgba(15,23,42,.45));
    border: 1px solid rgba(148,163,184,.10);
    position: relative;
    overflow: hidden;
}

.line-chart::before {
    content: '';
    position: absolute;
    inset: 28px 12px 48px;
    background: repeating-linear-gradient(to bottom, rgba(148,163,184,.12) 0 1px, transparent 1px 48px);
    pointer-events: none;
}

.line-bar {
    flex: 1;
    min-height: 30px;
    border-radius: 999px 999px 8px 8px;
    background: linear-gradient(180deg,#8B5CF6,#312E81);
    box-shadow: 0 0 28px rgba(124,58,237,.35);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.line-bar::after {
    content:'';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #A78BFA;
    position: absolute;
    top: -4px;
    box-shadow: 0 0 18px #8B5CF6;
}

.line-bar span {
    position: absolute;
    bottom: -28px;
    color: #CBD5E1;
    font-size: 12px;
    white-space: nowrap;
}

/* Donut chart */
.donut-wrap {
    display: flex;
    align-items: center;
    gap: 30px;
    height: 250px;
}

.donut {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: conic-gradient(#3B82F6 0 15%, #F59E0B 15% 52%, #8B5CF6 52% 65%, #EF4444 65% 74%, #22C55E 74% 100%);
    display: grid;
    place-items: center;
    box-shadow: 0 22px 50px rgba(0,0,0,.32);
}

.donut > div {
    width: 98px;
    height: 98px;
    border-radius: 50%;
    background: #111827;
    display: grid;
    place-items: center;
    text-align: center;
}

.donut strong {
    display: block;
    font-size: 28px;
    color: #F9FAFB;
}

.donut span {
    display: block;
    color: #9CA3AF;
    font-size: 12px;
    margin-top: -18px;
}

.legend-list {
    flex: 1;
}

.legend-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    color: #D1D5DB;
}

.legend-row b {
    color: #F8FAFC;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    background: #3B82F6;
}

.dot.new { background:#3B82F6; }
.dot.inprogress { background:#F59E0B; }
.dot.review { background:#8B5CF6; }
.dot.blocked { background:#EF4444; }
.dot.done { background:#22C55E; }

/* Priority bars */
.priority-bars {
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding-top: 18px;
}

.priority-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #F8FAFC;
}

.progress-track {
    height: 8px;
    border-radius: 99px;
    background: rgba(148,163,184,.12);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 99px;
    background: #3B82F6;
}

.progress-fill.critical { background:#EF4444; }
.progress-fill.high { background:#F97316; }
.progress-fill.medium { background:#FACC15; }
.progress-fill.low { background:#22C55E; }

/* Mini progress bar */
.mini-progress {
    display: inline-flex;
    width: 70px;
    height: 7px;
    border-radius: 99px;
    background: rgba(148,163,184,.16);
    overflow: hidden;
    vertical-align: middle;
    margin-right: 8px;
}

.mini-progress i {
    display: block;
    height: 100%;
    background: #7C3AED;
    border-radius: 99px;
}

/* Project icon */
.project-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    margin-right: 10px;
    background: rgba(79,70,229,.35);
    color: #C4B5FD;
    font-weight: 900;
}

/* Overdue tasks list */
.overdue-item {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(148,163,184,.12);
    border-left: 3px solid #64748B;
    padding-left: 10px;
}

.overdue-item.critical,
.overdue-item.high {
    border-left-color: #EF4444;
}
.overdue-item.medium {
    border-left-color: #F59E0B;
}
.overdue-item.low {
    border-left-color: #22C55E;
}

.overdue-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(239,68,68,.14);
    color: #F87171;
}

.overdue-item b {
    color: #F8FAFC;
    display: block;
}

.overdue-item span {
    color: #94A3B8;
    font-size: 13px;
}

.overdue-right {
    text-align: right;
}

.overdue-right b {
    font-size: 13px;
}

/* Monthly summary */
.monthly-summary {
    margin-bottom: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px,1fr));
    gap: 14px;
}

.summary-grid > div {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 4px 12px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    background: rgba(30,41,59,.45);
    border: 1px solid rgba(148,163,184,.10);
}

.summary-grid .mud-icon-root {
    grid-row: span 3;
    color: #60A5FA;
}

.summary-grid span {
    color: #CBD5E1;
    font-size: 13px;
}

.summary-grid b {
    color: #F8FAFC;
    font-size: 22px;
}

.summary-grid small {
    font-size: 12px;
}

@media (max-width: 1200px) {
    .summary-grid {
        grid-template-columns: repeat(3, minmax(120px,1fr));
    }
    .donut-wrap {
        flex-direction: column;
        height: auto;
    }
}

@media (max-width: 700px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    .header-actions {
        width: 100%;
    }
}
/* Improved Reports page */
.report-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 220px 220px auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    background: rgba(15,23,42,.62);
    border: 1px solid rgba(148,163,184,.14);
}

.muted-text {
    color: #93A4BC;
    font-size: 13px;
    margin-top: 2px;
}

.report-side-panel {
    min-height: 100%;
}

.summary-stat {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(148,163,184,.12);
}

.summary-stat:last-child {
    border-bottom: 0;
}

.summary-stat span {
    color: #CBD5E1;
    font-size: 14px;
}

.summary-stat b {
    color: #F8FAFC;
    font-size: 22px;
}

.attention-table b {
    display: block;
    color: #F8FAFC;
}

.attention-table small {
    display: block;
    color: #94A3B8;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attention-type {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid rgba(148,163,184,.18);
    background: rgba(59,130,246,.14);
    color: #93C5FD;
}

.attention-type.danger {
    background: rgba(239,68,68,.16);
    color: #FCA5A5;
    border-color: rgba(239,68,68,.30);
}

.attention-type.warning {
    background: rgba(245,158,11,.16);
    color: #FCD34D;
    border-color: rgba(245,158,11,.30);
}

.attention-type.info {
    background: rgba(14,165,233,.16);
    color: #7DD3FC;
    border-color: rgba(14,165,233,.30);
}

.attention-type.purple {
    background: rgba(139,92,246,.16);
    color: #C4B5FD;
    border-color: rgba(139,92,246,.30);
}

.empty-report-state {
    padding: 22px;
    text-align: center;
    color: #94A3B8;
}

.report-list-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 8px;
}

.report-bar-row small {
    color: #94A3B8;
    display: block;
    margin-top: 5px;
    font-size: 12px;
}

.report-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.report-bar-head span {
    color: #E5E7EB;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-bar-head b {
    color: #F8FAFC;
    font-size: 13px;
    white-space: nowrap;
}

.progress-fill.blue {
    background: linear-gradient(90deg, #38BDF8, #2563EB);
}

.progress-fill.purple {
    background: linear-gradient(90deg, #A78BFA, #7C3AED);
}

.progress-fill.new { background:#3B82F6; }
.progress-fill.backlog { background:#64748B; }
.progress-fill.inreview { background:#8B5CF6; }
.progress-fill.inprogress { background:#F59E0B; }
.progress-fill.waitingforcustomer { background:#F97316; }
.progress-fill.rejected { background:#EF4444; }
.progress-fill.cancelled { background:#94A3B8; }
.progress-fill.done { background:#22C55E; }
.progress-fill.completed { background:#22C55E; }

.light-mode .report-filter-bar,
.light-mode .summary-stat,
.light-mode .attention-table,
.light-mode .report-list-bars {
    color: #0F172A;
}

.light-mode .report-filter-bar {
    background: rgba(255,255,255,.88);
    border-color: rgba(15,23,42,.10);
}

.light-mode .muted-text,
.light-mode .summary-stat span,
.light-mode .report-bar-row small,
.light-mode .attention-table small {
    color: #64748B;
}

.light-mode .summary-stat b,
.light-mode .attention-table b,
.light-mode .report-bar-head span,
.light-mode .report-bar-head b {
    color: #0F172A;
}

.light-mode .summary-stat {
    border-bottom-color: rgba(15,23,42,.10);
}

@media (max-width: 900px) {
    .report-filter-bar {
        grid-template-columns: 1fr;
    }
}
