:root {
  --brandBlue: #2962ff;
  --brandBlueDark: #1e40af;
  --brandGreen: #00c853;
  --brandGreenDark: #16a34a;

  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --border: #e2e8f0;
  --border2: #cbd5e1;

  --text: #2d3748;
  --muted: #64748b;

  --radius: 18px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, #e8ecf1 100%);
  margin: 0;
  color: var(--text);
}

.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px 30px;
}

header.hero {
  margin-top: 18px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-inner {
  padding: 22px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand img {
  width: 230px;
  max-width: 70vw;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(41, 98, 255, 0.15);
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-meta strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-meta span {
  color: var(--muted);
  font-size: 0.9rem;
}

.network-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.toggle-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.toggle-btn.active {
  background: linear-gradient(135deg, var(--brandBlue) 0%, var(--brandGreen) 100%);
  color: #fff;
}

.toolbar {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.toolbar-top {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.context {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pill {
  background: linear-gradient(135deg, var(--brandBlue) 0%, var(--brandBlueDark) 100%);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(41, 98, 255, 0.25);
}

.context strong {
  font-size: 0.95rem;
}

.context .count {
  font-weight: 900;
  color: var(--brandBlue);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--brandBlue) 0%, var(--brandBlueDark) 100%);
  color: #fff;
  border-color: rgba(0, 0, 0, 0);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--border2);
}

.filters {
  padding: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(12, 1fr);
}

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

.field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

input,
select {
  padding: 11px 12px;
  border-radius: 12px;
  border: 2px solid var(--border);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  background: #fff;
}

input:focus,
select:focus {
  border-color: var(--brandBlue);
  box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.12);
}

.col-12 { grid-column: span 12; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

.results-wrap {
  margin-top: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 6px 12px;
}

.section-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  display: flex;
  gap: 10px;
  align-items: center;
}

.section-title::before {
  content: "";
  width: 6px;
  height: 22px;
  background: linear-gradient(180deg, var(--brandBlue) 0%, var(--brandGreen) 100%);
  border-radius: 6px;
}

.result-count {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
  border-color: rgba(41, 98, 255, 0.35);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-pill.active {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.status-pill.inactive {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.card-name {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.25;
  color: var(--brandBlueDark);
}

.card-meta {
  color: var(--muted);
  font-size: 0.92rem;
  display: grid;
  gap: 6px;
}

.card-meta strong {
  color: var(--text);
  font-weight: 800;
}

.card-meta a {
  color: var(--brandBlue);
  text-decoration: none;
  font-weight: 800;
}

.card-meta a:hover {
  text-decoration: underline;
}

.empty-state {
  display: none;
  text-align: center;
  padding: 40px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-weight: 700;
}

footer {
  margin-top: 22px;
  text-align: center;
  padding: 16px 0 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

footer p {
  margin: 4px 0;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1000;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: min(720px, 96vw);
  max-height: 85vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.modal-header {
  padding: 18px 18px 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
}

.modal-title {
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1.3;
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  font-weight: 900;
}

.modal-body {
  padding: 16px 18px 20px;
  display: grid;
  gap: 10px;
}

.taglist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
}

.tag {
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 900px) {
  .col-6 { grid-column: span 12; }
  .col-4 { grid-column: span 6; }
  .col-3 { grid-column: span 6; }
}

@media (max-width: 520px) {
  .col-4 { grid-column: span 12; }
  .col-3 { grid-column: span 12; }
  .brand img { width: 190px; }
  .toggle-btn { padding: 10px 12px; }
}

