:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #16202a;
  --muted: #667085;
  --line: #d9e2ec;
  --blue: #2367c9;
  --blue-soft: #e8f1ff;
  --green: #18a957;
  --orange: #f59e0b;
  --red: #d92d20;
  --purple: #7c3aed;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f5f6f8;
}

.auth-panel {
  width: min(100%, 460px);
  padding: 34px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

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

.auth-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand span,
.auth-hint,
.auth-footnote {
  color: var(--muted);
  font-size: 13px;
}

.auth-panel h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 600;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 500;
}

.auth-form input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.auth-form .notice {
  margin-top: 2px;
}

.auth-footnote {
  margin: 18px 0 0;
  line-height: 1.6;
}

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

h1,
h2,
h3,
strong,
b {
  font-weight: 600;
}

button {
  cursor: pointer;
}

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

.sidebar {
  background: rgba(255, 255, 255, 0.84);
  color: #111827;
  border-right: 1px solid #e5e7eb;
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(229, 231, 235, 0.9);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.sidebar-note span,
.eyebrow,
.hint,
.scan-card span {
  color: var(--muted);
}

.sidebar .brand span,
.sidebar-note span {
  color: #6b7280;
  font-size: 13px;
  margin-top: 3px;
}

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

.nav-item {
  border: 0;
  border-radius: 8px;
  color: #111827;
  background: transparent;
  padding: 10px 16px;
  text-align: left;
  font-weight: 500;
}

.nav-item.is-active,
.nav-item:hover {
  background: #050505;
  color: #ffffff;
}

.sidebar-note {
  margin-top: auto;
  border: 0;
  border-top: 1px solid #e5e7eb;
  border-radius: 0;
  padding: 14px;
  display: grid;
  gap: 7px;
}

.workspace {
  min-width: 0;
  padding: 32px 40px;
}

.top-adminbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
}

.adminbar-right {
  display: flex;
  gap: 20px;
  align-items: center;
  color: #4b5563;
}

.bell-dot {
  position: relative;
  font-size: 0;
  width: 20px;
  height: 20px;
}

.bell-dot::before {
  content: "♢";
  color: #111;
  font-size: 18px;
}

.bell-dot::after {
  content: "";
  position: absolute;
  right: 1px;
  top: 1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e52620;
}

.home-title {
  margin: 10px 0 28px;
}

.home-title h1 {
  margin: 0 0 10px;
  font-size: 33px;
  font-weight: 600;
  letter-spacing: 0;
}

.home-title p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.home-import-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -6px 0 18px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(229, 231, 235, 0.86);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.home-import-strip strong,
.home-import-strip span {
  display: block;
}

.home-import-strip strong {
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 600;
}

.home-import-strip span {
  color: var(--muted);
  font-size: 13px;
}

.home-import-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.import-trigger {
  cursor: pointer;
}

.import-trigger input {
  display: none;
}

.admin-workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.workflow-step {
  min-height: 92px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 6px 12px;
  align-items: start;
}

.workflow-step span {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f3f4f6;
  color: #111827;
  font-weight: 600;
  grid-row: span 2;
}

.workflow-step strong {
  font-size: 15px;
  font-weight: 600;
}

.workflow-step small {
  color: var(--muted);
  font-size: 12px;
}

.workflow-step.is-primary span {
  background: #050505;
  color: #fff;
}

.workflow-step:hover {
  border-color: #111827;
}

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

.home-metric-card,
.home-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(229, 231, 235, 0.86);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.home-metric-card {
  min-height: 138px;
  padding: 22px;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 20px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.metric-indicator {
  width: 10px;
  height: 72px;
  border-radius: 999px;
  background: #101828;
  position: relative;
}

.metric-indicator::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fff;
  transform: translateX(-50%);
}

