:root {
  --bg: #0b1220;
  --bg-2: #0f172a;
  --surface: rgba(15, 23, 42, 0.92);
  --surface-2: rgba(17, 24, 39, 0.96);
  --surface-3: rgba(10, 17, 32, 0.84);
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(214, 187, 24, 0.34);
  --text: #e5edf7;
  --muted: #98a7bd;
  --muted-2: #74849d;
  --brand: #d6bb18;
  --brand-soft: rgba(214, 187, 24, 0.14);
  --accent: #38bdf8;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --ok-bg: rgba(34, 197, 94, 0.14);
  --warn-bg: rgba(245, 158, 11, 0.16);
  --danger-bg: rgba(239, 68, 68, 0.16);
  --info-bg: rgba(56, 189, 248, 0.14);
  --shadow-soft: 0 18px 40px rgba(2, 6, 23, 0.34);
  --shadow-hard: 0 26px 80px rgba(2, 6, 23, 0.5);
  --radius: 18px;
  --radius-lg: 24px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 24%),
    radial-gradient(circle at top left, rgba(214, 187, 24, 0.08), transparent 22%),
    linear-gradient(180deg, #0b1220, #111827 48%, #0b1220);
  color: var(--text);
  font-family: "Aptos", "Segoe UI Variable", "Trebuchet MS", sans-serif;
}

body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
code { font-family: "Cascadia Mono", "Consolas", monospace; font-size: 13px; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background:
    linear-gradient(180deg, rgba(11, 18, 32, 0.98), rgba(11, 18, 32, 0.92)),
    radial-gradient(circle at top, rgba(214, 187, 24, 0.08), transparent 28%);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.content {
  min-width: 0;
  padding: 22px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.content-appbar,
.brand-card,
.profile-card,
.panel,
.stat-card,
.login-panel,
.list-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), transparent 28%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-soft);
}

.content-appbar {
  position: sticky;
  top: 14px;
  z-index: 12;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  backdrop-filter: blur(12px);
}

.content-appbar__main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.content-appbar__eyebrow {
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.content-appbar__title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: .01em;
}

.content-appbar__meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.content-appbar__side {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.shell-pill,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(214, 187, 24, 0.24);
  background: rgba(214, 187, 24, 0.1);
  color: #f7e79a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
}

.shell-pill--accent {
  border-color: rgba(56, 189, 248, 0.24);
  background: rgba(56, 189, 248, 0.12);
  color: #b9ebff;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.account-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(214, 187, 24, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.account-chip__avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(214, 187, 24, 0.94), rgba(56, 189, 248, 0.72));
  color: #08111e;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
}

.brand-card {
  padding: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.brand-icon,
.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.26), transparent 48%),
    linear-gradient(135deg, rgba(214, 187, 24, 0.92), rgba(125, 211, 252, 0.48));
  color: #0b1220;
  font-weight: 900;
  letter-spacing: .08em;
}

.brand-logo {
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.brand-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}

.brand-subtitle {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.profile-card { padding: 16px; }
.profile-name { font-size: 16px; font-weight: 900; }
.profile-meta { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  padding: 13px 15px;
  border-radius: 16px;
  color: var(--muted);
  font-weight: 800;
  border: 1px solid transparent;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.menu-item:hover {
  transform: translateX(2px);
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.menu-item.active {
  color: #f8f1bf;
  border-color: rgba(214, 187, 24, 0.26);
  background:
    linear-gradient(90deg, rgba(214, 187, 24, 0.16), rgba(214, 187, 24, 0.04)),
    rgba(255, 255, 255, 0.02);
  box-shadow: inset 3px 0 0 rgba(214, 187, 24, 0.9);
}

.logout-form { margin-top: auto; }

.hero,
.panel { padding: 22px; }

.hero {
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(214, 187, 24, 0.16), transparent 26%),
    radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.12), transparent 32%),
    linear-gradient(140deg, rgba(11, 18, 32, 0.98), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(214, 187, 24, 0.14);
  box-shadow: var(--shadow-hard);
}

.hero.compact { padding: 18px 22px; }
.hero h1 { margin: 12px 0 10px; font-size: 34px; line-height: 1.02; letter-spacing: -.03em; }
.hero p { margin: 0; color: #c7d3e4; max-width: 860px; line-height: 1.72; }

.hero-dashboard { overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr); gap: 18px; }
.hero-main { display: flex; flex-direction: column; gap: 18px; }
.hero-rail { display: grid; gap: 12px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.metric-chip-row { display: flex; flex-wrap: wrap; gap: 12px; }
.metric-chip {
  min-width: 160px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.metric-chip strong { display: block; font-size: 23px; line-height: 1.05; }
.metric-chip span { display: block; margin-top: 6px; color: #b4c3d8; font-size: 13px; }

.insight-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.24);
}

.insight-label {
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #b9c7da;
}

.insight-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.08;
}

.insight-card p {
  margin: 8px 0 0;
  color: #c7d3e4;
  line-height: 1.6;
}

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

.stat-card {
  padding: 18px;
  border-radius: 22px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand), rgba(214, 187, 24, 0));
  opacity: .9;
}

