:root {
  --go-red: #d30b17;
  --go-red-dark: #a40711;
  --go-red-soft: #fff0f1;
  --ink: #1d1d1f;
  --muted: #6b6f76;
  --line: #e7e8ec;
  --surface: #ffffff;
  --bg: #f7f7f9;
  --ok: #138a49;
  --warn: #a45c00;
  --bad: #b00020;
  --go-red-bright: #ff3a42;
  --side: #111216;
  --side-soft: #17191f;
  --line-on-dark: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid var(--go-red);
  border-radius: 6px;
  background: var(--go-red);
  color: white;
  padding: 8px 12px;
  cursor: pointer;
}

button.secondary {
  background: white;
  color: var(--go-red);
}

button.ghost {
  border-color: var(--line);
  color: var(--ink);
  background: white;
}

button.link {
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--go-red);
  padding: 0;
  font-weight: 700;
  text-align: left;
}

button.danger,
button.ghost.danger {
  border-color: var(--bad);
  color: white;
  background: var(--bad);
}

button.danger:disabled,
button.ghost.danger:disabled {
  border-color: var(--line);
  color: var(--muted);
  background: white;
  opacity: 1;
}

button.viewAsBtn.active,
.tabs button.active {
  border-color: var(--go-red);
  color: white;
  background: var(--go-red);
}

button.break-action {
  border-color: var(--go-red);
  background: var(--go-red);
  color: white;
}

button.end-break-action {
  border-color: #8bd8a9;
  background: #b9f4cf;
  color: #111216;
}

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

button.secondary:disabled,
button.ghost:disabled,
button.danger:disabled,
button.ghost.danger:disabled {
  border-color: var(--line);
  color: var(--muted);
  background: white;
  opacity: 1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 8px 10px;
}

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

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

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.side {
  background: #111216;
  color: white;
  padding: 18px;
}

.brand {
  display: grid;
  gap: 12px;
  align-items: center;
  justify-items: center;
  text-align: center;
  margin-bottom: 22px;
}

.brand img {
  width: 198px;
  max-width: 100%;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

.brand span {
  display: block;
  width: 100%;
  text-align: center;
}

.clean-panel-logo {
  display: grid;
  gap: 7px;
  justify-items: center;
  align-items: start;
  max-width: 100%;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35));
}

.clean-panel-logo img {
  display: block;
  width: 210px;
  max-width: 100%;
  height: auto;
  filter: none;
}

.clean-panel-logo .tagline {
  width: 220px;
  max-width: 100%;
  color: #ff3a42;
  font-size: 9.8px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.45px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 8px rgba(211, 11, 23, 0.25);
}

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

.nav a {
  color: #f5f5f5;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
}

.nav a.active,
.nav a:hover {
  background: rgba(211, 11, 23, 0.22);
}

.main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

.content {
  padding: 22px 24px 40px;
  display: grid;
  gap: 18px;
}

.band {
  background: white;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.band h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
}

.metric strong {
  display: block;
  font-size: 24px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.toolbar > * {
  flex: 1 1 160px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 18, 22, 0.66);
}

.confirm-dialog {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.28);
}

.confirm-dialog h2,
.confirm-dialog p {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  background: var(--go-red-soft);
  color: var(--go-red-dark);
  font-size: 12px;
  font-weight: 700;
}

.pill.ok {
  background: #e9f7ef;
  color: var(--ok);
}

.pill.warn {
  background: #fff6e8;
  color: var(--warn);
}

.pill.bad {
  background: #fff0f3;
  color: var(--bad);
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 8%, rgba(211, 11, 23, 0.16), transparent 36%),
    var(--side);
  color: white;
}

