:root {
  --theme-primary: #0f766e;
  --theme-secondary: #164e63;
  --theme-accent: #f59e0b;
  --theme-background: #ecfeff;
  --theme-surface: #ffffff;
  --theme-text: #0f172a;
  --theme-heading-font: "Space Grotesk", "Arial Narrow", sans-serif;
  --theme-body-font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --theme-border: rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--theme-text);
  font-family: var(--theme-body-font);
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 28%),
    linear-gradient(180deg, var(--theme-background), #f8fafc 65%);
}

.tenant-shell {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.tenant-backdrop {
  position: absolute;
  inset: 24px 20px auto;
  height: 220px;
  border-radius: 32px;
  background:
    linear-gradient(135deg, var(--theme-primary), var(--theme-secondary)),
    linear-gradient(45deg, rgba(255, 255, 255, 0.16), transparent);
  opacity: 0.96;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.tenant-header,
.dashboard-workspace,
.dashboard-sidebar,
.page-nav,
.dashboard-panel {
  position: relative;
  z-index: 1;
}

.tenant-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 36px 32px;
  color: #f8fafc;
}

.tenant-copy {
  max-width: 760px;
}

.tenant-eyebrow,
.widget-type {
  margin: 0 0 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
}

.tenant-header h1,
.widget-head h2 {
  margin: 0;
  font-family: var(--theme-heading-font);
}

.tenant-header h1 {
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 0.95;
}

.tenant-description {
  margin: 14px 0 0;
  max-width: 44rem;
  line-height: 1.6;
  color: rgba(248, 250, 252, 0.88);
}

.tenant-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.access-badge,
.api-link,
.page-chip {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.access-badge {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
}

.api-link {
  color: #f8fafc;
  text-decoration: none;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.16);
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.dashboard-sidebar {
  padding: 8px 0 0 12px;
}

.sidebar-card {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
  padding: 18px 16px;
}

.sidebar-label {
  margin: 0 0 14px;
  color: var(--theme-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.page-chip {
  cursor: pointer;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--theme-text);
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  text-align: left;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.page-chip:hover {
  transform: translateX(2px);
  border-color: rgba(15, 23, 42, 0.14);
}

.page-nav-empty {
  margin: 0;
  color: rgba(15, 23, 42, 0.6);
  font-size: 0.84rem;
  line-height: 1.55;
}

.page-chip[data-active="true"] {
  color: #f8fafc;
  background: var(--theme-secondary);
  border-color: transparent;
}

.dashboard-panel {
  padding: 8px 12px 0 0;
}

.dashboard-state {
  padding: 24px;
  border: 1px dashed var(--theme-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.7);
}

.layout-frame {
  width: 100%;
  min-height: 980px;
  border: 1px solid var(--theme-border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

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

.widget-card {
  grid-column: span var(--grid-width);
  min-height: 180px;
  padding: 22px;
  border: 1px solid var(--theme-border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), var(--theme-surface));
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.widget-head {
  margin-bottom: 18px;
}

.widget-type {
  color: var(--theme-secondary);
}

.widget-head h2 {
  font-size: 1.35rem;
  line-height: 1.1;
}

.widget-body {
  line-height: 1.5;
}

.widget-error {
  color: #b91c1c;
}

.kpi-value {
  margin: 0;
  font-family: var(--theme-heading-font);
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 0.95;
}

.kpi-unit,
.kpi-delta {
  margin: 10px 0 0;
}

.kpi-delta {
  color: var(--theme-secondary);
}

.chart-list {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 10px;
}

.chart-bar-wrap {
  height: 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-accent));
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  text-align: left;
  white-space: nowrap;
}

th {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--theme-secondary);
}

.summary-list,
.document-list,
.toggle-list {
  display: grid;
  gap: 10px;
}

.summary-item,
.document-list a,
.toggle-list label,
.map-placeholder li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.8);
  color: inherit;
  text-decoration: none;
}

.map-placeholder {
  display: grid;
  gap: 12px;
}

.map-placeholder p,
.map-placeholder pre {
  margin: 0;
}

.map-placeholder ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.map-placeholder pre {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.06);
  overflow-x: auto;
}

@media (max-width: 980px) {
  .dashboard-workspace {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    padding: 8px 12px 0;
  }

  .sidebar-card {
    padding: 16px 14px;
  }

  .widget-card {
    grid-column: span 12;
  }

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

  .tenant-meta {
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .tenant-shell {
    padding: 20px 12px 40px;
  }

  .tenant-backdrop {
    inset: 12px 12px auto;
    height: 260px;
    border-radius: 24px;
  }

  .tenant-header {
    padding: 28px 22px 24px;
  }

  .dashboard-panel {
    padding-left: 0;
    padding-right: 0;
  }

  .page-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .page-chip {
    min-width: 180px;
  }

  .layout-frame {
    min-height: 760px;
  }

  .chart-row {
    grid-template-columns: 1fr;
  }
}
