/* Home dashboard — inside .w3-mm .card */

.dash-home__intro {
  margin: 0 0 14px;
}

.dash-home__overview {
  padding-bottom: 18px;
}

.dash-home__modules-body {
  padding-top: 14px;
}

/* Status strip */
.dash-home__stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.dash-stat {
  --chip-accent: var(--ok, #37d39a);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--chip-accent) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip-accent) 16%, transparent);
  box-shadow: inset 2px 0 0 var(--chip-accent);
}

.dash-stat--ok {
  --chip-accent: var(--ok, #37d39a);
}

.dash-stat--muted {
  --chip-accent: var(--muted, #6b7f9a);
  opacity: 0.9;
}

.dash-stat__ico {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 0.7rem;
  color: var(--chip-accent);
  background: color-mix(in srgb, var(--chip-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip-accent) 24%, transparent);
}

.dash-stat__label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  align-self: end;
}

.dash-stat__value {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
  align-self: start;
}

.dash-stat__value--sm {
  font-size: 0.82rem;
  font-weight: 700;
}

.dash-stat__hint {
  grid-column: 2;
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--muted);
}

.dash-home__countdown {
  font-weight: 600;
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}

.dash-home__countdown.is-soon {
  color: #fbbf24;
}

.dash-home__countdown.is-expired {
  color: #f87171;
}

/* Module tiles */
.dash-home__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}

.dash-module {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 180px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(8, 14, 28, 0.9) 50%,
    rgba(6, 10, 20, 0.95) 100%
  );
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: inherit;
  isolation: isolate;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-module:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.dash-module--static {
  cursor: default;
  opacity: 0.55;
}

.dash-module--static:hover {
  transform: none;
  box-shadow: none;
}

.dash-module--locked {
  opacity: 0.78;
}

.dash-module--green:hover { border-color: rgba(55, 211, 154, 0.38); }
.dash-module--blue:hover { border-color: rgba(101, 216, 255, 0.38); }
.dash-module--cyan:hover { border-color: rgba(101, 216, 255, 0.38); }

.dash-module__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.dash-module__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.95rem;
}

.dash-module--green .dash-module__icon {
  color: var(--ok);
  background: rgba(55, 211, 154, 0.12);
  border: 1px solid rgba(55, 211, 154, 0.28);
}

.dash-module--blue .dash-module__icon,
.dash-module--cyan .dash-module__icon {
  color: #65d8ff;
  background: rgba(101, 216, 255, 0.1);
  border: 1px solid rgba(101, 216, 255, 0.25);
}

.dash-module--muted .dash-module__icon {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.dash-module__status {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ok);
  background: rgba(55, 211, 154, 0.1);
  border: 1px solid rgba(55, 211, 154, 0.22);
}

.dash-module--locked .dash-module__status {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.22);
}

.dash-module__status--off {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.dash-module__category {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.dash-module__name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.dash-module__desc {
  flex: 1;
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--muted);
}

.dash-module__action {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--dim);
  transition: color 0.2s ease;
}

.dash-module:hover .dash-module__action {
  color: var(--ok);
}

.dash-module--locked:hover .dash-module__action {
  color: #fbbf24;
}

.dash-module--static .dash-module__action {
  color: var(--dim);
}

.dash-module__action i {
  font-size: 0.62rem;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.dash-module:hover .dash-module__action i {
  transform: translateX(3px);
}

@media (max-width: 640px) {
  .dash-module {
    min-height: 0;
  }
}
