:root {
  --bg: #f4f0e8;
  --panel: rgba(255, 253, 248, 0.92);
  --ink: #1f1b16;
  --muted: #695d51;
  --accent: #0d6f63;
  --accent-dark: #094d45;
  --line: rgba(31, 27, 22, 0.12);
  --warning: #8f2800;
  --shadow: 0 18px 44px rgba(31, 27, 22, 0.12);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(13, 111, 99, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(197, 96, 45, 0.15), transparent 24%),
    linear-gradient(180deg, #fcfaf7 0%, var(--bg) 55%, #ebe3d7 100%);
}

.shell {
  width: min(1220px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.hero,
.panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.2rem;
}

.hero h1,
.panel h2 {
  font-family: Georgia, "Times New Roman", serif;
  margin: 0;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--muted);
}

.lede,
.panel-header p,
#tenant-meta,
#session-meta {
  color: var(--muted);
  max-width: 62ch;
}

.panel,
.stat-card {
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.panel-header {
  margin-bottom: 1rem;
}

.stats,
.grid {
  display: grid;
  gap: 1rem;
}

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

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

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 120px;
  justify-content: center;
}

.stat-card strong {
  font-size: 2.1rem;
}

.form-grid,
.filter-row {
  display: grid;
  gap: 0.85rem;
}

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

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

.wide {
  grid-column: 1 / -1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.94rem;
  color: var(--muted);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(31, 27, 22, 0.16);
  border-radius: 14px;
  padding: 0.78rem 0.9rem;
  background: #fffdf8;
  color: var(--ink);
}

textarea {
  min-height: 6.5rem;
  resize: vertical;
}

button {
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  padding: 0.82rem 1.2rem;
  cursor: pointer;
  align-self: start;
  transition: transform 140ms ease, background 140ms ease;
}

button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

button.secondary {
  background: rgba(13, 111, 99, 0.12);
  color: var(--accent-dark);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

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

th,
td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

th {
  background: rgba(13, 111, 99, 0.08);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

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

.status {
  min-height: 1.4rem;
  margin-top: 0.8rem;
  color: var(--warning);
}

.callout {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(13, 111, 99, 0.09);
  color: var(--accent-dark);
  white-space: pre-wrap;
}

.tenant-strip {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.token-note {
  max-width: 24rem;
}

.filter-row {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
}

.ai-operations-header {
  margin: 1.4rem 0 0.6rem;
}

.ai-operations-header .eyebrow {
  font-size: 0.82rem;
  color: var(--accent-dark);
}

.security-profile .filter-row {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
}

.checkbox-label input {
  width: auto;
}

.severity-pill {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(31, 27, 22, 0.08);
  color: var(--ink);
}

.severity-low { background: rgba(13, 111, 99, 0.14); color: var(--accent-dark); }
.severity-medium { background: rgba(197, 96, 45, 0.18); color: #7a3a14; }
.severity-high { background: rgba(143, 40, 0, 0.18); color: var(--warning); }
.severity-critical { background: var(--warning); color: white; }

.inline-btn {
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 999px;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 960px) {
  .stats,
  .two-up,
  .form-grid,
  .filter-row,
  .security-profile .filter-row {
    grid-template-columns: 1fr;
  }

  .tenant-strip,
  .hero {
    flex-direction: column;
  }
}
