:root {
  --bg: #f5f0e6;
  --surface: rgba(255, 252, 245, 0.76);
  --surface-strong: #fffdf8;
  --ink: #17211f;
  --muted: #5a665f;
  --line: rgba(41, 62, 57, 0.12);
  --brand: #136f63;
  --brand-dark: #0b554b;
  --accent: #c97a1c;
  --accent-soft: #f7e0bf;
  --success: #0f8b7b;
  --warn: #b86b0e;
  --danger: #ba2e24;
  --shadow: 0 24px 70px rgba(16, 29, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(209, 235, 224, 0.9) 0, transparent 28%),
    radial-gradient(circle at 100% 10%, rgba(244, 219, 183, 0.85) 0, transparent 26%),
    linear-gradient(180deg, #faf7f0 0%, #f2ecdf 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.background-orb {
  position: fixed;
  inset: auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(4px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.orb-left {
  top: -90px;
  left: -100px;
  background: radial-gradient(circle, rgba(19, 111, 99, 0.3), rgba(19, 111, 99, 0));
}

.orb-right {
  right: -120px;
  top: 140px;
  background: radial-gradient(circle, rgba(201, 122, 28, 0.26), rgba(201, 122, 28, 0));
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  gap: 20px;
}

.hero-panel {
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 251, 240, 0.9), rgba(245, 255, 252, 0.86));
  box-shadow: var(--shadow);
  animation: float-in 0.65s ease;
}

.eyebrow,
.card-kicker {
  margin: 0 0 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-dark);
}

.hero-panel h1,
.glass-card h2,
.glass-card h3 {
  margin: 0;
  line-height: 1.02;
}

.hero-panel h1 {
  max-width: 12ch;
  font-size: clamp(34px, 6vw, 68px);
}

.hero-copy {
  max-width: 72ch;
  margin: 14px 0 0;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.meta-chip,
.session-summary,
.status-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
}

.meta-chip span,
.session-summary span {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}

.meta-chip strong,
.session-summary strong {
  font-size: 14px;
}

.glass-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.auth-grid,
.dashboard-grid {
  display: grid;
  gap: 18px;
}

.auth-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.dashboard-main {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.two-column {
  grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1.18fr);
}

.topbar,
.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  align-items: center;
}

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

.session-summary {
  min-width: 220px;
}

.card-heading h2,
.card-heading h3 {
  font-size: clamp(22px, 2.6vw, 30px);
}

.status-pill {
  align-items: center;
  justify-content: center;
  min-width: 96px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pill.neutral { background: rgba(255, 255, 255, 0.55); }
.status-pill.success { background: rgba(207, 244, 234, 0.95); color: #0c6c5d; }
.status-pill.warn { background: rgba(255, 232, 198, 0.95); color: #995300; }
.status-pill.danger { background: rgba(255, 225, 223, 0.95); color: #8a1f18; }
.status-pill.accent { background: rgba(246, 225, 194, 0.95); color: #9a5c08; }

.stacked-form {
  display: grid;
  gap: 14px;
}

.compact-form {
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  transition: border 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

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

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(19, 111, 99, 0.42);
  box-shadow: 0 0 0 4px rgba(19, 111, 99, 0.12);
}

button,
.secondary-btn,
.ghost-btn {
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
}

button,
#login-btn,
#client-submit-btn,
.primary-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: 0 14px 24px rgba(19, 111, 99, 0.24);
}

button:hover,
#login-btn:hover,
#client-submit-btn:hover,
.primary-btn:hover {
  background: linear-gradient(135deg, #187769, #0a4e45);
}

.secondary-btn {
  background: #f3ece0;
  color: var(--ink);
  box-shadow: none;
}

.secondary-btn:hover {
  background: #e8decd;
}

.ghost-btn {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid rgba(19, 111, 99, 0.18);
  box-shadow: none;
}

.ghost-btn:hover {
  background: rgba(19, 111, 99, 0.08);
}

.feature-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.session-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
  gap: 16px;
  margin-top: 18px;
}

.session-info {
  display: grid;
  gap: 10px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.info-row span {
  color: var(--muted);
}

.info-row strong {
  text-align: right;
}

.session-actions {
  display: grid;
  gap: 10px;
  align-content: start;
}

.json-preview {
  margin: 16px 0 0;
  padding: 14px;
  border-radius: 16px;
  background: #14221f;
  color: #d9efe8;
  font-size: 12px;
  line-height: 1.6;
  overflow: auto;
  max-height: 280px;
  font-family: "IBM Plex Mono", monospace;
}

.qr-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.qr-placeholder {
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(19, 111, 99, 0.25);
  background: linear-gradient(180deg, rgba(239, 249, 245, 0.85), rgba(255, 255, 255, 0.55));
  color: var(--muted);
}

.qr-image {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.qr-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.table-tools input {
  min-width: min(100%, 320px);
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(248, 245, 236, 0.96);
}

td strong {
  display: inline-block;
  margin-bottom: 4px;
}

.cell-note {
  color: var(--muted);
  max-width: 260px;
}

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

.row-actions button {
  padding: 9px 11px;
  font-size: 12px;
}

.empty-state {
  margin: 16px 0 0;
  color: var(--muted);
  text-align: center;
}

.feedback {
  margin: 0;
  min-height: 22px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.feedback.ok { color: var(--success); }
.feedback.error { color: var(--danger); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 5;
  max-width: min(92vw, 420px);
  padding: 14px 16px;
  border-radius: 16px;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.toast.success { background: linear-gradient(135deg, #0f8b7b, #0b675d); }
.toast.error { background: linear-gradient(135deg, #bf3a2d, #86261f); }
.toast.info { background: linear-gradient(135deg, #a45f0d, #7e4604); }

.hidden {
  display: none !important;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .auth-grid,
  .dashboard-main,
  .two-column,
  .session-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 16px;
  }

  .hero-panel,
  .glass-card {
    border-radius: 20px;
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .session-summary {
    flex: 1;
  }

  .table-tools input {
    min-width: 100%;
  }

  table {
    min-width: 740px;
  }
}
