:root {
  --bg: #f6f6f7;
  --panel: rgba(255, 255, 255, 0.88);
  --text: #111114;
  --muted: #70727a;
  --line: #e8e8ec;
  --black: #08080a;
  --orange: #f6a21a;
  --blue: #2563eb;
  --green: #0f9f6e;
  --red: #dc2626;
  --shadow: 0 24px 70px rgba(12, 14, 20, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 30% -10%, rgba(255, 255, 255, 0.96), transparent 34%),
    linear-gradient(180deg, #fbfbfc 0%, var(--bg) 42%, #f2f2f4 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(22px);
}

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

.brand img {
  width: 64px;
  height: auto;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
}

.brand-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

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

.nav button {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 14px 16px;
  color: #444750;
  background: transparent;
  text-align: left;
  font-weight: 700;
  font-size: 16px;
}

.nav button.active {
  color: white;
  background: var(--black);
  box-shadow: 0 14px 28px rgba(8, 8, 10, 0.16);
}

.main {
  padding: 34px clamp(22px, 4vw, 56px) 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--orange);
  font-size: 15px;
  font-weight: 800;
}

h1 {
  margin: 6px 0 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  background: var(--black);
  color: white;
  font-weight: 800;
  min-height: 44px;
  font-size: 15px;
}

.btn.light {
  background: white;
  color: var(--text);
  border: 1px solid var(--line);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.98), transparent 38%),
    linear-gradient(180deg, #fbfbfc 0%, #f4f4f6 100%);
}

.login-card {
  width: min(560px, 100%);
  padding: 34px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 28px;
}

.login-card h1 {
  margin-bottom: 28px;
  font-size: clamp(34px, 4vw, 52px);
}

.login-card form {
  display: grid;
  gap: 16px;
}

.login-submit {
  justify-self: end;
  min-width: 120px;
}

.grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.two-col {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.stat {
  min-height: 126px;
}

.stat-label,
.muted {
  color: var(--muted);
  font-size: 15px;
}

.stat-value {
  margin-top: 12px;
  font-size: 34px;
  font-weight: 900;
}

.section-title {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 900;
}

.tabs,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: #4d5058;
  background: white;
  font-size: 15px;
  font-weight: 800;
}

.chip.active {
  color: white;
  background: var(--black);
  border-color: var(--black);
}

.world {
  position: relative;
  overflow: hidden;
  min-height: 510px;
}

.world-map {
  width: 100%;
  height: 465px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #f4f5f7);
  border: 1px solid var(--line);
}

.map-country {
  cursor: pointer;
  transition: fill 0.16s ease, opacity 0.16s ease;
}

.map-country:hover {
  opacity: 0.82;
}

.map-country.has-customers:hover {
  opacity: 1;
  filter: brightness(0.94);
}

.map-popover {
  position: absolute;
  right: 28px;
  top: 74px;
  display: grid;
  gap: 3px;
  min-width: 150px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(8, 8, 10, 0.12);
  backdrop-filter: blur(12px);
}

.map-popover span {
  color: var(--muted);
  font-size: 14px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.legend-bar {
  width: 150px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff5f5, #dc2626, #3e0c12);
  border: 1px solid var(--line);
}

.level-row,
.bar-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #ececf0;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--black);
}

.bar-fill.orange {
  background: linear-gradient(90deg, #f7c76f, #f39a15);
}

.list {
  display: grid;
  gap: 14px;
}

.customer-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.customer-name {
  font-size: 20px;
  font-weight: 900;
}

.tag {
  align-self: start;
  border-radius: 999px;
  padding: 6px 10px;
  color: #30323a;
  background: #f0f0f2;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.tag.blue { color: #174ea6; background: #e7efff; }
.tag.green { color: #087450; background: #e6f7f0; }
.tag.orange { color: #9a5a00; background: #fff2d8; }
.tag.red { color: #a31313; background: #ffe8e8; }
.tag.black { color: white; background: var(--black); }

.card-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}

.card-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

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

.field label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  background: white;
  outline: none;
  font-size: 16px;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.login-entry {
  min-width: 142px;
}

.login-modal {
  width: min(620px, 100%);
}

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

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.account-list {
  display: grid;
  gap: 10px;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.import-modal {
  width: min(720px, 100%);
}

.import-help {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.import-help p {
  margin: 0;
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.file-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--black);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.file-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.import-result {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f7f7f8;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.timeline {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.timeline-item {
  padding: 14px;
  border-radius: 16px;
  background: #f7f7f8;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
}

.modal {
  width: min(860px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: white;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.18);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 20px;
}

.chart {
  height: 260px;
  display: flex;
  align-items: end;
  gap: 16px;
  padding-top: 24px;
}

.month {
  flex: 1;
  display: grid;
  align-content: end;
  justify-items: center;
  height: 210px;
  position: relative;
}

.month-bar {
  width: 46px;
  border-radius: 999px 999px 8px 8px;
  background: #111114;
}

.month-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 5px rgba(246, 162, 26, 0.16);
}

.month-label {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

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

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 10;
    height: auto;
    padding: 8px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .brand {
    display: none;
  }

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

  .nav button {
    text-align: center;
    padding: 11px 8px;
    border-radius: 14px;
    font-size: 14px;
  }

  .main {
    padding: 24px 14px 92px;
  }

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

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .stats-grid,
  .two-col,
  .form-grid,
  .detail {
    grid-template-columns: 1fr;
  }

  .world-map {
    height: 310px;
  }

  .world {
    min-height: 360px;
  }

  .map-popover {
    top: 58px;
    right: 18px;
    min-width: 128px;
  }
  }

  body {
    font-size: 15px;
  }

  .section-title {
    font-size: 21px;
  }

  .card-meta,
  .muted,
  .stat-label {
    font-size: 14px;
  }
}
