:root {
  --bg: #08110d;
  --bg-elevated: #0d1712;
  --bg-panel: rgba(10, 21, 16, 0.92);
  --bg-panel-strong: #122019;
  --line: rgba(112, 255, 178, 0.18);
  --line-strong: rgba(112, 255, 178, 0.42);
  --text: #d7ffe7;
  --text-dim: #8fb8a0;
  --text-muted: #62806f;
  --accent: #7dffb2;
  --accent-strong: #b5ffcb;
  --warn: #ffd36e;
  --danger: #ff8673;
  --ok: #77f7c2;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
  --radius: 14px;
  --radius-sm: 10px;
  --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--mono);
  background:
    radial-gradient(circle at top, rgba(125, 255, 178, 0.08), transparent 32rem),
    linear-gradient(180deg, rgba(125, 255, 178, 0.03), transparent 16rem),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(125, 255, 178, 0.03), rgba(125, 255, 178, 0.03)) 0 0 / 100% 2px,
    linear-gradient(90deg, rgba(125, 255, 178, 0.025), transparent 1px) 0 0 / 18px 18px;
  mix-blend-mode: screen;
  opacity: 0.3;
}

a {
  color: var(--accent-strong);
}

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

.page-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 16px 14px 32px;
}

.header-banner {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(8, 17, 13, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.header-banner h1,
.header-banner h2,
.panel-title,
.panel-kicker,
.panel-meta,
.terminal-status,
.leading-question,
.helper-copy,
.status-message,
.empty-state,
.microcopy {
  margin: 0;
}

.header-eyebrow,
.panel-kicker,
.terminal-status,
.microcopy {
  color: var(--text-muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.header-banner h1 {
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.1;
}

.header-banner h2 {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 400;
}

.terminal-dot-row {
  display: inline-flex;
  gap: 6px;
  padding-top: 3px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(125, 255, 178, 0.24);
  border: 1px solid rgba(125, 255, 178, 0.35);
}

.terminal-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 22px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-panel-strong);
}

.terminal-status::before {
  content: ">";
  color: var(--accent);
}

.panel-grid {
  display: grid;
  gap: 14px;
}

.terminal-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel);
  box-shadow: var(--shadow);
}

.terminal-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(125, 255, 178, 0.03), transparent 40%);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.panel-title {
  font-size: 1rem;
}

.panel-meta {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.4;
}

.label-stack {
  display: grid;
  gap: 6px;
}

.field-grid,
.settings-grid,
.room-form,
.room-tools {
  display: grid;
  gap: 10px;
}

.form-field,
.room-edit-field {
  display: grid;
  gap: 6px;
}

.field-label {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #08120e;
  color: var(--text);
  outline: none;
  transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
}

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

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: #0c1712;
}

.button-row,
.button-container-flex,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-container-flex {
  width: 100%;
}

.large-button {
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(125, 255, 178, 0.15), rgba(125, 255, 178, 0.06));
  color: var(--text);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.large-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.large-button:active {
  transform: translateY(0);
}

.large-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.secondary-button {
  background: rgba(11, 20, 16, 0.9);
  color: var(--text-dim);
  border-color: var(--line);
}

.danger-button {
  border-color: rgba(255, 134, 115, 0.4);
  color: #ffc2b8;
}

.status-message {
  min-height: 22px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #09120e;
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.4;
}

.status-message.error {
  border-color: rgba(255, 134, 115, 0.4);
  color: #ffc2b8;
}

.status-message.success {
  border-color: rgba(119, 247, 194, 0.4);
  color: var(--ok);
}

.status-message.pending {
  border-color: rgba(255, 211, 110, 0.4);
  color: var(--warn);
}

.item-list {
  display: grid;
  gap: 10px;
}

.item-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 16, 13, 0.78);
}

.item-card h4,
.item-card p {
  margin: 0;
}

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

.tag {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(125, 255, 178, 0.08);
  color: var(--text-dim);
  font-size: 0.74rem;
}

.status-new {
  color: #ffe39c;
  border-color: rgba(255, 211, 110, 0.38);
}

.status-acknowledged {
  color: #9ed4ff;
  border-color: rgba(128, 192, 255, 0.35);
}

.status-resolved,
.status-cancelled {
  color: var(--ok);
  border-color: rgba(119, 247, 194, 0.35);
}

.empty-state {
  color: var(--text-muted);
  font-size: 0.88rem;
}

@keyframes bootIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.terminal-panel,
.header-banner {
  animation: bootIn 180ms ease-out;
}

@media (min-width: 720px) {
  .page-shell {
    padding: 20px 20px 40px;
  }

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

  .panel-span-4 {
    grid-column: span 4;
  }

  .panel-span-5 {
    grid-column: span 5;
  }

  .panel-span-7 {
    grid-column: span 7;
  }

  .panel-span-8 {
    grid-column: span 8;
  }

  .field-grid.two-up,
  .settings-grid,
  .room-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-grid.two-up .full-span,
  .settings-grid .full-span,
  .room-form .full-span {
    grid-column: 1 / -1;
  }
}