.login-panel {
  width: min(380px, 100%);
  display: grid;
  gap: 14px;
  justify-items: stretch;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.login-panel img {
  width: 210px;
  max-width: 100%;
  justify-self: center;
}

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

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.scroll {
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.split {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
}

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

.list button {
  text-align: left;
  justify-content: flex-start;
}

.list button.selected {
  border-color: var(--go-red);
  background: var(--go-red-soft);
}

.message {
  max-width: 760px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  margin-bottom: 8px;
}

.message.support,
.message.admin {
  border-color: #ffd0d5;
  background: var(--go-red-soft);
}

.preview {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.avatar {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.identity-cell {
  display: grid;
  grid-template-columns: 46px minmax(180px, 1fr);
  gap: 10px;
  align-items: start;
}

.identity-cell > div {
  display: grid;
  gap: 6px;
}

.identity-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.identity-inline h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  min-height: 22px;
  color: var(--muted);
}

.security-card {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfc;
}

.security-card code {
  display: block;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.security-card textarea {
  min-height: 70px;
  font-family: Consolas, "Courier New", monospace;
}

.qr-code {
  width: 210px;
  height: 210px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
}

.critical-zone {
  border-color: #ffd0d5;
  background: #fff8f9;
}

.portal {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 22px;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 8%, rgba(211, 11, 23, 0.16), transparent 36%),
    var(--side);
  color: white;
}

.portal-options {
  display: grid;
  gap: 12px;
  width: min(340px, 80vw);
  justify-self: center;
}

.portal-options a {
  display: grid;
  place-items: center;
  min-height: 50px;
  border: 1px solid var(--go-red);
  border-radius: 10px;
  background: var(--go-red);
  color: white;
  font-weight: 800;
  text-decoration: none;
}

.portal-logo {
  justify-self: center;
  gap: 8px;
}

.portal-logo img {
  width: min(330px, 78vw);
}

.portal-logo .tagline {
  width: min(330px, 78vw);
  color: var(--go-red-bright);
  font-size: 14px;
  letter-spacing: 0.8px;
}

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

  .side {
    position: static;
  }

  .topbar {
    height: auto;
    min-height: 64px;
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    padding: 14px 16px;
  }

  .topbar h1 {
    font-size: 22px;
    line-height: 1.15;
  }

  .row-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }

  .row-actions button {
    width: 100%;
  }

  .band {
    overflow-x: auto;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .grid.five,
  .split {
    grid-template-columns: 1fr;
  }
}

html.go-android-shell .shell {
  grid-template-columns: 1fr;
  width: 100%;
  overflow-x: hidden;
}

html.go-android-shell .side {
  position: static;
  padding: 14px 16px 10px;
  overflow: hidden;
}

html.go-android-shell .brand {
  gap: 8px;
  margin-bottom: 12px;
  justify-items: center;
  text-align: center;
}

html.go-android-shell .brand .clean-panel-logo {
  width: 100%;
  justify-self: center;
}

html.go-android-shell .clean-panel-logo img {
  width: min(220px, 64vw) !important;
  max-width: 64vw;
}

html.go-android-shell .clean-panel-logo .tagline {
  width: min(230px, 68vw);
  font-size: clamp(8px, 2.45vw, 10.5px);
}

html.go-android-shell .brand span {
  display: block;
  width: 100%;
  color: white;
  font-size: 20px;
  line-height: 1.2;
  text-align: center;
}

html.go-android-shell .nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

html.go-android-shell .nav::-webkit-scrollbar {
  display: none;
}

html.go-android-shell .nav a {
  flex: 0 0 auto;
  white-space: nowrap;
  max-width: 76vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.go-android-shell .topbar {
  height: auto;
  min-height: 64px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  padding: 14px 16px;
}

html.go-android-shell .topbar h1 {
  font-size: 22px;
  line-height: 1.15;
}

html.go-android-shell .row-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

html.go-android-shell .row-actions button {
  width: 100%;
}

html.go-android-shell .content {
  padding: 16px;
}

html.go-android-shell table {
  font-size: 14px;
}

html.go-android-shell th,
html.go-android-shell td {
  padding: 10px;
}
.login-panel h1 {
  margin: 0;
  color: white;
  font-size: 28px;
  font-weight: 500;
  text-align: center;
}

.login-panel label {
  color: #babdc5;
}

.login-panel input {
  min-height: 46px;
  border-color: var(--line-on-dark);
  background: var(--side-soft);
  color: white;
  border-radius: 8px;
}

.login-panel input:focus {
  border-color: rgba(255, 58, 66, 0.8);
  outline: none;
  box-shadow: 0 0 0 3px rgba(211, 11, 23, 0.22);
}

.login-panel button {
  min-height: 50px;
  border-radius: 10px;
  font-weight: 800;
}

.back-link {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line-on-dark);
  border-radius: 10px;
  color: #babdc5;
  background: transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.legal-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0;
  color: #babdc5;
  font-size: 13px;
}

.legal-links a {
  color: #ff6969;
  text-decoration: none;
  font-weight: 700;
}

.login-panel .status {
  min-height: 22px;
  color: #babdc5;
  text-align: center;
}
