:root {
  --bg: #f3f5fa;
  --bg-2: #fff9f2;
  --text: #1c2337;
  --muted: #5b667f;
  --line: #d7dfef;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --brand: #0f7a69;
  --brand-2: #f08d34;
  --danger: #c0392b;
  --shadow: 0 22px 45px rgba(28, 35, 55, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 14%, #ffe3c9 0%, transparent 34%),
    radial-gradient(circle at 88% 8%, #d5efe9 0%, transparent 31%),
    linear-gradient(140deg, var(--bg) 0%, var(--bg-2) 100%);
}

.bg-shape {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.45;
  pointer-events: none;
}

.shape-a {
  width: 320px;
  height: 320px;
  background: #f6bc82;
  top: -80px;
  right: -60px;
}

.shape-b {
  width: 280px;
  height: 280px;
  background: #7dc9bd;
  bottom: -70px;
  left: -70px;
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.06;
  pointer-events: none;
  background-image:
    radial-gradient(#000 0.45px, transparent 0.45px),
    radial-gradient(#000 0.45px, transparent 0.45px);
  background-size: 22px 22px;
  background-position: 0 0, 11px 11px;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.hidden {
  display: none !important;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 22px;
  backdrop-filter: blur(8px);
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.auth-view {
  min-height: calc(100vh - 80px);
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 24px;
  align-items: center;
  animation: fade-in 520ms ease;
}

.hero h1 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  margin: 10px 0 14px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.03;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.auth-card {
  padding: 28px;
  display: grid;
  gap: 12px;
}

.auth-card h2 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 12px 13px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 200ms, box-shadow 200ms, transform 200ms;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 122, 105, 0.14);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms, filter 180ms;
  background: linear-gradient(120deg, var(--brand), #18a086);
  color: #fff;
}

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

button.ghost {
  background: #e8eefb;
  color: #2a3a66;
}

button.danger {
  background: #f7d9d4;
  color: #85251c;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.status {
  margin: 0;
  min-height: 20px;
  font-size: 13px;
}

.status.ok {
  color: #0d815f;
}

.status.err {
  color: #a73c2d;
}

.dashboard {
  display: grid;
  gap: 16px;
  animation: fade-in 420ms ease;
}

.topbar {
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.topbar h2 {
  margin: 4px 0 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

#whoami {
  color: var(--muted);
  font-weight: 700;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  padding: 16px 18px;
}

.metric p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  margin-top: 8px;
  display: block;
  font-size: clamp(24px, 2.5vw, 34px);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) 1.35fr;
  gap: 16px;
}

.panel {
  padding: 20px;
}

.panel h3 {
  margin: 0 0 14px;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.tenant-form {
  display: grid;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
}

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

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #edf1fa;
  font-size: 13px;
  vertical-align: top;
}

th {
  color: #3a4665;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.link-col {
  display: grid;
  gap: 4px;
}

.link-col a {
  color: #1f6f8d;
  text-decoration: none;
  font-weight: 600;
}

.link-col a:hover {
  text-decoration: underline;
}

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

@media (max-width: 1024px) {
  .auth-view {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 20px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: calc(100% - 18px);
    margin-top: 14px;
  }
  .card {
    border-radius: 16px;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .top-actions button {
    flex: 1;
  }
}

