:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --soft: #eef4f5;
  --ink: #172129;
  --muted: #60717c;
  --line: #d7e2e5;
  --brand: #d91f2f;
  --brand-dark: #a71320;
  --blue: #177a9c;
  --green: #20845f;
  --yellow: #f2c84b;
  --shadow: 0 18px 50px rgba(23, 33, 41, .1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

body.admin-dashboard {
  --bg: #10171b;
  --surface: #ffffff;
  --soft: #eef4f5;
  --ink: #172129;
  --muted: #647681;
  --line: #d6e1e5;
  background:
    linear-gradient(180deg, #10171b 0, #142026 330px, #f4f7f8 331px),
    #f4f7f8;
}

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

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 44px);
  background: rgba(16, 23, 27, .92);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  color: #f7fbfc;
  backdrop-filter: blur(18px);
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.admin-brand strong,
.admin-brand small {
  display: block;
}

.admin-brand small {
  color: rgba(247, 251, 252, .66);
  margin-top: 3px;
}

.admin-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.admin-mark.wr-mark {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), #f45138);
  box-shadow: 0 12px 28px rgba(217, 31, 47, .24);
}

.admin-mark.wr-mark::before {
  content: none;
}

.admin-mark.wr-mark::after {
  content: none;
}

.admin-mark.wr-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.admin-topbar nav {
  display: flex;
  gap: 10px;
}

.admin-topbar nav a,
.actions a,
button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  cursor: pointer;
}

.admin-topbar nav a {
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .07);
  color: #f7fbfc;
  font-weight: 800;
}

.admin-topbar nav a:hover {
  border-color: rgba(255, 255, 255, .32);
  background: rgba(255, 255, 255, .13);
}

button {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

button:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.ghost-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.admin-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px clamp(16px, 4vw, 44px) 60px;
}

.admin-hero {
  margin-bottom: 22px;
}

.admin-hero p {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 4rem);
}

.admin-hero span {
  color: var(--muted);
}

.dashboard-shell {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 44px) 70px;
}

.dashboard-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  min-height: 280px;
  margin-bottom: 18px;
  padding: clamp(24px, 4vw, 40px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(217, 31, 47, .42), transparent 34%),
    linear-gradient(22deg, rgba(23, 122, 156, .42), transparent 50%),
    linear-gradient(180deg, #1b2a31, #10171b);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
  color: #f7fbfc;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .16) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px);
  background-size: 38px 38px;
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 24deg, rgba(255, 255, 255, .09) 0 12deg, transparent 12deg 24deg);
  animation: dashboardRadar 24s linear infinite;
}

.dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.dashboard-hero h1 {
  max-width: 780px;
  margin: 0 0 10px;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: .95;
  letter-spacing: 0;
}

.dashboard-hero span {
  display: block;
  max-width: 680px;
  color: rgba(247, 251, 252, .76);
  line-height: 1.5;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.dashboard-actions .ghost-action {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .1);
  color: #f7fbfc;
}

.dashboard-actions button {
  min-height: 46px;
  box-shadow: 0 16px 32px rgba(217, 31, 47, .28);
}

.kicker {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(23, 33, 41, .1);
}

.metric-icon {
  display: block;
  width: 12px;
  height: 12px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 8px rgba(23, 122, 156, .12);
}

.metric-card.is-good .metric-icon {
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(32, 132, 95, .14);
}

.metric-card.is-warning .metric-icon {
  background: var(--yellow);
  box-shadow: 0 0 0 8px rgba(242, 200, 75, .18);
}

.metric-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.45rem;
}

.metric-card small {
  color: var(--muted);
  line-height: 1.45;
}

.alarm-panel {
  display: grid;
  grid-template-columns: minmax(260px, .75fr) minmax(360px, 1.25fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid rgba(217, 31, 47, .24);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(217, 31, 47, .12), rgba(23, 122, 156, .08)),
    var(--surface);
  box-shadow: var(--shadow);
}

.alarm-panel h2 {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
}

.alarm-panel span {
  display: block;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.5;
}

.alarm-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

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

.alarm-console label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 900;
}

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

.alarm-console textarea {
  min-height: 96px;
}

.ghost-action.danger {
  border-color: rgba(217, 31, 47, .35);
  color: var(--brand-dark);
}

