body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #e5e7eb;
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.page-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.panel {
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}

.panel-accent {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.2), transparent 32%),
    radial-gradient(circle at bottom left, rgba(20, 184, 166, 0.18), transparent 28%),
    rgba(17, 24, 39, 0.92);
}

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

.row > * {
  flex: 1 1 300px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group label {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.02em;
}

textarea,
input,
select,
button {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #0f172a;
  color: #e5e7eb;
  padding: 12px 14px;
  font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 1px;
  border-color: rgba(59, 130, 246, 0.45);
}

button {
  cursor: pointer;
  background: linear-gradient(90deg, #2563eb 0%, #14b8a6 100%);
  border: none;
  font-weight: 600;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.16);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

button.secondary {
  background: #1f2937;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.admin-auth-panel {
  position: relative;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(260px, 1fr);
  gap: 16px;
}

.auth-card {
  padding: 18px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card-info {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.16), transparent 38%),
    rgba(2, 6, 23, 0.76);
}

.auth-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.auth-feedback {
  min-height: 22px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.auth-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-list-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.messages {
  min-height: 380px;
  max-height: 520px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message.user {
  background: rgba(37, 99, 235, 0.25);
  align-self: flex-end;
  max-width: 80%;
}

.message.assistant {
  background: rgba(15, 118, 110, 0.22);
  align-self: flex-start;
  max-width: 90%;
}

.meta {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 8px;
}

.image-preview {
  width: 100%;
  max-width: 512px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  margin-top: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.card {
  padding: 14px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.card-active {
  border-color: rgba(20, 184, 166, 0.45);
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.18);
}

.toolbar {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.hero-card {
  padding: 16px;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.hero-value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: #e5e7eb;
  font-size: 13px;
}

.toggle input {
  width: auto;
  padding: 0;
}

.status-chip {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.78);
}

.status-chip.status-ok {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.32);
}

.status-chip.status-error {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.28);
}

.status-chip.status-warn {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.28);
  color: #fcd34d;
}

.log-tail {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  font-size: 12px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.progress {
  height: 8px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb 0%, #14b8a6 100%);
  border-radius: 999px;
}

.status-ok {
  color: #34d399;
}

.status-error {
  color: #f87171;
}

.status-warn {
  color: #fbbf24;
}

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