/* ============ 航迹 FreightBoard ============ */
:root {
  --navy-950: #071b26;
  --navy-900: #0a2230;
  --navy-800: #0d2b3a;
  --navy-700: #12384a;
  --teal: #0f9e8e;
  --teal-dark: #0b7f73;
  --teal-soft: #e7f6f3;
  --cyan: #38c8b8;
  --ink: #182a33;
  --ink-2: #31454f;
  --muted: #71838d;
  --muted-2: #93a3ab;
  --line: #e4ecef;
  --line-2: #eef3f5;
  --bg: #f4f7f8;
  --white: #fff;
  --red: #cf5238;
  --red-soft: #fbeae6;
  --amber: #bd841f;
  --amber-soft: #fbf1dc;
  --green: #2c8a60;
  --green-soft: #e7f4ec;
  --blue: #2f6f9f;
  --blue-soft: #e9f1f8;
  --shadow-sm: 0 1px 2px rgba(14, 40, 53, .04);
  --shadow-md: 0 10px 30px -12px rgba(14, 40, 53, .18);
  --shadow-lg: 0 26px 70px -24px rgba(8, 30, 42, .35);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: #bfe9e2; }

/* ---------- boot / login ---------- */
.boot-splash {
  min-height: 100vh; display: flex; flex-direction: column; gap: 18px;
  align-items: center; justify-content: center; background: var(--navy-900); color: #d9e7ec;
}
.boot-logo { width: 54px; height: 54px; border-radius: 15px; background: linear-gradient(140deg, #23c3b1, #0b7f73); display: grid; place-items: center; box-shadow: 0 12px 30px -10px rgba(35, 195, 177, .6); }
.boot-splash p { font-size: 13px; letter-spacing: .12em; color: #7fa0ad; }
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255, 255, 255, .2); border-top-color: #7fe0d5; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; background: #fff; }
.login-art {
  position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at 10% 0%, #16495e 0%, transparent 55%), linear-gradient(160deg, #0a2230 0%, #0c2b3a 55%, #0a3b45 100%);
  color: #dcebf0;
}
.login-art::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(180deg, #000 0%, transparent 80%);
}
.login-art::after {
  content: ""; position: absolute; width: 560px; height: 560px; right: -180px; bottom: -260px;
  border-radius: 50%; border: 1px solid rgba(94, 220, 205, .18);
  box-shadow: 0 0 0 70px rgba(94, 220, 205, .04), 0 0 0 150px rgba(94, 220, 205, .03);
}
.login-art .brand { position: relative; z-index: 1; }
.login-copy { position: relative; z-index: 1; max-width: 440px; }
.login-copy .kicker { font-size: 11px; letter-spacing: .22em; color: #67cfc2; text-transform: uppercase; margin-bottom: 18px; }
.login-copy h2 { font-size: 34px; line-height: 1.28; font-weight: 600; letter-spacing: -.01em; margin-bottom: 18px; }
.login-copy p { color: #9fb7c1; font-size: 14px; line-height: 1.9; }
.login-points { display: flex; gap: 22px; margin-top: 30px; flex-wrap: wrap; }
.login-points span { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #b6cbd3; }
.login-points svg { color: #5ed3c5; }
.login-art .foot { position: relative; z-index: 1; font-size: 12px; color: #5f7c88; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: linear-gradient(180deg, #fff 0%, #f7fafb 100%); }
.login-card { width: 100%; max-width: 380px; }
.login-card .eyebrow { font-size: 11px; letter-spacing: .18em; color: var(--teal); font-weight: 600; }
.login-card h1 { font-size: 26px; font-weight: 600; margin: 8px 0 6px; letter-spacing: -.01em; }
.login-card .sub { color: var(--muted); margin-bottom: 30px; }
.login-card label.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 16px 0 7px; }
.login-card .input { height: 46px; }
.login-error { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 12.5px; }
.login-card .btn-primary { width: 100%; height: 46px; margin-top: 22px; justify-content: center; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 50;
  display: flex; flex-direction: column; padding: 22px 14px 16px;
  background: radial-gradient(700px 380px at -10% -5%, #16465a 0%, transparent 60%), linear-gradient(180deg, #0a2230 0%, #0b2734 100%);
  color: #c3d5dc; border-right: 1px solid rgba(255, 255, 255, .04);
}
.sidebar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 24px 24px; mask-image: linear-gradient(180deg, #000, transparent 65%);
}
.brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; padding: 2px 8px 24px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(145deg, #1fc3b0, #0a7a6e); display: grid; place-items: center; flex: none; box-shadow: 0 8px 20px -8px rgba(31, 195, 176, .7); }
.brand-text strong { display: block; font-size: 16px; letter-spacing: .14em; color: #f2fbfc; font-weight: 600; }
.brand-text span { display: block; font-size: 8.5px; letter-spacing: .2em; color: #6e97a4; margin-top: 2px; text-transform: uppercase; }
.nav { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; }
.nav-label { font-size: 9.5px; letter-spacing: .16em; color: #52727f; padding: 14px 12px 7px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: #9db6c0; font-size: 13.5px; position: relative; transition: .16s ease;
}
.nav-item svg { opacity: .8; flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #eaf6f7; }
.nav-item.active { background: rgba(31, 195, 176, .13); color: #f0fffc; }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #2ad0be; }
.nav-item.active svg { color: #4fe0cf; opacity: 1; }
.nav-item .count { margin-left: auto; font-size: 11px; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 20px; background: rgba(255, 255, 255, .08); color: #cfe3e8; }
.nav-item.active .count { background: rgba(42, 208, 190, .2); color: #7ff0e2; }
.nav-item .count.alert { background: rgba(228, 105, 74, .18); color: #ffb39f; }
.sidebar-foot { position: relative; z-index: 1; margin-top: auto; padding: 14px 8px 4px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; }
.sidebar-user .avatar { width: 30px; height: 30px; border-radius: 50%; background: rgba(31, 195, 176, .16); color: #67e5d6; display: grid; place-items: center; font-size: 12px; flex: none; }
.sidebar-user .who { min-width: 0; }
.sidebar-user .who b { display: block; font-size: 12.5px; color: #e2f0f3; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .who span { display: block; font-size: 10.5px; color: #688a96; }
.sidebar-foot .hint { font-size: 10.5px; color: #5a7b87; margin-top: 10px; line-height: 1.6; padding: 0 4px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 66px; position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 18px;
  padding: 0 30px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; min-width: 88px; }
.searchbox { position: relative; flex: 1; max-width: 420px; margin-left: 6px; }
.searchbox svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.searchbox input {
  width: 100%; height: 38px; border: 1px solid var(--line); background: #f7fafb; border-radius: 10px;
  padding: 0 40px 0 36px; font-size: 13px; outline: none; transition: .18s;
}
.searchbox input::placeholder { color: #9aa9b1; }
.searchbox input:focus { background: #fff; border-color: #b9dcd6; box-shadow: 0 0 0 3px rgba(15, 158, 142, .1); }
.searchbox kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-family: var(--font); font-size: 10px; color: #9aa9b1; border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 1px 5px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sync { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.sync i { width: 6px; height: 6px; border-radius: 50%; background: #4cbf9a; box-shadow: 0 0 0 3px rgba(76, 191, 154, .14); }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--muted); transition: .15s; }
.icon-btn:hover { background: #f0f5f6; color: var(--ink); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 9px 4px 4px; border: 1px solid var(--line); border-radius: 30px; background: #fff; }
.user-chip .avatar { width: 27px; height: 27px; border-radius: 50%; background: linear-gradient(145deg, #e3f5f1, #d5eeea); color: var(--teal-dark); display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.user-chip span { font-size: 12px; color: var(--ink-2); max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.view { padding: 28px 30px 70px; width: 100%; max-width: 1460px; margin: 0 auto; flex: 1; }
.view > .fade-in { animation: fadeUp .34s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- shared bits ---------- */
.page-head { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .eyebrow { width: 100%; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--teal); font-weight: 600; margin-bottom: -6px; }
.page-title { font-size: 27px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
.page-sub { color: var(--muted); font-size: 13px; }
.page-head .actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 13px;
  font-weight: 500; transition: .16s ease; white-space: nowrap; box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: #cfdcdf; background: #fbfdfd; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn svg { color: var(--muted); }
.btn-primary { background: linear-gradient(180deg, #12a897 0%, #0c8e80 100%); border-color: #0b887b; color: #fff; box-shadow: 0 6px 14px -7px rgba(12, 142, 128, .8); }
.btn-primary:hover { background: linear-gradient(180deg, #13b3a1 0%, #0d9486 100%); border-color: #0d9486; }
.btn-primary svg { color: rgba(255, 255, 255, .9); }
.btn-danger { color: var(--red); border-color: #f0d3cb; background: #fff; }
.btn-danger:hover { background: var(--red-soft); border-color: #e7bdb2; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: #f0f5f6; border-color: transparent; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .spin { animation: spin .9s linear infinite; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; }
.panel-title { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.panel-title .light { color: var(--muted-2); font-weight: 400; font-size: 12px; margin-left: 6px; }
.panel-link { margin-left: auto; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.panel-link:hover { color: var(--teal); }
.panel-body { padding: 16px 20px 20px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line-2); }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 500; white-space: nowrap; background: #f0f4f6; color: var(--muted); }
.pill svg { flex: none; }
.pill-teal { background: var(--teal-soft); color: var(--teal-dark); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-navy { background: #e9eff2; color: #36545f; }
.pill-ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.phase-pill { background: color-mix(in srgb, var(--pc, #71838d) 12%, #fff); color: var(--pc, #71838d); }
.phase-booking { --pc: #2f6f9f; }
.phase-loading { --pc: #b07a1f; }
.phase-customs { --pc: #b85c38; }
.phase-sailing { --pc: #0e8c8c; }
.phase-arrival { --pc: #3e7c4f; }
.phase-delivery { --pc: #4a6fa5; }
.phase-docs { --pc: #7a5aa6; }
.phase-billing { --pc: #8a6d3b; }
.phase-done { --pc: #5b6b73; }
.phase-cancelled { --pc: #98a4a9; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.empty { text-align: center; padding: 54px 24px; color: var(--muted); }
.empty .empty-icon { width: 52px; height: 52px; border-radius: 15px; background: #f2f6f7; color: #9db0b7; display: grid; place-items: center; margin: 0 auto 14px; }
.empty h3 { color: var(--ink-2); font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.empty p { font-size: 12.5px; margin-bottom: 16px; }
.empty .btn { display: inline-flex; }

.readonly-banner { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; background: #fff8e9; border: 1px solid #f0e0b8; color: #8d6a1e; font-size: 12.5px; margin-bottom: 18px; }
.readonly-banner svg { flex: none; }
.readonly-banner a { font-weight: 600; text-decoration: underline; }

/* ---------- dashboard ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 17px 18px 15px; box-shadow: var(--shadow-sm); }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, var(--teal)); opacity: .85; }
.kpi-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.kpi-top .kico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft, var(--teal-soft)); color: var(--accent, var(--teal)); }
.kpi-val { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.25; margin-top: 9px; font-variant-numeric: tabular-nums; }
.kpi-val small { font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 5px; }
.kpi-foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.kpi-foot .up { color: var(--red); font-weight: 600; }
.kpi-foot .ok { color: var(--green); font-weight: 600; }
.kpi.k-red { --accent: #cf5238; --accent-soft: #fbeae6; }
.kpi.k-amber { --accent: #bd841f; --accent-soft: #fbf1dc; }
.kpi.k-blue { --accent: #2f6f9f; --accent-soft: #e9f1f8; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.focus-count { margin-left: auto; display: flex; gap: 6px; }
.task-list { margin-top: 6px; }
.task-item { display: flex; align-items: center; gap: 13px; padding: 13px 2px; border-top: 1px solid var(--line-2); }
.task-item:first-child { border-top: 0; }
.task-flag { width: 4px; align-self: stretch; border-radius: 4px; background: var(--line); flex: none; }
.task-item.overdue .task-flag { background: var(--red); }
.task-item.today .task-flag { background: #d99a2b; }
.task-item.week .task-flag { background: #5e93b5; }
.task-main { min-width: 0; flex: 1; }
.task-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-line1 b { font-size: 13.5px; font-weight: 600; }
.task-line1 .order-link { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .01em; }
.task-line1 .order-link:hover { color: var(--teal); }
.task-line2 { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.task-line2 .cust { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-date { font-size: 11px; white-space: nowrap; }
.task-date.overdue { color: var(--red); font-weight: 600; }
.task-date.today { color: var(--amber); font-weight: 600; }
.task-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.task-actions .btn-done { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; border: 1px solid #cde8df; background: #f3fbf8; color: var(--teal-dark); display: inline-flex; align-items: center; gap: 4px; }
.task-actions .btn-done:hover { background: #e6f7f1; }
.task-actions .icon-btn { width: 30px; height: 30px; }

.phase-bars { display: flex; flex-direction: column; gap: 11px; margin-top: 4px; }
.phase-row { display: grid; grid-template-columns: 48px 1fr 26px; align-items: center; gap: 10px; font-size: 12px; }
.phase-row .name { color: var(--ink-2); }
.phase-row .bar { height: 7px; border-radius: 8px; background: #f0f4f5; overflow: hidden; }
.phase-row .bar i { display: block; height: 100%; border-radius: 8px; background: var(--pc, var(--teal)); min-width: 3px; }
.phase-row .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.sailing-list { display: flex; flex-direction: column; }
.sailing-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-2); }
.sailing-item:first-child { border-top: 0; padding-top: 4px; }
.date-chip { width: 44px; flex: none; text-align: center; border-radius: 9px; background: #f4f8f9; border: 1px solid #e8eff1; padding: 5px 0 4px; }
.date-chip b { display: block; font-size: 15px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.date-chip span { display: block; font-size: 9px; color: var(--muted); letter-spacing: .04em; }
.date-chip.eta { background: #f0f7f3; border-color: #e0eee5; }
.date-chip.eta b { color: #356e50; }
.sailing-main { min-width: 0; flex: 1; }
.sailing-main b { display: block; font-size: 12.5px; font-weight: 600; }
.sailing-main span { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sailing-item .pill { flex: none; }

.weekly { display: flex; align-items: flex-end; gap: 8px; height: 86px; margin-top: 8px; padding-top: 6px; }
.weekly .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.weekly .col i { display: block; width: 100%; max-width: 26px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #48cdbc, #0f9e8e); min-height: 3px; transition: .4s; }
.weekly .col.today i { background: linear-gradient(180deg, #12384a, #0a2230); }
.weekly .col span { font-size: 9px; color: var(--muted-2); white-space: nowrap; }
.weekly .col b { font-size: 10.5px; color: var(--ink-2); font-weight: 600; }

.activity { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 10px; padding: 9px 0; border-top: 1px dashed var(--line-2); font-size: 12px; }
.activity-item:first-child { border-top: 0; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: #b9cbd1; margin-top: 6px; flex: none; }
.activity-dot.create { background: var(--teal); }
.activity-dot.milestone { background: #5e93b5; }
.activity-dot.status { background: #c08a2e; }
.activity-body { min-width: 0; flex: 1; }
.activity-body .a1 { color: var(--ink-2); line-height: 1.5; }
.activity-body .a1 b { font-weight: 600; }
.activity-body .a2 { font-size: 10.5px; color: var(--muted-2); margin-top: 1px; display: flex; gap: 7px; }
.activity-body .a2 .order-link { font-family: var(--mono); }

/* ---------- filters / order list ---------- */
.filter-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); margin-bottom: 14px; flex-wrap: wrap; }
.filter-search { position: relative; flex: 1; min-width: 210px; }
.filter-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.filter-search input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px 0 34px; background: #f9fbfc; outline: none; font-size: 13px; }
.filter-search input:focus { background: #fff; border-color: #b9dcd6; box-shadow: 0 0 0 3px rgba(15, 158, 142, .09); }
.seg { display: inline-flex; background: #f2f6f7; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font-size: 12px; color: var(--muted); }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20, 50, 60, .1); font-weight: 500; }
.select { height: 36px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 28px 0 11px; font-size: 12.5px; color: var(--ink-2); outline: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2371838d' stroke-width='1.8'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.select:focus { border-color: #b9dcd6; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; white-space: nowrap; }
.toggle input { accent-color: var(--teal); width: 14px; height: 14px; margin: 0; }
.filter-spacer { flex: 1; }

.order-table { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; }
.order-head, .order-row {
  display: grid; grid-template-columns: minmax(140px, 1.05fr) minmax(140px, 1.15fr) minmax(120px, .95fr) 112px minmax(168px, 1.25fr) 92px 66px 72px;
  gap: 14px; align-items: center; padding: 0 18px;
}
.order-head { height: 40px; background: #f9fbfc; border-bottom: 1px solid var(--line); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }
.order-row { min-height: 76px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .14s; }
.order-row:last-child { border-bottom: 0; }
.order-row:hover { background: #fbfdfd; }
.order-row:hover .c-order .no { color: var(--teal-dark); }
.c-order { min-width: 0; }
.c-order .no { font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .14s; }
.c-order .tags { display: flex; align-items: center; gap: 5px; margin-top: 5px; }
.c-order .tags .pill { height: 19px; font-size: 9.5px; padding: 0 6px; }
.c-customer { min-width: 0; }
.c-customer b { display: block; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-customer span { display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-route { min-width: 0; font-size: 12px; }
.c-route .route-line { display: flex; align-items: center; gap: 5px; font-weight: 500; white-space: nowrap; overflow: hidden; }
.c-route .route-line svg { color: #9fb2ba; flex: none; }
.c-route .sub { font-size: 10.5px; color: var(--muted-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-dates { font-size: 11px; line-height: 1.7; }
.c-dates .d { display: flex; gap: 5px; color: var(--muted); }
.c-dates .d b { font-weight: 500; color: var(--ink-2); font-family: var(--mono); font-size: 10.5px; }
.c-dates .d.eta b { color: #47735c; }
.c-next { min-width: 0; }
.c-next .nx { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.c-next .nx span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-next .nx-date { font-size: 10.5px; color: var(--muted-2); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.c-next .nx-date.o { color: var(--red); font-weight: 600; }
.c-next .nx-date.t { color: var(--amber); font-weight: 600; }
.c-progress { display: flex; align-items: center; gap: 7px; }
.c-progress .bar { flex: 1; height: 5px; border-radius: 5px; background: #eef3f4; overflow: hidden; }
.c-progress .bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #35c4b3, #0f9e8e); }
.c-progress span { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-owner { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); min-width: 0; }
.c-owner .avatar { width: 22px; height: 22px; border-radius: 50%; background: #eef5f5; color: #4c7c80; font-size: 9.5px; display: grid; place-items: center; flex: none; }
.c-updated { font-size: 10px; color: var(--muted-2); text-align: right; line-height: 1.5; }
.order-note { padding: 10px 18px; background: #fcfdfd; border-top: 1px solid var(--line-2); font-size: 11px; color: var(--muted); display: none; }
.order-note.show { display: block; }
.count-note { display: flex; align-items: center; gap: 8px; padding: 10px 2px 0; font-size: 11.5px; color: var(--muted-2); }
.count-note b { color: var(--ink-2); font-weight: 600; }

/* ---------- detail ---------- */
.detail-back { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.detail-back:hover { color: var(--teal); }
.detail-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.detail-title { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.detail-title h1 { font-size: 25px; font-weight: 600; letter-spacing: -.02em; font-family: var(--mono); }
.detail-sub { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.detail-sub .customer { color: var(--ink-2); font-weight: 500; }
.detail-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.detail-progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.detail-progress .bar { width: 220px; height: 6px; border-radius: 6px; background: #e9eff1; overflow: hidden; }
.detail-progress .bar i { display: block; height: 100%; background: linear-gradient(90deg, #35c4b3, #0f9e8e); border-radius: 6px; }
.detail-progress span { font-size: 11.5px; color: var(--muted); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 18px; align-items: start; }
.detail-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.detail-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }

.timeline-panel .panel-body { padding-top: 8px; }
.timeline { position: relative; }
.ms-item { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line-2); position: relative; }
.ms-item:first-child { border-top: 0; }
.ms-rail { width: 26px; flex: none; display: flex; flex-direction: column; align-items: center; position: relative; }
.ms-dot { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #d6e1e4; background: #fff; color: #8ea1a9; display: grid; place-items: center; font-size: 10px; font-weight: 600; z-index: 1; flex: none; }
.ms-item:not(:last-child) .ms-rail::after { content: ""; position: absolute; top: 24px; bottom: -16px; width: 1.5px; background: #e3ebed; }
.ms-item.done .ms-dot { background: #eaf7f2; border-color: #9fd8c3; color: #2c8a60; }
.ms-item.done:not(:last-child) .ms-rail::after { background: #cce9dd; }
.ms-item.doing .ms-dot { background: #fff8e9; border-color: #e5c27a; color: #a9791e; box-shadow: 0 0 0 4px rgba(229, 194, 122, .16); }
.ms-item.current .ms-dot { box-shadow: 0 0 0 4px rgba(15, 158, 142, .13); border-color: #8fd3c7; }
.ms-item.overdue .ms-dot { background: #fdf0ed; border-color: #e7b2a4; color: var(--red); }
.ms-item.skipped .ms-dot { background: #f4f6f7; border-color: #dde5e8; color: #9aa9b0; }
.ms-body { flex: 1; min-width: 0; padding-bottom: 2px; }
.ms-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ms-head h4 { font-size: 13.5px; font-weight: 600; }
.ms-head .seq { font-family: var(--mono); font-size: 10px; color: var(--muted-2); }
.ms-head .pill { height: 19px; font-size: 9.5px; padding: 0 6px; }
.ms-status { margin-left: auto; font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.ms-item.done .ms-status { color: var(--green); }
.ms-item.doing .ms-status { color: var(--amber); }
.ms-item.overdue .ms-status { color: var(--red); }
.ms-guide { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 6px; }
.ms-meta { display: flex; align-items: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted-2); }
.ms-meta .mi { display: flex; align-items: center; gap: 4px; }
.ms-meta .mi b { font-weight: 500; color: var(--ink-2); font-family: var(--mono); font-size: 10.5px; }
.ms-meta .mi.overdue b { color: var(--red); }
.ms-docs { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.ms-docs span { font-size: 9.5px; color: #62767e; background: #f4f8f9; border: 1px solid #e9eff1; border-radius: 5px; padding: 1px 6px; }
.ms-tip { display: flex; gap: 6px; margin-top: 7px; font-size: 10.5px; color: #96702a; background: #fffaf0; border-left: 2px solid #e8c37e; padding: 5px 8px; border-radius: 0 5px 5px 0; line-height: 1.6; }
.ms-tip svg { flex: none; margin-top: 1px; }
.ms-note { margin-top: 7px; font-size: 11px; color: var(--ink-2); background: #f6fafb; border: 1px solid #e8f0f2; border-radius: 7px; padding: 6px 9px; }
.ms-note b { color: var(--muted-2); font-weight: 500; margin-right: 5px; }
.ms-foot { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ms-date-field { display: flex; flex-direction: column; gap: 2px; font-size: 9.5px; color: var(--muted-2); }
.ms-date-field input { height: 28px; border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; font-size: 11px; font-family: var(--mono); color: var(--ink-2); background: #fff; }
.ms-date-field input:focus { outline: none; border-color: #b9dcd6; }
.ms-btns { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.ms-btns .btn { height: 28px; padding: 0 9px; font-size: 10.5px; border-radius: 6px; box-shadow: none; }
.ms-btns .btn svg { width: 12px; height: 12px; }
.ms-item.done { opacity: .86; }
.ms-item.done .ms-guide { color: var(--muted-2); }
.ms-item.done:hover { opacity: 1; }
.ms-note-editor { margin-top: 8px; display: none; }
.ms-note-editor.open { display: block; }
.ms-note-editor textarea { width: 100%; min-height: 64px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; resize: vertical; outline: none; }
.ms-note-editor textarea:focus { border-color: #b9dcd6; }
.ms-note-editor .row { display: flex; gap: 6px; justify-content: flex-end; margin-top: 5px; }

.info-row { display: flex; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--line-2); font-size: 12px; }
.info-row:first-child { border-top: 0; }
.info-row .k { width: 74px; flex: none; color: var(--muted-2); }
.info-row .v { flex: 1; min-width: 0; color: var(--ink-2); word-break: break-word; }
.info-row .v.mono { font-size: 11px; }
.info-section { padding: 2px 0 6px; }
.info-section + .info-section { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 10px; }
.info-section h5 { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); margin: 2px 0 5px; font-weight: 600; }
.info-card .panel-body { padding-top: 4px; }
.info-edit { font-size: 11px; color: var(--teal); margin-left: auto; }

.log-list { display: flex; flex-direction: column; }
.log-item { display: flex; gap: 9px; padding: 9px 0; border-top: 1px dashed var(--line-2); font-size: 11.5px; }
.log-item:first-child { border-top: 0; }
.log-item .ld { width: 6px; height: 6px; border-radius: 50%; background: #c4d2d7; margin-top: 5px; flex: none; }
.log-item .lb { min-width: 0; flex: 1; }
.log-item .la { color: var(--ink-2); }
.log-item .la b { font-weight: 600; }
.log-item .lt { font-size: 10px; color: var(--muted-2); margin-top: 1px; }

/* ---------- tasks page ---------- */
.task-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.tsum { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.tsum .l { font-size: 11px; color: var(--muted); }
.tsum .v { font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tsum.red .v { color: var(--red); }
.tsum.amber .v { color: var(--amber); }
.tsum.blue .v { color: var(--blue); }
.task-groups { display: flex; flex-direction: column; gap: 16px; }
.task-group .tg-head { display: flex; align-items: center; gap: 9px; margin: 0 2px 8px; }
.task-group .tg-head h3 { font-size: 13px; font-weight: 600; }
.task-group .tg-head .n { font-size: 10.5px; color: var(--muted-2); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 0 7px; }
.task-group .tg-head .line { flex: 1; height: 1px; background: var(--line); }
.task-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; margin-bottom: 7px; cursor: pointer; transition: .14s; }
.task-card:hover { border-color: #cfe0e3; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.task-card .tc-bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--line); flex: none; }
.task-card.overdue .tc-bar { background: var(--red); }
.task-card.today .tc-bar { background: #d99a2b; }
.task-card .tc-main { flex: 1; min-width: 0; }
.task-card .tc-1 { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.task-card .tc-1 b { font-size: 13px; }
.task-card .tc-1 .on { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.task-card .tc-2 { display: flex; gap: 9px; align-items: center; margin-top: 3px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.task-card .tc-date { text-align: right; flex: none; font-size: 11px; color: var(--muted); line-height: 1.4; }
.task-card .tc-date b { display: block; font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.task-card .tc-date.o b { color: var(--red); }
.task-card .tc-date.t b { color: var(--amber); }
.task-card .tc-actions { display: flex; gap: 4px; flex: none; }

/* ---------- playbook ---------- */
.playbook-hero { position: relative; overflow: hidden; border-radius: 18px; padding: 30px 32px; background: radial-gradient(700px 300px at 85% -20%, #1b5c66 0%, transparent 60%), linear-gradient(135deg, #0a2230, #0d3342); color: #dcecef; margin-bottom: 18px; }
.playbook-hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 340px; height: 340px; border-radius: 50%; border: 1px solid rgba(84, 220, 201, .13); box-shadow: 0 0 0 60px rgba(84, 220, 201, .035), 0 0 0 130px rgba(84, 220, 201, .025); }
.playbook-hero .kicker { font-size: 10px; letter-spacing: .22em; color: #5fd4c4; text-transform: uppercase; margin-bottom: 9px; }
.playbook-hero h1 { font-size: 27px; font-weight: 600; letter-spacing: -.02em; }
.playbook-hero p { margin-top: 7px; color: #9db8c2; font-size: 13px; max-width: 560px; }
.tpl-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.tpl-tab { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 13px; font-size: 12.5px; color: var(--muted); transition: .15s; }
.tpl-tab:hover { border-color: #c4dadd; color: var(--ink-2); }
.tpl-tab.active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; box-shadow: 0 5px 14px -8px rgba(10, 34, 48, .8); }
.playbook-meta { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.playbook-list { position: relative; }
.pb-step { display: grid; grid-template-columns: 42px 1fr; gap: 14px; padding: 0 0 14px; }
.pb-num { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pb-num .n { width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 1px solid #d9e5e8; color: #6b828b; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 600; z-index: 1; }
.pb-num .line { width: 1px; flex: 1; background: #dfe8ea; }
.pb-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px; box-shadow: var(--shadow-sm); }
.pb-card .top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.pb-card h3 { font-size: 14px; font-weight: 600; }
.pb-card .dday { font-family: var(--mono); font-size: 10px; color: #7b8f97; background: #f4f8f9; border: 1px solid #e9eff1; border-radius: 5px; padding: 1px 6px; }
.pb-card .guide { margin-top: 7px; font-size: 12.5px; color: var(--ink-2); line-height: 1.75; }
.pb-card .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.pb-card .blk { font-size: 11.5px; }
.pb-card .blk h5 { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 4px; font-weight: 600; }
.pb-card .blk .docs { display: flex; gap: 5px; flex-wrap: wrap; }
.pb-card .blk .docs span { background: #f5f9fa; border: 1px solid #e9f0f1; border-radius: 5px; padding: 1px 6px; font-size: 10px; color: #5f757e; }
.pb-card .blk p { color: #96702a; line-height: 1.6; }
.pb-card .blk.risk { background: #fffbf2; border: 1px solid #f6edd9; border-radius: 8px; padding: 8px 10px; }
.pb-card .blk.risk h5 { color: #b08a3e; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.setting-card .panel-body { padding-top: 14px; }
.setting-desc { font-size: 12px; color: var(--muted); line-height: 1.7; margin-bottom: 12px; }
.setting-row { display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap; }
.setting-row .field { flex: 1; min-width: 160px; }
.field-label { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .03em; margin-bottom: 5px; }
.input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 11px; font-size: 13px; outline: none; transition: .15s; }
.input:focus { border-color: #b9dcd6; box-shadow: 0 0 0 3px rgba(15, 158, 142, .09); }
.input::placeholder { color: #a5b3ba; }
textarea.input { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.member-list { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 12px; }
.member-chip { display: inline-flex; align-items: center; gap: 6px; background: #f4f8f9; border: 1px solid #e8eff1; border-radius: 20px; padding: 3px 4px 3px 10px; font-size: 11.5px; color: var(--ink-2); }
.member-chip button { width: 18px; height: 18px; border-radius: 50%; border: 0; background: transparent; color: #9aabb2; display: grid; place-items: center; }
.member-chip button:hover { background: #e6edef; color: var(--red); }
.share-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px dashed var(--line-2); }
.share-row:first-of-type { border-top: 0; }
.share-row .s-label { font-size: 12px; font-weight: 500; }
.share-row .s-url { font-size: 10px; color: var(--muted-2); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.share-row .s-main { min-width: 0; flex: 1; }
.share-row .s-actions { display: flex; gap: 4px; }
.about-list { font-size: 12px; color: var(--muted); line-height: 2; }
.about-list b { color: var(--ink-2); font-weight: 500; }
.danger-zone { border-color: #f0d9d2; }
.danger-zone .panel-title { color: var(--red); }

/* ---------- modal ---------- */
.modal-mask { position: fixed; inset: 0; z-index: 100; background: rgba(7, 24, 33, .46); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-card { width: 100%; max-width: 860px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); animation: modalIn .26s cubic-bezier(.2, .8, .3, 1); margin: auto 0; }
.modal-card.narrow { max-width: 460px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.99); } }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: #fff; border-radius: 18px 18px 0 0; z-index: 2; }
.modal-head h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-close { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--muted); }
.modal-close:hover { background: #f5f8f9; color: var(--ink); }
.modal-body { padding: 20px 24px; max-height: calc(100vh - 240px); overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 15px 24px; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: #fff; border-radius: 0 0 18px 18px; }
.modal-foot .right { margin-left: auto; display: flex; gap: 8px; }
.form-section { margin-bottom: 20px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.form-section-head h4 { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.form-section-head .line { flex: 1; height: 1px; background: var(--line-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 11px 13px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-grid .field { min-width: 0; }
.form-hint { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; }
.form-error { color: var(--red); font-size: 12px; background: var(--red-soft); padding: 9px 12px; border-radius: 8px; margin-top: 12px; }
.radio-row { display: flex; gap: 6px; }
.radio-row label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; height: 36px; font-size: 12px; cursor: pointer; color: var(--muted); }
.radio-row label:has(input:checked) { border-color: #9ed6cd; background: #f2fbf9; color: var(--teal-dark); font-weight: 500; }
.radio-row input { accent-color: var(--teal); }

/* ---------- import ---------- */
.import-wrap { max-width: 980px; }
.dropzone { border: 1.5px dashed #c9dade; border-radius: 16px; background: #fff; padding: 46px 24px; text-align: center; transition: .18s; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--teal); background: #f8fdfc; }
.dropzone .dz-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--teal-soft); color: var(--teal-dark); display: grid; place-items: center; margin: 0 auto 13px; }
.dropzone h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.dropzone p { font-size: 12px; color: var(--muted); }
.dropzone .dz-formats { margin-top: 14px; display: flex; justify-content: center; gap: 6px; }
.dropzone .dz-formats span { font-size: 10px; color: var(--muted-2); background: #f4f8f9; border: 1px solid #e9eff1; border-radius: 5px; padding: 2px 7px; }
.import-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 11.5px; color: var(--muted-2); }
.import-steps .st { display: flex; align-items: center; gap: 6px; }
.import-steps .st i { width: 19px; height: 19px; border-radius: 50%; background: #eef3f4; color: #8fa1a9; display: grid; place-items: center; font-style: normal; font-size: 10px; }
.import-steps .st.active { color: var(--ink); }
.import-steps .st.active i { background: var(--teal); color: #fff; }
.import-steps .st.done i { background: #d8f0e9; color: var(--teal-dark); }
.import-steps .arr { color: #cbd8dc; }
.import-file-bar { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 12px; }
.import-file-bar .finfo { flex: 1; min-width: 0; }
.import-file-bar b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-file-bar span { font-size: 10.5px; color: var(--muted-2); }
.map-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
.map-row { display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 8px; }
.map-row .ml { font-size: 11.5px; color: var(--ink-2); display: flex; align-items: center; gap: 4px; }
.map-row .ml .req { color: var(--red); }
.map-row select { height: 32px; font-size: 11.5px; padding: 0 26px 0 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink-2); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2371838d' stroke-width='1.8'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
.map-row select:focus { outline: none; border-color: #b9dcd6; }
.import-options { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.preview-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 14px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 11px; white-space: nowrap; }
.preview-table th { background: #f8fafb; text-align: left; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.preview-table td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
.preview-table tr:last-child td { border-bottom: 0; }
.import-result { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; text-align: center; }
.import-result .ok-icon { width: 58px; height: 58px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 14px; }
.result-stats { display: flex; justify-content: center; gap: 26px; margin: 18px 0; }
.result-stats div { text-align: center; }
.result-stats b { display: block; font-size: 24px; font-weight: 600; }
.result-stats span { font-size: 11px; color: var(--muted); }
.result-errors { text-align: left; background: #fff8f6; border: 1px solid #f5e0da; border-radius: 10px; padding: 10px 14px; margin-top: 12px; font-size: 11px; color: #a15440; max-height: 160px; overflow: auto; }

/* ---------- toast / misc ---------- */
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 8px; background: #102c3a; color: #eaf6f7; font-size: 12.5px; border-radius: 10px; padding: 10px 14px; box-shadow: 0 14px 34px -12px rgba(8, 27, 36, .6); animation: toastIn .26s ease; max-width: 340px; }
.toast.error { background: #7d2f20; }
.toast.ok { background: #0d4b40; }
.toast svg { flex: none; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }

.skeleton { background: linear-gradient(90deg, #eff4f5 25%, #f7fafa 50%, #eff4f5 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-page { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.loading-page .sk-row { height: 74px; border-radius: 12px; }
.loading-page .sk-head { height: 34px; width: 240px; }

.mobile-nav { display: none; }
.mobile-search { display: none; }
.fab { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .order-head, .order-row { grid-template-columns: minmax(130px, 1.1fr) minmax(130px, 1.1fr) minmax(110px, .9fr) 104px minmax(150px, 1.15fr) 80px 60px; }
  .c-updated { display: none; }
  .detail-grid { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1020px) {
  .app { grid-template-columns: 210px minmax(0, 1fr); }
  .topbar-new { display: none; }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .view { padding: 22px 20px 64px; }
  .topbar { padding: 0 20px; }
  .dash-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; order: -1; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .app { display: block; }
  .sidebar { display: none; }
  .topbar { height: 58px; padding: 0 16px; gap: 10px; }
  .topbar-title { font-size: 15px; min-width: 0; }
  .searchbox { max-width: none; }
  .searchbox kbd { display: none; }
  .sync { display: none; }
  .user-chip > span:last-child { display: none; }
  .user-chip .avatar { display: grid; }
  .user-chip { padding: 3px; border: 0; }
  .user-chip .avatar { width: 30px; height: 30px; }
  .view { padding: 18px 16px 92px; }
  .page-head { margin-bottom: 18px; }
  .page-title { font-size: 23px; }
  .page-head .actions { width: 100%; margin-left: 0; }
  .page-head .actions .btn-primary { flex: 1; }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(255, 255, 255, .95); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0; font-size: 9.5px; color: var(--muted-2); border-radius: 9px; }
  .mobile-nav a svg { opacity: .8; }
  .mobile-nav a.active { color: var(--teal-dark); background: #f0faf8; }
  .mobile-nav a.active svg { opacity: 1; }
  .order-head { display: none; }
  .order-table { background: transparent; border: 0; box-shadow: none; }
  .order-row {
    grid-template-columns: 1fr auto; grid-template-areas: "order progress" "customer customer" "route route" "next next" "dates owner";
    gap: 5px 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 9px; background: #fff; min-height: 0;
  }
  .c-order { grid-area: order; }
  .c-customer { grid-area: customer; }
  .c-route { grid-area: route; }
  .c-dates { grid-area: dates; display: flex; gap: 12px; }
  .c-next { grid-area: next; margin-top: 4px; }
  .c-progress { grid-area: progress; width: 92px; }
  .c-owner { grid-area: owner; justify-content: flex-end; }
  .task-item { flex-wrap: wrap; }
  .task-actions { margin-left: auto; }
  .task-line2 .cust { max-width: 180px; }
  .kpi-grid { gap: 10px; margin-bottom: 16px; }
  .kpi { padding: 13px 14px; }
  .kpi-val { font-size: 25px; }
  .detail-head { margin-bottom: 14px; }
  .detail-actions { width: 100%; margin-left: 0; }
  .detail-actions .btn { flex: 1; }
  .detail-title h1 { font-size: 20px; }
  .detail-progress .bar { width: 150px; }
  .modal-mask { padding: 0; }
  .modal-card { border-radius: 0; min-height: 100vh; margin: 0; }
  .modal-head, .modal-foot { border-radius: 0; }
  .modal-body { max-height: none; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-3 { grid-column: span 2; }
  .form-grid .span-2 { grid-column: span 2; }
  .map-grid { grid-template-columns: 1fr; }
  .playbook-hero { padding: 24px 20px; }
  .playbook-hero h1 { font-size: 22px; }
  .pb-card .cols { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { min-height: 100vh; padding: 26px; }
  .task-summary { grid-template-columns: 1fr 1fr; }
  .detail-side { order: -1; }
}
@media (max-width: 560px) {
  .searchbox { display: none; }
  .mobile-search { display: grid; }
  .topbar-title { font-size: 16px; }
  .page-head .actions .icon-btn { display: none; }
  .task-item { flex-wrap: wrap; align-items: flex-start; }
  .task-main { flex: 1 1 calc(100% - 18px); }
  .task-date { text-align: left; padding-left: 17px; margin-top: 3px; flex: 1; }
  .task-date br { display: none; }
  .task-actions { margin-top: 2px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-top { font-size: 11px; }
  .kpi-top .kico { display: none; }
  .page-title { font-size: 21px; }
  .page-head .eyebrow { font-size: 9.5px; }
  .filter-bar { padding: 10px; gap: 8px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
  .filter-search { grid-column: 1 / -1; min-width: 0; }
  .filter-bar .seg { grid-column: 1 / -1; display: flex; }
  .filter-bar .seg button { flex: 1; white-space: nowrap; }
  .filter-bar .select { width: 100%; min-width: 0; }
  .filter-bar .toggle { justify-content: center; }
  .filter-bar .icon-btn { justify-self: end; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2, .form-grid .span-3 { grid-column: span 1; }
  .task-actions .btn-done span { display: none; }
  .task-card { flex-wrap: wrap; padding: 12px 13px; }
  .task-card .tc-date { text-align: left; }
  .task-card .tc-actions { margin-left: auto; }
  .detail-side { display: flex; }
  .ms-foot { gap: 5px; }
  .ms-btns { margin-left: 0; width: 100%; justify-content: flex-end; }
  .ms-date-field { flex: 1; }
  .ms-date-field input { width: 100%; }
  .playbook-hero h1 { font-size: 20px; }
  .result-stats { gap: 16px; }
  .toast-root { left: 14px; right: 14px; bottom: 80px; align-items: stretch; }
  .toast { max-width: none; }
  .sailing-item .pill { display: none; }
  .detail-progress { flex-wrap: wrap; }
  .modal-body { padding: 16px; }
  .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
}

@media print {
  .sidebar, .topbar, .mobile-nav, .detail-actions, .ms-btns, .ms-foot, .detail-back, .toast-root, .readonly-banner { display: none !important; }
  .app { display: block; }
  .view { padding: 0; max-width: none; }
  .detail-grid { display: block; }
  .detail-side { margin-top: 16px; }
  .panel { break-inside: avoid; }
  body { background: #fff; }
}

/* ---------- 作业计划 ---------- */
.plan-panel { border-color: #d9ebe7; }
.plan-panel .panel-head { flex-wrap: wrap; }
.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 4px; }
.plan-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; background: #fbfdfd; min-width: 0; }
.plan-item .pi-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-item .pi-date { font-size: 16px; font-weight: 600; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.plan-item .pi-rel { font-size: 10px; color: var(--muted-2); margin-top: 1px; }
.plan-item .pi-note { font-size: 10px; color: var(--muted-2); line-height: 1.45; margin-top: 4px; }
.plan-item.critical { background: #fff9f7; border-color: #f2d8d0; }
.plan-item.critical .pi-date { color: var(--red); }
.plan-item.warn { background: #fffcf4; border-color: #f1e3c5; }
.plan-item.warn .pi-date { color: var(--amber); }
.plan-item.late .pi-date { text-decoration: line-through; opacity: .75; }
.plan-item.late .pi-rel { color: var(--red); }
.plan-warnings { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.plan-warning { display: flex; gap: 6px; align-items: flex-start; font-size: 11px; line-height: 1.55; padding: 7px 9px; border-radius: 7px; background: #fffaf0; color: #8a6a28; border: 1px solid #f3e6c9; }
.plan-warning svg { flex: none; margin-top: 1px; }
.plan-warning.error { background: #fff7f5; color: #a24a35; border-color: #f1d6ce; }
.plan-foot { font-size: 10px; color: var(--muted-2); margin-top: 10px; line-height: 1.6; }
@media (max-width: 1180px) { .plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .plan-item .pi-date { font-size: 14px; } }
@media (max-width: 560px) {
  .detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
  .detail-actions .btn { width: 100%; }
}
.plan-panel .panel-head .panel-link { margin-left: 0; }
.plan-panel .panel-head .panel-link:first-of-type { margin-left: auto; }
.plan-panel .panel-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--muted); }
.plan-panel .panel-link:hover { color: var(--teal); }
.ms-owner-field select { height: 28px; border: 1px solid var(--line); border-radius: 6px; padding: 0 22px 0 7px; font-size: 11px; color: var(--ink-2); background: #fff; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='none' stroke='%2371838d' stroke-width='1.8'%3E%3Cpath d='M2 3.5 5 6.5 8 3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 7px center; max-width: 110px; }
.ms-owner-field select:focus { outline: none; border-color: #b9dcd6; }
.quick-entry { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; margin-bottom: 16px; border: 1px solid #d9ebe7; background: #f6fcfa; border-radius: 10px; }
.quick-entry .toggle { border: 0; padding: 0; background: transparent; font-weight: 500; color: var(--teal-dark); }
.form-quick [data-advanced] { display: none !important; }
.fee-totals { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: #f7fbfa; border: 1px solid #e3efec; border-radius: 8px; margin-bottom: 8px; }
.fee-total { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); }
.fee-total b { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-right: 5px; }
.fee-total b.pos { color: var(--green); }
.fee-total b.neg { color: var(--red); }
.fee-list { display: flex; flex-direction: column; }
.fee-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--line-2); }
.fee-item:first-child { border-top: 0; }
.fee-main { min-width: 0; flex: 1; }
.fee-title { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.fee-title b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fee-sub { font-size: 9.5px; color: var(--muted-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fee-amount { font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fee-actions { display: flex; gap: 0; }
.fee-actions .icon-btn { width: 24px; height: 24px; }
