:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #eef5f1;
  --text: #14231b;
  --muted: #66756c;
  --line: #dce7e0;
  --brand: #15734a;
  --brand-strong: #0d5837;
  --brand-soft: #e3f3ea;
  --accent: #d9a441;
  --danger: #bd4139;
  --shadow-sm: 0 8px 24px rgb(26 57 40 / 7%);
  --shadow-lg: 0 30px 80px rgb(15 43 28 / 15%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1510;
  --surface: #131f18;
  --surface-raised: #18271e;
  --surface-soft: #1a2d22;
  --text: #edf5f0;
  --muted: #9aaba0;
  --line: #293b31;
  --brand: #62c58e;
  --brand-strong: #8bd8ac;
  --brand-soft: #193a28;
  --danger: #ff8b82;
  --shadow-sm: 0 8px 24px rgb(0 0 0 / 18%);
  --shadow-lg: 0 30px 80px rgb(0 0 0 / 32%);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent);
  outline-offset: 2px;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.35;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.1rem;
}

small,
.muted {
  color: var(--muted);
}

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.icon-button:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.language-switcher {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-mark-small,
.brand-mark {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--brand), var(--brand-strong));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 24%, transparent);
  color: #fff;
  font-weight: 900;
}

/* Panel shell */
.panel-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-inline-end: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, var(--brand-soft));
}

.sidebar-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.brand-copy strong,
.brand-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy strong {
  font-size: 0.96rem;
}

.brand-copy small {
  font-size: 0.72rem;
}

.sidebar-close {
  display: none;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
}

.sidebar-nav {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 14px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.nav-label {
  margin: 4px 12px 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.nav-label-domains {
  margin-top: 24px;
}

.domain-navigation {
  display: grid;
  gap: 3px;
}

.nav-link {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  transition:
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.nav-link svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: currentColor;
}

.nav-link:hover {
  background: var(--surface-soft);
  color: var(--text);
  transform: translateX(calc(-2px * var(--direction-factor, 1)));
}

html[dir="ltr"] .nav-link:hover {
  --direction-factor: -1;
}

.nav-link[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.nav-link[aria-current="page"]::before {
  position: absolute;
  inset-block: 9px;
  inset-inline-start: -14px;
  width: 3px;
  border-radius: 10px;
  background: var(--brand);
  content: "";
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-avatar,
.profile-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 900;
}

.sidebar-user-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.sidebar-user-copy strong,
.sidebar-user-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy strong {
  font-size: 0.78rem;
}

.sidebar-user-copy small {
  font-size: 0.68rem;
}

.sidebar-backdrop {
  display: none;
}

.panel-main {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(20px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px);
}

.topbar-leading,
.topbar-actions {
  display: flex;
  align-items: center;
}

.topbar-leading {
  min-width: 0;
  gap: 12px;
}

.topbar-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.topbar-title small {
  font-size: 0.68rem;
}

.topbar-title strong {
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  gap: 8px;
}

.topbar-actions form {
  margin: 0;
}

.menu-button {
  display: none;
}

.logout-button {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.logout-button:hover {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  color: var(--danger);
}

.content {
  width: min(100%, 1240px);
  margin-inline: auto;
  padding: clamp(28px, 5vw, 54px) clamp(20px, 4vw, 44px) 70px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.eyebrow,
.login-kicker {
  margin: 0 0 7px;
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-description {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.8;
}

.badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.7rem;
  font-weight: 800;
}

.success::before {
  width: 7px;
  height: 7px;
  margin-inline-end: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent);
  content: "";
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-grid article,
.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-grid article {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 22px;
}

.stat-grid article > span,
.service-status-row {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.stat-grid strong {
  overflow-wrap: anywhere;
  font-size: 1.15rem;
}

.stat-grid small {
  line-height: 1.6;
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  position: absolute;
  inset-inline-end: -38px;
  inset-block-end: -45px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 7%, transparent);
  content: "";
}

.stat-card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.stat-card-realtime .stat-card-icon {
  background: color-mix(in srgb, #6b62d9 14%, var(--surface));
  color: #6b62d9;
}

.stat-card-worker .stat-card-icon {
  background: color-mix(in srgb, #d99b37 16%, var(--surface));
  color: #a46c13;
}

.surface {
  margin-top: 20px;
  padding: clamp(20px, 3vw, 28px);
}

.surface-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.surface-heading h2 {
  margin-bottom: 6px;
}

.surface-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: 1.05rem;
}

.details {
  display: grid;
  gap: 0;
  margin: 0;
}

.details div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(120px, 0.3fr) minmax(0, 1fr);
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.details div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.details dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  font-weight: 700;
}

.placeholder {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.placeholder h2 {
  margin: 14px 0 8px;
}

.placeholder p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.placeholder-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 22px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 2rem;
}

.identity-heading .page-description {
  max-width: 760px;
}

.identity-data-card {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--brand-soft) 45%, transparent),
      transparent 45%
    ),
    var(--surface);
}

.identity-data-card .eyebrow,
.identity-workflow .eyebrow {
  margin-bottom: 5px;
}

.identity-data-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.76rem;
  font-weight: 900;
}

.identity-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.identity-field {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 82%, var(--bg));
}

