/* Dashboard home (templates/dashboard/index_dynamic.html, view "dashboard_overview").
   Uses the dashboard's own tokens so light and dark themes both work. */

.home { display: grid; gap: 22px; }

/* ---- hero ------------------------------------------------------------------------------ */
.home-hero {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap;
    padding: 28px 30px; border-radius: 24px; border: 1px solid var(--admin-border);
    background:
        radial-gradient(520px 260px at 12% -20%, rgba(99, 102, 241, .38), transparent 70%),
        radial-gradient(460px 240px at 92% 120%, rgba(34, 211, 238, .22), transparent 70%),
        var(--admin-card);
}
.home-hero h2 { margin: 0; font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.home-hero p { margin: 8px 0 0; color: var(--admin-muted); font-size: 1rem; }
.home-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.home-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
    border: 1px solid var(--admin-border); background: color-mix(in srgb, var(--admin-card) 70%, transparent);
    color: var(--admin-muted); font-size: .8rem; font-weight: 600;
}
.home-hero .secondary-action { white-space: nowrap; }

/* ---- setup checklist -------------------------------------------------------------------- */
.home-panel { border: 1px solid var(--admin-border); border-radius: 22px; background: var(--admin-card); padding: 22px 24px; }
.home-panel__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.home-panel__head h3 { margin: 0; font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
.home-progress { display: flex; align-items: center; gap: 12px; color: var(--admin-muted); font-size: .85rem; font-weight: 600; }
.home-progress__bar { width: 160px; height: 8px; border-radius: 999px; background: var(--admin-border); overflow: hidden; }
.home-progress__fill {
    display: block; height: 100%; border-radius: inherit; width: var(--pct, 0%);
    background: linear-gradient(90deg, #6366f1, #22d3ee); transition: width .9s cubic-bezier(.2, .7, .2, 1);
}
.home-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.home-step {
    display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px;
    border: 1px solid var(--admin-border); background: var(--admin-card-soft); color: inherit; text-decoration: none;
    transition: transform .24s cubic-bezier(.2, .7, .2, 1), border-color .24s, box-shadow .24s;
}
a.home-step:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--admin-blue) 55%, transparent); box-shadow: var(--admin-shadow-soft); }
.home-step__mark {
    flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    border: 2px solid var(--admin-border); color: transparent; font-size: .8rem; font-weight: 800; margin-top: 1px;
}
.home-step.is-done .home-step__mark { background: var(--admin-green); border-color: var(--admin-green); color: #fff; }
.home-step.is-done strong { color: var(--admin-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.home-step strong { display: block; font-size: .95rem; font-weight: 650; }
.home-step small { display: block; margin-top: 3px; color: var(--admin-muted); font-size: .82rem; line-height: 1.45; }
.home-step__go { margin-inline-start: auto; align-self: center; color: var(--admin-blue); font-size: .82rem; font-weight: 700; white-space: nowrap; }
.home-step.is-done .home-step__go { color: var(--admin-green); }

/* ---- module tiles ----------------------------------------------------------------------- */
.home-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 14px; }
.home-tile {
    position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; padding: 18px; border-radius: 18px; color: inherit; text-decoration: none;
    border: 1px solid var(--admin-border); background: var(--admin-card-soft);
    transition: transform .24s cubic-bezier(.2, .7, .2, 1), border-color .24s, box-shadow .24s;
}
.home-tile:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--admin-blue) 55%, transparent); box-shadow: var(--admin-shadow-soft); }
.home-tile__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; }
.home-tile__count { font-size: 1.7rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.home-tile h4 { margin: 0; font-size: 1rem; font-weight: 700; }
.home-tile p { margin: 0; color: var(--admin-muted); font-size: .85rem; line-height: 1.45; }
.home-tile__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; font-size: .8rem; }
.home-tile__meta { color: var(--admin-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-tile__go { color: var(--admin-blue); font-weight: 700; white-space: nowrap; }
.home-tile.is-locked { background: transparent; border-style: dashed; }
.home-tile.is-locked .stat-icon { filter: grayscale(1); opacity: .55; }
.home-tile.is-locked h4, .home-tile.is-locked p { color: var(--admin-muted); }
.home-tile__lock { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--admin-border); color: var(--admin-muted); font-size: .72rem; font-weight: 700; }

/* ---- charts -------------------------------------------------------------------------------- */
.home-charts { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.home-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.home-bar { flex: 1; display: flex; align-items: flex-end; justify-content: center; height: 100%; }
.home-bar span {
    width: 100%; max-width: 22px; border-radius: 6px 6px 2px 2px; height: var(--h, 4%);
    background: linear-gradient(180deg, #6366f1, rgba(99, 102, 241, .25));
    transform-origin: bottom; animation: home-grow .8s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes home-grow { from { transform: scaleY(0); } to { transform: none; } }
.home-axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--admin-muted); font-size: .72rem; }
.home-empty { display: grid; place-items: center; text-align: center; gap: 10px; min-height: 150px; padding: 12px; color: var(--admin-muted); font-size: .9rem; line-height: 1.5; }
.home-empty svg { width: 34px; height: 34px; opacity: .55; }
.home-donut { display: flex; align-items: center; gap: 20px; padding-top: 8px; }
.home-donut__ring { width: 124px; height: 124px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; }
.home-donut__hole { width: 74px; height: 74px; border-radius: 50%; background: var(--admin-card); display: grid; place-items: center; align-content: center; }
.home-donut__hole strong { font-size: 1.15rem; font-weight: 700; }
.home-donut__hole small { color: var(--admin-muted); font-size: .66rem; }
.home-legend { display: grid; gap: 8px; flex: 1; font-size: .84rem; }
.home-legend div { display: flex; align-items: center; gap: 8px; }
.home-legend i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.home-legend span:last-child { margin-inline-start: auto; color: var(--admin-muted); }

@media (max-width: 980px) { .home-charts { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .home-hero { padding: 22px; } .home-panel { padding: 18px; } .home-progress__bar { width: 110px; } }
@media (prefers-reduced-motion: reduce) { .home-bar span, .home-progress__fill { animation: none; transition: none; } }
.home-arrow { display: inline-block; transition: transform .24s cubic-bezier(.2, .7, .2, 1); }
[dir="rtl"] .home-arrow { transform: scaleX(-1); }
.home-tile:hover .home-arrow, a.home-step:hover .home-arrow, .home-hero a:hover .home-arrow { transform: translateX(3px); }
[dir="rtl"] .home-tile:hover .home-arrow, [dir="rtl"] .home-hero a:hover .home-arrow { transform: scaleX(-1) translateX(3px); }

/* grid children may shrink below their content, so long labels ellipsis instead of spilling out */
.home-tile, .home-step, .home-panel, .home-tile__foot, .home-step > span { min-width: 0; }
.home-tile__meta { flex: 1 1 0; min-width: 0; }
.home-tile h4, .home-tile p { overflow-wrap: anywhere; }
.home-arrow { margin-inline-start: 4px; }