.stat-label { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.stat-value { margin-top: 10px; font-size: 34px; font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.stat-note { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }

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

.panel-header { margin-bottom: 16px; }
.panel-header h2 { margin: 0 0 6px; font-size: 20px; line-height: 1.2; }
.panel-header p { margin: 0; color: var(--muted); line-height: 1.55; }
.panel-header.between,
.between { display: flex; justify-content: space-between; gap: 14px; align-items: center; }

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

.list-row,
.list-card,
.activity-row {
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.03), transparent 26%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.84), rgba(11, 18, 32, 0.96));
}

.list-row,
.list-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  color: var(--muted);
}

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

.list-card strong,
.list-row strong,
.activity-title { color: var(--text); }

.client-card-link { transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.client-card-link:hover {
  transform: translateY(-2px);
  border-color: rgba(214, 187, 24, 0.28);
  box-shadow: 0 20px 34px rgba(2, 6, 23, 0.32);
}

.link-hint { color: #f2de77; font-weight: 800; }
.muted-link { color: #8adfff; text-decoration: underline; }

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

.chart-label,
.chart-value { font-size: 14px; }
.chart-value { color: var(--text); font-weight: 800; text-align: right; }

.chart-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.chart-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #facc15);
  box-shadow: 0 0 18px rgba(214, 187, 24, 0.24);
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.signal-card {
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(11, 18, 32, 0.92));
}

.signal-card span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.signal-card strong { display: block; margin-top: 8px; font-size: 20px; line-height: 1.2; }

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

.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 15px 16px;
}

.activity-main { min-width: 0; display: grid; gap: 6px; }
.activity-title { font-size: 15px; font-weight: 900; line-height: 1.4; }
.activity-meta { color: var(--muted); font-size: 13px; line-height: 1.55; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.03), transparent 24%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(11, 18, 32, 0.98));
}

table { width: 100%; border-collapse: collapse; min-width: 980px; }
thead { background: rgba(255, 255, 255, 0.03); }
th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 11px;
}

tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
}