.identity-field span {
  color: var(--brand);
  font-size: 0.67rem;
  font-weight: 900;
}

.identity-field strong {
  overflow: hidden;
  font-size: 0.79rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-workflow {
  margin-top: 28px;
}

.identity-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.identity-stage {
  min-height: 225px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.identity-stage-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 24px;
}

.identity-stage-number {
  color: color-mix(in srgb, var(--text) 14%, transparent);
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.identity-stage-status {
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #d99b37 13%, transparent);
  color: #9a6410;
  font-size: 0.63rem;
  font-weight: 800;
}

.identity-stage-status.ready {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.identity-stage small {
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 800;
}

.identity-stage h3 {
  margin: 8px 0 9px;
  font-size: 1rem;
}

.identity-stage p,
.identity-security-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.85;
}

.identity-security-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  border-radius: 15px;
  background: var(--brand-soft);
}

.identity-security-note > span {
  color: var(--brand);
}

.identity-security-note strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.8rem;
}

.service-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

/* Login */
.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(0, 1.08fr);
  background: var(--bg);
}

.login-presentation {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(28px, 5vw, 68px);
  background:
    radial-gradient(circle at 18% 20%, rgb(255 255 255 / 12%), transparent 30%),
    linear-gradient(145deg, #0b5133, #123d2a 62%, #102f22);
  color: #fff;
}

.login-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 13px;
}

.login-brand .brand-mark-small {
  background: rgb(255 255 255 / 15%);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.login-presentation-copy {
  position: relative;
  z-index: 2;
  max-width: 660px;
  margin-block: auto;
}

.login-presentation-copy h2 {
  max-width: 620px;
  margin: 14px 0 32px;
  font-size: clamp(1.8rem, 3.8vw, 3.6rem);
  line-height: 1.55;
  letter-spacing: -0.04em;
}

.login-kicker {
  color: #a6e4c2;
}

.login-features {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgb(255 255 255 / 78%);
  font-size: 0.84rem;
}

.login-features li::before {
  width: 22px;
  height: 22px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 50%;
  color: #a6e4c2;
  content: "✓";
  font-size: 0.65rem;
}

.login-orbit {
  position: absolute;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 50%;
}

.login-orbit-one {
  width: 480px;
  height: 480px;
  inset-inline-end: -220px;
  inset-block-end: -150px;
}

.login-orbit-two {
  width: 310px;
  height: 310px;
  inset-inline-end: -130px;
  inset-block-end: -65px;
}

.login-form-panel {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 80px clamp(22px, 6vw, 90px) 40px;
}

.login-toolbar {
  position: absolute;
  inset-block-start: 24px;
  inset-inline-end: 28px;
  display: flex;
  gap: 8px;
}

.login-card {
  width: min(100%, 470px);
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.login-card h1 {
  margin-bottom: 10px;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
}

.login-card .muted {
  margin-bottom: 0;
  font-size: 0.8rem;
  line-height: 1.8;
}

.login-mobile-brand {
  display: none;
  margin-bottom: 24px;
}

.login-card form {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.login-card label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.login-card input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 10%, transparent);
  outline: 0;
}

.auth-single-shell {
  display: block;
  background:
    radial-gradient(circle at 12% 8%, var(--brand-soft), transparent 30%),
    var(--bg);
}

.auth-wide-card {
  width: min(100%, 760px);
}

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

.auth-grid > div {
  display: grid;
  gap: 8px;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.76rem;
}

.auth-links-centered {
  justify-content: center;
}

.auth-links a {
  color: var(--brand-strong);
  font-weight: 750;
}

.success-message,
.development-otp {
  margin: 18px 0 0;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.76rem;
  line-height: 1.7;
}

.panel-user-create,
.panel-user-card {
  margin-bottom: 24px;
}

.panel-user-form {
  display: grid;
  gap: 20px;
  margin-top: 22px;
}

.panel-user-form label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.panel-user-form input:not([type="checkbox"]) {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
}

.access-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.access-checks legend {
  padding-inline: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.access-checks label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg);
}

