* {
  box-sizing: border-box;
}
html {
  min-width: 320px;
  background: var(--myg-desktop-canvas);
}
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--myg-text-primary);
  background: var(--myg-desktop-canvas);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 74% 20%, #6a5bd566 0, transparent 26%),
    radial-gradient(circle at 20% 80%, #d899c633 0, transparent 24%),
    linear-gradient(145deg, #17243b, #0b1428);
}
.login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 18px;
  padding: 42px;
  border: 1px solid #ffffff24;
  border-radius: 24px;
  background: #ffffff0d;
  box-shadow: 0 32px 80px #03081480;
  backdrop-filter: blur(20px);
  color: white;
}
.login-card img {
  width: 260px;
  max-width: 100%;
  margin: 0 auto 6px;
}
.login-card p {
  margin: 0 0 8px;
  text-align: center;
  color: #cbd4e8;
}
.login-card label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: #dce2f1;
}
.login-card input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #ffffff2d;
  border-radius: 11px;
  background: #ffffff12;
  color: white;
  outline: none;
}
.login-card input:focus {
  border-color: #8c7dff;
  box-shadow: 0 0 0 3px #7869ff25;
}
.login-card output {
  min-height: 20px;
  text-align: center;
  color: #ffafba;
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 222px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 13px;
  color: white;
  background:
    radial-gradient(circle at 40% 96%, #3b315e 0, transparent 28%),
    linear-gradient(165deg, #1a2942, #101b31 62%, #0b1428);
  overflow-y: auto;
  z-index: 4;
}
.brand {
  display: flex;
  align-items: center;
  padding: 0 9px 18px;
  border-bottom: 1px solid #ffffff1d;
}
.brand img {
  display: block;
  width: 174px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.sidebar nav {
  display: grid;
  gap: 4px;
  margin-top: 17px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 22px;
  border-radius: 9px;
  color: #cbd4e7;
  text-decoration: none;
  font-size: 15px;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  color: white;
  background: #5865a9;
  box-shadow: inset 3px 0 #9688ff;
}
.baseline {
  margin: auto 12px 0;
  padding-top: 20px;
  color: #8d9ab7;
  font-size: 11px;
}
.main-column {
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 38px;
  border-bottom: 1px solid #e7eaf3;
  background: #ffffffee;
  backdrop-filter: blur(14px);
}
.topbar > strong {
  font-size: 18px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #64708b;
  font-size: 13px;
}
.topbar-actions a {
  color: inherit;
  text-decoration: none;
}
.topbar-actions a span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 10px;
  background: #f0677d;
  color: white;
  font-size: 11px;
}
.profile,
.mobile-menu {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.mobile-menu {
  display: none;
  font-size: 22px;
}
#workspace {
  min-height: calc(100vh - 72px);
  padding: 36px 38px 54px;
  outline: none;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}
.page-heading h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: 0.02em;
}
.page-heading p {
  margin: 0;
  color: #8793ad;
  font-size: 13px;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.primary-button,
.secondary-button {
  min-height: 40px;
  padding: 9px 17px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
}
.primary-button {
  color: white;
  background: linear-gradient(135deg, #7960e8, #6548d0);
  box-shadow: 0 8px 18px #7056df29;
}
.secondary-button {
  color: #65718b;
  background: #edf0f8;
}
.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.metric-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  padding: 17px 20px;
  border: 1px solid #dde3f0;
  border-radius: 15px;
  background: white;
  box-shadow: 0 8px 22px #27365f08;
}
.metric-card .metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #e9ddff;
}
.metric-card:nth-child(4n + 2) .metric-icon {
  background: #d5f2ee;
}
.metric-card:nth-child(4n + 3) .metric-icon {
  background: #f9dfe5;
}
.metric-card:nth-child(4n + 4) .metric-icon {
  background: #e3eaf7;
}
.metric-card span {
  display: block;
  color: #8793ad;
  font-size: 13px;
}
.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 23px;
}