.alarm-actions small {
  flex-basis: 100%;
  color: var(--muted);
  text-align: right;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.dashboard-side {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: #152127;
  color: #f7fbfc;
  box-shadow: 0 20px 54px rgba(0, 0, 0, .18);
}

.dashboard-side strong {
  margin-bottom: 6px;
}

.dashboard-side a {
  display: flex;
  min-height: 40px;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  color: rgba(247, 251, 252, .72);
  font-weight: 800;
}

.dashboard-side a:hover {
  background: rgba(255, 255, 255, .1);
  color: #f7fbfc;
}

.side-note {
  margin-top: 10px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}

.side-note span {
  color: var(--brand);
  font-weight: 900;
}

.side-note p {
  margin: 8px 0 0;
  color: rgba(247, 251, 252, .65);
  line-height: 1.45;
}

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

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

.command-panel a {
  display: grid;
  min-height: 112px;
  align-content: space-between;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.command-panel span {
  color: var(--brand);
  font-size: .82rem;
  font-weight: 900;
}

.command-panel strong {
  font-size: 1.2rem;
}

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

.panel,
.login-card,
.login-intro {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
}

.panel h2 {
  margin: 0;
}

.panel h3 {
  margin: 0;
  font-size: 1.35rem;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--soft);
  color: var(--muted);
  font-size: .88rem;
  font-weight: 800;
}

.panel-head.compact {
  margin-bottom: 16px;
  padding-bottom: 14px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--soft);
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

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

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

fieldset {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.card-editor {
  margin-top: 16px;
}

legend {
  padding: 0 8px;
  font-weight: 900;
}

fieldset label {
  margin-top: 10px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-weight: 800;
}

.notice.success {
  background: #dff3e9;
  color: #176043;
}

.notice.error {
  background: #ffe2e2;
  color: #9d1720;
}

.api-secret {
  display: grid;
  gap: 8px;
}

.api-secret code,
.code-panel code {
  display: block;
  overflow-x: auto;
  border-radius: 8px;
  padding: 12px;
  background: #142026;
  color: #f7fbfc;
  font-family: Consolas, Monaco, monospace;
  font-size: .92rem;
}

.user-zone {
  margin-top: 24px;
  padding-top: 8px;
}

.user-zone-head {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.user-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.user-panel {
  margin-bottom: 18px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
}

.avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 900;
}

.profile-card strong,
.profile-card small {
  display: block;
}

.profile-card small {
  margin-top: 4px;
  color: var(--muted);
}

.locked-box {
  padding: 16px;
  border-radius: 8px;
  background: var(--soft);
}

.locked-box p {
  margin: 8px 0 0;
  color: var(--muted);
}

.user-list-panel {
  overflow: hidden;
}

.user-table {
  display: grid;
  gap: 8px;
}

.user-row {
  display: grid;
  grid-template-columns: 1.2fr 1.1fr .9fr .9fr;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--soft);
}

.user-row-head {
  min-height: 42px;
  background: var(--ink);
  color: var(--surface);
  font-size: .85rem;
  font-weight: 900;
  text-transform: uppercase;
}

.user-row strong,
.user-row small {
  display: block;
}

.user-row small {
  margin-top: 4px;
  color: var(--muted);
}

.user-row-head small {
  color: inherit;
}

.role-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
}

.mini-role-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 6px;
}

.mini-role-form select {
  min-height: 36px;
  padding: 7px 9px;
}

.mini-role-form button {
  min-height: 36px;
  padding: 0 8px;
}

.role-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.role-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.role-card span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 900;
}

.role-card h3 {
  margin: 0 0 10px;
}

.role-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.role-card.tone-danger span { background: var(--brand); }
.role-card.tone-blue span { background: var(--blue); }
.role-card.tone-green span { background: var(--green); }
.role-card.tone-yellow span { background: var(--yellow); color: var(--ink); }
.role-card.tone-dark span { background: var(--ink); }
.role-card.tone-muted span { background: var(--muted); }