.panel-user-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel-user-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.panel-user-card small {
  color: var(--muted);
}

.app-user-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 0.45fr) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 24px;
}

.app-user-filters label,
.app-user-edit-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.app-user-filters input,
.app-user-filters select,
.app-user-edit-form input {
  width: 100%;
  height: 48px;
  padding-inline: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
}

.app-user-filters .primary-button {
  margin: 0;
}

.app-user-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.app-user-card {
  display: grid;
  gap: 20px;
}

.app-user-card-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.app-user-card-heading h2,
.app-user-card-heading p {
  margin: 0;
}

.app-user-card-heading h2 {
  font-size: 1rem;
}

.app-user-card-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.app-user-avatar {
  position: relative;
  overflow: hidden;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 900;
}

.profile-image-avatar {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.profile-image-avatar > span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.profile-image-avatar > img {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface);
}

.app-user-detail-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-user-detail-avatar {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 3px solid var(--surface);
  border-radius: 24px;
  background: var(--brand-soft);
  box-shadow: var(--shadow-sm);
  color: var(--brand-strong);
  font-size: 1.35rem;
  font-weight: 900;
}

.app-user-card-details,
.review-details {
  display: grid;
  gap: 0;
  margin: 0;
}

.app-user-card-details div,
.review-details div {
  display: grid;
  grid-template-columns: minmax(100px, 0.5fr) minmax(0, 1fr);
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.app-user-card-details div:last-child,
.review-details div:last-child {
  border-bottom: 0;
}

.app-user-card-details dt,
.review-details dt {
  color: var(--muted);
  font-size: 0.73rem;
}

.app-user-card-details dd,
.review-details dd {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
}

.app-user-link,
.back-link,
.pagination a {
  color: var(--brand-strong);
  font-weight: 800;
}

.app-user-link {
  justify-self: end;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
}

.pagination-disabled {
  color: var(--muted);
  opacity: 0.55;
}

.app-user-detail-heading .back-link {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 0.76rem;
}

.app-user-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.app-user-detail-grid h2,
.app-user-edit h2,
.review-section h2 {
  margin-bottom: 16px;
  font-size: 1rem;
}

.app-user-edit,
.review-section {
  margin-top: 18px;
}

.app-user-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 14px;
}

.app-user-edit-form .primary-button {
  margin: 0;
}

.review-list {
  display: grid;
  gap: 12px;
}

.review-list > article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}

.review-list-heading,
.surface-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.review-details.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
}

.status-pill {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.65rem;
  font-weight: 850;
}

.status-pill.rejected,
.status-pill.failed,
.status-pill.inactive {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
}

.session-agent {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.7;
}

.primary-button {
  min-height: 50px;
  margin-top: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 12px 24px color-mix(in srgb, var(--brand) 20%, transparent);
  color: #fff;
  font-weight: 800;
}