.panel {
  overflow: hidden;
  border: 1px solid #dfe4ef;
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 28px #1c2f5a0a;
}
.operation-panel {
  margin-bottom: 24px;
}
.operation-panel summary {
  padding: 20px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  list-style-position: inside;
}
.operation-panel[open] summary {
  border-bottom: 1px solid #e7eaf2;
}
.operation-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 22px;
}
.operation-form > label,
.approval-form label {
  display: grid;
  gap: 8px;
  color: #65718b;
  font-size: 13px;
}
.operation-form input,
.operation-form select,
.operation-form textarea,
.approval-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #dfe4ef;
  border-radius: 9px;
  background: white;
  color: #25304a;
  outline: none;
}
.operation-form textarea,
.approval-form textarea {
  min-height: 78px;
  resize: vertical;
}
.operation-form input:focus,
.operation-form select:focus,
.operation-form textarea:focus,
.approval-form textarea:focus {
  border-color: #7865e4;
  box-shadow: 0 0 0 3px #7865e414;
}
.operation-form .wide {
  grid-column: 1 / -1;
}
.operation-form fieldset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #dfe4ef;
  border-radius: 9px;
}
.operation-form fieldset legend {
  padding: 0 5px;
  color: #65718b;
  font-size: 13px;
}
.operation-form fieldset label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
}
.operation-form fieldset input {
  width: auto;
  min-height: auto;
}
.form-hint {
  margin: 0;
  color: #8b96ac;
  font-size: 12px;
  line-height: 1.7;
}
.order-create-form {
  padding-bottom: 22px;
}
.order-header-fields {
  padding-bottom: 12px;
}
.order-lines-header,
.order-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
}
.order-lines-header h3,
.order-lines-header p {
  margin: 0;
}
.order-lines-header p {
  margin-top: 5px;
  color: #8b96ac;
  font-size: 12px;
}
.order-lines {
  display: grid;
  gap: 12px;
  padding: 10px 22px;
}
.order-line {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid #e0e5ef;
  border-radius: 12px;
  background: #fafbfe;
}
.order-line legend {
  padding: 0 6px;
  color: #65718b;
  font-size: 12px;
}
.order-line label {
  display: grid;
  gap: 7px;
  color: #65718b;
  font-size: 12px;
}
.order-line input,
.order-line select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #dfe4ef;
  border-radius: 8px;
  background: white;
}
.remove-order-line {
  position: absolute;
  top: -11px;
  right: 12px;
  padding: 4px 10px;
  border: 1px solid #f0cdd3;
  border-radius: 999px;
  background: #fff5f6;
  color: #b34b5d;
  cursor: pointer;
  font-size: 11px;
}
.order-submit {
  justify-content: flex-end;
}
.shipment-task-grid {
  display: grid;
  gap: 16px;
  padding: 0 20px 22px;
}
.shipment-task-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #e1e6ef;
  border-radius: 13px;
  background: #fafbfe;
}
.shipment-task-head,
.shipment-document-fields {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.shipment-task-head div {
  display: grid;
  gap: 4px;
}
.shipment-task-head strong {
  color: #222d47;
  font-size: 16px;
}
.shipment-task-head span,
.shipment-address,
.shipment-task-line > span {
  color: #77839b;
  font-size: 12px;
}
.shipment-document-fields label,
.shipment-task-line label {
  display: grid;
  flex: 1;
  gap: 7px;
  color: #65718b;
  font-size: 12px;
}
.shipment-document-fields input,
.shipment-task-line input,
.shipment-task-line select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #dfe4ef;
  border-radius: 8px;
  background: white;
}
.shipment-task-lines {
  display: grid;
  gap: 10px;
}
.shipment-task-line {
  display: grid;
  grid-template-columns: minmax(90px, 0.45fr) minmax(230px, 1.4fr) minmax(120px, 0.6fr);
  align-items: end;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid #e4e8f0;
  border-radius: 10px;
}
.shipment-task-line legend {
  padding: 0 6px;
  color: #44506a;
  font-size: 12px;
}
.purchase-receipt-panel {
  margin-top: 24px;
}
.purchase-receipt-form {
  padding-bottom: 22px;
}
.purchase-receipt-lines {
  display: grid;
  gap: 12px;
  padding: 0 22px 18px;
}
.purchase-receipt-line {
  display: grid;
  grid-template-columns: minmax(100px, 0.5fr) repeat(3, minmax(150px, 1fr));
  align-items: end;
  gap: 12px;
  margin: 0;
  padding: 15px;
  border: 1px solid #e1e6ef;
  border-radius: 11px;
  background: #fafbfe;
}
.purchase-receipt-line legend {
  padding: 0 6px;
  color: #44506a;
  font-size: 12px;
}
.purchase-receipt-line > span,
.purchase-receipt-line label {
  color: #65718b;
  font-size: 12px;
}
.purchase-receipt-line label {
  display: grid;
  gap: 7px;
}
.purchase-receipt-line input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #dfe4ef;
  border-radius: 8px;
  background: white;
}
.purchase-receipt-line .stocktake-select {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  color: #44506a;
}
.purchase-receipt-line .stocktake-select input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--brand-green, #0c7654);
}
.stocktake-review-panel {
  margin-top: 24px;
  padding-bottom: 22px;
}
.receipt-submit {
  padding: 0 22px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.approval-actions {
  margin-top: 24px;
}
.payment-confirmations {
  margin-top: 24px;
}
.payment-confirm-form {
  grid-template-columns: minmax(180px, 0.7fr) minmax(210px, 1fr) minmax(190px, 0.8fr) auto;
}
.payment-confirm-form input[type="file"] {
  max-width: 100%;
  font-size: 12px;
}
.locked-evidence {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #dce5df;
  border-radius: 9px;
  background: #edf8f3;
  color: #34735e;
  font-size: 12px;
}
.approval-grid {
  display: grid;
  gap: 14px;
  padding: 0 20px 20px;
}
.approval-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.3fr) auto;
  align-items: end;
  gap: 18px;
  padding: 16px;
  border: 1px solid #e3e7f0;
  border-radius: 12px;
  background: #f9faff;
}
.approval-form strong,
.approval-form span {
  display: block;
}
.approval-form span {
  margin-top: 7px;
  color: #7c879e;
  font-size: 13px;
}
.panel-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 20px;
}
.panel-header h2 {
  margin: 0;
  font-size: 18px;
}
.panel-subtitle {
  margin: 6px 0 0;
  color: #8b96ac;
  font-size: 12px;
}
.reimbursement-create .table-wrap {
  padding-bottom: 20px;
}
.expense-choice {
  width: 18px;
  height: 18px;
  accent-color: #7056df;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}
.toolbar input,
.toolbar select {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #dfe4ef;
  border-radius: 9px;
  background: white;
  color: #3b4660;
  outline: none;
}
.toolbar input:focus,
.toolbar select:focus {
  border-color: #7865e4;
  box-shadow: 0 0 0 3px #7865e414;
}
.section-gap {
  height: 24px;
}
.shipment-print-preview-panel {
  margin-top: 24px;
  border-color: #dce2ef;
}
.shipment-print-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 28px;
  padding: 0 20px 20px;
  color: #4e5c76;
  font-size: 13px;
}
.shipment-print-summary span {
  padding-bottom: 8px;
  border-bottom: 1px solid #e6e9f1;
}
.shipment-print-summary .wide {
  grid-column: 1 / -1;
}
.shipment-print-actions {
  display: grid;
  grid-template-columns: minmax(220px, 0.5fr) 1fr auto;
  align-items: end;
  gap: 18px;
  margin: 0 20px 20px;
  padding: 16px;
  border-radius: 12px;
  background: #f5f3ff;
}
.shipment-print-actions label {
  display: grid;
  gap: 7px;
  color: #5f6a83;
  font-size: 12px;
}
.shipment-print-actions select {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #dfe4ef;
  border-radius: 9px;
  background: #fff;
}
.shipment-print-actions p {
  margin: 0;
  color: #78849b;
  font-size: 12px;
}
.print-history {
  margin: 0 20px 20px;
  border-top: 1px solid #e6e9f1;
  padding-top: 16px;
}
.print-history summary {
  color: #6548d0;
  cursor: pointer;
  font-weight: 600;
}
.print-history .table-wrap {
  padding: 14px 0 0;
}
.master-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.master-create-grid .panel {
  margin: 0;
}
.table-action {
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid #d8ddef;
  border-radius: 8px;
  background: #f4f2ff;
  color: #6548d0;
  cursor: pointer;
  white-space: nowrap;
}
.table-action:disabled {
  opacity: 0.45;
  cursor: wait;
}
.table-wrap {
  overflow-x: auto;
  padding: 0 20px 20px;
}
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 13px;
}
th {
  padding: 14px 15px;
  background: #f0f2f9;
  color: #71809d;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
th:first-child {
  border-radius: 9px 0 0 9px;
}
th:last-child {
  border-radius: 0 9px 9px 0;
}
td {
  min-height: 54px;
  padding: 15px;
  border-bottom: 1px solid #e5e9f2;
  color: #27344f;
  vertical-align: middle;
}
tbody tr:nth-child(even) {
  background: #fafbfe;
}
tbody tr:hover {
  background: #f5f3ff;
}
.empty-state,
.loading-state,
.error-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 30px;
  text-align: center;
  color: #8c97ae;
}
.error-state {
  color: #c85669;
}
.status {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #34735e;
  background: #dff5ec;
  font-size: 12px;
  white-space: nowrap;
}
.status.pending {
  color: #a9661b;
  background: #fff0d8;
}
.status.inactive {
  color: #7f889c;
  background: #edf0f5;
}
.money {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.note {
  margin: 14px 20px 20px;
  color: #8b96ac;
  font-size: 12px;
}
.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 18px;
}
.assistant-panel {
  min-height: 520px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(150deg, #18243c, #111a30 58%, #2c2350);
  color: white;
}
.assistant-panel .panel-header {
  border-bottom: 1px solid #ffffff18;
}
.assistant-messages {
  padding: 24px;
  color: #cfd7ea;
}
.assistant-prompt {
  display: flex;
  gap: 10px;
  padding: 18px;
  border-top: 1px solid #ffffff18;
}
.assistant-prompt textarea {
  flex: 1;
  min-height: 52px;
  resize: vertical;
  padding: 12px;
  border: 1px solid #ffffff24;
  border-radius: 10px;
  background: #ffffff0d;
  color: white;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 420px;
  padding: 13px 18px;
  border-radius: 10px;
  background: #18233a;
  color: white;
  box-shadow: 0 18px 40px #10182f4d;
  font-size: 13px;
}
.toast[data-kind="error"] {
  background: #a42c41;
}

@media (max-width: 1080px) {
  .master-create-grid {
    grid-template-columns: 1fr;
  }
  .shipment-task-line {
    grid-template-columns: 1fr;
  }
  .purchase-receipt-line {
    grid-template-columns: 1fr;
  }
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }
  .sidebar {
    padding-inline: 10px;
  }
  .brand {
    justify-content: center;
    padding-inline: 0;
  }
  .brand img {
    width: 64px;
    height: 48px;
    object-fit: cover;
    object-position: left;
  }
  .sidebar nav a {
    justify-content: center;
    padding-inline: 7px;
    font-size: 11px;
    text-align: center;
  }
  .baseline {
    display: none;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: 0;
    width: 238px;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 12px 0 35px #08112666;
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  .brand img {
    width: 180px;
    height: auto;
    object-fit: contain;
  }
  .sidebar nav a {
    justify-content: flex-start;
    padding-inline: 20px;
    font-size: 14px;
  }
  .topbar {
    height: 62px;
    padding: 0 14px;
  }
  .topbar > strong {
    font-size: 14px;
  }
  .mobile-menu {
    display: block;
  }
  .topbar-actions {
    gap: 12px;
  }
  #workspace {
    min-height: calc(100vh - 62px);
    padding: 24px 14px 36px;
  }
  .page-heading {
    display: block;
  }
  .page-heading h1 {
    font-size: 24px;
  }
  .page-actions {
    justify-content: flex-start;
    margin-top: 16px;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .metric-card {
    min-height: 88px;
    padding: 13px;
    grid-template-columns: 28px 1fr;
  }
  .metric-card .metric-icon {
    width: 27px;
    height: 27px;
  }
  .metric-card strong {
    font-size: 18px;
  }
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .toolbar {
    justify-content: flex-start;
  }
  .login-card {
    padding: 30px 24px;
  }
  .operation-form,
  .approval-form,
  .payment-confirm-form {
    grid-template-columns: 1fr;
  }
  .operation-form .wide {
    grid-column: auto;
  }
  .order-line {
    grid-template-columns: 1fr;
  }
  .shipment-print-summary,
  .shipment-print-actions {
    grid-template-columns: 1fr;
  }
  .shipment-print-summary .wide {
    grid-column: auto;
  }
}
