:root {
  --surface: rgba(255, 250, 242, 0.82);
  --ink: #1a1a1a;
  --muted: #5e5b56;
  --line: rgba(26, 26, 26, 0.09);
  --gold: #b7792f;
  --forest: #1f5c4c;
  --coral: #b94f3c;
  --shadow: 0 24px 60px rgba(68, 42, 16, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(183, 121, 47, 0.18), transparent 28%),
    radial-gradient(circle at right 20%, rgba(31, 92, 76, 0.16), transparent 30%),
    linear-gradient(145deg, #f8f1e5 0%, #efe7da 48%, #f8f3ed 100%);
}

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

textarea {
  resize: vertical;
}

.hidden,
.hidden-force {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card,
.sidebar-card,
.panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(460px, 100%);
  padding: 32px;
}

.auth-brand {
  text-align: center;
}

.auth-card h1,
.hero h2,
.panel h3,
.sidebar h1 {
  margin: 0;
}

.auth-copy,
.auth-hint,
.auth-error,
.sidebar-card span,
.allocation-meta,
.activity-meta,
.spotlight-item p,
th,
td {
  color: var(--muted);
}

.auth-error {
  min-height: 24px;
  margin: 10px 0 0;
  color: var(--coral);
}

.auth-hint {
  margin: 10px 0 0;
}

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

.login-form,
.search,
.data-form label {
  display: grid;
  gap: 8px;
}

.login-form {
  margin-top: 20px;
}

.auth-button {
  margin-top: 10px;
}

.shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 248, 239, 0.72);
  backdrop-filter: blur(14px);
}

@media (min-width: 1121px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    align-self: start;
  }
}

.nav {
  display: grid;
  gap: 10px;
  margin: 32px 0 auto;
}

.nav-link {
  padding: 14px 16px;
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(26, 26, 26, 0.06);
}

.sidebar-card {
  padding: 18px;
}

.sidebar-card strong,
.stat-card strong {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.credential-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.credential-line {
  margin: 6px 0;
  color: var(--muted);
  word-break: break-word;
}

.main {
  padding: 28px;
  display: grid;
  gap: 24px;
}

.hero,
.panel-head,
.toolbar,
.spotlight-item,
.activity-item,
.table-client,
.form-actions,
.item-actions,
.inline-item {
  display: flex;
  align-items: center;
}

.hero,
.panel-head,
.toolbar,
.inline-item {
  justify-content: space-between;
}

.hero {
  padding: 30px 32px;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.94), rgba(31, 92, 76, 0.9));
  color: #fdf8ef;
}

.hero h2 {
  max-width: 12ch;
  font-size: clamp(2.3rem, 4vw, 4.3rem);
  line-height: 0.96;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
}

.hero-actions,
.item-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.mini-button,
.action-button {
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
}

.primary-button {
  background: #f8ecd8;
  color: #1c1c1c;
}

.ghost-button {
  background: transparent;
  color: #fdf8ef;
  border-color: rgba(255, 248, 239, 0.16);
}

.ghost-button.dark {
  color: var(--ink);
  border-color: var(--line);
}

.mini-button,
.action-button {
  padding: 8px 12px;
  background: rgba(26, 26, 26, 0.06);
  color: var(--ink);
}

.action-button.danger {
  color: var(--coral);
  background: rgba(185, 79, 60, 0.08);
}

.compact {
  padding: 10px 14px;
}

.stats-grid,
.insight-grid,
.bottom-grid {
  display: grid;
  gap: 20px;
}

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

.insight-grid {
  grid-template-columns: 1.4fr 1fr;
}

.insight-grid.client-performance-only {
  grid-template-columns: 1fr;
}

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

.stat-card,
.panel {
  padding: 24px;
}

.pill {
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.pill.positive,
.badge.active {
  background: rgba(31, 92, 76, 0.12);
  color: var(--forest);
}

.badge.inactive {
  background: rgba(26, 26, 26, 0.06);
  color: var(--muted);
}

.badge.review {
  background: rgba(183, 121, 47, 0.14);
  color: var(--gold);
}

.badge.alert {
  background: rgba(185, 79, 60, 0.12);
  color: var(--coral);
}

.chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  min-height: 260px;
  padding-top: 28px;
}

.chart-bar {
  position: relative;
  border-radius: 18px 18px 6px 6px;
  background: linear-gradient(180deg, rgba(183, 121, 47, 0.95), rgba(31, 92, 76, 0.9));
  min-height: 48px;
}

.chart-bar span,
.chart-bar strong {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
}

.chart-bar span {
  bottom: -28px;
  color: var(--muted);
}

.chart-bar strong {
  top: -28px;
}

.allocation-list,
.activity-list,
.spotlight-list,
.inline-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.inline-item {
  gap: 16px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
}

.allocation-bar {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.08);
  overflow: hidden;
}

.allocation-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.toolbar {
  gap: 14px;
  flex-wrap: wrap;
}

.search input,
.search select,
.login-form input,
.data-form input,
.data-form select,
.data-form textarea {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.data-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  border: 1px dashed rgba(26, 26, 26, 0.14);
  background: rgba(255, 255, 255, 0.45);
}

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

.data-form .form-actions {
  grid-column: 1 / -1;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
  margin-top: 18px;
}

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

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

.table-client {
  gap: 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(183, 121, 47, 0.18), rgba(44, 109, 144, 0.18));
  font-weight: 700;
}

.client-name {
  font-weight: 700;
}

.credential-cell strong {
  font-size: 0.92rem;
}

.badge {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.positive-text {
  color: var(--forest);
}

.negative-text {
  color: var(--coral);
}

.activity-item,
.spotlight-item {
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child,
.spotlight-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 8px rgba(183, 121, 47, 0.12);
}

.grow {
  flex: 1;
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1120px) {
  .shell,
  .stats-grid,
  .insight-grid,
  .bottom-grid,
  .data-form,
  .data-form.wide {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .main,
  .sidebar,
  .auth-shell {
    padding: 18px;
  }

  .hero,
  .panel,
  .stat-card,
  .auth-card {
    padding: 20px;
    border-radius: 24px;
  }

  .hero h2 {
    max-width: none;
  }
}
