:root {
  --bg-app: #202123;
  --bg-sidebar: #171717;
  --bg-main: #212121;
  --bg-panel: #2a2b2f;
  --bg-panel-soft: #2f3136;
  --bg-input: #171b23;
  --line: #3b3f46;
  --line-soft: #444955;
  --text-main: #ececf1;
  --text-soft: #a9b0bd;
  --text-dim: #8a91a1;
  --accent: #ececf1;
  --accent-dark: #111827;
  --chip: #343741;
  --ok-bg: rgba(30, 181, 58, 0.18);
  --ok-bd: rgba(30, 181, 58, 0.5);
  --ok-tx: #8bf0a0;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: Arial, sans-serif;
}

body {
  overflow: hidden;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 236px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex-shrink: 0;
}

.sidebar-top {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #3b3f46;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--text-main);
  flex-shrink: 0;
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-country-badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
  padding: 6px 9px 7px;
  border-radius: 12px;
  background: #3b3f46;
  width: fit-content;
}

.brand-country-top {
  font-size: 10px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.brand-country-bottom {
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.tan-green {
  color: #1eb53a;
}

.tan-yellow {
  color: #fcd116;
}

.tan-black {
  color: #000000;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.28);
}

.tan-blue {
  color: #00a3dd;
}

.sidebar-toggle-btn {
  width: 26px;
  height: 26px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111722;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-toggle-lines,
.sidebar-toggle-lines::before,
.sidebar-toggle-lines::after {
  display: block;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.sidebar-toggle-lines {
  position: relative;
}

.sidebar-toggle-lines::before,
.sidebar-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.sidebar-toggle-lines::before {
  top: -5px;
}

.sidebar-toggle-lines::after {
  top: 5px;
}

.user-compact-card {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-card-main {
  display: flex;
  align-items: center;
}

.user-card-copy {
  min-width: 0;
}

.user-email {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.user-meta {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 5px;
  line-height: 1.35;
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px 20px;
}

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

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-group-toggle,
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.nav-group-toggle::before,
.nav-link::before {
  content: attr(data-icon);
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 8px;
  background: #111722;
  border: 1px solid var(--line);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}

.nav-group-toggle {
  justify-content: space-between;
  color: var(--text-soft);
  font-weight: 700;
}

.nav-group-toggle span:first-of-type {
  flex: 1;
}

.nav-group-toggle:hover,
.nav-link:hover,
.nav-group-toggle.active-group,
.nav-link.active {
  background: #3b3f46;
  color: var(--text-main);
}

.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding-left: 8px;
}

.nav-submenu.open {
  display: flex;
}

.group-arrow {
  color: var(--text-dim);
  font-size: 12px;
}

.workspace {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  background: var(--bg-main);
  padding: 16px;
  overflow-y: auto;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 16px;
}

.page-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
}

.page-subtitle {
  color: var(--text-soft);
  font-size: 14px;
  margin-top: 8px;
}

.header-controls {
  min-width: 300px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
}

.header-control {
  min-width: 132px;
}

.header-control label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-soft);
}

select {
  min-height: 26px;
  border: 1px solid var(--line-soft);
  background: #ffffff;
  color: #000000;
  padding: 2px 6px;
}

.view {
  display: none;
}

.view.active,
.view:not([hidden]) {
  display: block;
}

.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: 220px 220px;
  gap: 16px;
  margin-bottom: 18px;
}

.hero-card,
.dashboard-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  cursor: pointer;
  text-align: left;
  background-size: cover;
  background-position: center;
  padding: 0;
  color: var(--text-main);
}

.hero-card {
  grid-column: span 2;
  grid-row: span 2;
}

.card-image-track {
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.65)),
    url("https://images.unsplash.com/photo-1526232761682-d26e03ac148e?auto=format&fit=crop&w=1400&q=80");
}

.card-image-main {
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.65)),
    url("https://images.unsplash.com/photo-1579952363873-27f3bade9f55?auto=format&fit=crop&w=1400&q=80");
}

.card-image-alerts {
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.65)),
    url("https://images.unsplash.com/photo-1551958219-acbc608c6377?auto=format&fit=crop&w=1400&q=80");
}

.card-image-config {
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.65)),
    url("https://images.unsplash.com/photo-1431324155629-1a6deb1dec8d?auto=format&fit=crop&w=1400&q=80");
}

.card-image-prospects {
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.65)),
    url("https://images.unsplash.com/photo-1517927033932-b3d18e61fb3a?auto=format&fit=crop&w=1400&q=80");
}

.card-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.68));
}

.card-image-content {
  position: absolute;
  inset: auto 0 0 0;
  padding: 24px;
  z-index: 2;
}

.eyebrow {
  font-size: 12px;
  color: #d5d9e4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.card-image-content h2,
.card-image-content h3 {
  margin: 0 0 8px;
  color: #ffffff;
}

.card-image-content p {
  margin: 0;
  color: #d7dcea;
  font-size: 13px;
  line-height: 1.45;
  max-width: 80%;
}

.summary-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 16px;
}

.panel-card,
.config-workspace-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.panel-head h4 {
  margin: 0 0 6px;
}

.panel-body {
  font-size: 13px;
  line-height: 1.5;
}

.muted,
.panel-body.muted {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  line-height: 1.6;
}

.manager-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 210px;
  gap: 16px;
  margin-bottom: 18px;
}

.manager-main-card {
  grid-column: span 3;
}

.manager-small-card {
  grid-column: span 2;
}

.development-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(17, 24, 39, 0.78);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.app-btn {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--bg-input);
  color: var(--text-main);
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
}

.app-btn:hover {
  background: #232734;
}

.app-btn.primary,
.app-btn-primary {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.app-btn.primary:hover,
.app-btn-primary:hover {
  background: rgba(251, 191, 36, 0.18);
}

.logout-chpp-btn {
  margin-top: 10px;
  width: 100%;
  justify-content: center;
  font-size: 12px;
  opacity: 0.86;
}

.logout-chpp-btn::before {
  content: "<";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  font-size: 14px;
}

.chpp-connect-card {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chpp-connect-content {
  width: min(520px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}

.chpp-connect-badge {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #374151;
  color: #f8fafc;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
}

.chpp-connect-content h2 {
  margin: 0;
}

.chpp-connect-content p {
  margin: 0;
  max-width: 460px;
  color: var(--text-soft);
  line-height: 1.5;
}

.error-text {
  color: #ff8f8f;
  font-weight: 800;
}

@media (max-width: 1280px) {
  .dashboard-grid,
  .manager-dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .hero-card,
  .dashboard-card,
  .manager-main-card,
  .manager-small-card {
    grid-column: auto;
    grid-row: auto;
    min-height: 220px;
  }

  .summary-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: grid;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    width: 100%;
  }

  .workspace {
    height: auto;
    min-height: 100vh;
  }

  .workspace-header,
  .header-controls {
    display: grid;
    justify-content: stretch;
    min-width: 0;
  }
}
