/* صفحهٔ اصلی: بنر وضعیت، شاخص‌ها، نمودار هفته، آخرین ثبت‌ها، نمای مدیریت */

.hx {
  position: relative; overflow: hidden; color: #fff;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center;
  padding: 34px clamp(20px, 4vw, 46px); border-radius: 26px;
  background:
    radial-gradient(520px 300px at 0 0, rgba(47, 214, 160, .30), transparent 70%),
    radial-gradient(520px 320px at 100% 110%, rgba(86, 132, 255, .38), transparent 70%),
    linear-gradient(135deg, rgba(255, 255, 255, .05) 0 25%, transparent 25% 50%, rgba(255, 255, 255, .035) 50% 75%, transparent 75%) 0 0 / 64px 64px,
    linear-gradient(135deg, #17398f, #0d2160 55%, #091a4d);
  box-shadow: 0 34px 60px -36px rgba(10, 26, 74, .9), inset 0 0 0 1px rgba(255, 255, 255, .09);
}
.hx-date { margin: 0; color: rgba(255, 255, 255, .72); font-size: 15px; font-weight: 600; }
.hx-hello { margin: 4px 0 0; font-size: clamp(26px, 4vw, 40px); font-weight: 800; line-height: 1.35; letter-spacing: -.01em; }
.hx-sub { margin: 8px 0 0; color: rgba(255, 255, 255, .78); font-size: 16px; max-width: 34rem; }

.hx-panel {
  display: flex; align-items: center; gap: 24px; padding: 18px 24px;
  border-radius: 24px; background: rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), 0 18px 36px -24px rgba(0, 0, 0, .6);
}
.hx-clock { position: relative; width: 136px; height: 136px; flex: none; }
.hx-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.hx-ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.hx-ring-bg { stroke: rgba(255, 255, 255, .16); }
.hx-ring-live { stroke: rgba(255, 255, 255, .28); stroke-dasharray: 60 280; transform-origin: 60px 60px; }
.is-in .hx-ring-live { stroke: var(--gem); stroke-dasharray: 150 190; filter: drop-shadow(0 0 6px rgba(47, 214, 160, .8)); animation: orbit 9s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.hx-clock-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.hx-timer { font-size: 30px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; direction: ltr; }
.hx-clock-text small { color: rgba(255, 255, 255, .7); font-size: 13px; }

.hx-act { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.hx-badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 5px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12);
  font-size: 14px; font-weight: 700;
}
.hx-badge::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.is-in .hx-badge::before { background: var(--gem); animation: pulse 2.2s ease-out infinite; }
.hx .btn-hero {
  min-width: 190px; margin: 0; padding: 15px 30px; font-size: 18px; border-radius: 16px; border: 0;
  background: linear-gradient(180deg, #46e6b4, #16b284); color: #03281c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 16px 30px -14px rgba(47, 214, 160, .8);
}
.hx .btn-hero:hover { background: linear-gradient(180deg, #5df0c2, #1cc294); }
.hx .btn-hero.is-out {
  background: rgba(255, 255, 255, .10); color: #fff; box-shadow: none;
  border: 2px solid rgba(255, 255, 255, .42);
}
.hx .btn-hero.is-out:hover { background: rgba(255, 255, 255, .2); border-color: #fff; }

/* شاخص‌ها */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.kpi { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.kpi-ico {
  flex: none; width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
  color: var(--accent); background: linear-gradient(145deg, #eaf0ff, #dbe6ff);
  box-shadow: inset 0 0 0 1px rgba(31, 79, 191, .12);
}
.kpi-ico .icon { width: 24px; height: 24px; }
.kpi-live { color: #0b7a55; background: linear-gradient(145deg, #e4faf1, #cdf3e2); box-shadow: inset 0 0 0 1px rgba(15, 157, 107, .16); }
.kpi .stat-value { font-size: 30px; font-variant-numeric: tabular-nums; }
.kpi .of { font-size: 15px; font-weight: 600; color: var(--muted); }
.kpi-fill { flex: 1; min-width: 0; }
.meter { height: 8px; margin-top: 8px; border-radius: 99px; background: #e5ebf7; overflow: hidden; }
.meter span { display: block; height: 100%; width: var(--v); min-width: 6px; border-radius: inherit; background: linear-gradient(270deg, var(--gem), var(--ok)); }

/* نمودار هفته و آخرین ثبت‌ها */
.dash { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; margin-top: 16px; }
.dash > .card { margin-top: 0; }
.card-head h2 { margin: 0; }
.card-head a { font-size: 14px; font-weight: 600; text-decoration: none; }
.card-head a:hover { text-decoration: underline; }

.bars { display: flex; gap: 10px; align-items: stretch; height: 220px; margin: 18px 0 0; padding: 0; list-style: none; }
.bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar-track { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar-val { font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; direction: ltr; }
.bar-fill {
  width: 100%; max-width: 46px; border-radius: 12px 12px 5px 5px;
  height: max(calc((100% - 24px) * var(--h) / 100), 5px);
  background: linear-gradient(180deg, #7ea2f4, #3f6fdc);
  transform-origin: bottom; animation: grow .8s cubic-bezier(.2, .8, .2, 1) both;
}
.bar:nth-child(2) .bar-fill { animation-delay: .05s; }
.bar:nth-child(3) .bar-fill { animation-delay: .10s; }
.bar:nth-child(4) .bar-fill { animation-delay: .15s; }
.bar:nth-child(5) .bar-fill { animation-delay: .20s; }
.bar:nth-child(6) .bar-fill { animation-delay: .25s; }
.bar:nth-child(7) .bar-fill { animation-delay: .30s; }
@keyframes grow { from { transform: scaleY(.05); opacity: .4; } }
.bar.is-today .bar-fill { background: linear-gradient(180deg, #55e6b6, #14a77a); box-shadow: 0 10px 20px -10px rgba(15, 157, 107, .8); }
.bar.is-today .bar-val { color: #0b7a55; }
.bar-day { font-size: 14px; font-weight: 700; color: #44516f; }
.bar.is-today .bar-day { color: #0b7a55; }

.feed { list-style: none; margin: 8px 0 0; padding: 0; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line-strong); }
.feed-item:last-child { border-bottom: 0; }
.feed-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #b8c4de; }
.feed-dot.is-live { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.feed-dot.is-void { background: var(--danger); }
.feed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.55; }
.feed-main strong { font-size: 15px; color: var(--ink); }
.feed-times { font-size: 13.5px; color: var(--muted); }
.empty { margin: 14px 0 4px; color: var(--muted); }

/* نمای مدیریت */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 0; }
.sec-head h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--ink); }
.sec-head a { font-size: 14px; font-weight: 600; text-decoration: none; }
.sec-head + .kpis, .sec-head + .qa { margin-top: 12px; }
.main > .kpis + .card { margin-top: 16px; }
.people { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #f5f8fe; box-shadow: inset 0 0 0 1px var(--line); }
.av {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; color: #fff; background: linear-gradient(145deg, #3f6fdc, #17398f);
  box-shadow: 0 0 0 3px var(--ok-soft), 0 0 0 4px rgba(15, 157, 107, .45);
}
.who { flex: 1; min-width: 0; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.since { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* دسترسی سریع */
.qa { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); margin-top: 12px; }
.qa a {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1);
  color: var(--ink); font-weight: 700; text-decoration: none;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.qa a:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: rgba(31, 79, 191, .4); color: var(--ink); }
.qa-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: linear-gradient(145deg, #eaf0ff, #dbe6ff); transition: background .18s, color .18s; }
.qa a:hover .qa-ico { background: linear-gradient(145deg, #2c62da, #1b45ae); color: #fff; }

@media (max-width: 900px) {
  .hx { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 24px 18px; border-radius: 22px; }
  .hx-panel { justify-content: space-between; gap: 14px; padding: 14px 16px; }
  .hx-clock { width: 112px; height: 112px; }
  .hx-timer { font-size: 25px; }
  .hx .btn-hero { min-width: 0; width: 100%; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi { gap: 12px; padding: 14px; }
  .kpi-ico { width: 42px; height: 42px; border-radius: 13px; }
  .kpi .stat-value { font-size: 24px; }
  .bars { height: 190px; gap: 6px; }
}
@media (max-width: 420px) {
  .hx-panel { flex-direction: column; align-items: stretch; }
  .hx-clock { align-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .is-in .hx-ring-live, .is-in .hx-badge::before, .bar-fill { animation: none !important; }
}

/* اصلاح رنگ تیتر داخل بنر و پرشدن قد نمودار */
.hx h1.hx-hello { color: #fff; }
.hx p.hx-date { color: rgba(255, 255, 255, .72); }
.hx p.hx-sub { color: rgba(255, 255, 255, .8); }
.wk { display: flex; flex-direction: column; }
.wk .bars { flex: 1; min-height: 220px; }
