:root {
  --blue: #2f6df6;
  --blue-soft: #eef4ff;
  --green: #31a86b;
  --green-soft: #eaf8f0;
  --orange: #ff9f2d;
  --orange-soft: #fff3df;
  --red: #f04c4c;
  --red-soft: #ffecec;
  --violet: #8b5cf6;
  --violet-soft: #f0eaff;
  --sky: #45aeea;
  --sky-soft: #eaf7ff;
  --text: #17213b;
  --muted: #6b7895;
  --line: #e5eaf3;
  --panel: #ffffff;
  --bg: #f6f8fc;
  --shadow: 0 12px 32px rgba(28, 44, 75, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif;
  letter-spacing: 0;
  font-size: 13px;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; font-weight: 700; }

.route-select {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.route-card {
  width: min(520px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.route-card h1 { margin: 6px 0 18px; font-size: 24px; }
.route-actions { display: flex; gap: 10px; }
.route-actions a {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
}

.dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  background: linear-gradient(90deg, #fff 0 228px, var(--bg) 228px);
}
.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,0.94);
}
.nav-head {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.nav-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}
.side-nav nav {
  display: grid;
  gap: 7px;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 14px;
  color: #44506a;
  border-radius: 8px;
  font-size: 12.5px;
}
.side-nav a.active {
  background: var(--blue-soft);
  color: var(--blue);
}
.side-nav a span {
  width: 18px;
  text-align: center;
  color: #7f8ba6;
}
.side-nav a.active span { color: var(--blue); }
.side-nav b {
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
}

.dash-main {
  padding: 26px 28px 30px;
  min-width: 0;
}
.dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.dash-top h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}
.dash-top p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.top-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #35405b;
  font-size: 12.5px;
}
.account-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.bell {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.account-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d9e2f3, #f3f6fb);
}

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.kpi-card, .panel, .worker-kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.kpi-card {
  min-height: 112px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.kpi-card span, .worker-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.kpi-card strong {
  display: block;
  margin: 10px 0 10px;
  font-size: 20px;
}
.kpi-card small { color: var(--muted); font-weight: 700; font-size: 11px; }
.plus { color: var(--green) !important; }
.minus { color: var(--red) !important; }
.spark {
  align-self: end;
  width: 86px;
  height: 34px;
  border-radius: 8px;
  background:
    linear-gradient(140deg, transparent 0 48%, currentColor 49% 52%, transparent 53%),
    linear-gradient(160deg, transparent 0 38%, currentColor 39% 42%, transparent 43%);
  opacity: .9;
}
.spark.blue { color: var(--blue); }
.spark.green { color: var(--green); }
.icon-chip {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-style: normal;
  font-weight: 800;
}
.icon-chip.orange { background: var(--orange-soft); color: var(--orange); }
.icon-chip.violet { background: var(--violet-soft); color: var(--violet); }
.icon-chip.mint { background: var(--green-soft); color: var(--green); }

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  gap: 16px;
}
.panel { padding: 18px; min-width: 0; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 {
  margin: 0;
  font-size: 15px;
}
.panel-head select, .filter-head button, .filter-head input {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  min-height: 34px;
  padding: 0 10px;
  color: #5d6984;
}
.filter-head > div {
  display: flex;
  gap: 8px;
  align-items: center;
}
.sales-layout {
  display: grid;
  grid-template-columns: 1.25fr .9fr;
  gap: 24px;
  align-items: center;
}
.bar-chart {
  height: 230px;
  display: flex;
  align-items: end;
  gap: 18px;
  padding: 28px 8px 32px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0 45px, #eef2f8 46px 47px);
}
.bar-chart div {
  flex: 1;
  min-width: 22px;
  position: relative;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(#4584ff, #2f6df6);
}
.bar-chart span {
  position: absolute;
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
}
.donut-wrap {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 14px;
  align-items: center;
}
.donut {
  width: 148px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--blue) 0 45%, var(--green) 45% 70%, #ffc857 70% 85%, #d6dce8 85% 100%);
  position: relative;
}
.donut::after {
  content: "";
  position: absolute;
  inset: 32px;
  background: #fff;
  border-radius: 50%;
}
.donut strong {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 13px;
}
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--muted); font-size: 12px; }
.legend b { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; }
.blue-dot { background: var(--blue); }
.green-dot { background: var(--green); }
.yellow-dot { background: #ffc857; }
.gray-dot { background: #d6dce8; }

.sales-panel, .progress-panel { min-height: 338px; }
.workers-panel { grid-column: 1; }
.payout-panel { grid-column: 2; }
.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.clean-table th, .clean-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}
.clean-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.compact-table th, .compact-table td { padding: 13px 8px; }
.bar {
  display: inline-block;
  width: 86px;
  height: 7px;
  background: #e4eaf5;
  border-radius: 99px;
  overflow: hidden;
  margin-right: 8px;
  vertical-align: middle;
}
.bar i { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 7px;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.admin-tabs button,
.link-button,
.primary-admin-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #53617d;
  padding: 0 11px;
  font-weight: 800;
  font-size: 12px;
}
.admin-tabs button.active,
.primary-admin-button {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.link-button {
  border: 0;
  color: var(--blue);
  background: transparent;
  padding: 0;
}
.worker-name {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  text-align: left;
}
.worker-name small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-top: 2px;
}
.clean-table select,
.account-settings input,
.account-settings select,
.admin-detail select,
.modal-grid input,
.modal-grid select,
.admin-modal textarea {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 9px;
  font-size: 12px;
}
.admin-detail {
  display: grid;
  gap: 10px;
}
.admin-detail p {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.admin-detail span {
  color: var(--muted);
}
.admin-notice {
  display: none;
  margin: -10px 0 14px;
  padding: 9px 12px;
  border: 1px solid #bfe5d1;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
}
.admin-notice.show {
  display: block;
}
.admin-modal {
  width: min(640px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(20, 32, 60, .25);
}
.admin-modal::backdrop {
  background: rgba(20, 32, 60, .35);
}
.admin-modal form {
  padding: 20px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-head p,
.modal-head h2 {
  margin: 0;
}
.modal-head p {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}
.modal-head h2 {
  font-size: 17px;
}
.modal-head button {
  border: 0;
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 8px;
  min-height: 32px;
  padding: 0 12px;
  font-weight: 800;
}
.admin-modal label,
.account-settings label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 12px;
}
.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.checkbox-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
.admin-modal textarea {
  width: 100%;
  min-height: 86px;
  padding: 9px;
}
.account-settings {
  max-width: 620px;
}
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.orange { background: var(--orange-soft); color: #d27a00; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.gray { background: #f0f3f8; color: #7b8599; }
.red { color: var(--red); font-weight: 800; }
.ok { color: var(--green); font-weight: 800; }
.locked-text { color: var(--red); font-weight: 800; }
.stars { color: #f6ad23; font-weight: 800; white-space: nowrap; }
.avatar-cell {
  min-width: 150px;
  font-weight: 800;
}
.avatar-cell img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 10px;
}
.avatar-cell small {
  margin-left: 44px;
  color: var(--muted);
  font-weight: 700;
}

.worker-shell {
  grid-template-columns: 232px minmax(0, 1fr);
  background: linear-gradient(90deg, #fff 0 232px, var(--bg) 232px);
}
.worker-profile {
  padding: 10px 18px 24px;
  display: grid;
  gap: 5px;
}
.worker-profile img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 4px;
}
.worker-profile strong { font-size: 15px; }
.worker-profile span { color: var(--muted); font-size: 12px; }
.worker-profile em {
  width: max-content;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}
.worker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  gap: 16px;
}
.worker-center { display: grid; gap: 16px; }
.worker-right { display: grid; gap: 16px; align-content: start; }
.worker-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.worker-kpi { padding: 18px; min-height: 112px; }
.worker-kpi strong {
  display: block;
  margin: 12px 0 10px;
  font-size: 25px;
}
.worker-kpi small { color: var(--muted); font-weight: 700; }
.worker-kpi button, .worker-job button, .side-card button {
  width: 100%;
  min-height: 35px;
  border: 1px solid #cbd9f7;
  background: #fff;
  color: var(--blue);
  border-radius: 7px;
  font-weight: 800;
}
.worker-kpi:nth-child(2) button {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.rating strong { color: #17213b; }
.rating strong::first-letter { color: #ffb21e; }
.worker-job-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.worker-job {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 14px;
}
.worker-job h3 {
  margin: 10px 0 8px;
  font-size: 15px;
}
.worker-job p {
  min-height: 48px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.worker-job dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 12px;
}
.worker-job dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.worker-job dd {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 800;
}
.tag {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}
.tag.violet { background: var(--violet-soft); color: var(--violet); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.orange { background: var(--orange-soft); color: #d27a00; }
.tag.sky { background: var(--sky-soft); color: var(--sky); }
.locked-zone { background: #fff; }
.locked-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.locked-grid article {
  position: relative;
  min-height: 112px;
  padding: 14px;
  border-radius: 9px;
  background: linear-gradient(135deg, #f3f5f9, #e8edf5);
  color: #25314d;
}
.locked-grid h3 { margin: 10px 0; font-size: 15px; }
.locked-grid p { color: #506079; font-size: 12px; }
.locked-grid span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  color: #68758f;
}
.worker-task-table .tag { margin-right: 8px; }
.side-card { padding: 16px; }
.side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.side-card h2 { margin: 0; font-size: 16px; }
.side-card p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.skill-side { display: grid; gap: 12px; }
.skill-side div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.skill-side b { color: #f6ad23; white-space: nowrap; }
.payout-history {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.payout-history li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.payout-history strong { color: var(--text); }
.payout-history em {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .admin-kpis, .worker-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid, .worker-layout, .sales-layout { grid-template-columns: 1fr; }
  .payout-panel, .workers-panel { grid-column: auto; }
}
@media (max-width: 820px) {
  .dashboard-shell, .worker-shell {
    grid-template-columns: 1fr;
    background: var(--bg);
  }
  .side-nav {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .side-nav nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-main { padding: 18px; }
  .dash-top { align-items: flex-start; }
  .admin-kpis, .worker-kpis, .worker-job-grid, .locked-grid, .donut-wrap { grid-template-columns: 1fr; }
  .clean-table { min-width: 760px; }
  .panel { overflow-x: auto; }
}