.badge-success { color: #bbf7d0; background: var(--ok-bg); border-color: rgba(34, 197, 94, 0.34); }
.badge-warning { color: #fde68a; background: var(--warn-bg); border-color: rgba(245, 158, 11, 0.36); }
.badge-danger { color: #fecaca; background: var(--danger-bg); border-color: rgba(239, 68, 68, 0.36); }
.badge-default { color: #bae6fd; background: var(--info-bg); border-color: rgba(56, 189, 248, 0.28); }

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

.filters-grid label,
.form-stack label,
.three-col-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.checkbox-field { justify-content: flex-end; }
.checkbox-field input { width: 18px; height: 18px; margin-top: 6px; accent-color: var(--brand); }
.form-actions-span { display: flex; align-items: end; }
.form-span-3 { grid-column: 1 / -1; }
.panel-narrow { max-width: 760px; }

input,
select,
textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 13, 24, 0.78);
  color: var(--text);
  padding: 13px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

input::placeholder,
textarea::placeholder { color: var(--muted-2); }

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(214, 187, 24, 0.44);
  box-shadow: 0 0 0 3px rgba(214, 187, 24, 0.12);
}

.filters-actions,
.button-row {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.button-row { align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 16px;
  padding: 11px 16px;
  border: 1px solid transparent;
  font-weight: 900;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-dark {
  background: linear-gradient(135deg, var(--brand), #caa510);
  color: #0b1220;
  box-shadow: 0 12px 24px rgba(214, 187, 24, 0.18);
}

.btn-dark:hover { box-shadow: 0 18px 28px rgba(214, 187, 24, 0.24); }

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-color: var(--line);
}

.btn-outline:hover { border-color: rgba(214, 187, 24, 0.28); background: rgba(255, 255, 255, 0.06); }
.btn-full { width: 100%; }

.code-block {
  background: rgba(2, 6, 23, 0.96);
  color: #d7e6f7;
  border: 1px solid rgba(56, 189, 248, 0.16);
  padding: 18px;
  border-radius: 22px;
  overflow-x: auto;
}

.code-block pre { margin: 0; font-family: "Cascadia Mono", "Consolas", monospace; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.helper-text { color: var(--muted); line-height: 1.7; }

.empty-state {
  padding: 26px;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  text-align: center;
}

.logo-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  margin-bottom: 14px;
  border-radius: 22px;
  border: 1px dashed rgba(214, 187, 24, 0.22);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.logo-preview { max-width: 100%; max-height: 150px; object-fit: contain; }
.logo-upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.logo-upload-field {
  flex: 1 1 260px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-inline-input {
  padding: 10px 12px;
  font-size: 13px;
}

.upload-hint { margin-top: 10px; font-size: 12px; }

.alert {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  margin-top: 18px;
}

.alert-danger { color: #fecaca; border-color: rgba(239, 68, 68, 0.28); background: rgba(127, 29, 29, 0.18); }
.alert-success { color: #bbf7d0; border-color: rgba(34, 197, 94, 0.28); background: rgba(20, 83, 45, 0.18); }

.login-body {
  min-height: 100vh;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(214, 187, 24, 0.12), transparent 22%),
    radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.1), transparent 24%),
    linear-gradient(180deg, #0b1220, #111827);
}

.login-grid {
  width: min(1160px, 100%);
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
}

.login-panel { padding: 34px; }
.hero-panel { background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(11, 18, 32, 0.92)); }
.hero-panel h1 { margin: 18px 0 12px; font-size: 42px; line-height: 1.02; letter-spacing: -.03em; }
.hero-panel p,
.hero-list { color: #c7d3e4; line-height: 1.78; }
.hero-list { display: grid; gap: 10px; margin-top: 22px; }

.form-panel { background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(11, 18, 32, 0.94)); }
.form-title { font-size: 30px; font-weight: 900; line-height: 1.05; }
.form-subtitle { margin-top: 8px; color: var(--muted); line-height: 1.7; }
.form-stack { margin-top: 22px; display: grid; gap: 14px; }

.subtle-panel { background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(11, 18, 32, 0.98)); }
.compact-header h3 { margin: 0 0 4px; }
.wrap-row { flex-wrap: wrap; }
.tight-stack { gap: 8px; margin-top: 14px; }
.small-code pre { font-size: 12px; line-height: 1.55; word-break: break-word; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .stats-grid,
  .panel-grid.two-col,
  .filters-grid,
  .three-col-form,
  .login-grid,
  .hero-grid,
  .signal-grid { grid-template-columns: 1fr; }
  .content-appbar,
  .panel-header.between,
  .between { flex-direction: column; align-items: flex-start; }
  .content-appbar__side { justify-content: flex-start; }
  .chart-row { grid-template-columns: 1fr; }
  .metric-chip-row { flex-direction: column; }
}

@media (max-width: 760px) {
  .content { padding: 14px; }
  .content-appbar { top: 8px; padding: 14px 15px; }
  .content-appbar__title { font-size: 20px; }
  .hero h1 { font-size: 28px; }
  .login-panel { padding: 24px; }
  .hero-panel h1 { font-size: 34px; }
  .activity-row,
  .list-row { flex-direction: column; align-items: flex-start; }
}
