:root {
  --bg: #fbf7ef;
  --bg-strong: #efe2cf;
  --paper: rgba(255, 252, 245, 0.94);
  --paper-strong: #fffaf0;
  --ink: #1d1a17;
  --muted: #71685d;
  --line: rgba(29, 26, 23, 0.12);
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-soft: rgba(15, 118, 110, 0.12);
  --amber: #b45309;
  --amber-soft: rgba(180, 83, 9, 0.1);
  --danger: #b91c1c;
  --shadow: 0 28px 80px rgba(36, 30, 18, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(
      circle at top left,
      rgba(15, 118, 110, 0.15),
      transparent 30%
    ),
    radial-gradient(
      circle at top right,
      rgba(180, 83, 9, 0.14),
      transparent 30%
    ),
    linear-gradient(180deg, #fffdf7 0%, var(--bg) 45%, var(--bg-strong) 100%);
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.workspace-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
}

.workspace-sidebar {
  padding: 2rem 1.4rem;
  background: rgba(20, 20, 18, 0.94);
  color: #f6f0e7;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.sidebar-kicker,
.eyebrow,
.card-kicker,
.security-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
}

.workspace-sidebar h1 {
  margin: 0.65rem 0 0.75rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.05rem;
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.sidebar-copy,
.security-blurb p {
  margin: 0;
  color: rgba(246, 240, 231, 0.76);
  line-height: 1.6;
}

.sidebar-nav {
  display: grid;
  gap: 0.55rem;
}

.nav-link {
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition:
    background 140ms ease,
    transform 140ms ease,
    border-color 140ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(2px);
}

.security-blurb {
  margin-top: auto;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.workspace-main {
  padding: 1.5rem;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.workspace-header h2 {
  margin: 0.45rem 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  letter-spacing: -0.05em;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem;
}

.status-pill,
.ghost-button,
.primary-button {
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  border: 1px solid transparent;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 700;
}

.ghost-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  cursor: pointer;
}

.banner {
  min-height: 0;
  margin-top: 1rem;
}

.banner:not(:empty) {
  padding: 1rem 1.1rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
}

.banner.is-error:not(:empty) {
  border-color: rgba(185, 28, 28, 0.18);
  background: rgba(185, 28, 28, 0.08);
  color: var(--danger);
}

.banner.is-success:not(:empty) {
  border-color: rgba(15, 118, 110, 0.16);
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal-dark);
}

.auth-layout,
.dashboard-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.auth-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.auth-card,
.config-card,
.dashboard-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.card-heading h3 {
  margin: 0.35rem 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.4rem;
  letter-spacing: -0.04em;
}

.card-copy,
.panel-note,
.record-list span {
  color: var(--muted);
  line-height: 1.6;
}

.field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.field span {
  font-weight: 700;
  font-size: 0.92rem;
}

.field input {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
}

.primary-button {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #f8fffd;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(15, 118, 110, 0.2);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.config-list,
.session-list {
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.config-list div,
.session-list div {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.config-list div:last-child,
.session-list div:last-child {
  border-bottom: 0;
}

.config-list dt,
.session-list dt {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.config-list dd,
.session-list dd {
  margin: 0.35rem 0 0;
  font-weight: 700;
}

.session-card {
  grid-row: span 2;
}

.mini-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1rem 0;
}

.mini-metric {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
}

.mini-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.mini-metric strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.15rem;
}

.record-list {
  margin: 1rem 0 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.9rem;
}

.record-list strong {
  display: block;
  margin-bottom: 0.25rem;
}

.recaptcha-slot {
  min-height: 1px;
}

@media (max-width: 1100px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .auth-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .session-card {
    grid-row: auto;
  }

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