:root {
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --bg: #f4f7f9;
  --surface: #ffffff;
  --green: #237a57;
  --green-strong: #126742;
  --amber: #d18b18;
  --blue: #2d6cdf;
  --red: #c54646;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background:
    linear-gradient(160deg, rgba(35, 122, 87, 0.12), transparent 38%),
    linear-gradient(22deg, rgba(209, 139, 24, 0.14), transparent 42%),
    var(--bg);
}

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

.employee-shell {
  display: grid;
  place-items: center;
  padding: 18px;
}

.phone-frame {
  width: min(100%, 430px);
  min-height: min(780px, calc(100vh - 36px));
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(23, 32, 51, 0.14);
}

.top-band {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(18, 103, 66, 0.96), rgba(35, 122, 87, 0.78)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath d='M0 96c30-16 58-14 86 6 26 19 50 20 74 3v55H0z' fill='%23ffffff' fill-opacity='.11'/%3E%3Ccircle cx='122' cy='42' r='20' fill='%23ffffff' fill-opacity='.10'/%3E%3C/svg%3E");
  background-size: cover;
}

.eyebrow {
  margin: 0 0 6px;
  color: inherit;
  opacity: 0.72;
  font-size: 13px;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

.time-pill {
  align-self: start;
  min-width: 76px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}

.order-form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.field,
.toolbar label {
  display: grid;
  gap: 8px;
}

.field span,
.choice-block legend,
.toolbar span {
  color: var(--muted);
  font-size: 14px;
}

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

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(45, 108, 223, 0.18);
  border-color: var(--blue);
}

.choice-block {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-block legend {
  margin-bottom: 8px;
}

.segmented {
  display: grid;
  gap: 10px;
}

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

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-weight: 700;
  cursor: pointer;
}

.segmented input:checked + span {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.primary-btn,
.secondary-btn {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary-btn:hover,
.secondary-btn:hover {
  background: var(--green-strong);
}

.primary-btn:disabled {
  background: #aab4be;
  cursor: not-allowed;
}

.secondary-btn {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.secondary-btn:hover {
  background: #eef3f7;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--green);
  font-size: 14px;
}

.form-message.error {
  color: var(--red);
}

.company-lock {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 14px;
}

.company-lock.ok {
  border-color: rgba(35, 122, 87, 0.28);
  background: #edf6f1;
  color: var(--green-strong);
  font-weight: 700;
}

.company-lock.blocked {
  border-color: rgba(197, 70, 70, 0.28);
  background: #fff1f1;
  color: var(--red);
}

.identity-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

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

.identity-card strong {
  font-size: 18px;
}

.success-frame {
  min-height: 620px;
}

.success-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 34px 22px;
  text-align: center;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.success-panel h2 {
  margin: 8px 0 0;
  font-size: 26px;
  letter-spacing: 0;
}

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

.success-details {
  display: grid;
  gap: 10px;
  width: 100%;
  margin: 16px 0 0;
}

.success-details div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.success-details dt {
  color: var(--muted);
  font-size: 14px;
}

.success-details dd {
  margin: 0;
  font-weight: 800;
}

.is-hidden {
  display: none;
}

.admin-shell {
  padding: 22px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1240px;
  margin: 0 auto 18px;
}

.admin-header .eyebrow {
  color: var(--muted);
}

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

.metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.toolbar {
  display: grid;
  grid-template-columns: 170px 1fr 140px 140px 96px;
  align-items: end;
  gap: 12px;
  max-width: 1240px;
  margin: 0 auto 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.table-wrap {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #f7f9fb;
  color: #475467;
  font-weight: 700;
}

tbody tr:hover {
  background: #f9fbfc;
}

.tag {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #edf6f1;
  color: var(--green-strong);
  font-weight: 700;
}

.tag.delivery {
  background: #fff4df;
  color: #9b620d;
}

.empty-state {
  display: none;
  margin: 0;
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.empty-state.show {
  display: block;
}

@media (max-width: 760px) {
  .admin-shell {
    padding: 14px;
  }

  .admin-header {
    align-items: stretch;
    flex-direction: column;
  }

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

  .toolbar .secondary-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 460px) {
  .employee-shell {
    padding: 0;
    place-items: stretch;
  }

  .phone-frame {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

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