.primary-button:hover {
  filter: brightness(1.05);
}

.error {
  margin: 18px 0 0;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--danger);
  font-size: 0.76rem;
  line-height: 1.7;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 22px;
}

.report-filters label,
.report-status-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.report-filters select,
.report-status-form select {
  min-height: 44px;
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
}

.report-filters .primary-button {
  min-height: 44px;
  margin: 0;
}

.report-grid {
  display: grid;
  gap: 16px;
}

.report-card {
  display: grid;
  gap: 18px;
}

.report-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.report-card-header time {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 0.72rem;
}

.report-status {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 850;
}

.report-status-reviewing {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.report-status-resolved {
  background: color-mix(in srgb, var(--brand) 13%, transparent);
  color: var(--brand);
}

.report-status-rejected {
  background: color-mix(in srgb, var(--danger) 11%, transparent);
  color: var(--danger);
}

.report-parties {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-party {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.report-party > span,
.report-details dt {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 750;
}

.report-party a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.report-party a small {
  color: var(--muted);
  direction: ltr;
  grid-column: 2;
  justify-self: start;
}

.report-party-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  grid-row: 1 / 3;
}

.report-details {
  display: grid;
  gap: 12px;
  margin: 0;
}

.report-details div {
  display: grid;
  gap: 6px;
}

.report-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.8;
}

.report-status-form {
  display: grid;
  grid-template-columns: minmax(180px, 280px) auto;
  gap: 12px;
  align-items: end;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.secondary-button {
  min-height: 44px;
  padding-inline: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 800;
}

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

  .stat-card:last-child {
    grid-column: 1 / -1;
  }

  .login-presentation-copy h2 {
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  }
}

@media (max-width: 900px) {
  .panel-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(86vw, 320px);
    height: 100dvh;
    box-shadow: var(--shadow-lg);
    transform: translateX(110%);
    transition: transform 220ms ease;
  }

  html[dir="ltr"] .sidebar {
    transform: translateX(-110%);
  }

  .panel-shell[data-menu-open] .sidebar {
    transform: translateX(0);
  }

  .sidebar-close,
  .menu-button {
    display: inline-grid;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    padding: 0;
    border: 0;
    background: rgb(3 16 9 / 52%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
    backdrop-filter: blur(3px);
  }

  .panel-shell[data-menu-open] .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar {
    height: 72px;
    padding-inline: 16px;
  }

  .content {
    padding-block-start: 28px;
  }

  .login-shell {
    display: block;
  }

  .login-presentation {
    display: none;
  }

  .login-form-panel {
    min-height: 100dvh;
    padding: 82px 20px 34px;
    background:
      radial-gradient(circle at 15% 8%, var(--brand-soft), transparent 34%),
      var(--bg);
  }

  .identity-field-grid,
  .identity-stage-grid {
    grid-template-columns: 1fr;
  }

  .identity-stage {
    min-height: auto;
  }

  .login-mobile-brand {
    display: grid;
  }
}

@media (max-width: 620px) {
  .topbar-title small,
  .logout-button span:first-child {
    display: none;
  }

  .logout-button {
    width: 42px;
    justify-content: center;
    padding: 0;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 24px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .stat-card:last-child {
    grid-column: auto;
  }

  .details div {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .content {
    padding-inline: 16px;
  }

  .surface,
  .stat-grid article {
    padding: 19px;
  }

  .login-card {
    padding: 25px 20px;
    border-radius: 20px;
  }

  .login-toolbar {
    inset-inline-end: 20px;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

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

  .app-user-filters,
  .app-user-grid,
  .app-user-detail-grid,
  .app-user-edit-form,
  .review-details.compact,
  .report-filters,
  .report-parties,
  .report-status-form {
    grid-template-columns: 1fr;
  }

  .report-card-header time {
    width: 100%;
    margin-inline-start: 0;
  }

  .app-user-card-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .app-user-card-heading .badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .auth-links {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
