:root {
  color-scheme: dark;
  --bg: #08101d;
  --bg-soft: #101a2d;
  --panel: rgba(16, 27, 47, 0.88);
  --panel-strong: rgba(10, 18, 33, 0.94);
  --line: rgba(120, 151, 210, 0.16);
  --line-strong: rgba(120, 151, 210, 0.28);
  --text: #f4f7fb;
  --muted: #95a5c0;
  --muted-strong: #c4d0e3;
  --brand: #1f6feb;
  --brand-soft: rgba(31, 111, 235, 0.18);
  --success: #34c759;
  --shadow: 0 32px 90px rgba(0, 0, 0, 0.36);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --container: 1240px;
  font-family: "Segoe UI", "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(31, 111, 235, 0.16), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(195, 34, 91, 0.14), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(38, 153, 251, 0.12), transparent 28%),
    linear-gradient(180deg, #08101d 0%, #09111d 52%, #070d17 100%);
  color: var(--text);
}

body {
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.52;
}

body::before {
  top: -120px;
  left: -80px;
  width: 360px;
  height: 360px;
  background: rgba(31, 111, 235, 0.22);
}

body::after {
  right: -120px;
  bottom: 0;
  width: 320px;
  height: 320px;
  background: rgba(215, 68, 110, 0.18);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.shell-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(8, 15, 28, 0.72);
}

.shell-header__inner,
.shell-main {
  width: min(calc(100% - 40px), var(--container));
  margin: 0 auto;
}

.shell-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-lockup img {
  width: auto;
  height: 42px;
}

.brand-copy small,
.hero-copy small,
.section-header small,
.card-kicker,
.metric-label,
.aux-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6fa8ff;
}

.brand-copy h1 {
  margin: 4px 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-pill,
.time-pill,
.aux-chip {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted-strong);
}

.time-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(52, 199, 89, 0.12);
}

.logout-button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.logout-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.shell-main {
  padding: 34px 0 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.95fr);
  gap: 26px;
  align-items: stretch;
}

.hero-panel,
.spotlight-panel,
.metric-card,
.dashboard-card,
.login-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 27, 47, 0.92) 0%, rgba(8, 15, 28, 0.96) 100%);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 34px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-panel::after,
.spotlight-panel::after,
.dashboard-card::after {
  content: "";
  position: absolute;
  inset: auto -30% -45% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--brand-soft) 0%, transparent 68%);
  pointer-events: none;
}

.hero-copy h2 {
  margin: 14px 0 14px;
  max-width: 13ch;
  font-size: clamp(2.5rem, 4vw, 4.4rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.hero-copy p {
  max-width: 62ch;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--muted-strong);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.metric-card {
  padding: 18px 18px 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.metric-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

.spotlight-panel {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.spotlight-header h3,
.section-header h3,
.empty-state h3 {
  margin: 12px 0 0;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.spotlight-header p,
.section-header p,
.dashboard-card p,
.empty-state p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.spotlight-stack {
  display: grid;
  gap: 12px;
}

.spotlight-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
}

.spotlight-item strong {
  display: block;
  font-size: 1rem;
}

.spotlight-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.section-block {
  margin-top: 28px;
}

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

.section-header p {
  max-width: 56ch;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.dashboard-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 300px;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
}

.dashboard-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-icon {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.dashboard-icon svg {
  width: 28px;
  height: 28px;
}

.dashboard-badge {
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 0.78rem;
  color: var(--muted-strong);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.dashboard-card h4 {
  margin: 0;
  font-size: 1.72rem;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.dashboard-meta {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.dashboard-meta li {
  position: relative;
  padding-left: 18px;
  color: var(--muted-strong);
  line-height: 1.55;
}

.dashboard-meta li::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.02);
}

.dashboard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
}

.dashboard-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

.dashboard-link svg {
  width: 16px;
  height: 16px;
}

.dashboard-url {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.empty-state {
  padding: 48px 34px;
}

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

.login-panel {
  width: min(100%, 430px);
  padding: 34px 30px 30px;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.login-logo img {
  width: 160px;
  height: auto;
}

.login-panel h1 {
  margin: 0;
  font-size: 2.05rem;
  text-align: center;
  letter-spacing: -0.05em;
}

.login-panel p {
  margin: 10px auto 0;
  max-width: 32ch;
  text-align: center;
  color: var(--muted);
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.86rem;
  color: var(--muted-strong);
}

.field input {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input:focus {
  border-color: rgba(111, 168, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.12);
}

.submit-button {
  height: 54px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #1f6feb 0%, #1757c4 100%);
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.submit-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.error-banner {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 107, 129, 0.28);
  background: rgba(255, 86, 112, 0.12);
  color: #ffd6dc;
  line-height: 1.55;
}

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

.loading-box {
  width: min(100%, 420px);
  text-align: center;
  padding: 38px 28px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: rgba(16, 27, 47, 0.85);
  box-shadow: var(--shadow);
}

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 18px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: #6fa8ff;
  animation: spin 1s linear infinite;
}

.loading-box h1 {
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: -0.04em;
}

.loading-box p {
  margin: 10px 0 0;
  color: var(--muted);
}

[data-theme="logistics"] {
  --accent: #3f94ff;
  --accent-strong: #1f6feb;
}

[data-theme="sales"] {
  --accent: #f5b23a;
  --accent-strong: #cb7b1e;
}

[data-theme="default"] {
  --accent: #6fa8ff;
  --accent-strong: #4e7fd4;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell-header__inner,
  .header-actions,
  .section-header,
  .dashboard-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .shell-header__inner,
  .shell-main {
    width: min(calc(100% - 28px), var(--container));
  }

  .hero-panel,
  .spotlight-panel,
  .dashboard-card,
  .login-panel {
    padding: 24px;
    border-radius: 24px;
  }

  .dashboard-card h4 {
    font-size: 1.45rem;
  }

  .hero-copy h2 {
    font-size: 2.5rem;
  }

  .dashboard-url {
    white-space: normal;
  }
}
