:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #16233a;
  background: #f2f6fc;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(55, 112, 220, 0.16), transparent 30rem),
    linear-gradient(180deg, #f8fbff, #eef3fb);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 0.78rem 1rem;
  background: #173f91;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button.secondary {
  border: 1px solid #cad5e7;
  background: #fff;
  color: #29405f;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd6e7;
  border-radius: 11px;
  padding: 0.7rem 0.8rem;
  background: #fff;
  color: #16233a;
}

label {
  display: grid;
  gap: 0.38rem;
}

label span {
  color: #526178;
  font-size: 0.82rem;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

.shell {
  width: min(1500px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hidden {
  display: none !important;
}

.section-tabs {
  display: flex;
  gap: 10px;
  margin: 0 0 20px;
}

.section-tabs button {
  width: auto;
  background: #e9eef8;
  color: #263957;
}

.section-tabs button.active {
  background: #253f91;
  color: #fff;
}

.extension-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(180px, 1fr) minmax(280px, 1.4fr);
  gap: 24px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid #dfe6f2;
}

.extension-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.extension-identity strong {
  font-size: 18px;
}

.extension-link {
  display: flex;
  gap: 8px;
  align-items: end;
}

.extension-link select {
  min-width: 210px;
}

@media (max-width: 900px) {
  .extension-row {
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  margin-bottom: 0.45rem;
  color: #2459be;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.muted {
  color: #65738a;
}

.error {
  color: #a12626;
  font-weight: 650;
}

.card,
.stat-card {
  border: 1px solid rgba(40, 69, 115, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 45px rgba(36, 61, 102, 0.08);
}

.login-layout {
  min-height: calc(100vh - 6rem);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 480px);
  align-items: center;
  gap: 4rem;
}

.brand-panel h1 {
  max-width: 760px;
  margin-bottom: 1rem;
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.brand-panel > p:last-child {
  max-width: 620px;
  color: #526178;
  font-size: 1.15rem;
}

.brand-mark {
  display: grid;
  width: 76px;
  height: 76px;
  margin-bottom: 2rem;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(145deg, #ef9d3e, #ffd57b);
  color: white;
  font-size: 1.7rem;
  font-weight: 900;
}

.login-card {
  display: grid;
  gap: 1.1rem;
  padding: 2rem;
}

.topbar,
.section-heading,
.list-heading,
.actions,
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar {
  margin-bottom: 1.5rem;
}

.topbar h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card {
  display: grid;
  gap: 0.4rem;
  padding: 1.25rem;
}

.stat-card span {
  color: #69768a;
  font-size: 0.84rem;
}

.stat-card strong {
  font-size: 1.55rem;
}

#admin-view > .card {
  margin-bottom: 1rem;
  padding: 1.4rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.wide {
  grid-column: 1 / -1;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
  width: min(980px, 100%);
}

.search-form .search-query {
  flex: 1 1 280px;
}

.search-form select {
  width: auto;
  min-width: 145px;
}

.users-list {
  display: grid;
  gap: 0.8rem;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) minmax(180px, 0.8fr) 150px 150px minmax(180px, 0.8fr) auto;
  gap: 0.85rem;
  align-items: start;
  padding: 1rem 0;
  border-top: 1px solid #e2e8f2;
}

.identity {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 0.75rem;
}

.avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: #dfe8f8;
  color: #21427e;
  font-weight: 900;
  object-fit: cover;
}

.identity-fields {
  display: grid;
  gap: 0.4rem;
}

.field-caption {
  display: block;
  margin-bottom: 0.35rem;
  color: #718096;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.memberships {
  color: #526178;
  font-size: 0.9rem;
  line-height: 1.45;
}

.pagination {
  margin-top: 1rem;
  justify-content: flex-end;
}

@media (max-width: 1050px) {
  .user-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .login-layout,
  .stats,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .login-layout {
    gap: 2rem;
  }

  .wide {
    grid-column: auto;
  }

  .topbar,
  .list-heading,
  .search-form {
    align-items: stretch;
    flex-direction: column;
  }

  .user-row {
    grid-template-columns: 1fr;
  }
}
