/* 系统字体，避免每次打开工作台去拉 Google Fonts */

:root {
  --ink: #1a2332;
  --navy: #1e3a5f;
  --gold: #c9a227;
  --gold-d: #9a7a12;
  --teal: #0e7c66;
  --rose: #c45c4a;
  --paper: #f4efe4;
  --card: #fffdf8;
  --line: #d9d0c0;
  --muted: #6d7a86;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html, body {
  scrollbar-width: thin;
  scrollbar-color: #c4b89a var(--paper);
}
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 8px; height: 8px; }
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track { background: var(--paper); }
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb {
  background: #c9bea4;
  border-radius: 99px;
}
html::-webkit-scrollbar-thumb:hover, body::-webkit-scrollbar-thumb:hover { background: #b5a888; }
html::-webkit-scrollbar-button, body::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
html::-webkit-scrollbar-corner, body::-webkit-scrollbar-corner { background: transparent; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

#app.is-app { display: grid; grid-template-columns: 220px 1fr; min-height: 100%; }
#app.is-login { height: 100%; overflow: hidden; background: #0d1c2c; }

.login-page {
  position: relative;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: #0d1c2c;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.login-page__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 360px at 20% 20%, rgba(201, 162, 39, 0.22), transparent 60%),
    linear-gradient(115deg, rgba(8, 18, 28, 0.9) 0%, rgba(16, 36, 56, 0.74) 45%, rgba(10, 22, 34, 0.58) 100%);
}
.login-page__bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  padding: 10px 18px 0;
}
.login-page .lang-switch {
  margin-left: 0;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
.login-page .lang-switch button {
  background: transparent;
  color: var(--navy);
  font-weight: 700;
  min-width: 2.4rem;
  padding: .28rem .55rem;
  font-size: .75rem;
}
.login-page .lang-switch button.on { background: var(--gold); color: #1a1204; }
.login-page > .brand-copy,
.login-page > .login-copy { flex-shrink: 0; position: relative; z-index: 2; }
.login-copy {
  margin: 0;
  padding: .2rem 1rem 0;
  text-align: center;
  font-size: .72rem;
  color: rgba(255,255,255,.55);
}
.login-page__shell {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
  padding: 8px 18px 14px;
  flex-wrap: nowrap;
}
.login-card {
  width: min(360px, 34vw);
  flex-shrink: 0;
  background: rgba(255, 253, 248, 0.98);
  border-radius: 16px;
  padding: 16px 18px 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-card .brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.login-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(145deg, #16324f, #0d1c2c);
  display: grid; place-items: center; flex-shrink: 0;
}
.login-mark img { width: 24px; height: auto; }
.login-card .brand-row h1 { margin: 0; font-size: 1.05rem; font-weight: 800; color: #111; line-height: 1.25; }
.login-card .tagline { margin: 2px 0 0; font-size: .78rem; color: #666; }
.login-card .flow-line { margin: 0 0 8px; font-size: .8rem; color: #0e7c66; font-weight: 600; }
.login-card .role-pill {
  display: inline-flex; align-self: flex-start; margin-bottom: 10px; padding: 3px 10px; border-radius: 999px;
  background: rgba(201, 162, 39, 0.16); color: #9a7a12; font-size: .75rem; font-weight: 700;
}
.login-form { display: flex; flex-direction: column; }
.login-form label { display: block; margin: 0 0 8px; font-size: .75rem; font-weight: 600; color: #334155; }
.login-form input {
  display: block; width: 100%; margin-top: 4px; height: 36px; padding: 0 .7rem;
  border: 1px solid #d9d0c0; border-radius: 8px; background: #fff; font: inherit; color: var(--ink);
}
.login-form input[readonly] { background: #f7f1e6; color: #5b6570; }
.login-form input:focus { outline: 2px solid rgba(201, 162, 39, 0.45); border-color: var(--gold); }
.login-err { margin: 0 0 8px; padding: 6px 8px; border-radius: 8px; background: #fde8e4; color: #c45c4a; font-size: .78rem; }
.login-card .submit-btn {
  width: 100%; height: 38px; margin-top: 2px; background: var(--gold); color: #1a1204;
  font-weight: 800; border-radius: 8px; border: 0; cursor: pointer; font: inherit;
}
.login-card .submit-btn:hover { filter: brightness(.95); }
.login-card .submit-btn:disabled { opacity: .7; cursor: wait; }
.login-card .links {
  margin-top: 10px; display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; flex-wrap: wrap;
}
.login-card .links a { color: #0e7c66; text-decoration: none; font-weight: 600; }
.role-panel {
  width: min(760px, 58vw);
  flex: 1 1 auto;
  max-width: 780px;
  background: rgba(10, 22, 34, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px 14px 12px;
  color: #fff;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.role-panel__top { margin-bottom: 8px; }
.role-panel h2 { margin: 0; font-size: 1rem; }
.role-hint { margin: 4px 0 0; color: rgba(255,255,255,.68); font-size: .78rem; line-height: 1.4; }
.role-sec { margin-bottom: 8px; }
.role-sec:last-of-type { margin-bottom: 6px; }
.role-sec__h {
  display: flex; align-items: center; gap: .4rem;
  margin: 0 0 6px; font-size: .74rem; font-weight: 700; color: #f0c36a; letter-spacing: .04em;
}
.role-sec__h em {
  font-style: normal; font-size: .64rem; color: #fff;
  background: #1e3a5f; border-radius: 5px; padding: .08rem .34rem;
}
.role-sec__h--cn em { background: #1e3a5f; }
.role-sec__h--fac em { background: #8a5a12; }
.role-sec__h--br em { background: #0e7c66; }
.role-grid { display: grid; gap: 8px; }
.role-grid--hq { grid-template-columns: repeat(3, 1fr); }
.role-grid--cn { grid-template-columns: repeat(4, 1fr); }
.role-grid--fac { grid-template-columns: 1fr; max-width: 25%; }
.role-grid--br { grid-template-columns: repeat(2, 1fr); max-width: 50%; }
.role-card {
  text-align: left; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06); border-radius: 10px;
  padding: 8px 10px; color: #fff; cursor: pointer; font: inherit; transition: .15s ease;
}
.role-card:hover { border-color: rgba(201,162,39,.7); background: rgba(201,162,39,.12); }
.role-card.on { border-color: #c9a227; background: rgba(201,162,39,.18); box-shadow: 0 0 0 1px rgba(201,162,39,.35); }
.role-card:disabled { opacity: .7; cursor: wait; }
.role-card__title { font-weight: 800; font-size: .86rem; margin-bottom: 2px; }
.role-card__user { font-size: .72rem; color: #f0c36a; font-family: ui-monospace, Consolas, monospace; }
.role-card__desc { display: none; }
.h5-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.h5-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 0; padding: 8px 12px; border-radius: 10px;
  text-decoration: none; color: #fff;
  background: linear-gradient(135deg, rgba(201,162,39,.32), rgba(14,124,102,.2));
  border: 1px solid rgba(201,162,39,.4);
}
.h5-banner strong { font-size: .82rem; }
.h5-banner span { font-size: .72rem; color: rgba(255,255,255,.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.login { max-width: 980px; margin: 0 auto; padding: 3rem 1.2rem 4rem; color: #e8eef3; }
.login-brand { display: flex; gap: .8rem; align-items: center; margin-bottom: 1.2rem; flex-wrap: wrap; }
.lang-switch { margin-left: auto; display: inline-flex; border: 1px solid #2a3b4d; border-radius: 8px; overflow: hidden; }
.lang-switch button {
  background: #1c2836; color: #8aa0b3; border: 0; padding: .35rem .75rem;
  cursor: pointer; font: inherit; font-size: .82rem;
}
.lang-switch button.on { background: var(--gold); color: #1a1204; font-weight: 700; }
.lang-switch.compact { border-color: var(--line); }
.lang-switch.compact button { background: #f4efe4; color: var(--muted); padding: .22rem .5rem; font-size: .75rem; }
.lang-switch.compact button.on { background: var(--navy); color: #fff; }
.login-brand i, .logo i {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #e8c45a, #c9a227);
  display: inline-block;
}
.login-brand b, .logo b { display: block; color: var(--gold); }
.login-brand small, .logo small { color: #8aa0b3; font-size: .75rem; }
.login h1 { margin: .2rem 0; font-size: 1.8rem; }
.roles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-top: 1.2rem; }
.role {
  text-align: left; background: #1c2836; color: #e8eef3; border: 1px solid #2a3b4d;
  border-radius: 12px; padding: .85rem .9rem; cursor: pointer; font: inherit;
}
.role:hover { border-color: var(--gold); }
.role b { display: block; }
.role em { display: block; color: var(--gold); font-style: normal; font-size: .78rem; margin: .2rem 0; }
.role span { color: #8aa0b3; font-size: .78rem; }

.side {
  background: linear-gradient(180deg, #121a24, #1a2a3a);
  color: #e8eef3; padding: .75rem .55rem 1rem;
  position: sticky; top: 0; height: 100vh;
  overflow-x: hidden; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,162,39,.42) transparent;
  display: flex; flex-direction: column;
}
.logo { display: flex; gap: .5rem; align-items: center; color: inherit; text-decoration: none; padding: .2rem .35rem .65rem; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: .4rem; flex-shrink: 0; min-width: 0; }
.logo div { min-width: 0; }
.logo b { font-size: .92rem; line-height: 1.3; white-space: nowrap; }
.logo small {
  display: block; margin-top: .12rem; font-size: .66rem; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side::-webkit-scrollbar { width: 5px; }
.side::-webkit-scrollbar-track { background: transparent; }
.side::-webkit-scrollbar-thumb {
  background: rgba(201,162,39,.38);
  border-radius: 99px;
}
.side::-webkit-scrollbar-thumb:hover { background: rgba(201,162,39,.62); }
.side::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.side::-webkit-scrollbar-corner { background: transparent; }
.side-nav { display: flex; flex-direction: column; gap: 1px; flex: 0 0 auto; }
.side-extra {
  margin-top: .45rem; padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px;
  flex-shrink: 0;
}
.side-extra a {
  display: block; text-align: center; color: #c5d2dc; text-decoration: none;
  font-size: .72rem; line-height: 1.3; padding: .38rem .15rem;
  border-radius: 6px; background: rgba(255,255,255,.04);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-extra a:hover { background: rgba(201,162,39,.14); color: #fff; }
.std-pager {
  display: flex; align-items: center; justify-content: flex-end; gap: .4rem;
  padding: .65rem .2rem .2rem; flex-wrap: wrap;
}
.std-pager__n { font-size: .8rem; color: var(--muted); }
.std-pager .std-page[disabled] { opacity: .4; cursor: default; }
input[type="date"].std-date { min-height: 36px; }
.std-region {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem;
}
.std-region label { margin: 0; }
.nav-g { border-radius: 8px; flex-shrink: 0; }
.nav-h, .nav-k a {
  display: flex; align-items: center; gap: .35rem; color: #c5d2dc; text-decoration: none;
  padding: .38rem .45rem; border-radius: 8px; font-size: .82rem; line-height: 1.35;
  white-space: nowrap; overflow: hidden; min-height: 1.9rem;
}
button.nav-h {
  width: 100%; display: flex; background: transparent; color: inherit; border: 0;
  text-align: left; font: inherit; cursor: pointer; padding: .38rem .45rem;
}
.nav-h i { width: 1.25rem; color: var(--gold); font-style: normal; font-size: .72rem; flex-shrink: 0; }
.nav-h .chev {
  margin-left: auto; width: auto; color: #8aa0b3; font-size: .7rem;
  transition: transform .16s ease; flex-shrink: 0;
}
.nav-g.open > .nav-h .chev { transform: rotate(90deg); color: var(--gold); }
.nav-g.current > .nav-h { color: #fff; }
.nav-h.on, .nav-k a.on { background: rgba(201,162,39,.18); color: #fff; }
.nav-h:hover, .nav-k a:hover { background: rgba(201,162,39,.12); color: #fff; }
.nav-k {
  max-height: 0; overflow: hidden; padding: 0;
  transition: max-height .18s ease;
}
.nav-g.open > .nav-k { max-height: 18rem; padding-bottom: .1rem; }
.nav-k a {
  padding-left: 1.85rem; font-size: .78rem; position: relative;
}
.nav-k a::before {
  content: ""; position: absolute; left: 1.05rem; top: 50%;
  width: 4px; height: 4px; border-radius: 50%; background: #5d7384;
  transform: translateY(-50%);
}
.nav-k a.on::before { background: var(--gold); }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.main > .body { flex: 1; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem 1.4rem; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.crumb { font-weight: 700; }
.top-r { display: flex; gap: .6rem; align-items: center; }
.who { font-size: .85rem; }
.who em { display: block; color: var(--muted); font-style: normal; font-size: .72rem; }
.body { padding: 1.2rem 1.4rem 3rem; }

button, .ghost, .primary { font: inherit; border: 0; cursor: pointer; border-radius: 8px; padding: .45rem .85rem; text-decoration: none; display: inline-block; }
button.nav-h { display: flex; padding: .38rem .45rem; }
.primary { background: var(--gold); color: #1a1204; font-weight: 700; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.toolbar { display: flex; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.toolbar select, .toolbar input[type="date"] { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 .5rem; font: inherit; }
.miss { color: #b45309; font-size: .86rem; }
.warn-box { color: #8a5a00; background: #fff6e5; border: 1px solid #f0d9a6; border-radius: 8px; padding: .5rem .7rem; }
.toolbar input, .editor input, .editor select, .editor textarea {
  font: inherit; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%;
}
.editor select.lookup {
  cursor: pointer; background: #fffdf4; border-color: #c9b48a;
}
.editor select.lookup:focus {
  outline: 2px solid rgba(201,162,39,.4); outline-offset: 1px;
}
.editor input.is-ro { background: #f4efe4; color: var(--muted); }
table tr.warn td { color: var(--rose); }
.lines select.lookup { min-width: 10rem; }
.rel-a { color: var(--navy); text-decoration: none; border-bottom: 1px dashed var(--line); }
.rel-a:hover { color: var(--gold-d); }
.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; margin-right: 6px; vertical-align: middle; cursor: zoom-in; background: #eee; }
.thumb-ph { display: inline-block; width: 40px; height: 40px; border-radius: 4px; background: #eee; color: #999; font-size: .65rem; text-align: center; line-height: 40px; margin-right: 6px; vertical-align: middle; }
.funnel-step { display: flex; justify-content: space-between; gap: .6rem; align-items: center; }
.funnel-step .rate { font-size: .78rem; color: var(--muted); }
.funnel-step .rate.low { color: #a33b2b; font-weight: 700; }
.miss-late { color: #a33b2b; font-weight: 600; }
.lb { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; z-index: 80; }
.lb img { max-width: 90vw; max-height: 86vh; border-radius: 8px; }
.ship-sub td { background: #faf7f0; font-size: .82rem; color: var(--muted); }
.rel-panel {
  background: #fbf7ef; border: 1px solid var(--line); border-radius: 10px;
  padding: .85rem 1rem; margin-top: .2rem;
}
.rel-panel header h4 { margin: 0 0 .55rem; font-size: .95rem; }
.rel-spawn { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .55rem; }
.rel-blocked { display: flex; flex-wrap: wrap; gap: .4rem; margin: .35rem 0; }
.spawn-block { opacity: .72; border-style: dashed; color: #8a5a00; }
.sop-miss { margin: .2rem 0 .4rem; padding-left: 1.1rem; color: #8a5a00; font-size: .82rem; }
.sop-track { background: #fbf7ef; border: 1px solid var(--line); border-radius: 10px; padding: .75rem 1rem; }
.sop-track header h4 { margin: 0 0 .45rem; font-size: .95rem; }
.sop-steps { display: flex; flex-wrap: wrap; gap: .35rem; }
.sop-step { padding: .22rem .55rem; border-radius: 999px; font-size: .78rem; background: #f4efe4; color: #1e3a5f; }
.sop-step.done { background: #e8f3ec; color: #1b5e3b; }
.sop-step.now { background: #1e3a5f; color: #f4efe4; }
.rel-jumps { margin: .2rem 0 .5rem; font-size: .86rem; }
.rel-jumps a { color: var(--navy); }
.rel-kids { list-style: none; margin: 0; padding: 0; }
.rel-kids li { padding: .28rem 0; border-bottom: 1px dashed var(--line); }
.rel-kids a { color: var(--navy); text-decoration: none; }
.toolbar input { max-width: 280px; }
.nav-sec {
  margin: .5rem .4rem .12rem;
  color: var(--gold);
  font-size: .64rem;
  letter-spacing: .08em;
  line-height: 1.35;
  white-space: nowrap;
}
.welcome { margin-bottom: .8rem; }
.welcome b { color: var(--gold-d); }
.welcome p { margin: .2rem 0 0; color: var(--muted); }
.welcome a { color: var(--teal); }
.zone {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .85rem 1rem 1rem;
  margin-bottom: .8rem;
}
.zone-br { background: #f6fbf8; border-color: #c9d9cf; }
.zone-fac { background: #fbf7ee; border-color: #e4d4a8; }
.zone-h { display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; margin-bottom: .65rem; }
.zone-h em {
  font-style: normal; font-size: .72rem; font-weight: 700;
  color: #fff; background: var(--navy); border-radius: 6px; padding: .12rem .42rem;
}
.zone-br .zone-h em { background: var(--teal); }
.zone-fac .zone-h em { background: #8a5a12; }
.zone-h h3 { margin: 0; font-size: 1rem; }
.zone-h p { margin: 0; color: var(--muted); font-size: .82rem; }
.zone .story { margin-bottom: .7rem; }
.zone .kpis { margin-bottom: 0; }
.story { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: .45rem; margin-bottom: 1rem; }
.story a { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .6rem; }
.story em { color: var(--gold-d); font-style: normal; font-size: .72rem; }
.story span { display: block; font-weight: 700; font-size: .85rem; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-bottom: 1rem; }
.kpis.kpi3 { grid-template-columns: repeat(3, 1fr); }
.kpis.kpi4 { grid-template-columns: repeat(4, 1fr); }
.kpis.kpi6 { grid-template-columns: repeat(6, 1fr); }
.zone-cash { border-color: #d8c48a; }
.bar-row { display: grid; grid-template-columns: 7.2rem 1fr 5.4rem; gap: .4rem; align-items: center; }
.bar-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row i { display: block; height: 8px; background: linear-gradient(90deg, #c9a227, #e8c45a); border-radius: 99px; min-width: 4px; }
.bar-row em { text-align: right; font-style: normal; color: var(--teal); font-size: .82rem; }
.kpis article { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; box-shadow: 0 8px 24px rgba(16,32,51,.04); }
.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 .85rem; }
.period-bar button.on { background: var(--gold); color: #1a1204; border-color: var(--gold); font-weight: 700; }
.period-bar em { font-style: normal; color: var(--muted); font-size: .78rem; margin-left: .3rem; }
.kpis article small { display: block; color: var(--muted); font-size: .7rem; margin-top: .2rem; font-weight: 400; }
.slice-chip { font-size: .78rem; color: #8a5a00; background: #fff6e5; border: 1px solid #f0d9a6; border-radius: 8px; padding: .25rem .55rem; }
.slice-chip a { color: var(--navy); }
.kpi-a { text-decoration: none; color: inherit; display: block; }
.kpi-a article { height: 100%; transition: border-color .15s; }
.kpi-a:hover article { border-color: var(--gold); }
.bar-row > a { display: contents; color: inherit; text-decoration: none; }
.bar-row > a:hover span { color: var(--gold-d); }
.lane a { color: var(--navy); text-decoration: none; }
.lane a:hover { color: var(--gold-d); }
.toolbar .mine { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.toolbar .mine input { width: auto; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--gold-d); }
.form-sec { margin: 0; }
.form-sec h4 { margin: 0 0 .55rem; font-size: .86rem; color: var(--gold-d); letter-spacing: .04em; }
.form-sec__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.form-sec__grid .span2, .form-sec__grid .std-region { grid-column: 1 / -1; }
.lookup-wrap { display: flex; flex-direction: column; gap: .28rem; }
.lookup-q { font: inherit; padding: .35rem .55rem; border: 1px dashed var(--line); border-radius: 6px; background: #fffdf8; }
i.req { color: #c45c4a; font-style: normal; margin-left: .15rem; }
.signoff .rej { color: #a33b2b; display: block; width: 100%; margin-top: .2rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .8rem; }
.mini { width: 100%; border-collapse: collapse; font-size: .84rem; }
.mini td { padding: .28rem 0; border-bottom: 1px dashed var(--line); }
.kpis span { color: var(--muted); font-size: .8rem; }
.kpis strong { display: block; font-size: 1.35rem; margin-top: .25rem; }
.kpis .gold strong { color: var(--gold-d); }
.kpis .teal strong { color: var(--teal); }
.kpis .rose strong { color: var(--rose); }
.kpis .navy strong { color: var(--navy); }
.grid2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: .8rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.15rem; }
.panel h3 { margin: 0 0 .7rem; font-size: 1rem; }
.lane { list-style: none; margin: 0; padding: 0; }
.lane li { padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.lane em { color: var(--teal); font-style: normal; }
.muted { color: var(--muted); font-size: .85rem; }
.table-wrap { overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.table-wrap {
  scrollbar-width: thin;
  scrollbar-color: #c9bea4 transparent;
}
.table-wrap::-webkit-scrollbar { width: 7px; height: 7px; }
.table-wrap::-webkit-scrollbar-thumb {
  background: #c9bea4;
  border-radius: 99px;
}
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: .55rem .65rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f7f1e6; font-weight: 600; white-space: nowrap; }
.st { font-size: .72rem; padding: .1rem .4rem; border-radius: 99px; background: #eee; }
.st.approved, .st.active, .st.paid, .st.confirmed, .st.settled, .st.won, .st.done, .st.ok { background: #d8f3ec; color: #0d6b58; }
.st.fail { background: #fde8e4; color: #a33b2b; }
.st.low { background: #d8f3ec; color: #0d6b58; }
.st.mid { background: #fde7c4; color: #8a5a00; }
.st.high { background: #fde8e4; color: #a33b2b; }
.mgmt-verdict { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .85rem 1.1rem; margin: 0 0 1rem; }
.mgmt-verdict b { display: block; margin-bottom: .35rem; }
.mgmt-verdict p { margin: 0; color: var(--ink); line-height: 1.5; }
.conn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1rem; }
.integ-wrap { margin-bottom: 1.1rem; }
.integ-group { margin: 0 0 .85rem; }
.integ-group h4 { margin: 0 0 .45rem; font-size: .82rem; color: var(--muted); font-weight: 600; }
.integ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .55rem; }
.integ-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .65rem .75rem; }
.integ-card.on { border-top: 3px solid var(--teal); }
.integ-card.off { opacity: .72; }
.integ-card header { display: flex; justify-content: space-between; gap: .4rem; align-items: baseline; }
.integ-card header em { font-style: normal; font-size: .7rem; color: var(--muted); }
.integ-card p { margin: .3rem 0 .45rem; }
.integ-card .acts { display: flex; gap: .4rem; flex-wrap: wrap; }
.conn-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .85rem 1rem; }
.conn-card .acts { display: flex; gap: .5rem; margin-top: .6rem; }
.conn-maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.conn-job { cursor: pointer; }
.conn-json { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.conn-json pre { margin: .4rem 0 0; padding: .6rem; background: #f6f3ea; border-radius: 8px; font-size: .72rem; overflow: auto; max-height: 240px; white-space: pre-wrap; }
.st.pending, .st.placed, .st.production { background: #fde7c4; color: #8a5a00; }
.st.shipped, .st.delivered, .st.in_transit, .st.cleared { background: #d7e8f8; color: #1e3a5f; }
.st.stored { background: #d8f3ec; color: #0d6b58; }
.st.draft, .st.expired { background: #ececec; }
.st.rejected { background: #fde8e4; color: #a33b2b; }
.ops button { margin-right: .2rem; padding: .15rem .4rem; }
.editor { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.editor label { display: block; font-size: .8rem; color: var(--muted); }
.editor .field-hint { display: block; margin-top: .2rem; font-size: .72rem; color: #8a7a5a; line-height: 1.35; }
.editor .form-lead { background: #f3efe3; border: 1px solid #e2d8c2; border-radius: 8px; padding: .55rem .75rem; color: #4a5560; font-size: .82rem; line-height: 1.45; }
.editor-act { grid-column: 1 / -1; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.signoff { display: flex; flex-wrap: wrap; gap: .45rem .6rem; align-items: center; padding: .55rem .7rem; background: #f7f2e8; border: 1px dashed var(--line); border-radius: 8px; font-size: .86rem; }
.signoff strong { margin-right: .2rem; }
.signoff i { color: var(--muted); font-style: normal; }
.signoff em { color: var(--muted); font-style: normal; margin-left: .4rem; }
.signoff .ok { color: #2a7a4b; }
.signoff .now { color: #b45309; font-weight: 600; }
.signoff .wait { color: var(--muted); }
.editor .span2 { grid-column: 1 / -1; }
.crm360 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding: .85rem; border: 1px solid var(--line); border-radius: 10px; background: #fbf7ef; }
.alerts .danger { color: #c45c4a; }
.alerts .warn { color: #8a5a00; }
.radar-lead { margin-bottom: .85rem; }
.zone .grid3 { margin: 0; }
.zone .grid3 .panel { background: #fff; }
.radar-kpis article { border-top: 3px solid var(--line); }
.radar-kpis article.rose { border-top-color: var(--rose); }
.radar-kpis article.gold { border-top-color: var(--gold); }
.radar-kpis article.teal { border-top-color: var(--teal); }
.radar-kpis article.navy { border-top-color: var(--navy); }
.risk-meter { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 .9rem; }
.risk-chip {
  display: inline-flex; align-items: baseline; gap: .35rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: .28rem .7rem; text-decoration: none; color: inherit; font-size: .8rem;
}
.risk-chip strong { font-size: 1.05rem; }
.risk-chip.danger { background: #fdecea; border-color: #f0c4bc; color: #a33b2b; }
.risk-chip.warn { background: #fff6e5; border-color: #f0d9a6; color: #8a5a00; }
.risk-chip.info { background: #eef4f8; border-color: #c5d2dc; color: #1e3a5f; }
.risk-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; margin-top: .2rem; }
.risk-col {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: .85rem .9rem 1rem; min-height: 12rem;
}
.risk-col header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .65rem; }
.risk-col h3 { margin: 0; font-size: .95rem; }
.risk-col header em {
  font-style: normal; min-width: 1.6rem; text-align: center;
  background: #f4efe4; border-radius: 8px; padding: .1rem .4rem; font-weight: 700; font-size: .82rem;
}
.risk-col.risk-cash { border-top: 3px solid var(--navy); }
.risk-col.risk-profit { border-top: 3px solid var(--rose); }
.risk-col.risk-ops { border-top: 3px solid var(--gold); }
.risk-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center;
  text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 10px; padding: .55rem .6rem; margin: 0 0 .4rem;
  background: #fffdf8;
}
.risk-item:hover { border-color: var(--gold); }
.risk-item i {
  font-style: normal; font-size: .68rem; font-weight: 700;
  border-radius: 6px; padding: .12rem .35rem; white-space: nowrap;
  background: #eef4f8; color: #1e3a5f;
}
.risk-item.danger i { background: #fde8e4; color: #a33b2b; }
.risk-item.warn i { background: #fff6e5; color: #8a5a00; }
.risk-item.danger { border-left: 3px solid var(--rose); }
.risk-item.warn { border-left: 3px solid #c9a227; }
.risk-item.info { border-left: 3px solid #5d7384; }
.risk-item b { display: block; font-size: .84rem; line-height: 1.35; }
.risk-item small { display: block; color: var(--muted); font-size: .72rem; margin-top: .12rem; }
.risk-item em { font-style: normal; font-size: .72rem; color: var(--navy); white-space: nowrap; }
@media (max-width: 980px) {
  .risk-board { grid-template-columns: 1fr; }
}
.nav-h-row { display: flex; align-items: center; }
.nav-h-row .nav-h { flex: 1; }
.nav-tog {
  background: transparent; border: 0; color: inherit; padding: .2rem .45rem; cursor: pointer;
}
.docs-board { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.docs-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: .85rem .95rem; border-top: 3px solid var(--gold);
}
.docs-card.ready { border-top-color: var(--teal); }
.docs-card header { display: flex; justify-content: space-between; align-items: baseline; }
.docs-card header a { color: inherit; text-decoration: none; }
.docs-card header em { font-style: normal; font-size: .75rem; color: var(--muted); }
.docs-card p { margin: .35rem 0 .55rem; color: var(--muted); font-size: .82rem; }
.docs-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.docs-chips i {
  font-style: normal; font-size: .7rem; font-weight: 700;
  border-radius: 6px; padding: .12rem .38rem;
}
.docs-chips i.on { background: #d8f3ec; color: #0d6b58; }
.docs-chips i.off { background: #fde8e4; color: #a33b2b; }
.docs-card footer {
  display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap;
  margin-top: .65rem; font-size: .78rem;
}
.docs-card footer a { color: var(--navy); text-decoration: none; }
@media (max-width: 980px) {
  .docs-board { grid-template-columns: 1fr; }
}
.lines header { display: flex; justify-content: space-between; align-items: center; }

@media (max-height: 720px) and (min-width: 981px) {
  .login-card .flow-line, .role-hint { display: none; }
  .login-card { padding: 12px 16px 10px; }
  .role-panel { padding: 10px 12px; }
  .role-sec { margin-bottom: 6px; }
  .login-form input, .login-card .submit-btn { height: 32px; }
}
@media (max-width: 980px) {
  #app.is-login { overflow: auto; }
  .login-page { height: auto; min-height: 100dvh; overflow: visible; }
  .login-page__shell { flex-wrap: wrap; align-items: stretch; padding-bottom: 20px; }
  .login-card, .role-panel { width: 100%; max-width: 560px; }
  .role-grid--hq, .role-grid--cn, .role-grid--br, .role-grid--fac { grid-template-columns: 1fr 1fr; max-width: none; }
  .h5-row { grid-template-columns: 1fr; }
  .role-card__desc { display: block; margin-top: 4px; font-size: .72rem; color: rgba(255,255,255,.7); line-height: 1.35; }
  .h5-banner { flex-direction: column; align-items: flex-start; }
  .h5-banner span { white-space: normal; }
}
.paybar { position: relative; min-width: 72px; height: 16px; background: #efe8d8; border-radius: 99px; overflow: hidden; }
.paybar i { display: block; height: 100%; background: #0e7c66; }
.paybar em { position: absolute; inset: 0; font-style: normal; font-size: .68rem; text-align: center; line-height: 16px; color: #1a2332; }
.factory-wall { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.fac-col { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .75rem; }
.fac-col header h3 { margin: 0 0 .6rem; font-size: .95rem; }
.fac-node { margin-bottom: .65rem; }
.fac-node h4 { margin: 0 0 .35rem; font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; }
.fac-node h4 i { font-style: normal; }
.fac-card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 10px; padding: .45rem .55rem; margin: 0 0 .35rem; background: #fffdf8;
}
.fac-card b { display: block; font-size: .82rem; }
.fac-card span, .fac-card em { display: block; font-size: .74rem; color: var(--muted); font-style: normal; }
.fac-card.late { border-left: 3px solid var(--rose); background: #fdf4f2; }
th.chk, td:has(.row-chk) { width: 2rem; }

@media (max-width: 900px) {
  #app.is-app { grid-template-columns: 1fr; }
  .side { height: auto; position: relative; padding: .55rem .7rem; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: .25rem; }
  .side-nav a, .side-nav button { padding: .28rem .5rem; font-size: .78rem; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar input { max-width: none; width: 100%; }
  .toolbar select, .toolbar input[type="date"] { width: 100%; }
  .roles, .kpis, .kpis.kpi3, .kpis.kpi4, .kpis.kpi6, .story, .grid2, .grid3, .editor, .form-sec__grid, .conn-grid, .conn-json, .crm360, .std-region, .integ-grid { grid-template-columns: 1fr; }
  .editor { padding: .7rem; }
  table { font-size: .78rem; }
  th, td { padding: .4rem .45rem; }
  .factory-wall { grid-template-columns: 1fr; }
  .period-bar input[type="date"] { height: 32px; }
  .top { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .side-extra { display: flex; flex-wrap: wrap; gap: .3rem; }
  .who em { display: none; }
}
