/* ── Modules page layout ─────────────────────────────────── */
.mod-main {
  background: #f0f4f8;
}
.mod-view {
  padding: 24px 28px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ── Header ─────────────────────────────────────────────── */
.mod-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.mod-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 3px;
  line-height: 1.2;
}
.mod-sub {
  font-size: .83rem;
  color: #64748b;
  margin: 0;
}

/* ── Search ─────────────────────────────────────────────── */
.mod-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 0 12px;
  height: 40px;
  min-width: 220px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mod-search-wrap:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.mod-search-icon { font-size: .9rem; color: #94a3b8; flex-shrink: 0; }
.mod-search-inp {
  border: none;
  outline: none;
  background: transparent;
  font-size: .87rem;
  color: #0f172a;
  width: 100%;
  font-family: inherit;
}
.mod-search-inp::placeholder { color: #94a3b8; }

/* ── Grid ───────────────────────────────────────────────── */
.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 220px));
  gap: 16px;
}

/* ── Tile ───────────────────────────────────────────────── */
.mod-tile {
  --tile-color: #0f62ac;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 20px 14px 14px;
  border-radius: 16px;
  border: 1.5px solid #e8edf4;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
  text-decoration: none;
  color: #0f172a;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  min-height: 175px;
}
.mod-tile::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--tile-color);
  border-radius: 16px 16px 0 0;
}
.mod-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(15,23,42,.13);
  border-color: color-mix(in srgb, var(--tile-color) 35%, #e8edf4);
}
.mod-tile:active { transform: translateY(-1px); }

/* ── Tile icon ──────────────────────────────────────────── */
.mod-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--tile-color) 10%, #f8fafc);
  color: var(--tile-color);
  font-size: 1.55rem;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(15,23,42,.07);
}
.mod-tile__icon svg {
  width: 26px; height: 26px;
  stroke: var(--tile-color); fill: none;
}

/* ── Tile text ──────────────────────────────────────────── */
.mod-tile__title {
  font-size: .9rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}
.mod-tile__desc {
  font-size: .74rem;
  color: #64748b;
  text-align: center;
  line-height: 1.45;
  word-break: break-word;
  flex: 1 1 auto;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* ── Tile footer ────────────────────────────────────────── */
.mod-tile__footer {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}
.mod-tile__version {
  font-size: .67rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

/* ── Tile badge ─────────────────────────────────────────── */
.mod-tile__badge {
  position: absolute;
  top: 9px; right: 9px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--tile-color);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

/* ── Detail footer bar ──────────────────────────────────── */
.mod-detail-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border-top: 1.5px solid #e2e8f0;
  box-shadow: 0 -4px 18px rgba(15,23,42,.08);
  transform: translateY(100%);
  opacity: 0;
  transition: transform .22s ease, opacity .18s ease;
  pointer-events: none;
}
.mod-detail-bar.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mod-detail-bar__accent {
  height: 3px;
  background: #0f172a;
  transition: background .15s ease;
}
.mod-detail-bar__content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  min-height: 54px;
}
.mod-detail-bar__icon {
  font-size: 1.4rem;
  flex: 0 0 auto;
  line-height: 1;
  transition: color .15s ease;
}
.mod-detail-bar__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mod-detail-bar__title {
  font-size: .88rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mod-detail-bar__desc {
  font-size: .76rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mod-detail-bar__ver {
  flex: 0 0 auto;
  font-size: .7rem;
  font-weight: 600;
  color: #94a3b8;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.mod-detail-bar__ver:empty { display: none; }

/* ── Empty / no-results ─────────────────────────────────── */
.mod-empty,
.mod-no-results {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1.5px dashed #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 22px 20px;
  color: #475569;
  font-size: .88rem;
  line-height: 1.55;
}
.mod-empty-icon {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e8edf4;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.mod-empty code {
  background: #e8edf4;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .88em;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 700px) {
  .mod-view { padding: 16px; }
  .mod-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .mod-tile { min-height: 150px; }
  .mod-header { flex-direction: column; align-items: flex-start; }
  .mod-search-wrap { min-width: 100%; }
}
