.cat-shell {
  --cat-ink: #18212f;
  --cat-muted: #667085;
  --cat-line: #d9e1ea;
  --cat-panel: #ffffff;
  --cat-soft: #f6f8fb;
  --cat-accent: #126b60;
  --cat-second: #7a3b18;
  min-height: 100vh;
  background: var(--cat-soft);
  color: var(--cat-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cat-hero {
  padding: 28px clamp(16px, 4vw, 42px) 22px;
  background: #ffffff;
  border-bottom: 1px solid var(--cat-line);
}

.cat-eyebrow,
.cat-card-family {
  margin: 0 0 4px;
  color: var(--cat-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.cat-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.cat-subtitle {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--cat-muted);
  font-size: 18px;
}

.cat-sort span,
.cat-segment legend {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
}

.cat-sort select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--cat-line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--cat-ink);
  font: inherit;
}

.cat-search-bar {
  margin-bottom: 12px;
}

.cat-search-bar label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
}

.cat-search-bar input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--cat-line);
  border-radius: 8px;
  padding: 9px 14px;
  background: #fff;
  color: var(--cat-ink);
  font: inherit;
  font-size: 15px;
}

.cat-layout {
  padding: 18px clamp(16px, 4vw, 42px) 30px;
}

/* ── Horizontal filter bar ─────────────────────────────────────── */

.cat-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  border: 1px solid var(--cat-line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.cat-segment {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
}

.cat-segment legend {
  float: left;
  width: 100%;
  margin-bottom: 6px;
  padding: 0;
}

.cat-segment button,
.cat-active-filters button {
  border: 1px solid var(--cat-line);
  border-radius: 8px;
  background: #fff;
  padding: 7px 12px;
  color: var(--cat-ink);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.2;
}

.cat-segment button.is-active,
.cat-active-filters button {
  border-color: var(--cat-accent);
  background: #eef8f5;
  color: #0f514a;
}

.cat-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cat-field span {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.cat-field select {
  min-height: 36px;
  min-width: 130px;
  border: 1px solid var(--cat-line);
  border-radius: 8px;
  padding: 5px 10px;
  background: #fff;
  color: var(--cat-ink);
  font: inherit;
  font-size: 13px;
}

.cat-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-end;
  padding-bottom: 2px;
  color: var(--cat-muted);
  font-size: 13px;
  white-space: nowrap;
}

.cat-filter-reset {
  align-self: flex-end;
  margin-left: auto;
  padding-bottom: 2px;
}

/* ── Toolbar & layout ──────────────────────────────────────────── */

.cat-toolbar,
.cat-card-top,
.cat-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cat-toolbar h2 {
  margin: 0;
  letter-spacing: 0;
}

.cat-content {
  min-width: 0;
}

.cat-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.cat-kpi {
  border: 1px solid var(--cat-line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.cat-kpi strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.cat-kpi span {
  display: block;
  margin-top: 6px;
  font-weight: 800;
}

.cat-kpi p,
#catResultMeta,
.cat-description {
  margin: 4px 0 0;
  color: var(--cat-muted);
}

.cat-toolbar {
  margin-bottom: 12px;
}

.cat-sort {
  min-width: 180px;
}

.cat-sort span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
}

.cat-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.cat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* ── Overlay ───────────────────────────────────────────────────── */

.cat-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 33, 47, 0.55);
  backdrop-filter: blur(4px);
  padding: 16px;
}

.cat-overlay[hidden] {
  display: none;
}

body.cat-overlay-open {
  overflow: hidden;
}

.cat-overlay-box {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 40px 36px 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  animation: cat-card-in 0.25s ease both;
}

.cat-overlay-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--cat-muted);
  cursor: pointer;
  padding: 4px 8px;
}

.cat-overlay-close:hover {
  color: var(--cat-ink);
}

.cat-overlay-icon {
  display: block;
  font-size: 48px;
  margin-bottom: 16px;
}

.cat-overlay-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
}

.cat-overlay-msg {
  color: var(--cat-muted);
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.5;
}

.cat-overlay-cta {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
}

/* ── Card animations ───────────────────────────────────────────── */

@keyframes cat-card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cat-card {
  display: grid;
  grid-template-rows: 96px minmax(0, 1fr);
  grid-template-columns: 1fr;
  border: 1px solid var(--cat-line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  animation: cat-card-in 0.3s ease both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}

.cat-card:nth-child(1)  { animation-delay: 0.00s; }
.cat-card:nth-child(2)  { animation-delay: 0.04s; }
.cat-card:nth-child(3)  { animation-delay: 0.08s; }
.cat-card:nth-child(4)  { animation-delay: 0.12s; }
.cat-card:nth-child(5)  { animation-delay: 0.16s; }
.cat-card:nth-child(6)  { animation-delay: 0.20s; }
.cat-card:nth-child(7)  { animation-delay: 0.24s; }
.cat-card:nth-child(8)  { animation-delay: 0.28s; }
.cat-card:nth-child(9)  { animation-delay: 0.32s; }
.cat-card:nth-child(10) { animation-delay: 0.36s; }
.cat-card:nth-child(11) { animation-delay: 0.40s; }
.cat-card:nth-child(12) { animation-delay: 0.44s; }

.cat-card-accent {
  display: flex;
  align-items: flex-end;
  padding: 12px 16px;
  color: #fff;
}

.cat-card-banner-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.cat-card-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.cat-card h3 {
  font-size: 19px;
  line-height: 1.2;
}

.cat-area {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f1f3f6;
  color: var(--cat-muted);
  font-size: 12px;
  font-weight: 800;
}

.cat-area.professionale {
  background: #fff3e8;
  color: var(--cat-second);
}

.cat-description {
  min-height: 44px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cat-dept-badge {
  border-radius: 999px;
  background: #fef3c7;
  padding: 4px 8px;
  color: #92400e;
  font-size: 12px;
  font-weight: 700;
}

.cat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cat-tags span,
.cat-card-foot span {
  border-radius: 999px;
  background: #f4f6f8;
  padding: 4px 8px;
  color: #4d5b6b;
  font-size: 12px;
  font-weight: 700;
}

.cat-meters {
  display: grid;
  gap: 5px;
}

.cat-meters strong {
  font-size: 12px;
  text-transform: uppercase;
}

.cat-meter {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--cat-muted);
  font-size: 12px;
}

.cat-meter i {
  height: 7px;
  border-radius: 999px;
  background: #edf1f5;
  overflow: hidden;
}

.cat-meter b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cat-accent);
}

.cat-card-foot {
  margin-top: auto;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.cat-card-foot .btn {
  margin-left: auto;
}

.cat-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}

.cat-pagination .is-active {
  background: var(--cat-accent);
  border-color: var(--cat-accent);
  color: #fff;
}

.cat-page-gap {
  padding: 5px 4px;
  color: var(--cat-muted);
}

.cat-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--cat-line);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
  color: var(--cat-muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .cat-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .cat-dashboard,
  .cat-list {
    grid-template-columns: 1fr;
  }

  .cat-filter-reset {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .cat-hero {
    padding-top: 20px;
  }

  .cat-toolbar,
  .cat-card-top {
    align-items: stretch;
    flex-direction: column;
  }

  .cat-sort {
    min-width: 0;
  }

  .cat-card-accent {
    font-size: 28px;
  }

  .cat-card-foot .btn {
    width: 100%;
    margin-left: 0;
  }

  .cat-field select {
    min-width: 0;
    width: 100%;
  }
}
