* {
  box-sizing: border-box;
}

:root {
  --bg: #16110d;
  --bg-2: #1f1812;
  --panel: rgba(33, 25, 18, 0.92);
  --panel-2: rgba(40, 31, 22, 0.96);
  --border: rgba(245, 239, 227, 0.10);
  --border-strong: rgba(245, 239, 227, 0.20);
  --text: #f5efe3;
  --text-soft: #b9aa96;
  --orange: #ed8b2b;
  --orange-soft: #f4a857;
  --orange-deep: #c9701a;
  --green: #6fcf97;
  --blue: #5aa6ff;
  --red: #ff6f7d;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

body {
  margin: 0;
  font-family: "Inter", Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -5%, rgba(237, 139, 43, 0.18), transparent 32%),
    radial-gradient(circle at 95% 0%, rgba(237, 139, 43, 0.08), transparent 30%),
    linear-gradient(180deg, #16110d 0%, #1b150f 50%, #130e0a 100%);
  min-height: 100vh;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.brand-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 4px 26px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand-tagline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

.brand-tagline::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--orange);
  display: inline-block;
}

.brand-spacer {
  flex: 1;
}

.brand-link {
  font-size: 13px;
  color: var(--text-soft);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition: color 140ms ease, border-color 140ms ease;
}

.brand-link:hover {
  color: var(--text);
  border-color: var(--orange);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.95fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-copy {
  padding: 28px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(46, 35, 24, 0.96), rgba(28, 21, 15, 0.9));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-stats {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(38, 29, 20, 0.94), rgba(24, 18, 13, 0.86));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--orange);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.16em;
  font-weight: 700;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.subtitle {
  max-width: 720px;
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
  font-size: 15px;
}

.stat-card {
  padding: 18px;
  border-radius: 16px;
  background: rgba(245, 239, 227, 0.04);
  border: 1px solid rgba(245, 239, 227, 0.07);
}

.stat-label,
.summary-label,
.field span,
.gel-subtitle,
.meta {
  color: var(--text-soft);
}

.stat-label,
.summary-label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
}

.panel {
  background: linear-gradient(180deg, rgba(35, 27, 19, 0.94), rgba(26, 20, 14, 0.92));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.toolbar,
.actions,
.gel-grid,
.summary-grid,
.preset-grid {
  display: grid;
  gap: 14px;
}

.toolbar {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.admin-login-toolbar {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.actions {
  grid-template-columns: repeat(3, max-content);
  margin: 18px 0 20px;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  margin-bottom: 18px;
}

.summary-card {
  padding: 18px;
  border-radius: 16px;
  background: rgba(245, 239, 227, 0.04);
  border: 1px solid rgba(245, 239, 227, 0.07);
}

.summary-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
}

.summary-value.identifier-value {
  font-size: 16px;
  line-height: 1.35;
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
  max-width: 100%;
}

.stacked-panel {
  margin-top: 22px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0 0 8px;
  font-size: 28px;
}

.subtitle.compact {
  max-width: 760px;
  font-size: 14px;
}

.grow {
  min-width: 0;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 500;
}

input,
select,
button {
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(18, 13, 9, 0.9);
  color: var(--text);
  outline: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: rgba(237, 139, 43, 0.75);
  box-shadow: 0 0 0 4px rgba(237, 139, 43, 0.16);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  background: rgba(245, 239, 227, 0.08);
  color: var(--text);
  font-weight: 600;
  transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

button.primary {
  background: linear-gradient(135deg, var(--orange-soft), var(--orange-deep));
  color: #1a1207;
  box-shadow: 0 10px 30px rgba(237, 139, 43, 0.3);
}

button.danger {
  background: linear-gradient(135deg, #ff6b7e, #db4a5f);
  box-shadow: 0 10px 28px rgba(220, 74, 95, 0.25);
}

button.small {
  padding: 9px 12px;
  font-size: 14px;
}

.status {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(237, 139, 43, 0.12);
  border: 1px solid rgba(237, 139, 43, 0.42);
  color: #f8e6cf;
}

.status.error {
  background: rgba(182, 52, 70, 0.16);
  border-color: rgba(255, 111, 125, 0.5);
  color: #ffd8dd;
}

.meta {
  margin-bottom: 16px;
  font-size: 14px;
}

.gel-list {
  display: grid;
  gap: 16px;
}

.preset-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gel-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(38, 29, 20, 0.96), rgba(24, 18, 13, 0.94));
  border: 1px solid var(--border);
}

.gel-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--gel-accent, var(--orange));
}

.gel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.gel-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gel-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--gel-accent, var(--orange));
  box-shadow: 0 0 0 6px rgba(245, 239, 227, 0.04);
}

.gel-title {
  margin: 0 0 4px;
  font-size: 19px;
}

.gel-subtitle {
  margin: 0;
  font-size: 13px;
}

.preset-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#adminPanel[hidden],
#adminLoginPanel[hidden] {
  display: none;
}

.gel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid {
  margin-bottom: 18px;
}

.admin-actions {
  grid-template-columns: repeat(4, max-content);
}

.checkbox-field {
  align-content: start;
}

.checkbox-field input {
  width: 20px;
  height: 20px;
  accent-color: var(--orange);
}

.login-screen {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(440px, 100%);
  padding: 30px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(40, 31, 22, 0.96), rgba(26, 20, 14, 0.94));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.login-card .field {
  margin-bottom: 14px;
}

.login-card .full {
  width: 100%;
  margin-top: 6px;
}

@media (max-width: 920px) {
  .hero,
  .summary-grid,
  .preset-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page {
    padding-inline: 14px;
  }

  .panel,
  .hero-copy,
  .hero-stats {
    padding: 18px;
  }

  .toolbar,
  .actions,
  .gel-grid,
  .admin-actions {
    grid-template-columns: 1fr;
  }

  .admin-login-toolbar {
    grid-template-columns: 1fr;
  }

  .gel-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .section-header {
    flex-direction: column;
  }

  .brand-tagline {
    display: none;
  }
}
