:root {
  --ink: #17211e;
  --muted: #697672;
  --subtle: #98a29f;
  --line: #e7ebe8;
  --surface: #ffffff;
  --canvas: #f4f6f3;
  --forest: #173f35;
  --forest-2: #24594a;
  --mint: #dcece5;
  --mint-2: #eef7f2;
  --gold: #bd8a3e;
  --gold-soft: #f8efe0;
  --danger: #b44f4f;
  --danger-soft: #fbeaea;
  --blue: #46738f;
  --blue-soft: #eaf2f7;
  --shadow: 0 12px 36px rgba(23, 63, 53, .08);
  --shadow-lg: 0 28px 80px rgba(18, 42, 35, .16);
  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 44%) 1fr;
  background: #f6f7f4;
}
.login-visual {
  position: relative;
  overflow: hidden;
  padding: 54px 58px;
  color: #fff;
  background:
    radial-gradient(circle at 16% 18%, rgba(255,255,255,.13) 0 3px, transparent 4px),
    radial-gradient(circle at 83% 67%, rgba(255,255,255,.11) 0 4px, transparent 5px),
    linear-gradient(145deg, #102f28 0%, #1d4a3d 60%, #295e4e 100%);
}
.login-visual::before,
.login-visual::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
}
.login-visual::before { width: 480px; height: 480px; right: -230px; top: -80px; }
.login-visual::after { width: 330px; height: 330px; left: -210px; bottom: -100px; }
.brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 13px; color: var(--forest); background: #f6dfb5; font-weight: 800; font-size: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: .08em; }
.brand-sub { margin-top: 3px; font-size: 11px; color: rgba(255,255,255,.62); letter-spacing: .15em; }
.visual-copy { position: absolute; z-index: 1; left: 58px; right: 58px; bottom: 72px; }
.visual-eyebrow { color: #e8c88c; font-size: 12px; letter-spacing: .18em; }
.visual-copy h1 { margin: 15px 0 18px; font-size: clamp(34px, 4vw, 58px); line-height: 1.16; font-weight: 650; letter-spacing: -.03em; }
.visual-copy p { margin: 0; max-width: 460px; color: rgba(255,255,255,.7); font-size: 16px; line-height: 1.8; }
.login-main { display: grid; place-items: center; padding: 44px; }
.login-card { width: min(430px, 100%); }
.login-card h2 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.login-intro { margin: 10px 0 32px; color: var(--muted); }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 13px; color: #4f5c58; font-weight: 600; }
.input,
.field input,
.field select,
.field textarea {
  width: 100%; min-height: 44px; border: 1px solid #dce2de; border-radius: 10px;
  padding: 10px 13px; color: var(--ink); background: #fff; outline: none; transition: .18s ease;
}
.field textarea { min-height: 86px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: #548778; box-shadow: 0 0 0 3px rgba(65, 124, 105, .1); }
.login-submit { width: 100%; height: 46px; margin-top: 5px; border: 0; border-radius: 10px; color: #fff; background: var(--forest); font-weight: 650; }
.login-submit:hover { background: var(--forest-2); }
.demo-label { display: flex; align-items: center; gap: 10px; margin: 28px 0 13px; color: var(--subtle); font-size: 12px; }
.demo-label::before, .demo-label::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.demo-accounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.demo-account { border: 1px solid var(--line); border-radius: 9px; padding: 10px 6px; background: #fff; color: var(--muted); }
.demo-account:hover { border-color: #97b4aa; color: var(--forest); background: var(--mint-2); }
.demo-account b { display: block; margin-bottom: 2px; color: var(--ink); font-size: 13px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 24px 16px 16px; color: rgba(255,255,255,.76); background: #132f28;
}
.sidebar .brand { padding: 0 8px 25px; }
.sidebar .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 15px; }
.sidebar .brand-name { color: #fff; font-size: 16px; }
.sidebar .brand-sub { font-size: 9px; }
.nav-label { padding: 8px 12px; color: rgba(255,255,255,.35); font-size: 10px; letter-spacing: .16em; }
.nav { display: grid; gap: 4px; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 9px;
  padding: 10px 12px; color: inherit; background: transparent; text-align: left; transition: .16s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: rgba(255,255,255,.11); box-shadow: inset 3px 0 #e5bd75; }
.nav-icon { width: 18px; height: 18px; opacity: .9; }
.sidebar-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-store { padding: 10px 12px 14px; }
.sidebar-store span { display: block; color: rgba(255,255,255,.4); font-size: 10px; margin-bottom: 5px; }
.sidebar-store b { color: #fff; font-size: 12px; font-weight: 550; }

.main { min-width: 0; }
.topbar {
  height: 72px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(15px);
  position: sticky; top: 0; z-index: 20;
}
.page-heading h1 { margin: 0; font-size: 19px; font-weight: 680; letter-spacing: -.02em; }
.page-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 13px; }
.date-chip { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; font-size: 12px; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--forest-2); font-weight: 700; }
.user-meta b { display: block; font-size: 12px; }
.user-meta span { color: var(--subtle); font-size: 10px; }
.content { padding: 24px 30px 40px; }

.toolbar { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 18px; }
.toolbar-copy h2 { margin: 0 0 4px; font-size: 18px; }
.toolbar-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.toolbar-actions { display: flex; gap: 9px; align-items: center; }
.btn {
  min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; color: #33403c; background: #fff; font-weight: 570; font-size: 12px;
}
.btn:hover { border-color: #b6c4bf; background: #fafcfb; }
.btn-primary { border-color: var(--forest); color: #fff; background: var(--forest); }
.btn-primary:hover { border-color: var(--forest-2); background: var(--forest-2); }
.btn-soft { border-color: #cce0d7; color: var(--forest); background: var(--mint-2); }
.btn-danger { border-color: #efd5d5; color: var(--danger); background: #fffafa; }
.btn-gold { border-color: #eed9b5; color: #865d20; background: var(--gold-soft); }
.btn-sm { min-height: 30px; padding: 5px 9px; font-size: 11px; }
.btn-icon { width: 34px; padding: 0; }
.btn:disabled { cursor: not-allowed; opacity: .48; }
.search { position: relative; }
.search input { width: 220px; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px 7px 33px; outline: none; background: #fff; }
.search::before { content: "⌕"; position: absolute; left: 11px; top: 7px; color: var(--subtle); font-size: 18px; line-height: 20px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.metric-card { padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 18px rgba(31,55,46,.025); }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.metric-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--forest-2); box-shadow: 0 0 0 4px var(--mint-2); }
.metric-value { margin-top: 10px; font-size: 25px; font-weight: 720; letter-spacing: -.035em; }
.metric-note { margin-top: 5px; color: var(--subtle); font-size: 10px; }

.workbench-grid { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 16px; }
.workflow { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 4px; }
.stage { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #f8faf8; overflow: hidden; }
.stage-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 11px; }
.stage-title { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.stage-title i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.stage:nth-child(2) .stage-title i { background: var(--gold); }
.stage:nth-child(3) .stage-title i { background: var(--forest-2); }
.count { min-width: 23px; padding: 3px 6px; border-radius: 10px; color: var(--muted); background: #e9eeeb; font-size: 10px; text-align: center; }
.stage-body { display: grid; gap: 9px; padding: 0 9px 9px; }
.task-card { padding: 13px; border: 1px solid #e4e9e6; border-radius: 10px; background: #fff; box-shadow: 0 4px 14px rgba(23, 63, 53, .035); }
.task-time { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.task-time b { color: var(--forest); font-size: 12px; }
.task-card h4 { margin: 10px 0 4px; font-size: 14px; }
.task-service { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-tech { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 11px; }
.task-tech i { width: 7px; height: 7px; border-radius: 50%; background: #61a187; }
.task-actions { display: flex; gap: 6px; margin-top: 11px; }
.task-actions .btn { flex: 1; }
.stage-empty { padding: 30px 10px; color: var(--subtle); text-align: center; font-size: 11px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 14px; }
.panel-head span { color: var(--subtle); font-size: 10px; }
.queue-list { padding: 7px 12px 11px; }
.queue-item { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 10px 2px; border-bottom: 1px solid #f0f2f1; }
.queue-item:last-child { border-bottom: 0; }
.queue-num { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: var(--forest); background: var(--mint-2); font-size: 10px; font-weight: 700; }
.queue-item:first-child .queue-num { color: #80591d; background: var(--gold-soft); }
.queue-person b { display: block; font-size: 12px; }
.queue-person span { color: var(--subtle); font-size: 9px; }
.task-order-id { margin: -2px 0 7px; color: var(--subtle); font-size: 9px; letter-spacing: .02em; }
.order-filter-bar { display: flex; align-items: end; gap: 10px; margin: -5px 0 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.order-filter-bar label { display: flex; min-width: 145px; flex-direction: column; gap: 5px; color: var(--muted); font-size: 10px; }
.order-filter-bar input, .order-filter-bar select { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }

.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 20px; font-size: 10px; white-space: nowrap; background: #eef1ef; color: var(--muted); }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-green { color: #2f745d; background: #e9f5ef; }
.status-gold { color: #936b2d; background: #fbf1df; }
.status-blue { color: #42728d; background: #eaf3f8; }
.status-red { color: #a24d4d; background: #fbecec; }
.status-gray { color: #7b8582; background: #eff1f0; }

.table-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 12px 14px; color: #7c8783; background: #fafbfa; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; font-weight: 600; letter-spacing: .04em; }
td { padding: 13px 14px; border-bottom: 1px solid #eff2f0; color: #3c4844; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfb; }
.cell-main b { display: block; color: var(--ink); font-size: 12px; }
.cell-main span { display: block; margin-top: 3px; color: var(--subtle); font-size: 9px; }
.money { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 650; }
.muted { color: var(--muted); }
.actions { display: flex; gap: 5px; }
.link-btn { border: 0; padding: 3px; color: var(--forest-2); background: transparent; font-size: 11px; }
.link-btn.danger { color: var(--danger); }
.empty-table { padding: 55px; color: var(--subtle); text-align: center; }

.insight-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; margin-bottom: 16px; }
.hero-panel { padding: 22px; color: #fff; background: linear-gradient(125deg, #173f35, #285e4e); border-radius: var(--radius); }
.hero-panel span { color: rgba(255,255,255,.63); font-size: 11px; }
.hero-panel strong { display: block; margin: 8px 0 4px; font-size: 31px; }
.hero-panel p { margin: 0; color: rgba(255,255,255,.58); font-size: 10px; }
.bar-chart { display: flex; align-items: flex-end; gap: 13px; height: 104px; margin-top: 23px; }
.bar { flex: 1; min-width: 22px; position: relative; border-radius: 5px 5px 2px 2px; background: rgba(255,255,255,.18); }
.bar.active { background: #e4bd77; }
.bar label { position: absolute; bottom: -19px; width: 100%; color: rgba(255,255,255,.52); text-align: center; font-size: 9px; }
.setting-list { padding: 5px 17px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row b { display: block; font-size: 12px; }
.setting-row span { display: block; margin-top: 3px; color: var(--subtle); font-size: 9px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(15, 31, 26, .48); backdrop-filter: blur(3px); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 44px); display: flex; flex-direction: column; border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); overflow: hidden; animation: modal-in .18s ease-out; }
.modal-lg { width: min(720px, 100%); }
.modal-xl { width: min(1120px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 19px 21px 15px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.modal-close { width: 30px; height: 30px; border: 0; border-radius: 8px; color: var(--muted); background: #f2f4f2; font-size: 18px; }
.modal > form { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.modal-body { flex: 1; min-height: 0; padding: 20px 21px; overflow-y: auto; }
.modal-footer { display: flex; flex-shrink: 0; justify-content: flex-end; gap: 8px; padding: 13px 21px; border-top: 1px solid var(--line); background: #fafbfa; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-note { padding: 11px 12px; border-radius: 9px; color: #5b6b65; background: var(--mint-2); font-size: 11px; line-height: 1.6; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check-card { display: flex; align-items: flex-start; gap: 10px; min-height: 62px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.check-card:hover { border-color: #a9c2b8; background: #fbfdfc; }
.check-card input[type="checkbox"] { flex: none; width: 18px; min-height: 18px; height: 18px; margin: 2px 0 0; padding: 0; border-radius: 4px; cursor: pointer; }
.check-card span { display: grid; gap: 4px; min-width: 0; }
.check-card b { color: var(--ink); font-size: 13px; }
.check-card small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.test-data-options .check-card:last-child { grid-column: span 2; border-color: #f0d6d0; background: #fffaf9; }
.construct-options .check-card:last-child { grid-column: auto; border-color: var(--line); background: #fff; }
.pem-upload { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fafcfb; }
.pem-upload > label { display: block; margin-bottom: 9px; color: var(--text); font-size: 11px; font-weight: 650; }
.pem-upload > input { width: 100%; padding: 9px; border: 1px dashed #bdc9c3; border-radius: 8px; background: #fff; font-size: 10px; }
.pem-meta { display: flex; align-items: center; gap: 10px; margin-top: 9px; color: var(--muted); font-size: 10px; }
.pem-meta b { color: var(--text); }
.pem-meta .link-btn { margin-left: auto; }
.pem-meta.empty { color: var(--subtle); }
.hidden { display: none !important; }
.real-payment-fields > .form-grid { margin-top: 4px; }
.payment-status-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 17px; padding: 13px; border-radius: 11px; background: #f5f8f6; }
.payment-status-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; padding: 4px 7px; color: var(--muted); font-size: 10px; }
.payment-status-item .status { margin: 0; }
.modal-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.comp-section + .comp-section { margin-top: 22px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.rule-group { padding: 13px 0; border-top: 1px solid var(--line); }
.rule-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; margin: 10px 0; padding: 14px; align-items: end; border: 1px solid #e4e9e5; border-radius: 12px; background: #fafcfb; }
.rule-row[data-rule="card"] { grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 1fr) auto; }
.rule-row[data-rule="overtime"] { grid-template-columns: minmax(150px, .8fr) minmax(280px, 1.7fr) minmax(180px, 1fr) auto; }
.rule-row[data-rule="review"] { grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr); }
.rule-row.performance-rule { grid-template-columns: minmax(150px, 1fr) minmax(120px, .75fr) minmax(230px, 1.55fr) minmax(180px, 1fr) auto; }
.rule-row input, .rule-row select { width: 100%; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; }
.rule-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rule-field[hidden] { display: none !important; }
.rule-label { color: #66736e; font-size: 11px; font-weight: 600; }
.rule-static { display: flex; align-items: center; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #f3f6f4; color: #43534d; }
.rule-row .service-scope { height: 72px; padding: 5px 8px; }
.rule-row .service-scope:disabled { color: #98a19d; background: #eef1ef; cursor: not-allowed; opacity: .75; }
.service-picker { display: flex; min-height: 36px; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.service-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.service-tags:empty { display: none; }
.service-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px 4px 9px; border-radius: 999px; color: var(--forest); background: var(--mint-2); font-size: 10px; }
.service-chip button { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; color: #9d4444; background: #fff; font-size: 14px; line-height: 16px; }
.service-add { flex: 1; min-width: 130px; height: 28px !important; margin: 0; border-style: dashed !important; color: var(--forest); }
.service-add:disabled { color: #98a19d; background: #eef1ef; cursor: not-allowed; }
.danger-note { color: #8c3737; background: #fff0ed; }
.range-input { display: grid; grid-template-columns: minmax(70px, 1fr) auto minmax(70px, 1fr) auto; gap: 8px; align-items: center; }
.range-input > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rule-remove { align-self: end; min-height: 36px; }
.unit-input { display: flex; align-items: center; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.unit-input input { min-width: 0; border: 0; border-radius: 0; }
.unit-input span { flex: none; padding-right: 9px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.payroll-summary { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 8px; margin-bottom: 16px; }
.payroll-summary span, .payroll-summary b { padding: 11px; border-radius: 9px; background: #f3f7f5; color: var(--muted); font-size: 11px; }
.payroll-summary b { color: var(--forest); background: var(--mint-2); }
.detail-block { padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-block:last-child { border-bottom: 0; }
.detail-block p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.customer-picker, .activity-picker { position: relative; }
.customer-results, .activity-results { position: absolute; z-index: 5; top: 66px; left: 0; right: 0; display: none; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-lg); }
.customer-results.open, .activity-results.open { display: grid; }
.customer-results button, .activity-results button { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.customer-results button:hover, .activity-results button:hover { background: var(--soft); }
.customer-results span, .activity-results span { color: var(--muted); font-size: 10px; }
.customer-results .add-result, .activity-results .add-result { justify-content: flex-start; color: var(--forest-2); border-top: 1px solid var(--line); border-radius: 0; }
.customer-results .nav-icon, .activity-results .nav-icon { width: 14px; height: 14px; }
.activity-result-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.activity-result-row .link-btn { padding: 0 8px; }
.order-actions { min-width: 170px; flex-wrap: wrap; }
.link-btn:disabled { color: #b8bfbb; cursor: not-allowed; }
.wechat-qr { display: grid; justify-items: center; gap: 12px; text-align: center; }
.wechat-qr img { width: 220px; height: 220px; border: 8px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.wechat-qr span { max-width: 360px; color: var(--muted); font-size: 11px; }
.wechat-qr code { max-width: 100%; padding: 8px; overflow-wrap: anywhere; color: var(--subtle); background: var(--soft); border-radius: 7px; font-size: 9px; }
.permission-section { margin-bottom: 18px; }
.permission-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.permission-title b { font-size: 13px; }
.permission-title span { color: var(--subtle); font-size: 10px; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.permission-card { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfa; }
.permission-card > b { display: block; margin-bottom: 8px; font-size: 11px; }
.permission-card > div { display: flex; flex-wrap: wrap; gap: 7px 12px; }
.permission-card label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.permission-card input { width: 14px; height: 14px; margin: 0; accent-color: var(--forest); }
.permission-card input:disabled { opacity: .65; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.check-row input { width: 16px; height: 16px; accent-color: var(--forest); }
.price-summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-radius: 10px; background: #f5f7f5; }
.price-summary span { color: var(--muted); }
.price-summary b { font-size: 20px; }

.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 370px; padding: 12px 14px; border: 1px solid #d8e5df; border-radius: 10px; color: #24473c; background: #f6fcf9; box-shadow: var(--shadow); animation: toast-in .2s ease; }
.toast.error { border-color: #efd2d2; color: #8e3d3d; background: #fff6f6; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }
.loading { min-height: 70vh; display: grid; place-items: center; color: var(--muted); }
.loading::before { content: ""; width: 25px; height: 25px; border: 2px solid #cdd9d4; border-top-color: var(--forest); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .sidebar .brand { padding-inline: 8px; justify-content: center; }
  .sidebar .brand > div:last-child, .nav-item span, .nav-label, .sidebar-store { display: none; }
  .nav-item { justify-content: center; padding: 11px; }
  .workbench-grid { grid-template-columns: 1fr; }
  .queue-panel { order: -1; }
  .queue-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
  .queue-item { grid-template-columns: 25px 1fr; border: 1px solid var(--line); border-radius: 9px; padding: 7px; }
  .queue-item .status { display: none; }
}
@media (max-width: 800px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-main { padding: 28px 20px; }
  .shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0; z-index: 40; width: auto; height: 62px; flex-direction: row; padding: 7px 10px; overflow-x: auto; }
  .sidebar .brand, .nav-label, .sidebar-bottom { display: none; }
  .nav { display: flex; width: 100%; justify-content: space-around; }
  .nav-item { min-width: 52px; padding: 9px; }
  .nav-item.active { box-shadow: inset 0 -3px #e5bd75; }
  .topbar { height: 64px; padding: 0 17px; }
  .content { padding: 17px 15px 85px; }
  .date-chip, .user-meta { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .workflow { grid-template-columns: repeat(3, 270px); }
  .toolbar { align-items: flex-start; }
  .toolbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .search { display: none; }
  .insight-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .rule-row, .rule-row.performance-rule, .rule-row[data-rule="card"], .rule-row[data-rule="overtime"], .rule-row[data-rule="review"] { grid-template-columns: 1fr; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
  .order-filter-bar { align-items: stretch; flex-direction: column; }
  .payroll-summary { grid-template-columns: repeat(2, 1fr); }
  .permission-grid { grid-template-columns: 1fr; }
  .queue-list { grid-template-columns: repeat(2, 1fr); }
}
