:root {
  --bg: #0b1020;
  --panel: #111a33;
  --panel-2: #0f1730;
  --border: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.65);
  --primary: #5b8cff;
  --danger: #ff4d6d;
  --success: #2dd4bf;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --gap: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans",
    sans-serif;
  background: radial-gradient(1200px 700px at 20% 10%, rgba(91, 140, 255, 0.18), transparent 55%),
    radial-gradient(800px 500px at 85% 0%, rgba(45, 212, 191, 0.12), transparent 50%),
    radial-gradient(900px 600px at 60% 100%, rgba(255, 77, 109, 0.08), transparent 55%), var(--bg);
  color: var(--text);
}

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(11, 16, 32, 0.68);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  gap: 14px;
}

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

.brand__logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.28), rgba(45, 212, 191, 0.18));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-weight: 800;
  letter-spacing: 0.6px;
}

.brand__title {
  font-weight: 700;
}

.brand__subtitle {
  color: var(--muted);
  font-size: 13px;
}

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

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin: 18px 0;
}

.summary__card {
  padding: 14px;
}

.summary__label {
  color: var(--muted);
  font-size: 13px;
}

.summary__value {
  font-size: 28px;
  font-weight: 800;
  margin-top: 8px;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 12px;
}

.tab {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(17, 26, 51, 0.72);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 650;
}

.tab--active {
  border-color: rgba(91, 140, 255, 0.45);
  background: rgba(91, 140, 255, 0.14);
}

.panel {
  display: none;
  margin: 0 0 26px;
}

.panel--active {
  display: block;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 16px 0 14px;
}

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

.panel__tools {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 280px;
}

.grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: var(--gap);
}

.card {
  background: rgba(17, 26, 51, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card__title {
  margin: 0 0 12px;
  font-size: 16px;
}

.form {
  display: grid;
  gap: 10px;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(15, 23, 48, 0.78);
  color: var(--text);
  outline: none;
}

.textarea {
  resize: vertical;
  min-height: 86px;
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(91, 140, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.14);
}

.form__actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(15, 23, 48, 0.72);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  user-select: none;
}

.btn--primary {
  border-color: rgba(91, 140, 255, 0.55);
  background: rgba(91, 140, 255, 0.2);
}

.btn--danger {
  border-color: rgba(255, 77, 109, 0.55);
  background: rgba(255, 77, 109, 0.15);
}

.btn--ghost {
  background: transparent;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.images {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 48, 0.35);
}

.images__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.images__title {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 700;
}

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

.img-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 16, 32, 0.35);
}

.img-card__img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.img-card__bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.img-card__name {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 170px;
}

.img-card__btn {
  padding: 6px 10px;
  border-radius: 10px;
}

.check-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 16, 32, 0.3);
}

.check-card__label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-card__input {
  width: 18px;
  height: 18px;
}

.antena-public {
  margin: 18px 0;
  display: grid;
  gap: 12px;
}

.antena-public__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.antena-public__title {
  font-size: 18px;
  font-weight: 800;
}

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

.kv {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 16, 32, 0.25);
  border-radius: 12px;
  padding: 10px;
}

.kv__k {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
}

.kv__v {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  word-break: break-word;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 14px;
}

.modal[hidden] {
  display: none;
}

.antena-public[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal__dialog {
  position: relative;
  width: min(520px, 100%);
  padding: 16px;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.modal__title {
  font-weight: 800;
}

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

.qr {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 16, 32, 0.25);
}

.qr__link {
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.qr-inline {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 16, 32, 0.25);
  cursor: pointer;
}

.qr-inline svg {
  width: 68px;
  height: 68px;
  display: block;
}

.table__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.table__meta {
  color: var(--muted);
  font-size: 13px;
}

.table__wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.table th,
.table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  vertical-align: top;
}

.table th {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 48, 0.95);
  font-size: 12px;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.82);
  z-index: 1;
}

.table td {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.38);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.6);
}

.badge--danger {
  border-color: rgba(255, 77, 109, 0.4);
}

.badge--danger .badge__dot {
  background: rgba(255, 77, 109, 0.95);
}

.badge--primary {
  border-color: rgba(91, 140, 255, 0.45);
}

.badge--primary .badge__dot {
  background: rgba(91, 140, 255, 0.95);
}

.badge--success {
  border-color: rgba(45, 212, 191, 0.45);
}

.badge--success .badge__dot {
  background: rgba(45, 212, 191, 0.95);
}

.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.footer {
  padding: 18px 0 26px;
  border-top: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.35);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 280px;
  max-width: min(720px, calc(100% - 24px));
  background: rgba(17, 26, 51, 0.92);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.9);
  display: none;
}

.toast--show {
  display: block;
}

@media (max-width: 980px) {
  .summary {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .panel__tools {
    min-width: 0;
    width: 100%;
  }

  .table {
    min-width: 760px;
  }

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

  .antena-public__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