.site-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.integration-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.integration-card span {
  color: var(--brand);
  font-size: .82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.integration-card h3 {
  margin: 8px 0;
}

.integration-card p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.api-table .user-row {
  grid-template-columns: 1.15fr .95fr 1fr .75fr;
}

.code-panel {
  display: grid;
  gap: 10px;
}

.partner-portal {
  width: min(1540px, 100%);
}

.partner-dashboard-hero {
  min-height: 320px;
  background:
    linear-gradient(118deg, rgba(217, 31, 47, .46), transparent 35%),
    linear-gradient(24deg, rgba(32, 132, 95, .24), transparent 46%),
    linear-gradient(180deg, #17272f, #10171b);
}

.partner-dashboard-hero h1 {
  max-width: 900px;
}

.partner-overview .metric-card {
  min-height: 174px;
}

.partner-alert-panel {
  border-color: rgba(23, 122, 156, .28);
  background:
    linear-gradient(118deg, rgba(23, 122, 156, .12), rgba(217, 31, 47, .08)),
    var(--surface);
}

.partner-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.partner-flow article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px 14px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.partner-flow span {
  display: grid;
  grid-row: span 2;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #142026;
  color: #f7fbfc;
  font-weight: 900;
}

.partner-flow strong {
  font-size: 1.08rem;
}

.partner-flow p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.partner-layout {
  grid-template-columns: 300px minmax(0, 1fr);
}

.partner-panel {
  border-color: color-mix(in srgb, var(--line) 72%, var(--blue));
}

.partner-panel .form-grid {
  align-items: end;
}

.partner-site-list .integration-card {
  min-height: 132px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(238, 244, 245, .88));
}

.partner-doc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: 14px;
  align-items: stretch;
}

.partner-doc-grid .locked-box {
  display: grid;
  align-content: center;
}

.partner-doc-grid code {
  font-family: Consolas, Monaco, monospace;
}

.ad-admin-list {
  display: grid;
  gap: 10px;
}

.ad-admin-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 190px;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(23, 33, 41, .07);
}

.ad-admin-card.no-media {
  grid-template-columns: minmax(0, 1fr) 190px;
}

.ad-admin-media {
  position: relative;
  min-height: 116px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.ad-admin-image {
  display: block;
  width: 100%;
  height: 128px;
  object-fit: contain;
  padding: 8px;
  background: #fff;
}

.ad-admin-logo {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 33, 41, .16);
}

.ad-admin-media .ad-admin-logo:first-child {
  position: static;
  width: 100%;
  height: 116px;
  box-shadow: none;
}

.ad-admin-card.status-approved {
  border-color: rgba(32, 132, 95, .28);
  background:
    linear-gradient(90deg, rgba(32, 132, 95, .08), transparent 34%),
    #fff;
}

.ad-admin-card.status-rejected {
  opacity: .72;
}

.ad-admin-card span {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  border-radius: 8px;
  padding: 0 9px;
  background: #142026;
  color: #f7fbfc;
  font-size: .8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ad-admin-card h3,
.ad-admin-card p {
  margin: 8px 0 0;
}

.ad-admin-card h3 {
  font-size: 1.18rem;
}

.ad-admin-card p,
.ad-admin-card small {
  color: var(--muted);
  line-height: 1.45;
}

.ad-admin-card a {
  display: inline-block;
  margin-top: 8px;
  color: var(--blue);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ad-admin-actions {
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.ad-admin-actions form,
.ad-admin-actions button,
.ad-admin-actions .ghost-action {
  width: 100%;
}

.ad-editor {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.ad-editor summary {
  display: inline-grid;
  min-height: 36px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 900;
}

.ad-editor summary::-webkit-details-marker {
  display: none;
}

.ad-editor summary::after {
  content: " öffnen";
  color: var(--muted);
  font-weight: 800;
}

.ad-editor[open] summary {
  margin-bottom: 12px;
  border-color: rgba(23, 122, 156, .38);
  color: var(--blue);
}

.ad-editor[open] summary::after {
  content: " schließen";
}

.ad-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(23, 122, 156, .07), transparent 42%),
    #f7fafb;
}

.ad-editor-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
}

.ad-editor-grid input,
.ad-editor-grid select,
.ad-editor-grid textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.ad-editor-grid textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.45;
}

.ad-editor-grid input[type="file"] {
  padding: 8px;
}

.ad-editor-grid input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: 10px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: #142026;
  color: #fff;
  font-weight: 900;
}

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

.ad-editor-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.ad-status-pill {
  display: grid;
  min-height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 900;
}

