:root {
  --bg: #eef3f5;
  --bg-card: #ffffff;
  --text: #112036;
  --muted: #5e6d7a;
  --border: #d7dee5;
  --accent: #0f6586;
  --accent-strong: #0b4f6b;
  --warn: #a33d09;
  --ok: #1a7f46;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(13, 35, 49, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 0%, #cfe3ed 0%, rgba(207, 227, 237, 0) 32%),
    radial-gradient(circle at 100% 0%, #f9dfc8 0%, rgba(249, 223, 200, 0) 35%),
    var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
}

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

.bg-shape-a {
  width: 320px;
  height: 320px;
  top: -120px;
  right: -80px;
  background: #f0a35d;
}

.bg-shape-b {
  width: 280px;
  height: 280px;
  bottom: -120px;
  left: -70px;
  background: #2d99bc;
}

.shell-header {
  max-width: 1280px;
  margin: 26px auto 0;
  padding: 0 22px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.15em;
  font-size: 12px;
  font-weight: 600;
}

h1 {
  margin: 8px 0 0;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.1;
}

.tenant-meta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pill {
  background: #d8e8ef;
  color: #0f3e53;
  border: 1px solid #b2ccd8;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
}

.mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

.top-nav {
  max-width: 1280px;
  margin: 18px auto 0;
  padding: 0 22px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  color: #163040;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms ease;
}

.nav-btn:hover {
  transform: translateY(-1px);
  border-color: #9ec2d1;
}

.nav-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.shell-main {
  max-width: 1280px;
  margin: 16px auto 36px;
  padding: 0 22px;
}

.alert {
  margin-bottom: 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
}

.alert.info {
  background: #e7f2f8;
  border-color: #bad7e6;
  color: #0f4f6b;
}

.alert.ok {
  background: #e8f6ec;
  border-color: #b7dfc3;
  color: #145a32;
}

.alert.error {
  background: #fbeae3;
  border-color: #efc4b5;
  color: #7d2e09;
}

.panel {
  display: none;
  animation: panelIn 220ms ease;
}

.panel.is-active {
  display: block;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.grid.uneven {
  grid-template-columns: minmax(280px, 0.9fr) minmax(460px, 1.3fr);
}

.top-gap {
  margin-top: 14px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  padding: 16px;
}

.metric-card h2,
.card h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.metric-value {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
}

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

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.grow {
  flex: 1;
}

label {
  display: block;
}

label > span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 2px;
}

.inline-check > span {
  margin: 0;
  color: #274053;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #c8d6df;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fcfeff;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(17, 119, 158, 0.2);
  border-color: #6ba7be;
}

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

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

.btn-primary,
.btn-ghost,
.btn-small {
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 120ms ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 10px 12px;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  background: #edf4f7;
  border-color: #cae1eb;
  color: #16465d;
  padding: 9px 11px;
}

.btn-ghost:hover {
  background: #dbeaf1;
}

.btn-small {
  padding: 6px 8px;
  border-color: #cfe0e8;
  background: #f5fafc;
  color: #1b4e66;
  margin-left: 6px;
  margin-bottom: 4px;
  font-size: 13px;
}

.btn-small.warn {
  color: #7d2e09;
  border-color: #edc2af;
  background: #fcece5;
}

.table-wrap {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid #d4dfe6;
}

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

th,
td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #e2eaef;
  font-size: 14px;
  vertical-align: top;
}

th {
  background: #f1f7fa;
  color: #305060;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f8fbfd;
}

tbody tr.is-selected {
  background: #ecf6fb;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
}

.badge.active {
  background: #e5f8ec;
  color: var(--ok);
}

.badge.archived {
  background: #f7ece8;
  color: var(--warn);
}

.badge.status {
  background: #ebf2f6;
  color: #255166;
}

@media (max-width: 980px) {
  .grid.two-col,
  .grid.uneven {
    grid-template-columns: 1fr;
  }

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

  .tenant-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .shell-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
