:root {
  --bg: #f5f2ea;
  --surface: #ffffff;
  --surface-soft: #faf8f3;
  --surface-warm: #fff8ec;
  --ink: #273129;
  --ink-soft: #465248;
  --muted: #737c75;
  --line: #e6e1d7;
  --line-strong: #d8d1c5;
  --orange: #e79027;
  --orange-deep: #b95f0a;
  --orange-soft: #fff0d7;
  --green: #456451;
  --green-soft: #e9f0eb;
  --red: #b84b43;
  --red-soft: #fff0ed;
  --blue: #4d6d8d;
  --blue-soft: #eef5fb;
  --sidebar: #26342d;
  --sidebar-soft: #314238;
  --shadow: 0 16px 48px rgba(57, 48, 33, .08);
  --shadow-small: 0 8px 26px rgba(57, 48, 33, .07);
  --radius: 16px;
  --radius-small: 11px;
  --focus: 0 0 0 4px rgba(231, 144, 39, .15);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
input, select, textarea { width: 100%; }
input, select, textarea {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
textarea { resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: #beb4a5; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: #a2a9a3; }
input[disabled], select[disabled], textarea[disabled] { background: #f3f1ec; color: #969c97; cursor: not-allowed; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.is-hidden { display: none !important; }

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 13px;
  background: var(--bg);
  color: var(--muted);
}
.loading-brand, .brand-symbol {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--orange);
}
.loading-brand { width: 58px; height: 58px; border-radius: 18px; box-shadow: 0 12px 28px rgba(185, 95, 10, .18); }
.loading-brand svg { width: 34px; height: 34px; fill: currentColor; stroke: none; }
.loading-spinner { width: 24px; height: 24px; border: 2px solid #ded8cc; border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
.loading-screen strong { font-size: 22px; color: var(--ink); }
.loading-screen p { margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  width: 228px;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  background: var(--sidebar);
  color: #fff;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; min-height: 52px; padding: 4px 7px; color: #fff; text-decoration: none; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { font-size: 16px; letter-spacing: .02em; }
.sidebar-brand small { margin-top: 2px; color: rgba(255,255,255,.55); font-size: 11px; }
.brand-symbol { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 13px; }
.brand-symbol svg { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.brand-symbol--small { width: 32px; height: 32px; border-radius: 10px; }
.brand-symbol--small svg { width: 20px; height: 20px; }
.sidebar-section { margin-top: 36px; }
.sidebar-label { margin: 0 9px 9px; color: rgba(255,255,255,.43); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-module {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255,255,255,.72);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
}
.sidebar-module svg { width: 21px; height: 21px; }
.sidebar-module.is-active { background: var(--sidebar-soft); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.sidebar-spacer { flex: 1; }
.sidebar-system, .sidebar-user {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 10px;
}
.sidebar-system { border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.04); color: #fff; text-align: left; }
.sidebar-system:hover { background: rgba(255,255,255,.07); }
.sidebar-system > span:nth-child(2), .sidebar-user > span:nth-child(2) { min-width: 0; flex: 1; }
.sidebar-system strong, .sidebar-system small, .sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-system strong, .sidebar-user strong { font-size: 12px; }
.sidebar-system small, .sidebar-user small { margin-top: 2px; color: rgba(255,255,255,.48); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-system svg { width: 16px; height: 16px; color: rgba(255,255,255,.45); }
.sidebar-user { margin-top: 10px; border-top: 1px solid rgba(255,255,255,.08); border-radius: 0; padding-top: 16px; }
.avatar { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: rgba(231,144,39,.2); color: #ffc272; font-size: 12px; font-weight: 800; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.status-dot--loading { background: #c9a66b; animation: pulse 1.4s infinite; }
.status-dot--pass { background: #62aa76; }
.status-dot--warn { background: #e7a23f; }
.status-dot--fail { background: #db6b63; }
@keyframes pulse { 0%,100% { opacity: .4; } 50% { opacity: 1; } }

.workspace { grid-column: 2; min-width: 0; }
.workspace-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 30px;
  border-bottom: 1px solid rgba(216,209,197,.85);
  background: rgba(245,242,234,.9);
  backdrop-filter: blur(16px);
}
.mobile-brand { display: none; align-items: center; gap: 9px; }
.page-tabs { display: flex; align-items: stretch; height: 100%; gap: 26px; }
.page-tab { position: relative; border: 0; background: transparent; padding: 0 1px; color: var(--muted); font-size: 14px; font-weight: 700; }
.page-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.page-tab:hover { color: var(--ink); }
.page-tab.is-active { color: var(--ink); }
.page-tab.is-active::after { background: var(--orange); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-text-button, .mobile-system-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.75);
  border-radius: 10px;
  min-height: 38px;
  color: var(--ink-soft);
}
.icon-text-button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; font-weight: 700; }
.icon-text-button svg { width: 16px; height: 16px; }
.mobile-system-button { display: none; width: 38px; padding: 0; place-items: center; }

.workspace-content { width: min(1380px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 96px; }
.app-page { animation: pageIn .2s ease; }
@keyframes pageIn { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-heading--compact { align-items: center; }
.page-heading h1 { margin: 4px 0 7px; font-size: clamp(29px, 3vw, 38px); letter-spacing: -.035em; }
.page-heading p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow { margin: 0; color: var(--orange-deep); font-size: 10px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.muted { color: var(--muted); }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-small); }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 20px; align-items: start; }
.form-column { display: grid; gap: 17px; min-width: 0; }
.form-section { padding: 25px; }
.section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 22px; }
.section-number { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; background: var(--orange-soft); color: var(--orange-deep); font-size: 11px; font-weight: 900; }
.section-heading h2 { margin: 0 0 4px; font-size: 19px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.field-grid { display: grid; gap: 18px 16px; }
.field-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-group { min-width: 0; }
.field-group--wide { grid-column: 1 / -1; }
.field-group label, .label-row label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 750; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.required-mark, .optional-mark { margin-left: 4px; font-size: 10px; font-weight: 650; }
.required-mark { color: var(--orange-deep); }
.optional-mark { color: #8d948e; }
.field-hint { margin: 6px 0 0; color: #8b928c; font-size: 11px; line-height: 1.45; }
.field-error { min-height: 15px; margin: 4px 0 0; color: var(--red); font-size: 11px; line-height: 1.35; }
.field-group.has-error input, .field-group.has-error select, .field-group.has-error textarea, .field-group.has-error .multi-picker__button { border-color: var(--red); background: #fffaf9; }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; transition: border-color .18s, box-shadow .18s; overflow: hidden; }
.input-prefix:focus-within { border-color: var(--orange); box-shadow: var(--focus); }
.input-prefix > span { padding-left: 12px; color: var(--muted); font-weight: 750; }
.input-prefix input { border: 0; box-shadow: none !important; padding-left: 7px; }
.mini-action { border: 0; background: transparent; color: var(--orange-deep); font-size: 11px; font-weight: 750; padding: 3px 0; }
.textarea-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.textarea-meta > span { margin-top: 6px; color: #9ca29d; font-size: 10px; white-space: nowrap; }

.button { min-height: 40px; border-radius: 10px; border: 1px solid transparent; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 750; transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease; }
.button svg { width: 16px; height: 16px; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; }
.button--primary { background: var(--orange); color: #fff; box-shadow: 0 7px 17px rgba(185,95,10,.16); }
.button--primary:hover:not(:disabled) { background: #df841c; }
.button--secondary { border-color: #ccd8d0; background: var(--green-soft); color: var(--green); }
.button--ghost { border-color: var(--line-strong); background: rgba(255,255,255,.82); color: var(--ink-soft); }
.button--text { border-color: transparent; background: transparent; color: var(--muted); }
.button--danger { background: var(--red); color: #fff; }
.button--full { width: 100%; }
.button--large { min-height: 48px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: inline-grid; place-items: center; padding: 0; }
.icon-button:hover { background: var(--surface-soft); }
.icon-button svg { width: 18px; height: 18px; }

.summary-column { position: sticky; top: 86px; }
.order-summary { padding: 22px; }
.order-summary__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.order-summary__header h2 { margin: 4px 0 0; font-size: 19px; }
.draft-status { border-radius: 999px; background: #f0eee9; color: var(--muted); padding: 5px 8px; font-size: 10px; font-weight: 750; }
.draft-status.is-saved { background: var(--green-soft); color: var(--green); }
.progress-wrap { margin: 20px 0; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.progress-label strong { color: var(--ink); }
.progress-track { height: 7px; border-radius: 999px; background: #eeeae2; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--orange); transition: width .25s ease; }
.summary-list { margin: 0 0 18px; display: grid; }
.summary-list div { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.summary-list dt { color: var(--muted); font-size: 11px; }
.summary-list dd { margin: 0; text-align: right; font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.summary-warnings { margin-bottom: 12px; padding: 10px 12px; border-radius: 9px; background: var(--orange-soft); color: #8b4c0c; font-size: 11px; }
.summary-warnings ul { margin: 0; padding-left: 17px; }
.submit-help { margin: 9px 0 0; text-align: center; color: #929993; font-size: 10px; line-height: 1.45; }

.optional-section { overflow: hidden; }
.optional-section summary { min-height: 70px; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; cursor: pointer; }
.optional-section summary::-webkit-details-marker { display: none; }
.optional-section summary strong, .optional-section summary small { display: block; }
.optional-section summary small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.summary-action { color: var(--orange-deep); font-size: 11px; font-weight: 750; }
.optional-section[open] .summary-action { font-size: 0; }
.optional-section[open] .summary-action::after { content: "收起"; font-size: 11px; }
.optional-section__body { padding: 0 24px 24px; }
.empty-state, .empty-page { color: var(--muted); text-align: center; }
.empty-state { padding: 22px; }
.empty-page { display: grid; place-items: center; align-content: center; gap: 6px; min-height: 240px; }
.empty-page strong { color: var(--ink); font-size: 18px; }

.multi-picker { position: relative; }
.multi-picker__button { width: 100%; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; text-align: left; }
.multi-picker__button:focus { border-color: var(--orange); box-shadow: var(--focus); }
.multi-picker__values { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.multi-picker__placeholder { color: #a2a9a3; }
.multi-picker__chevron { color: var(--muted); font-size: 11px; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; background: var(--green-soft); color: var(--green); padding: 4px 8px; font-size: 11px; font-weight: 750; }
.chip button { border: 0; background: transparent; padding: 0; width: 14px; height: 14px; color: currentColor; }
.multi-picker__panel { position: absolute; z-index: 90; top: calc(100% + 6px); left: 0; right: 0; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow-small); padding: 6px; }
.multi-picker__option { display: flex; align-items: center; gap: 9px; padding: 9px; border-radius: 8px; cursor: pointer; font-size: 12px; }
.multi-picker__option:hover { background: var(--surface-soft); }
.multi-picker__option input { width: 17px; min-height: 17px; margin: 0; accent-color: var(--orange); }
.multi-picker__empty { padding: 11px; color: var(--muted); font-size: 11px; }
.multi-picker__custom { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; margin-top: 5px; padding: 7px; border-top: 1px solid var(--line); }
.multi-picker__custom input { min-height: 36px; padding: 7px 9px; font-size: 11px; }
.multi-picker__custom button { min-width: 52px; border: 1px solid #d1ddd5; border-radius: 8px; background: var(--green-soft); color: var(--green); font-weight: 750; }

.record-picker { position: relative; }
.record-picker__results { position: absolute; z-index: 90; top: 48px; left: 0; right: 0; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow-small); padding: 6px; }
.record-option { width: 100%; border: 0; border-radius: 8px; background: transparent; padding: 9px; text-align: left; }
.record-option:hover { background: var(--surface-soft); }
.record-option strong, .record-option small { display: block; }
.record-option strong { font-size: 12px; }
.record-option small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.record-loading, .record-empty { padding: 13px; color: var(--muted); font-size: 11px; text-align: center; }
.record-selected { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; border-radius: 9px; background: var(--green-soft); color: var(--green); padding: 8px 10px; font-size: 11px; }
.record-selected button { border: 0; background: transparent; color: var(--green); font-weight: 750; }

.notice { margin-bottom: 16px; border: 1px solid; border-radius: 12px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: 12px; }
.notice strong, .notice span { display: block; }
.notice span { margin-top: 2px; }
.notice > button { border: 0; background: transparent; color: currentColor; font-weight: 750; white-space: nowrap; }
.notice--warning { border-color: #efc99a; background: var(--orange-soft); color: #82490f; }
.notice--info { border-color: #cbdce9; background: var(--blue-soft); color: #3d607e; }
.notice__actions { display: flex; gap: 6px; }

/* Order list and calendar */
.filter-card { padding: 18px; margin-bottom: 16px; }
.filter-primary-row { display: grid; grid-template-columns: minmax(280px, 1fr) auto; gap: 14px; align-items: center; }
.search-control { position: relative; display: block; }
.search-control svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; color: #909892; transform: translateY(-50%); pointer-events: none; }
.search-control input { padding-left: 40px; }
.segmented-control { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); padding: 3px; }
.segmented-control button { min-width: 68px; min-height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; }
.segmented-control button.is-active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(57,48,33,.08); }
.filter-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)) auto; gap: 10px; align-items: end; }
.filter-grid label, .analytics-filter label { min-width: 0; }
.filter-grid label span, .analytics-filter label span { display: block; margin: 0 0 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.filter-grid input, .filter-grid select, .analytics-filter input, .analytics-filter select { min-height: 38px; padding: 8px 9px; font-size: 11px; }
.filter-actions { display: flex; gap: 5px; }
.filter-actions .button { min-height: 38px; padding: 8px 11px; font-size: 11px; }
.metric-strip { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.metric-strip article { min-height: 82px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.78); padding: 15px 17px; }
.metric-strip span, .metric-strip small { display: block; color: var(--muted); font-size: 10px; }
.metric-strip strong { display: inline-block; margin: 7px 5px 0 0; font-size: 22px; letter-spacing: -.02em; }
.metric-strip small { display: inline; }
.calendar-panel { overflow: hidden; }
.calendar-toolbar { min-height: 69px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 15px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.calendar-toolbar h2 { margin: 0; font-size: 18px; text-align: center; }
.calendar-toolbar > p { margin: 0; text-align: right; color: var(--muted); font-size: 11px; }
.month-control { display: flex; align-items: center; gap: 5px; }
.month-control .button { min-height: 36px; padding: 7px 9px; font-size: 11px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.calendar-weekdays span { padding: 9px 8px; color: var(--muted); text-align: center; font-size: 10px; font-weight: 750; }
.calendar-day { position: relative; min-height: 126px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 9px; background: #fff; overflow: hidden; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.is-outside { background: #faf9f6; color: #acb1ad; }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px rgba(231,144,39,.55); }
.calendar-day__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.calendar-day__number { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; font-size: 11px; font-weight: 750; }
.calendar-day.is-today .calendar-day__number { background: var(--orange); color: #fff; }
.calendar-day__sum { color: var(--muted); font-size: 9px; }
.calendar-orders { display: grid; gap: 4px; }
.calendar-order { width: 100%; border: 0; border-left: 3px solid var(--orange); border-radius: 6px; background: var(--orange-soft); color: #6d3b0c; padding: 5px 6px; text-align: left; font-size: 9px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-order:nth-child(2n) { border-left-color: var(--green); background: var(--green-soft); color: var(--green); }
.calendar-more { border: 0; background: transparent; color: var(--muted); padding: 2px 0; font-size: 9px; font-weight: 750; text-align: left; }
.list-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.orders-table { width: 100%; border-collapse: collapse; min-width: 920px; }
.orders-table th { padding: 12px 14px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 800; text-align: left; white-space: nowrap; }
.orders-table td { padding: 13px 14px; border-top: 1px solid var(--line); font-size: 11px; vertical-align: middle; }
.orders-table tbody tr:hover { background: #fffdf9; }
.order-title-cell strong, .order-title-cell small { display: block; }
.order-title-cell strong { max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.order-title-cell small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.amount-cell { font-weight: 800; white-space: nowrap; }
.table-action { border: 0; background: transparent; color: var(--orange-deep); font-size: 10px; font-weight: 750; }
.table-placeholder { padding: 44px !important; color: var(--muted); text-align: center; }
.orders-mobile-list { display: none; }
.pagination { min-height: 60px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px; }
.pagination .button { min-height: 34px; padding: 7px 11px; font-size: 10px; }
.pagination span { color: var(--muted); font-size: 10px; }

/* Analytics */
.analytics-filter { display: grid; grid-template-columns: auto minmax(130px, .8fr) minmax(130px,.8fr) minmax(130px,.8fr) auto; gap: 12px; align-items: end; padding: 16px; }
.preset-buttons { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); padding: 3px; }
.preset-buttons button { min-height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); padding: 0 12px; font-size: 10px; font-weight: 750; }
.preset-buttons button.is-active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(57,48,33,.08); }
.analytics-filter .button { min-height: 38px; font-size: 11px; }
.data-definition { margin: 9px 3px 16px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 13px; }
.kpi-card { min-height: 132px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow-small); padding: 20px; }
.kpi-card--accent { border-color: #efcfaa; background: var(--surface-warm); }
.kpi-card > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.kpi-card > strong { display: block; margin: 12px 0 8px; font-size: clamp(26px,3vw,34px); letter-spacing: -.04em; }
.kpi-change { color: var(--muted); font-size: 10px; }
.kpi-change.is-up { color: #3f7c51; }
.kpi-change.is-down { color: var(--red); }
.analytics-grid { display: grid; gap: 13px; margin-bottom: 13px; }
.analytics-grid--wide { grid-template-columns: minmax(0,1.75fr) minmax(300px,.75fr); }
.analytics-grid--three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.analytics-card { min-width: 0; padding: 20px; }
.card-heading { min-height: 43px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.card-heading h2 { margin: 0 0 4px; font-size: 16px; }
.card-heading p, .card-heading > span { margin: 0; color: var(--muted); font-size: 10px; }
.chart-legend { display: flex; gap: 12px; color: var(--muted); font-size: 9px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--orange); }
.chart-legend span:nth-child(2) i { background: var(--green); }
.trend-chart { min-height: 285px; position: relative; }
.trend-chart svg { width: 100%; height: 285px; overflow: visible; }
.chart-grid-line { stroke: #ece8e0; stroke-width: 1; }
.chart-area { fill: rgba(231,144,39,.12); stroke: none; }
.chart-line { fill: none; stroke: var(--orange); stroke-width: 2.4; }
.chart-dot { fill: #fff; stroke: var(--orange); stroke-width: 2; }
.chart-count-bar { fill: rgba(69,100,81,.18); stroke: none; }
.chart-axis-label { fill: #858e87; font-size: 9px; font-family: inherit; }
.chart-empty { min-height: 250px; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.donut-layout { min-height: 285px; display: grid; grid-template-columns: 145px minmax(0,1fr); align-items: center; gap: 14px; }
.donut-wrap { position: relative; width: 138px; height: 138px; margin: auto; }
.donut-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-track { fill: none; stroke: #eeeae2; stroke-width: 15; }
.donut-segment { fill: none; stroke-width: 15; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; }
.donut-center strong { font-size: 18px; }
.donut-center span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.donut-legend { display: grid; gap: 8px; }
.donut-legend-row { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; gap: 7px; align-items: center; font-size: 10px; }
.donut-legend-row i { width: 9px; height: 9px; border-radius: 3px; }
.donut-legend-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-legend-row strong { font-size: 10px; }
.ranking-list { display: grid; gap: 12px; }
.ranking-item { display: grid; gap: 6px; }
.ranking-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; }
.ranking-top span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ranking-top strong { white-space: nowrap; }
.ranking-track { height: 7px; border-radius: 999px; background: #eeeae2; overflow: hidden; }
.ranking-track i { display: block; height: 100%; border-radius: inherit; background: var(--orange); }
.ranking-meta { color: var(--muted); font-size: 9px; }
.quality-card { margin-bottom: 10px; }
.quality-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 10px; }
.quality-item { border: 1px solid var(--line); border-radius: 12px; padding: 13px; background: var(--surface-soft); }
.quality-item span, .quality-item small { display: block; color: var(--muted); font-size: 9px; }
.quality-item strong { display: block; margin: 8px 0 4px; font-size: 21px; }
.quality-item.is-risk { border-color: #efc5bf; background: var(--red-soft); }

/* Drawer and modal */
.drawer { position: fixed; inset: 0; z-index: 150; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(24,31,27,.38); backdrop-filter: blur(2px); }
.drawer-panel { position: absolute; top: 0; right: 0; width: min(470px, 100%); height: 100%; overflow: auto; background: #fff; box-shadow: -20px 0 50px rgba(30,38,33,.16); animation: drawerIn .22s ease; }
@keyframes drawerIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-header { position: sticky; top: 0; z-index: 2; min-height: 82px; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 17px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.drawer-header h2 { margin: 4px 0 0; font-size: 18px; overflow-wrap: anywhere; }
.drawer-body { padding: 20px; }
.detail-amount { margin-bottom: 18px; border-radius: 14px; background: var(--surface-warm); padding: 18px; }
.detail-amount span { display: block; color: var(--muted); font-size: 10px; }
.detail-amount strong { display: block; margin-top: 6px; font-size: 28px; }
.detail-list { margin: 0; display: grid; }
.detail-list div { display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 10px; }
.detail-list dd { margin: 0; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-completeness { margin-top: 18px; border-radius: 12px; background: var(--surface-soft); padding: 13px; color: var(--muted); font-size: 10px; }

.modal { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(32,40,35,.44); backdrop-filter: blur(3px); }
.modal__panel { position: relative; width: min(520px,100%); max-height: min(780px, calc(100vh - 40px)); overflow: auto; border-radius: 18px; background: #fff; box-shadow: 0 30px 90px rgba(29,35,31,.22); padding: 24px; animation: modalIn .18s ease; }
@keyframes modalIn { from { opacity: .4; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__panel--wide { width: min(760px,100%); }
.modal__panel--small { width: min(420px,100%); }
.modal__panel--success { text-align: center; padding: 32px; }
.modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.modal__header h2, .modal__panel--success h2 { margin: 4px 0 0; }
.modal__footer, .success-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.success-actions { justify-content: center; }
.success-icon { width: 55px; height: 55px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 25px; font-weight: 900; }
.success-order-name { margin: 10px 0 0; font-weight: 750; }
.modal-footnote { margin: 14px 0 0; color: var(--muted); font-size: 10px; }
.system-summary { border-radius: 11px; background: var(--surface-soft); padding: 12px; color: var(--muted); font-size: 11px; }
.system-checks { margin-top: 12px; display: grid; gap: 7px; }
.system-check { display: grid; grid-template-columns: 9px minmax(120px,.5fr) minmax(0,1fr); gap: 9px; align-items: start; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 10px; }
.system-check__dot { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: #9da39f; }
.system-check--pass .system-check__dot { background: #58a16c; }
.system-check--warn .system-check__dot { background: var(--orange); }
.system-check--fail .system-check__dot { background: var(--red); }
.system-check span:last-child { color: var(--muted); }

.toast-region { position: fixed; z-index: 220; right: 20px; bottom: 20px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 250px; max-width: 390px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow); padding: 11px 13px; display: flex; align-items: flex-start; gap: 9px; animation: toastIn .2s ease; pointer-events: auto; }
@keyframes toastIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.toast__icon { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 900; }
.toast--error .toast__icon { background: var(--red-soft); color: var(--red); }
.toast--info .toast__icon { background: var(--blue-soft); color: var(--blue); }
.toast p { margin: 1px 0 0; font-size: 11px; line-height: 1.45; }
.mobile-submit-bar, .mobile-bottom-nav { display: none; }

@media (max-width: 1180px) {
  .filter-grid { grid-template-columns: repeat(4,minmax(120px,1fr)); }
  .filter-actions { justify-content: flex-end; }
  .quality-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .analytics-grid--three { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .analytics-grid--three > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .workspace { min-width: 0; }
  .workspace-header { height: 58px; padding: 0 16px; }
  .mobile-brand { display: flex; }
  .page-tabs { display: none; }
  .mobile-system-button { display: grid; }
  .workspace-content { width: min(100% - 28px, 900px); padding-top: 24px; padding-bottom: 118px; }
  .form-layout { grid-template-columns: 1fr; }
  .summary-column { position: static; }
  .order-summary { display: none; }
  .mobile-submit-bar { position: fixed; z-index: 95; left: 0; right: 0; bottom: 58px; min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); padding: 9px 14px calc(9px + env(safe-area-inset-bottom,0px)); }
  .mobile-submit-bar div small, .mobile-submit-bar div strong { display: block; }
  .mobile-submit-bar div small { color: var(--muted); font-size: 9px; }
  .mobile-submit-bar div strong { margin-top: 2px; font-size: 15px; }
  .mobile-submit-bar .button { min-width: 145px; min-height: 44px; }
  .mobile-bottom-nav { position: fixed; z-index: 100; left: 0; right: 0; bottom: 0; height: calc(58px + env(safe-area-inset-bottom,0px)); display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); background: rgba(255,255,255,.98); padding-bottom: env(safe-area-inset-bottom,0px); }
  .mobile-bottom-nav button { border: 0; background: transparent; color: #8a918b; display: grid; place-items: center; align-content: center; gap: 3px; font-size: 9px; font-weight: 750; }
  .mobile-bottom-nav button svg { width: 20px; height: 20px; }
  .mobile-bottom-nav button.is-active { color: var(--orange-deep); }
  .filter-grid { grid-template-columns: repeat(3,minmax(120px,1fr)); }
  .analytics-filter { grid-template-columns: 1fr 1fr 1fr; }
  .preset-buttons { grid-column: 1 / -1; width: max-content; }
  .analytics-filter .button { align-self: end; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .analytics-grid--wide { grid-template-columns: 1fr; }
  .analytics-grid--three { grid-template-columns: 1fr; }
  .analytics-grid--three > :last-child { grid-column: auto; }
}

@media (max-width: 680px) {
  .workspace-content { width: calc(100% - 20px); padding-top: 19px; }
  .page-heading { align-items: flex-start; margin-bottom: 17px; }
  .page-heading h1 { font-size: 27px; }
  .page-heading p:last-child { font-size: 12px; line-height: 1.55; }
  .page-heading > .button { min-height: 36px; padding: 7px 10px; font-size: 10px; white-space: nowrap; }
  .form-section { padding: 19px 16px; }
  .field-grid--2 { grid-template-columns: 1fr; }
  .field-group--wide { grid-column: auto; }
  .optional-section summary { padding: 16px; }
  .optional-section__body { padding: 0 16px 18px; }
  .notice { align-items: flex-start; flex-direction: column; gap: 8px; }
  .filter-card { padding: 12px; }
  .filter-primary-row { grid-template-columns: 1fr; }
  .segmented-control { width: 100%; }
  .segmented-control button { flex: 1; }
  .filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-grid label:nth-of-type(6) { grid-column: 1 / -1; }
  .filter-actions { grid-column: 1 / -1; }
  .filter-actions .button--primary { flex: 1; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip article:last-child { grid-column: 1 / -1; }
  .calendar-toolbar { grid-template-columns: 1fr auto; padding: 11px; }
  .calendar-toolbar h2 { order: -1; text-align: left; }
  .calendar-toolbar > p { grid-column: 1 / -1; text-align: left; }
  .month-control { justify-content: flex-end; }
  .calendar-weekdays span { padding: 7px 2px; font-size: 8px; }
  .calendar-day { min-height: 91px; padding: 5px; }
  .calendar-day__top { margin-bottom: 4px; }
  .calendar-day__number { width: 20px; height: 20px; font-size: 9px; }
  .calendar-day__sum { display: none; }
  .calendar-order { border-left-width: 2px; padding: 4px; font-size: 7px; }
  .calendar-more { font-size: 7px; }
  .table-scroll { display: none; }
  .orders-mobile-list { display: grid; gap: 0; }
  .order-mobile-card { border-bottom: 1px solid var(--line); padding: 14px; }
  .order-mobile-card:last-child { border-bottom: 0; }
  .order-mobile-top { display: flex; justify-content: space-between; gap: 10px; }
  .order-mobile-top strong { min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .order-mobile-top span { white-space: nowrap; color: var(--orange-deep); font-size: 12px; font-weight: 800; }
  .order-mobile-meta { margin: 7px 0 9px; display: flex; flex-wrap: wrap; gap: 5px 10px; color: var(--muted); font-size: 9px; }
  .order-mobile-card button { border: 0; background: transparent; color: var(--orange-deep); padding: 0; font-size: 9px; font-weight: 750; }
  .analytics-filter { grid-template-columns: 1fr 1fr; padding: 12px; }
  .preset-buttons { width: 100%; display: grid; grid-template-columns: repeat(4,1fr); }
  .preset-buttons button { padding: 0 5px; }
  .analytics-filter label:first-of-type { grid-column: 1 / -1; }
  .analytics-filter .button { grid-column: 1 / -1; }
  .kpi-grid { gap: 9px; }
  .kpi-card { min-height: 112px; padding: 15px; }
  .kpi-card > strong { margin: 10px 0 6px; font-size: 25px; }
  .analytics-card { padding: 15px; }
  .donut-layout { grid-template-columns: 120px minmax(0,1fr); min-height: 230px; }
  .donut-wrap { width: 112px; height: 112px; }
  .trend-chart, .trend-chart svg { min-height: 235px; height: 235px; }
  .quality-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .drawer-panel { width: 100%; }
  .modal { padding: 10px; }
  .modal__panel { padding: 19px; }
  .system-check { grid-template-columns: 9px 1fr; }
  .system-check span:last-child { grid-column: 2; }
  .toast-region { left: 10px; right: 10px; bottom: 132px; }
  .toast { min-width: 0; max-width: none; width: 100%; }
}
