:root {
  --bg: #eef2f6;
  --bg-deep: #dde5ee;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-solid: #ffffff;
  --panel-strong: #f7f9fc;
  --panel-dark: #122032;
  --ink: #142033;
  --ink-soft: #32435c;
  --muted: #6d7a8d;
  --line: rgba(20, 32, 51, 0.11);
  --line-strong: rgba(20, 32, 51, 0.18);
  --brand: #1d7b75;
  --brand-strong: #155e61;
  --highlight: #3459d1;
  --accent: #e38761;
  --accent-soft: rgba(227, 135, 97, 0.16);
  --warn: #b27b1d;
  --danger: #b44a57;
  --ok: #2f8f5f;
  --shadow-soft: 0 32px 80px rgba(21, 32, 50, 0.12);
  --shadow-card: 0 18px 48px rgba(21, 32, 50, 0.1);
  --shadow-strong: 0 30px 80px rgba(8, 15, 29, 0.28);
  --radius-lg: 24px;
  --radius-xl: 30px;
  --font-display: "Manrope", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 14%, rgba(29, 123, 117, 0.18), transparent 20%),
    radial-gradient(circle at 88% 10%, rgba(227, 135, 97, 0.18), transparent 16%),
    linear-gradient(180deg, #f5f7fa 0%, var(--bg) 42%, #e8edf3 100%);
  position: relative;
  overflow-x: hidden;
}

.app-body::before,
.app-body::after {
  content: "";
  position: fixed;
  width: 24rem;
  height: 24rem;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.42;
  pointer-events: none;
  z-index: 0;
}

.app-body::before {
  top: -10rem;
  right: -8rem;
  background: rgba(52, 89, 209, 0.2);
}

.app-body::after {
  bottom: -11rem;
  left: -8rem;
  background: rgba(29, 123, 117, 0.14);
}

h1,
h2,
h3,
h4,
strong {
  font-family: var(--font-display);
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

a {
  color: var(--highlight);
  text-decoration: none;
}

a:hover {
  color: #2748b7;
}

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.shell-authenticated {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 26px;
  padding: 24px;
}

.shell-guest {
  padding: 24px;
}

.sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
}

.sidebar-panel {
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 24px;
  border-radius: var(--radius-xl);
  color: #eef4fb;
  background:
    radial-gradient(circle at top right, rgba(227, 135, 97, 0.2), transparent 28%),
    linear-gradient(180deg, rgba(15, 24, 39, 0.98) 0%, rgba(18, 32, 50, 0.98) 100%);
  box-shadow: var(--shadow-strong);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: white;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  box-shadow: 0 16px 36px rgba(29, 123, 117, 0.3);
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-copy strong {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-copy span {
  color: rgba(228, 236, 249, 0.72);
  font-size: 0.92rem;
  line-height: 1.45;
}

.brand-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(224, 233, 246, 0.56);
}

.nav-group {
  display: grid;
  gap: 12px;
}

.nav-label {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(224, 233, 246, 0.56);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(236, 243, 251, 0.86);
  font-weight: 500;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.nav a:hover {
  color: white;
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
}

.nav a.is-active {
  background: linear-gradient(135deg, rgba(29, 123, 117, 0.24), rgba(52, 89, 209, 0.18));
  border-color: rgba(133, 213, 201, 0.36);
  color: white;
}

.nav a.is-active::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff 0%, #d8f6ef 100%);
  box-shadow: 0 0 0 6px rgba(216, 246, 239, 0.1);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.sidebar-note {
  color: rgba(228, 236, 249, 0.72);
  line-height: 1.55;
  font-size: 0.92rem;
}

.logout-form {
  display: flex;
}

.main {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 22px;
}

.topbar {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 252, 0.78));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-card);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 13rem;
  height: 13rem;
  background: radial-gradient(circle, rgba(29, 123, 117, 0.14), transparent 70%);
  pointer-events: none;
}

.topbar-guest {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(247, 250, 252, 0.58));
}

.topbar-copy,
.topbar-meta {
  position: relative;
  z-index: 1;
}

.topbar-copy {
  max-width: 54rem;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--brand-strong);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.topbar p {
  max-width: 44rem;
  margin-bottom: 0;
  color: var(--ink-soft);
  line-height: 1.65;
  font-size: 1rem;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.role-pill,
.user-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(21, 32, 50, 0.08);
  font-weight: 600;
  color: var(--ink);
}

.role-pill {
  background: rgba(29, 123, 117, 0.12);
  color: var(--brand-strong);
  border-color: rgba(29, 123, 117, 0.18);
}

.user-pill-subtle {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.64);
}

.content {
  display: grid;
  gap: 20px;
  padding-bottom: 24px;
}

.card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--panel) 0%, rgba(247, 249, 252, 0.95) 100%);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  padding: 22px;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.44), transparent 38%);
}

.card>* {
  position: relative;
  z-index: 1;
}

.card h3,
.card h4 {
  margin-bottom: 14px;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.card p:last-child,
.card .hint:last-child {
  margin-bottom: 0;
}

.card .card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(245, 248, 252, 0.82));
  box-shadow: none;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

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

.metric {
  gap: 10px;
  align-content: start;
  min-height: 150px;
  background:
    radial-gradient(circle at top right, rgba(227, 135, 97, 0.12), transparent 24%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(245, 248, 252, 0.96));
}

.metric small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
}

.metric strong {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.metric::after {
  content: "";
  position: relative;
  display: block;
  width: 56px;
  height: 4px;
  margin-top: auto;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: left;
}

tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(20, 32, 51, 0.08);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background 180ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.48);
}