.admin-login {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(217, 31, 47, .34), transparent 34%),
    linear-gradient(28deg, rgba(23, 122, 156, .42), transparent 54%),
    linear-gradient(180deg, #10171b, #17252c 58%, #10171b);
}

.admin-login::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .24;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .16) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px),
    repeating-linear-gradient(112deg, transparent 0 20px, rgba(255, 255, 255, .08) 20px 22px, transparent 22px 44px);
  background-size: 42px 42px, 42px 42px, auto;
}

.admin-login::after {
  content: "";
  position: absolute;
  right: 8vw;
  top: 9vh;
  width: min(48vw, 620px);
  height: min(48vw, 620px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  background:
    repeating-conic-gradient(from 15deg, rgba(255, 255, 255, .10) 0 10deg, transparent 10deg 24deg);
  animation: dashboardRadar 26s linear infinite;
}

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(320px, 390px);
  gap: 22px;
  width: min(960px, 100%);
  align-items: center;
}

.login-intro {
  position: relative;
  min-height: 460px;
  padding: clamp(26px, 3.2vw, 42px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .95), rgba(238, 244, 245, .88));
  overflow: hidden;
}

.login-intro::after {
  content: "";
  position: absolute;
  right: 32px;
  bottom: 36px;
  width: 78px;
  height: 128px;
  clip-path: polygon(42% 0, 82% 0, 58% 38%, 88% 38%, 26% 100%, 43% 52%, 16% 52%);
  background: #f2c84b;
  filter: drop-shadow(0 0 22px rgba(242, 200, 75, .48));
}

.login-intro h1 {
  max-width: 420px;
  margin: 48px 0 16px;
  font-size: clamp(2.75rem, 4vw, 4.25rem);
  line-height: .94;
  overflow-wrap: normal;
}

.login-intro h1 span {
  display: block;
}

.login-intro p {
  max-width: 430px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.login-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.login-status span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.login-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
}

.login-card {
  align-self: center;
  width: 100%;
  padding: 26px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
}

.login-card h2 {
  margin: 0 0 14px;
  font-size: 2rem;
}

.login-card form {
  display: grid;
  gap: 14px;
}

.login-card button {
  min-height: 48px;
  box-shadow: 0 16px 32px rgba(217, 31, 47, .24);
}

.login-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
}

.login-link:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--brand) 44%, var(--line));
}

.login-eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: .8rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

  .dashboard-overview {
    grid-template-columns: 1fr;
  }

  .command-panel,
  .user-grid,
  .role-board,
  .ad-admin-card,
  .partner-flow,
  .partner-doc-grid {
    grid-template-columns: 1fr;
  }

  .user-row,
  .user-row-head,
  .api-table .user-row {
    grid-template-columns: 1fr;
  }

  .user-row-head {
    display: none;
  }

  .dashboard-side {
    position: relative;
    top: auto;
  }

  .dashboard-actions {
    justify-content: flex-start;
  }

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

  .alarm-console {
    grid-template-columns: 1fr;
  }

  .alarm-actions {
    justify-content: flex-start;
  }

  .alarm-actions button,
  .alarm-actions .ghost-action {
    width: 100%;
  }

  .alarm-actions small {
    text-align: left;
  }

  .ad-admin-actions {
    justify-content: flex-start;
  }

  .ad-admin-actions form,
  .ad-admin-actions button {
    width: 100%;
  }

  .ad-editor-grid {
    grid-template-columns: 1fr;
  }

  .ad-editor-actions button {
    width: 100%;
  }

  .panel-head {
    display: grid;
  }

  .admin-topbar,
  .admin-topbar nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-topbar nav {
    width: 100%;
  }

  .admin-topbar nav a {
    width: 100%;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .admin-login::after {
    right: -90px;
    top: 16vh;
    width: 360px;
    height: 360px;
  }

  .login-intro {
    min-height: auto;
  }

  .login-intro h1 {
    margin-top: 42px;
    font-size: clamp(2.3rem, 10vw, 3.2rem);
    line-height: 1;
  }

  .form-grid,
  .card-editor,
  .site-list {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 761px) and (max-width: 1120px) {
  .dashboard-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .command-panel,
  .role-board,
  .partner-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@keyframes dashboardRadar {
  to {
    transform: rotate(1turn);
  }
}

body.admin-app-body {
  min-height: 100vh;
  background: #f3f7f8;
}

.admin-app {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 18px;
  overflow-y: auto;
  background:
    linear-gradient(160deg, rgba(217, 31, 47, .18), transparent 34%),
    linear-gradient(24deg, rgba(23, 122, 156, .18), transparent 52%),
    #10171b;
  color: #f7fbfc;
}

.admin-sidebar-brand,
.admin-brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.admin-sidebar-brand {
  padding: 8px 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.admin-sidebar-brand strong,
.admin-sidebar-brand small {
  display: block;
}

.admin-sidebar-brand small {
  margin-top: 3px;
  color: rgba(247, 251, 252, .62);
}

.admin-sidebar-nav {
  display: grid;
  gap: 8px;
}

.admin-sidebar-nav a {
  display: grid;
  gap: 3px;
  min-height: 64px;
  align-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  color: rgba(247, 251, 252, .78);
}

.admin-sidebar-nav a:hover,
.admin-sidebar-nav a.is-active {
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.admin-sidebar-nav small {
  color: rgba(247, 251, 252, .58);
}

.admin-sidebar-user {
  display: grid;
  gap: 7px;
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, .07);
}

.admin-sidebar-user span {
  color: var(--yellow);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-sidebar-user a {
  color: rgba(247, 251, 252, .74);
  font-weight: 800;
}

.admin-main {
  min-width: 0;
  padding: 24px clamp(16px, 3vw, 36px) 48px;
}

.admin-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 30px);
  background:
    linear-gradient(135deg, rgba(217, 31, 47, .08), transparent 36%),
    #fff;
  box-shadow: 0 14px 38px rgba(23, 33, 41, .08);
}

.admin-page-head h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: 0;
}

.admin-page-head span {
  display: block;
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.admin-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

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

.admin-stat-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 240px));
}

