.home-dashboard {
    --home-blue: #182050;
    --home-green: #388060;
    --home-text: #17213a;
    --home-muted: #747c8d;
    --home-border: #e5e8ee;
    --home-surface: #ffffff;
    direction: rtl;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    gap: 20px;
    overflow: hidden;
    color: var(--home-text);
    font-family: "Cairo", sans-serif;
}

.home-dashboard *, .home-dashboard *::before, .home-dashboard *::after { box-sizing: border-box; }

.home-dashboard__intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.home-dashboard__intro h1 { margin: 0; color: var(--home-blue); font-size: clamp(1.55rem, 2vw, 2rem); line-height: 1.3; }
.home-dashboard__intro h1 small { display: block; margin-top: 2px; color: var(--home-green); font-size: .58rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.home-dashboard__intro p, .home-section__header p, .home-chart-card header p { margin: 5px 0 0; color: var(--home-muted); font-size: .78rem; }
.home-dashboard__data-state { padding: 7px 12px; color: #537064; background: #edf6f1; border: 1px solid #d6e9df; border-radius: 999px; font-size: .68rem; white-space: nowrap; }

.home-dashboard__kpis { min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.home-kpi { --accent: #405797; --pastel: #eef1fa; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 14px 11px; background: var(--home-surface); border: 1px solid var(--home-border); border-radius: 14px; box-shadow: 0 7px 22px rgba(24, 32, 80, .055); }
.home-kpi__icon { width: 37px; height: 37px; flex: 0 0 37px; display: grid; place-items: center; color: var(--accent); background: var(--pastel); border-radius: 11px; font-size: 1rem; font-weight: 800; }
.home-kpi div { min-width: 0; display: grid; gap: 2px; }
.home-kpi div > span { overflow: hidden; color: #697184; font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.home-kpi strong { color: var(--home-blue); font-size: 1.25rem; line-height: 1.25; }
.home-kpi small { overflow: hidden; color: var(--accent); font-size: .43rem; letter-spacing: .03em; text-overflow: ellipsis; white-space: nowrap; }
.home-kpi--violet { --accent:#6c63a8; --pastel:#f1effa; }.home-kpi--cyan { --accent:#26889a; --pastel:#e9f6f8; }.home-kpi--amber { --accent:#bd7d2e; --pastel:#fff4e5; }.home-kpi--green { --accent:#388060; --pastel:#eaf5ef; }.home-kpi--gold { --accent:#a88324; --pastel:#fbf5df; }

.home-section, .home-chart-card { min-width: 0; max-width: 100%; background: var(--home-surface); border: 1px solid var(--home-border); border-radius: 18px; box-shadow: 0 9px 28px rgba(24, 32, 80, .055); }
.home-section { overflow: hidden; padding: 18px; }
.home-section__header, .home-chart-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 19px; }
.home-section__header h2, .home-chart-card h2 { margin: 0; color: var(--home-blue); font-size: 1rem; }
.home-section__header > small, .home-chart-card header > small { color: var(--home-green); font-size: .52rem; letter-spacing: .06em; white-space: nowrap; }

.home-journey__viewport { width: 100%; max-width: 100%; min-width: 0; overflow: hidden; padding: 5px 2px 8px; }
.home-journey__track { position: relative; width: 100%; min-width: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(2, auto); gap: 14px; padding: 4px 0; }
.home-journey__track::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 4px 0;
    background:
        linear-gradient(#dce1e9, #dce1e9) center 38px / 80% 2px no-repeat,
        linear-gradient(#dce1e9, #dce1e9) 30% calc(100% - 38px) / 40% 2px no-repeat,
        linear-gradient(#dce1e9, #dce1e9) 10% center / 2px calc(100% - 76px) no-repeat;
}
.home-journey-step:nth-child(1) { grid-column: 1; grid-row: 1; }
.home-journey-step:nth-child(2) { grid-column: 2; grid-row: 1; }
.home-journey-step:nth-child(3) { grid-column: 3; grid-row: 1; }
.home-journey-step:nth-child(4) { grid-column: 4; grid-row: 1; }
.home-journey-step:nth-child(5) { grid-column: 5; grid-row: 1; }
.home-journey-step:nth-child(6) { grid-column: 5; grid-row: 2; }
.home-journey-step:nth-child(7) { grid-column: 4; grid-row: 2; }
.home-journey-step:nth-child(8) { grid-column: 3; grid-row: 2; }
.home-journey-step { --accent:#405797; --pastel:#eef1fa; position: relative; z-index: 1; min-width: 0; min-height: 124px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 10px 8px; text-align: center; background: #fff; border: 1px solid var(--home-border); border-top: 3px solid var(--accent); border-radius: 12px; }
.home-journey-step::after { content: ""; position: absolute; top: 32px; left: 50%; width: 7px; height: 7px; translate: -50% 0; background: var(--accent); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #dce1e9; }
.home-journey-step__icon { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 6px; color: var(--accent); background: var(--pastel); border-radius: 10px; font-size: .9rem; font-weight: 800; }
.home-journey-step h3 { margin: 0 0 4px; color: var(--home-blue); font-size: .68rem; line-height: 1.4; }
.home-journey-step p { margin: 0; color: var(--home-muted); font-size: .54rem; line-height: 1.6; }
.home-journey-step--violet { --accent:#6c63a8; --pastel:#f1effa; }.home-journey-step--cyan { --accent:#26889a; --pastel:#e9f6f8; }.home-journey-step--teal { --accent:#2d927f; --pastel:#e9f5f2; }.home-journey-step--green { --accent:#388060; --pastel:#eaf5ef; }.home-journey-step--orange { --accent:#c27335; --pastel:#fff0e5; }.home-journey-step--gold { --accent:#a88324; --pastel:#fbf5df; }.home-journey-step--navy { --accent:#182050; --pastel:#edf0f8; }

.home-dashboard__charts { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.home-chart-card { min-height: 330px; display: flex; flex-direction: column; overflow: hidden; padding: 17px; }
.home-donut-layout { flex: 1; display: grid; grid-template-columns: minmax(130px, .85fr) minmax(150px, 1fr); align-items: center; gap: 20px; }
.home-donut { width: min(155px, 100%); aspect-ratio: 1; display: grid; place-items: center; margin: auto; background: conic-gradient(#e6e9ef 0 100%); border-radius: 50%; }
.home-donut::before { content: ""; grid-area: 1/1; width: 70%; aspect-ratio: 1; background: #fff; border-radius: 50%; }
.home-donut > span { z-index: 1; grid-area: 1/1; display: grid; color: var(--home-blue); font-size: 1.35rem; font-weight: 800; text-align: center; }
.home-donut small { color: var(--home-muted); font-size: .56rem; font-weight: 500; }
.home-chart-legend { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.home-chart-legend li { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 8px; color: #626b7b; font-size: .64rem; }
.home-chart-legend li::before { content: ""; width: 8px; height: 8px; background: var(--key); border-radius: 50%; }
.home-chart-legend b { color: var(--home-blue); font-weight: 700; }
.home-line-chart { position: relative; flex: 1; min-height: 245px; overflow: hidden; padding: 15px 8px 28px; border-radius: 12px; }
.home-line-chart__grid { position: absolute; inset: 18px 8px 43px; display: grid; grid-template-rows: repeat(4, 1fr); }
.home-line-chart__grid span { border-top: 1px dashed #e1e5ec; }
.home-line-chart svg { position: absolute; inset: 18px 8px 43px; width: calc(100% - 16px); height: calc(100% - 61px); }
.home-line-chart__baseline { fill: none; stroke: #b9c1cf; stroke-width: 2; stroke-dasharray: 5 6; }
.home-line-chart__months { position: absolute; right: 8px; bottom: 12px; left: 8px; display: grid; grid-template-columns: repeat(6, 1fr); color: var(--home-muted); font-size: .57rem; text-align: center; }
.home-chart-placeholder { position: absolute; inset: 48% 0 auto; color: #9299a6; font-size: .68rem; text-align: center; }

@media (max-width: 1450px) { .home-dashboard__kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .home-dashboard__charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-chart-card:last-child { grid-column: 1 / -1; } }
@media (max-width: 760px) {
    .home-dashboard { gap: 18px; }
    .home-dashboard__intro { align-items: flex-start; flex-direction: column; }
    .home-dashboard__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-dashboard__charts { grid-template-columns: 1fr; }
    .home-chart-card:last-child { grid-column: auto; }
    .home-donut-layout { grid-template-columns: 1fr; }
    .home-chart-card { min-height: 410px; }
    .home-journey__track { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, auto); gap: 12px 10px; }
    .home-journey-step:nth-child(1) { grid-column: 1; grid-row: 1; }
    .home-journey-step:nth-child(2) { grid-column: 2; grid-row: 1; }
    .home-journey-step:nth-child(3) { grid-column: 2; grid-row: 2; }
    .home-journey-step:nth-child(4) { grid-column: 1; grid-row: 2; }
    .home-journey-step:nth-child(5) { grid-column: 1; grid-row: 3; }
    .home-journey-step:nth-child(6) { grid-column: 2; grid-row: 3; }
    .home-journey-step:nth-child(7) { grid-column: 2; grid-row: 4; }
    .home-journey-step:nth-child(8) { grid-column: 1; grid-row: 4; }
    .home-journey__track::before {
        background:
            linear-gradient(#dce1e9, #dce1e9) center 34px / 50% 2px no-repeat,
            linear-gradient(#dce1e9, #dce1e9) center 154px / 50% 2px no-repeat,
            linear-gradient(#dce1e9, #dce1e9) center 274px / 50% 2px no-repeat,
            linear-gradient(#dce1e9, #dce1e9) center 394px / 50% 2px no-repeat,
            linear-gradient(#dce1e9, #dce1e9) 25% 94px / 2px 120px no-repeat,
            linear-gradient(#dce1e9, #dce1e9) 75% 214px / 2px 120px no-repeat,
            linear-gradient(#dce1e9, #dce1e9) 25% 334px / 2px 120px no-repeat;
    }
}
@media (max-width: 430px) { .home-dashboard__kpis { grid-template-columns: 1fr; } .home-section, .home-chart-card { padding: 14px; } .home-journey__track { gap: 10px 7px; } .home-journey-step { padding-inline: 5px; } }
@media (prefers-reduced-motion: reduce) { .home-dashboard * { scroll-behavior: auto !important; } }