.metric-total .metric-indicator { background: #101828; }
.metric-done .metric-indicator { background: #027a48; }
.metric-warning .metric-indicator { background: #d92d20; }
.metric-people .metric-indicator { background: #175cd3; }

.metric-total { border-left: 4px solid #101828; }
.metric-done { border-left: 4px solid #027a48; }
.metric-warning { border-left: 4px solid #d92d20; }
.metric-people { border-left: 4px solid #175cd3; }

.home-metric-card::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -42px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.035);
}

.home-metric-card span,
.home-metric-card small {
  display: block;
  color: #6b7280;
}

.home-metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
}

.danger-text {
  color: #e52620 !important;
  font-weight: 600;
}

.home-grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.home-card {
  padding: 18px;
}

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

.home-card h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.tiny-select,
.link-btn {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 7px 10px;
  color: #4b5563;
}

.link-btn {
  border-color: transparent;
  background: transparent;
}

.line-chart {
  height: 286px;
  position: relative;
}

.home-work-bars {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  padding: 26px 10px 4px;
}

.home-work-bar {
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: 22px minmax(0, 1fr) 22px;
  gap: 8px;
  align-items: end;
  justify-items: center;
}

.home-work-bar strong {
  color: #344054;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.home-work-bar i {
  align-self: end;
  display: block;
  width: 100%;
  max-width: 54px;
  min-height: 4px;
  border-radius: 7px 7px 2px 2px;
  background: #050505;
}

.home-work-bar span {
  color: #667085;
  font-size: 12px;
  white-space: nowrap;
}

.home-chart-empty {
  min-height: 100%;
  border: 1px dashed #d9e1ea;
  border-radius: 8px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: #667085;
  padding: 24px;
}

.home-chart-empty strong {
  color: #101828;
  font-size: 18px;
}

.home-chart-empty span {
  max-width: 460px;
  line-height: 1.55;
}

.line-chart svg {
  width: 100%;
  height: 238px;
  overflow: visible;
}

.chart-line {
  fill: none;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.line-0 { stroke: #050505; }
.line-1 { stroke: #9ca3af; }
.line-2 { stroke: #d1d5db; stroke-dasharray: 4 4; }

.chart-labels {
  display: flex;
  justify-content: space-between;
  color: #6b7280;
  font-size: 12px;
}

.home-alert-list {
  display: grid;
  gap: 22px;
}

.home-alert-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
}

.alert-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.alert-icon.red { background: #df251f; }
.alert-icon.orange { background: #ff930f; }

.home-alert-item strong,
.home-alert-item small,
.home-alert-item time {
  display: block;
}

.home-alert-item strong {
  font-weight: 600;
}

.home-alert-item small,
.home-alert-item time {
  color: #6b7280;
}

.region-card {
  margin-bottom: 18px;
}

.home-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.home-subnote {
  color: #667085;
  font-size: 12px;
  font-weight: 500;
}

.table-muted {
  color: #667085;
  font-size: 12px;
}

.table-status {
  display: inline-flex;
  max-width: 280px;
  border-radius: 8px;
  padding: 5px 8px;
  background: #f2f4f7;
  color: #475467;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.table-status.is-active {
  background: #fff7e6;
  color: #b54708;
}

.table-status.is-done {
  background: #e8f8ef;
  color: #027a48;
}

.project-progress-list {
  display: grid;
  gap: 13px;
}

.project-progress-item {
  border: 1px solid #eef0f3;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 9px;
  background: #fbfcfe;
}

.project-progress-head,
.project-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.project-progress-head strong {
  min-width: 0;
  line-height: 1.35;
  word-break: break-word;
}

.project-progress-head span {
  font-weight: 600;
  color: #050505;
}

.project-progress-meta {
  flex-wrap: wrap;
  justify-content: flex-start;
  color: #667085;
  font-size: 12px;
}

.project-progress-bar {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef0f3;
}

.project-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #050505;
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.region-item {
  padding: 0 18px;
  border-right: 1px solid #e5e7eb;
}

.region-item:last-child {
  border-right: 0;
}

.region-item strong {
  margin-right: 16px;
  font-size: 18px;
}

.region-item span {
  color: #6b7280;
}

.region-numbers,
.region-labels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.region-numbers b {
  font-size: 28px;
}

.region-labels {
  margin-top: 4px;
  font-size: 12px;
}

.region-bar {
  height: 5px;
  margin-top: 14px;
  background: #e5e7eb;
  position: relative;
}

.region-bar i,
.region-bar em {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: #050505;
}

.region-bar em {
  left: auto;
  right: 0;
  background: #ff930f;
}

.home-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
}

.home-table {
  width: 100%;
  border-collapse: collapse;
}

.home-table th,
.home-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #eef0f3;
  text-align: left;
  font-size: 13px;
}

.home-table th {
  color: #6b7280;
  background: #f7f7f8;
}

.dot-status {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.dot-status.done { background: #050505; }
.dot-status.doing { background: #ff930f; }

.home-rank-list {
  display: grid;
  gap: 16px;
}

.home-rank-item {
  display: grid;
  grid-template-columns: 32px 70px 1fr 44px;
  gap: 12px;
  align-items: center;
}

.home-rank-bar {
  height: 7px;
  border-radius: 999px;
  background: #eef0f3;
  overflow: hidden;
}

.home-rank-bar i {
  display: block;
  height: 100%;
  background: #050505;
}

.quick-card {
  display: none;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}

.quick-grid button {
  border: 0;
  border-radius: 10px;
  background: #f7f7f8;
  padding: 14px 8px;
  font-weight: 500;
}

.hero,
.topbar {
  background: var(--panel);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 10px;
}

.hero h1 {
  margin: 0;
  font-size: 28px;
}

.hero-text {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.hero-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7fbff 100%);
}

.hero-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.hero-card strong {
  font-size: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar h1,
.panel h2,
.panel h3 {
  margin: 0;
}

.topbar h1 {
  font-size: 24px;
  font-weight: 600;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.topbar-actions,
.action-row,
.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn,
.danger-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 500;
  white-space: nowrap;
}

.primary-btn {
  background: var(--blue);
  color: #fff;
}

.ghost-btn {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.danger-btn {
  background: #fff1f0;
  border-color: #ffc9c4;
  color: var(--red);
}

.view {
  display: none;
  margin-top: 22px;
}

.view.is-active {
  display: block;
}

.mobile-layout,
.dashboard-grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 22px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, 0.6fr);
}

.wide {
  grid-row: span 2;
}

.phone-panel,
.panel,
.metric-card {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  border: 1px solid rgba(217, 226, 236, 0.7);
}

.phone-panel {
  max-width: 420px;
  overflow: hidden;
}

.phone-top {
  background: #101828;
  color: #fff;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.form-stack,
.panel {
  padding: 20px;
}

.form-stack,
.work-form,
.record-list,
.ranking-list,
.api-grid {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

.scan-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.mini-qr,
.qr-fallback {
  min-width: 72px;
  height: 72px;
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, #111827 0 5px, #fff 5px 10px);
  border: 6px solid #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.mini-qr canvas {
  width: 72px !important;
  height: 72px !important;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #eef2f6;
  border-radius: 8px;
  padding: 4px;
}

.safety-level-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.safety-level-flow div {
  min-height: 72px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  display: grid;
  align-content: center;
  gap: 5px;
}

.safety-level-flow strong {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.safety-level-flow span {
  color: var(--muted);
  font-size: 12px;
}

.segmented button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 10px;
  font-weight: 500;
  color: var(--muted);
}

.segmented button.is-active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 3px 9px rgba(15, 23, 42, 0.08);
}

.segmented button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.photo-box {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed #9db3cf;
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  text-align: center;
}

.photo-box input {
  display: none;
}

.photo-box.is-done {
  background: #e8f8ef;
  border-color: #8bdbad;
  color: var(--green);
}

.part-photo-box {
  width: 100%;
}

.section-label {
  margin: 0;
  color: #344054;
  font-weight: 500;
}

.notice {
  border-radius: 8px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #7a4d00;
  padding: 10px 12px;
  font-size: 13px;
}

.notice.is-good {
  background: #e8f8ef;
  border-color: #a6f4c5;
  color: #027a48;
}

.notice.is-bad {
  background: #fff1f3;
  border-color: #fda29b;
  color: #b42318;
}

.hidden {
  display: none !important;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

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

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  background: #eef2f6;
  color: #475467;
}

.status-pill.running {
  background: #e8f8ef;
  color: var(--green);
}

.detail-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  display: grid;
  gap: 4px;
}

.detail-item span {
  color: #667085;
  font-size: 12px;
  font-weight: 500;
}

.detail-item strong {
  min-width: 0;
  color: #111827;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.detail-item-wide {
  grid-column: 1 / -1;
}

.detail-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px 12px;
  color: var(--muted);
  font-weight: 500;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

.record-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 7px;
}

.record-card .record-meta {
  line-height: 1.45;
}

.record-card strong {
  display: block;
}

.record-meta {
  color: var(--muted);
  font-size: 13px;
}

.record-meta.multiline,
.work-content-cell {
  line-height: 1.65;
}

.work-content-cell {
  min-width: 220px;
}

.filters {
  background: var(--panel);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.filters label {
  min-width: 190px;
}

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

.metric-card {
  padding: 20px;
  text-align: center;
}

.metric-card span {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.metric-card strong {
  font-size: 28px;
  color: var(--blue);
}

.metric-card:nth-child(2) strong {
  color: var(--green);
}

.metric-card:nth-child(3) strong {
  color: var(--purple);
  font-size: 22px;
}

.metric-card:nth-child(4) strong {
  color: var(--orange);
}

.timeline-chart {
  display: grid;
  gap: 16px;
}

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

.timeline-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-track {
  position: relative;
  height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(to right, rgba(35, 103, 201, 0.08) 1px, transparent 1px) 0 0 / 10% 100%,
    #fbfdff;
  overflow: hidden;
}

.time-block {
  position: absolute;
  top: 14px;
  height: 40px;
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  min-width: 28px;
  padding: 0 5px;
}

.time-block.repair {
  background: var(--orange);
}

.time-block.rescue {
  background: #8b5cf6;
}

.time-block.parts {
  background: #0f766e;
}

.time-block.inspection {
  background: #2563a8;
}

.time-block.overhaul {
  background: #9a3412;
}

.time-block.anomaly {
  outline: 3px solid rgba(217, 45, 32, 0.28);
}

.ranking-item {
  display: grid;
  gap: 8px;
}

.ranking-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: #eef2f6;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--green);
}

.bar.low span {
  background: var(--red);
}

.bar.mid span {
  background: var(--orange);
}

.qr-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 420px;
  gap: 22px;
}

.map-toolbar,
.import-box {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.map-toolbar label,
.import-box label {
  min-width: 260px;
}

.map-toolbar .map-key {
  min-width: 180px;
}

.map-mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.map-toolbar input,
.map-toolbar select {
  height: 40px;
}

.map-hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  padding-bottom: 10px;
}

.map-provider-message {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 5;
  max-width: min(520px, calc(100% - 36px));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 251, 235, 0.94);
  color: #92400e;
  font-size: 13px;
  font-weight: 500;
}

.mock-map {
  position: relative;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(35, 103, 201, 0.08) 1px, transparent 1px) 0 0 / 8% 8%,
    linear-gradient(0deg, rgba(35, 103, 201, 0.08) 1px, transparent 1px) 0 0 / 8% 8%,
    radial-gradient(circle at 22% 34%, rgba(24, 169, 87, 0.16), transparent 20%),
    radial-gradient(circle at 76% 66%, rgba(245, 158, 11, 0.14), transparent 22%),
    #f8fbff;
}

.mock-map.is-amap-mode {
  background: #fff;
}

.mock-map::before,
.mock-map::after {
  content: "";
  position: absolute;
  background: rgba(102, 112, 133, 0.18);
  border-radius: 999px;
}

.mock-map.is-amap-mode::before,
.mock-map.is-amap-mode::after {
  display: none;
}

.mock-map::before {
  left: -10%;
  right: -10%;
  top: 48%;
  height: 28px;
  transform: rotate(-8deg);
}

.mock-map::after {
  top: -10%;
  bottom: -10%;
  left: 56%;
  width: 24px;
  transform: rotate(18deg);
}

.map-point {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.25);
  transform: translate(-50%, -50%);
}

.map-point.black {
  background: #050505;
}

.map-point.orange,
.map-point.busy {
  background: #ff930f;
}

.map-point.red,
.map-point.done {
  background: #e52620;
}

.map-point.cluster {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.map-point:hover {
  z-index: 4;
  outline: 4px solid rgba(35, 103, 201, 0.18);
}

.real-map-point {
  position: static;
  cursor: pointer;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
}

.empty-map {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 500;
  z-index: 2;
}

.qr-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  display: grid;
  justify-items: center;
  gap: 12px;
  align-content: start;
}

.qr-preview-actions,
.qr-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.qr-preview-actions {
  justify-content: center;
}

.qr-row-actions .compact-btn {
  white-space: nowrap;
}

#qrPayload {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.table-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}

.api-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.api-card code {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  white-space: pre-wrap;
}

.type-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.plan-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.type-stat,
.plan-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.type-stat span,
.plan-stat span {
  color: var(--muted);
  font-size: 13px;
}

.type-stat strong,
.plan-stat strong {
  font-size: 28px;
  line-height: 1;
}

.type-stat small {
  color: var(--muted);
}

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

.monthly-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.monthly-item > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.monthly-item span,
.monthly-item small {
  color: var(--muted);
  font-size: 12px;
}

.monthly-item b {
  font-size: 24px;
  line-height: 1;
}

.compact-btn {
  padding: 6px 8px;
  font-size: 12px;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 18px 0 24px;
}

.view-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 20px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  width: fit-content;
  max-width: 100%;
}

.view-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: transparent;
  color: #475467;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.view-tabs button.is-active {
  background: #111827;
  color: #fff;
}

.nav-group {
  display: grid;
}

.nav-submenu {
  display: grid;
  gap: 2px;
  margin: -2px 0 6px;
  padding-left: 20px;
}

.nav-subitem {
  min-height: 34px;
  border: 0;
  padding: 0 12px;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
}

.nav-subitem:hover,
.nav-subitem.is-active {
  color: #111827;
  background: #f3f4f6;
}

.inspection-tab-panel {
  min-width: 0;
}

.inspection-entry {
  margin-bottom: 24px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.inspection-metrics {
  margin-top: 2px;
}

.settings-section {
  min-width: 0;
}

.settings-section h3 {
  margin: 0 0 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.form-grid .wide-field {
  grid-column: 1 / -1;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.toggle-field input {
  width: 18px;
  height: 18px;
}

.approval-photos {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.approval-photo {
  display: grid;
  gap: 3px;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-size: 11px;
}

.approval-photo img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.approval-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.approval-step {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: inline-grid;
  place-items: center;
  font-size: 12px;
}

.approval-step.is-done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.approval-step.is-current {
  border-color: var(--blue);
  color: var(--blue);
}

.status-pill.is-danger {
  background: #fff1f3;
  color: var(--red);
}

.status-pill.is-warning {
  background: #fff7e6;
  color: #9a6700;
}

.employee-map-point {
  position: absolute;
  z-index: 8;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 3px solid var(--blue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.real-employee-point {
  position: static;
}

.trend-chart {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdff;
}

.trend-bars {
  height: 150px;
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.trend-bar {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.trend-bar i {
  display: block;
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: #050505;
}

.trend-bar span {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.plan-builder {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.3fr) repeat(2, minmax(180px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 12px 0 16px;
}

.plan-builder label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.plan-builder input,
.plan-builder select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

.editor-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.editor-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.editor-dialog-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.editor-dialog-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.editor-dialog-form input,
.editor-dialog-form select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

.icon-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: #f3f4f6;
  color: #111827;
  font-size: 24px;
  line-height: 1;
}

.dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.employee-checkbox-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.employee-check-option {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text) !important;
}

.employee-check-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.employee-check-option span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.employee-check-option small {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.order-dialog {
  width: min(760px, calc(100vw - 32px));
}

.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.order-detail-grid > div {
  padding: 12px 14px;
  background: #fff;
}

.order-detail-grid dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.order-detail-grid dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.order-detail-section {
  margin-top: 16px;
}

.order-detail-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.order-detail-section p {
  margin: 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.7;
}

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

.order-photo {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  font-size: 12px;
}

.order-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.order-photo-placeholder {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
}

.analyzer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 320px;
  gap: 16px;
  margin-top: 16px;
}

.upload-zone {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 20px;
  min-height: 180px;
  display: grid;
  gap: 10px;
  align-content: center;
  background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
  cursor: pointer;
}

.upload-zone strong {
  font-size: 18px;
}

.upload-zone span {
  color: var(--muted);
  line-height: 1.6;
}

.upload-zone input {
  display: none;
}

.upload-zone.is-dragging {
  border-color: #111827;
  background: #f3f4f6;
}

.analyzer-summary {
  display: grid;
  gap: 12px;
}

.analyzer-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.analyzer-summary span {
  color: var(--muted);
  font-size: 13px;
}

.analyzer-summary strong {
  font-size: 28px;
  line-height: 1;
}

.data-management-section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.data-management-section + .data-management-section {
  margin-top: 2px;
}

.data-section-head {
  margin: 0 0 14px;
  align-items: flex-start;
}

.data-section-head > div:first-child {
  display: grid;
  gap: 5px;
}

.data-section-head > div:first-child strong {
  font-size: 17px;
}

.employee-editor {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  margin-top: 16px;
}

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

.section-mini-head strong {
  font-size: 15px;
}

.section-mini-head span {
  color: var(--muted);
  font-size: 12px;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.quality-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.quality-item span,
.quality-item small {
  color: var(--muted);
  font-size: 12px;
}

.quality-item strong {
  font-size: 24px;
  line-height: 1;
}

.quality-item.is-good {
  border-color: rgba(24, 169, 87, 0.25);
}

.quality-item.is-warning {
  border-color: rgba(245, 158, 11, 0.38);
}

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

.analysis-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.analysis-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  background: #fff;
}

.analysis-item strong {
  font-size: 14px;
}

.analysis-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.analysis-item.muted {
  background: #fbfdff;
}

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

  .sidebar {
    position: static;
  }

  .mobile-layout,
  .hero,
    .home-metrics,
    .admin-workflow,
    .home-grid-main,
    .home-ops-grid,
    .region-grid,
    .home-bottom-grid,
    .dashboard-grid,
    .map-layout,
    .qr-layout,
    .metric-grid,
    .type-stat-grid,
    .plan-summary,
    .monthly-grid,
    .plan-builder,
    .settings-grid,
    .form-grid,
    .employee-editor,
    .quality-grid,
    .analyzer-layout {
      grid-template-columns: 1fr;
    }

  .phone-panel {
    max-width: none;
  }

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

  .region-item {
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 0;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-import-strip,
  .data-section-head,
  .analyzer-actions,
  .home-import-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .home-work-bars {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 260px;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 14px;
  }

  .sidebar {
    padding: 18px 14px;
  }

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

  .order-detail-grid {
    grid-template-columns: 1fr;
  }

  .order-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view-tabs {
    width: 100%;
  }

  .view-tabs button {
    flex: 1;
    padding: 0 6px;
    font-size: 12px;
  }

  .timeline-row {
    grid-template-columns: 1fr;
  }

  .home-work-bars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 420px;
  }

  .trend-bars {
    gap: 3px;
  }

  .trend-bar span {
    font-size: 9px;
  }
}
