:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: rgba(15, 23, 42, .9);
  --panel2: rgba(30, 41, 59, .72);
  --line: rgba(148, 163, 184, .18);
  --text: #e5f0ff;
  --muted: #91a3ba;
  --cyan: #22d3ee;
  --green: #22c55e;
  --red: #fb7185;
  --yellow: #facc15;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(34, 211, 238, .12), transparent 25%),
    linear-gradient(135deg, #070b12, #101827 50%, #06080d);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 11px;
  background: rgba(148, 163, 184, .12);
  color: var(--text);
  cursor: pointer;
}

button:hover {
  border-color: rgba(34, 211, 238, .42);
}

.primary {
  background: linear-gradient(135deg, #0891b2, #16a34a);
  border-color: transparent;
  color: #041014;
  font-weight: 900;
}

.danger {
  background: rgba(127, 29, 29, .48);
  border-color: rgba(251, 113, 133, .42);
  color: #ffe4e6;
}

input,
select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  background: rgba(2, 6, 23, .68);
  color: var(--text);
}

.hidden {
  display: none !important;
}

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

.rail {
  border-right: 1px solid var(--line);
  padding: 16px;
  background: rgba(2, 6, 23, .45);
}

.brand {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  color: #041014;
  font-weight: 1000;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.brand h1 {
  font-size: 23px;
}

.brand p,
.topbar p,
.panel span,
.card p,
.metric span {
  color: var(--muted);
}

.panel {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  margin-bottom: 12px;
}

.buttonRow,
.topActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace {
  padding: 16px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.topbar h2 {
  font-size: 28px;
}

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

.metrics > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.metrics strong {
  display: block;
  font-size: 25px;
}

.profileGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 9px;
  align-items: start;
}

.card {
  display: grid;
  gap: 8px;
  min-height: 156px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.cardHead {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.card h3 {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  background: rgba(148, 163, 184, .16);
  color: #cbd5e1;
}

.chip.good {
  color: #bbf7d0;
  background: rgba(34, 197, 94, .16);
}

.chip.warn {
  color: #fef3c7;
  background: rgba(250, 204, 21, .16);
}

.chip.bad {
  color: #ffe4e6;
  background: rgba(251, 113, 133, .16);
}

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

.cardActions button {
  min-height: 28px;
  padding: 5px 7px;
  font-size: 11px;
}

dialog {
  width: min(760px, calc(100vw - 30px));
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0f172a;
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, .62);
}

dialog header,
dialog footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

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

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.check input {
  width: auto;
  min-height: auto;
}

.adminList {
  display: grid;
  gap: 8px;
}

.adminRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
}

@media (max-width: 1250px) {
  .profileGrid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .profileGrid,
  .metrics,
  .formGrid {
    grid-template-columns: 1fr;
  }
}
