:root {
  --bg: #eef2f4;
  --bg-accent: #d9e5e8;
  --surface: #ffffff;
  --ink: #152028;
  --ink-soft: #4d5d68;
  --line: #d2dde3;
  --brand: #0f6b6d;
  --brand-strong: #0a5254;
  --brand-soft: #d7ecec;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --warning: #8a5a00;
  --warning-soft: #fff4d6;
  --info: #184e77;
  --info-soft: #e6f1f8;
  --success: #1b6b3a;
  --success-soft: #e5f6eb;
  --shadow: 0 12px 40px rgba(21, 32, 40, 0.08);
  --radius: 14px;
  --font: "Manrope", sans-serif;
  --display: "Source Serif 4", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(15, 107, 109, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(24, 78, 119, 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%);
  line-height: 1.5;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-strong);
}

code {
  font-size: 0.92em;
  background: var(--brand-soft);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 700;
}

.brand__mark {
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(145deg, var(--brand), #1a8a7d);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.brand__mark--lg {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.brand__name {
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 0.35rem;
  flex: 1;
}

.nav__link {
  color: var(--ink-soft);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--ink);
  background: var(--brand-soft);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.role-chip {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-strong);
  background: var(--brand-soft);
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
}

.icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  color: var(--brand);
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.auth-body .page {
  max-width: none;
  padding: 0;
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    linear-gradient(135deg, rgba(15, 107, 109, 0.18), transparent 40%),
    linear-gradient(320deg, rgba(24, 78, 119, 0.14), transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(26, 138, 125, 0.16), transparent 35%);
}

.auth-panel {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid rgba(210, 221, 227, 0.9);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem 1.75rem;
  animation: rise 0.45s ease both;
}

.auth-panel__brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-title {
  margin: 0;
  font-family: var(--display);
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.auth-lead,
.page-lead {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
}

.auth-switch {
  margin: 1.25rem 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  animation: rise 0.4s ease both;
}

.panel--narrow {
  max-width: 640px;
}

.page-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.85rem;
  letter-spacing: -0.03em;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.info-block {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdfe, #f4f8f9);
}

.info-block h2 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.info-block p {
  margin: 0;
}

.form {
  display: grid;
  gap: 0.95rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field__error {
  color: var(--danger);
  font-size: 0.85rem;
}

.input,
.select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 107, 109, 0.15);
}

.select--sm {
  width: auto;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
}

.form-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.35rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.68rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--brand);
  color: #fff;
}

.btn--primary:hover {
  background: var(--brand-strong);
}

.btn--secondary {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: transparent;
}

.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}

.btn--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn--block {
  width: 100%;
}

.btn--sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

.inline-form {
  display: inline;
}

.flash-stack {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.flash {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  animation: rise 0.3s ease both;
}

.flash--success { background: var(--success-soft); color: var(--success); border-color: #b7e0c4; }
.flash--danger { background: var(--danger-soft); color: var(--danger); border-color: #f3c1bc; }
.flash--warning { background: var(--warning-soft); color: var(--warning); border-color: #f0d48a; }
.flash--info { background: var(--info-soft); color: var(--info); border-color: #b9d4e8; }

.muted {
  color: var(--ink-soft);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 1.25rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.table th,
.table td {
  text-align: left;
  padding: 0.85rem 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.user-cell {
  display: grid;
  gap: 0.15rem;
}

.badge {
  display: inline-block;
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-strong);
  background: var(--brand-soft);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.inline-role-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.wh-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.wh-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 249, 0.95));
}

.wh-card__title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.wh-card__meta {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.wh-card__note {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.wh-staff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.9rem;
}

.wh-staff__group {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 8rem;
}

.wh-staff__group legend {
  padding: 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.check-list {
  display: grid;
  gap: 0.35rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.check-item input {
  margin-top: 0.2rem;
}

.wh-card__actions {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 800px) {
  .wh-staff {
    grid-template-columns: 1fr;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 800px) {
  .topbar__inner {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .role-chip {
    display: none;
  }
}