.admin-dashboard-card,
.admin-shortcut-grid,
.admin-page-grid,
.panel,
.role-board {
  margin-top: 16px;
}

.admin-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-shortcut-grid a {
  display: grid;
  gap: 8px;
  min-height: 150px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(23, 33, 41, .07);
}

.admin-shortcut-grid span {
  color: var(--brand);
  font-weight: 900;
}

.admin-shortcut-grid strong {
  font-size: 1.1rem;
}

.admin-shortcut-grid small {
  color: var(--muted);
  line-height: 1.45;
}

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

.admin-page-grid .full,
.admin-page-grid .admin-sticky-actions {
  grid-column: 1 / -1;
}

.admin-sticky-actions {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  justify-content: flex-end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 45px rgba(23, 33, 41, .12);
  backdrop-filter: blur(14px);
}

.admin-mobilebar,
.admin-menu-toggle,
.admin-menu-backdrop {
  display: none;
}

.admin-brand-mini .admin-mark {
  width: 38px;
  height: 38px;
}

@media (max-width: 1120px) {
  .admin-app {
    grid-template-columns: 244px minmax(0, 1fr);
  }

  .admin-stat-grid,
  .admin-shortcut-grid,
  .admin-page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .admin-app {
    display: block;
  }

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(310px, 86vw);
    transform: translateX(-104%);
    transition: transform .2s ease;
    box-shadow: 24px 0 60px rgba(0, 0, 0, .24);
  }

  .admin-menu-toggle:checked ~ .admin-app .admin-sidebar {
    transform: translateX(0);
  }

  .admin-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(16, 23, 27, .45);
  }

  .admin-menu-toggle:checked ~ .admin-app .admin-menu-backdrop {
    display: block;
  }

  .admin-main {
    padding: 82px 12px 36px;
  }

  .admin-mobilebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 66px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 10px 28px rgba(23, 33, 41, .1);
    backdrop-filter: blur(14px);
  }

  .admin-mobilebar label,
  .admin-mobilebar a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 11px;
    background: #fff;
    font-weight: 900;
  }

  .admin-brand-mini {
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .admin-page-head {
    display: grid;
    padding: 18px;
  }

  .admin-page-actions {
    justify-content: flex-start;
  }

  .admin-stat-grid,
  .admin-stat-grid.compact,
  .admin-shortcut-grid,
  .admin-page-grid,
  .user-grid {
    grid-template-columns: 1fr;
  }

  .admin-sticky-actions {
    position: static;
  }
}