.forms-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

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

label {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(244, 247, 250, 0.95);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: inherit;
  transition: box-shadow 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #8c98a9;
}

input:hover,
select:hover,
textarea:hover {
  background: rgba(255, 255, 255, 0.98);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(52, 89, 209, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(52, 89, 209, 0.24),
    0 0 0 4px rgba(52, 89, 209, 0.12);
  background: white;
  transform: translateY(-1px);
}

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

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--highlight) 100%);
  color: white;
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(29, 123, 117, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

button:hover,
.button-link:hover {
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(29, 123, 117, 0.22);
  filter: saturate(1.03);
}

button:focus-visible,
.button-link:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(52, 89, 209, 0.16),
    0 18px 34px rgba(29, 123, 117, 0.18);
}

.button-link.secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px var(--line);
}

.button-link.secondary:hover {
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px rgba(20, 32, 51, 0.18),
    0 14px 28px rgba(21, 32, 50, 0.08);
}

.ghost-btn {
  width: 100%;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #e8eef6;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-pill.ok {
  background: rgba(47, 143, 95, 0.12);
  border-color: rgba(47, 143, 95, 0.15);
  color: var(--ok);
}

.status-pill.warn {
  background: rgba(178, 123, 29, 0.14);
  border-color: rgba(178, 123, 29, 0.14);
  color: var(--warn);
}

.status-pill.fail {
  background: rgba(180, 74, 87, 0.12);
  border-color: rgba(180, 74, 87, 0.14);
  color: var(--danger);
}

.stack {
  display: grid;
  gap: 12px;
}

.hint {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.94rem;
}

.hero {
  padding: 28px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(227, 135, 97, 0.16), transparent 24%),
    linear-gradient(145deg, rgba(29, 123, 117, 0.1), rgba(52, 89, 209, 0.08));
  border: 1px solid rgba(29, 123, 117, 0.14);
}

.hero strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.code-block {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at top right, rgba(227, 135, 97, 0.14), transparent 20%),
    linear-gradient(180deg, #122033 0%, #0f1827 100%);
  color: #e7edf7;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.55;
  overflow: auto;
  white-space: pre-wrap;
}

.table-inline-form {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.table-inline-form label {
  gap: 6px;
  font-size: 0.8rem;
}

.table-inline-form label span {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.table-inline-form input {
  padding: 9px 11px;
  border-radius: 11px;
}

.table-inline-form button {
  min-height: 40px;
  padding: 10px 12px;
}

.template-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.template-groups {
  display: grid;
  gap: 18px;
}

.template-group {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.6);
}

.template-group h4 {
  margin-bottom: 12px;
}

.template-option-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.template-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.template-option:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 123, 117, 0.2);
  box-shadow: 0 16px 30px rgba(21, 32, 50, 0.08);
}

.template-option input {
  width: auto;
  margin-top: 2px;
  box-shadow: none;
}

.template-option span {
  display: grid;
  gap: 4px;
}

.template-option strong {
  font-size: 0.96rem;
  color: var(--ink);
}

.template-option small {
  color: var(--muted);
  line-height: 1.45;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 22px;
  align-items: stretch;
}

.auth-intro {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 34px;
  min-height: 100%;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(227, 135, 97, 0.22), transparent 26%),
    linear-gradient(160deg, rgba(18, 32, 50, 0.98) 0%, rgba(24, 40, 62, 0.96) 100%);
  color: #eff4fb;
  box-shadow: var(--shadow-strong);
}

.auth-intro::after {
  content: "";
  position: absolute;
  inset: auto -5rem -6rem auto;
  width: 16rem;
  height: 16rem;
  border-radius: 999px;
  background: rgba(29, 123, 117, 0.16);
  filter: blur(8px);
}

.auth-intro .eyebrow {
  margin-bottom: 0;
  color: rgba(233, 240, 249, 0.72);
}

.auth-intro h2 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.auth-intro p {
  position: relative;
  z-index: 1;
  max-width: 38rem;
  margin-bottom: 0;
  color: rgba(233, 240, 249, 0.78);
  line-height: 1.7;
  font-size: 1rem;
}

.auth-highlights {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: auto;
}

.hero-chip {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.hero-chip strong {
  font-size: 0.96rem;
}

.hero-chip span {
  color: rgba(233, 240, 249, 0.72);
  font-size: 0.88rem;
  line-height: 1.5;
}

.auth-panel {
  align-self: stretch;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 30px;
}

.auth-panel-header {
  display: grid;
  gap: 8px;
}

.auth-panel-header h3 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

.auth-panel-header p {
  margin-bottom: 0;
}

.auth-form {
  gap: 16px;
}

.auth-footnote {
  padding-top: 4px;
}

.section-offset {
  margin-top: 18px;
}

@media (max-width: 1280px) {
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .auth-highlights {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: static;
  }

  .sidebar-panel {
    min-height: auto;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .forms-grid,
  .form-grid.two,
  .auth-layout,
  .template-option-list {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {

  .shell-authenticated,
  .shell-guest {
    padding: 16px;
  }

  .topbar {
    padding: 22px;
  }

  .topbar,
  .topbar-meta {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .card,
  .auth-intro,
  .auth-panel,
  .sidebar-panel {
    border-radius: 24px;
  }

  .auth-intro,
  .auth-panel {
    padding: 24px;
  }
}

@media (max-width: 720px) {
  table {
    display: block;
    overflow-x: auto;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-badge {
    width: 48px;
    height: 48px;
  }

  .topbar h1 {
    font-size: 1.85rem;
  }

  .metric {
    min-height: 132px;
  }
}