:root {
  --ink: #102033;
  --navy: #16324f;
  --solar: #e39b12;
  --solar-d: #b77808;
  --teal: #1c8c7a;
  --rose: #c45c4a;
  --paper: #f3eee4;
  --card: #fffdf8;
  --line: #d9d0c0;
  --muted: #6d7a86;
  --side: #0d1c2c;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html {
  scrollbar-width: thin;
  scrollbar-color: #c9bda8 transparent;
}
html::-webkit-scrollbar { width: 8px; height: 8px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb {
  background: #c9bda8;
  border-radius: 99px;
}
html::-webkit-scrollbar-thumb:hover { background: #b3a48c; }
html::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
body {
  font-family: "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

#app.is-app {
  display: grid;
  grid-template-columns: 236px 1fr;
  min-height: 100%;
}
#app.is-login { height: 100%; min-height: 100%; overflow: hidden; background: #0d1c2c; }

.side {
  background: linear-gradient(180deg, #0b1826, #13283c);
  color: #e8eef3;
  padding: 1rem .75rem 1.1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.logo {
  display: flex;
  gap: .65rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
  padding: .35rem .4rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: .6rem;
}
.logo img { height: 34px; }
.logo b {
  display: block;
  color: var(--solar);
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9.5rem;
  font-size: .95rem;
}
.logo small {
  color: #8aa0b3;
  font-size: .72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9.5rem;
}
.side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
}
.side nav,
.role-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(227, 155, 18, .35) transparent;
}
.side nav::-webkit-scrollbar,
.role-panel::-webkit-scrollbar { width: 6px; }
.side nav::-webkit-scrollbar-track,
.role-panel::-webkit-scrollbar-track { background: transparent; }
.side nav::-webkit-scrollbar-thumb,
.role-panel::-webkit-scrollbar-thumb {
  background: rgba(227, 155, 18, .38);
  border-radius: 99px;
}
.side nav::-webkit-scrollbar-thumb:hover,
.role-panel::-webkit-scrollbar-thumb:hover { background: rgba(227, 155, 18, .55); }
.side nav::-webkit-scrollbar-button,
.role-panel::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.side nav::-webkit-scrollbar-corner,
.role-panel::-webkit-scrollbar-corner { background: transparent; }
.nav-g { padding-bottom: 2px; }
.nav-sec {
  margin: .7rem .45rem .15rem;
  padding: 0 .15rem;
  color: #8aa0b3;
  font-size: .72rem;
  letter-spacing: .04em;
}
.nav-h, .nav-k a {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: #c5d2dc;
  text-decoration: none;
  padding: .5rem .55rem;
  border-radius: 8px;
  font-size: .9rem;
  line-height: 1.25;
  min-height: 36px;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.nav-h i { width: 1.1rem; color: var(--solar); font-style: normal; flex: 0 0 auto; }
.nav-h span { flex: 1; }
.nav-h .chev {
  margin-left: auto;
  font-style: normal;
  font-size: .68rem;
  opacity: .45;
  width: .8rem;
  text-align: center;
}
.nav-g.open > .nav-h .chev { transform: rotate(90deg); }
.nav-h.on, .nav-k a.on { background: rgba(227,155,18,.16); color: #fff; }
.nav-h:hover, .nav-k a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-k a.on:hover { background: rgba(227,155,18,.2); }
.nav-k {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: .15rem 0 .2rem 1.15rem;
}
.nav-g.open > .nav-k { display: flex; }

.main { min-width: 0; }
.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;
  gap: .8rem;
  min-width: 0;
}
.crumb { font-weight: 700; min-width: 0; }
.crumb-row { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.top-r {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.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;
}
.primary { background: var(--solar); 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; }
.list-head { margin: 0 0 .55rem; }
.list-head h3 { margin: 0; font-size: 1.15rem; }
.list-head p { display: none; }
.page-size { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .82rem; }
.page-size select { font: inherit; padding: .35rem .45rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.toolbar input, .editor input {
  font: inherit;
  padding: .5rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  width: 100%;
}
.toolbar input { max-width: 280px; }

.welcome { margin-bottom: .8rem; }
.welcome b { color: var(--solar-d); }
.welcome p { margin: .2rem 0 0; color: var(--muted); }
.welcome a { color: var(--teal); }
.story {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .45rem;
  margin-bottom: 1rem;
}
.story.story-7,
.story.story-8,
.story.story-11,
.story.story-14 {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
}
@media (min-width: 901px) {
  .story.story-7 { grid-template-columns: repeat(7, 1fr); }
}
.story a {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .55rem .6rem;
}
.story a.sot-kd { border-color: #1c8c7a; }
.editor.is-ro input, .editor.is-ro select, .editor.is-ro textarea {
  pointer-events: none; background: #f4f1ea;
}
.story em { color: var(--solar-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 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);
}
.kpis span { color: var(--muted); font-size: .8rem; }
.kpis strong { display: block; font-size: 1.45rem; margin-top: .25rem; }
.kpis .gold strong { color: var(--solar-d); }
.kpis .teal strong { color: var(--teal); }
.kpis .rose strong { color: var(--rose); }
.kpis .navy strong { color: var(--navy); }
.kpi-link { text-decoration: none; color: inherit; display: block; }
.kpi-link article { height: 100%; }
.kpis em { display: block; margin-top: .25rem; font-style: normal; font-size: .72rem; color: var(--teal); }
.field-hint, .lookup-hint {
  display: block;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 400;
  margin: .15rem 0 .35rem;
  line-height: 1.4;
}
.form-lead {
  background: #f7f1e4;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .65rem .8rem;
  color: #3d4a55;
  margin: 0 0 .6rem;
}

.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; }
.copilot-card p { margin: 0 0 .5rem; color: var(--muted); font-size: .9rem; }
.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; }
.mini { width: 100%; border-collapse: collapse; }
.mini td { padding: .35rem 0; border-bottom: 1px solid var(--line); }

.table-wrap { overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
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.open { background: #d8f3ec; color: #0d6b58; }
.st.pending { background: #fde7c4; color: #8a5a00; }
.st.draft { background: #ececec; }
.ops { display: flex; flex-wrap: wrap; gap: .25rem; }
.ops button { margin-right: 0; padding: .2rem .45rem; font-size: .78rem; }

.editor {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.editor-act { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; }
.editor .span2, .editor .warn { grid-column: 1 / -1; }
.editor select, .editor textarea { width: 100%; }
.lines header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.lines h4 { margin: 0; font-size: .95rem; }
.lines input { width: 100%; min-width: 4.5rem; }
.lines .table-wrap { margin: 0; }
.editor .warn { color: #8a5a00; background: #fde7c4; padding: .5rem .7rem; border-radius: 8px; margin: 0; }
.alerts .danger { color: #c45c4a; }
.alerts .warn { color: #8a5a00; }
.crm360 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .7rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbf7ef;
}
.crm360 h4 { grid-column: 1 / -1; margin: 0 0 .2rem; }
.crm360-col b { display: block; font-size: .82rem; margin-bottom: .3rem; }
.crm360-col ul { margin: 0; padding: 0; list-style: none; }
.crm360-col li { font-size: .8rem; padding: .2rem 0; border-bottom: 1px dashed var(--line); }
.crm-stat { list-style: none; margin: 0; padding: 0; }
.crm-stat li { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.doc-links {
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f7f4;
}
.doc-links h4 { margin: 0 0 .5rem; }
.doc-links-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.doc-links ul { margin: 0; padding: 0; list-style: none; }
.doc-links li { font-size: .82rem; padding: .25rem 0; border-bottom: 1px dashed var(--line); }
.lookup-hint { float: right; color: var(--teal); font-size: .72rem; }
.lookup-miss { outline: 1px solid #c45c4a; }
.lookup-err { display: block; color: #c45c4a; font-size: .75rem; margin-top: .2rem; }
.load-err { margin: 0 0 .8rem; }
.body.is-busy { opacity: .55; pointer-events: none; }
.lane-tl {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .6rem;
}
.lane-tl li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem .65rem;
  background: var(--card);
  min-height: 5.2rem;
}
.lane-tl li b { display: block; font-size: .78rem; margin-bottom: .35rem; }
.lane-tl__no { display: block; font-weight: 600; }
.lane-tl__st { display: block; font-size: .75rem; color: #666; margin-top: .2rem; }
.lane-tl .tone-ok { border-color: #2f7d4f; background: #eef7f1; }
.lane-tl .tone-wait { border-color: #c9a227; background: #fff8e6; }
.lane-tl .tone-miss { border-color: #c45c4a; background: #fdf0ee; }
.lane-tl--tail { opacity: .72; }
.drill { color: var(--teal); }

.rep-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin: 1rem 0; }
.rep {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .9rem;
}
.rep:hover { border-color: var(--solar); }
.rep small { display: block; color: var(--muted); margin-top: .25rem; }

.login-page {
  position: relative;
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  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(227, 155, 18, 0.28), transparent 60%),
    linear-gradient(115deg, rgba(8, 18, 28, 0.88) 0%, rgba(16, 36, 56, 0.72) 45%, rgba(10, 22, 34, 0.55) 100%);
}
.login-page__shell {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 20px 12px;
  box-sizing: border-box;
  flex-wrap: nowrap;
}
.login-card {
  width: min(360px, 38vw);
  flex-shrink: 0;
  background: rgba(255, 253, 248, 0.98);
  border-radius: 16px;
  padding: 16px 18px 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}
.login-card .brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.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: 30px; height: auto; }
.login-card .brand-row h1 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: #111;
  line-height: 1.25;
}
.login-card .tagline {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: #666;
}
.login-lang-dock {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 16px 0;
  flex-shrink: 0;
}
.login-lang-dock__lab {
  display: none;
  color: #f0c36a;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-shadow: 0 1px 8px rgba(0,0,0,.45);
}
.lang-switch {
  display: inline-flex;
  border: 1.5px solid rgba(227, 155, 18, 0.45);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(16, 32, 51, 0.12);
}
.lang-switch button {
  border: 0;
  background: transparent;
  padding: .42rem .7rem;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--navy);
  border-radius: 0;
  min-width: 2.4rem;
}
.lang-switch button + button { border-inline-start: 1px solid var(--line); }
.lang-switch button.on {
  background: var(--solar);
  color: #1a1204;
}
.lang-switch--hero {
  background: rgba(255, 253, 248, 0.96);
  border-color: #e39b12;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.lang-switch--hero button {
  min-width: 3.6rem;
  padding: .38rem .6rem;
  font-size: .82rem;
}
.lang-switch--hero button.on {
  background: var(--solar);
  color: #1a1204;
  box-shadow: inset 0 0 0 1px rgba(183, 120, 8, 0.35);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.lang-select { display: inline-flex; flex-shrink: 0; }
.lang-select select {
  height: 2.05rem;
  min-width: 7.4rem;
  max-width: 9.2rem;
  padding: 0 .7rem;
  border: 1.5px solid rgba(227, 155, 18, 0.45);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
}
.login-card .flow-line {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: #1c8c7a;
  font-weight: 600;
}
.login-card .role-pill {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(227, 155, 18, 0.14);
  color: #b77808;
  font-size: 0.86rem;
  font-weight: 700;
}
.login-form { display: flex; flex-direction: column; gap: 0; }
.login-form label {
  display: block;
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}
.login-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  height: 36px;
  padding: 0 .8rem;
  border: 1px solid #d9d0c0;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}
.login-form input[readonly] {
  background: #f7f1e6;
  color: #5b6570;
}
.login-form input:focus {
  outline: 2px solid rgba(227, 155, 18, 0.45);
  border-color: var(--solar);
}
.login-err {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fde8e4;
  color: #c45c4a;
  font-size: 0.82rem;
}
.login-card .submit-btn {
  width: 100%;
  height: 38px;
  margin-top: 2px;
  background: var(--solar);
  color: #1a1204;
  font-weight: 800;
  border-radius: 10px;
}
.login-card .submit-btn:hover { background: var(--solar-d); color: #fff; }
.login-card .submit-btn:disabled { opacity: 0.7; cursor: wait; }
.login-card .links {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.login-card .links a {
  color: #1c8c7a;
  text-decoration: none;
  font-weight: 600;
}
.login-card .copyright {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
}
.role-panel {
  width: min(720px, 58vw);
  max-height: none;
  overflow: visible;
  background: rgba(10, 22, 34, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px 14px 12px;
  color: #fff;
  backdrop-filter: blur(10px);
}
.role-panel h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.role-hint {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
  line-height: 1.35;
}
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.role-grid--org {
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 2px;
}
.role-hint--sub {
  margin-top: 8px;
}
.org-tree {
  margin: 0 0 1rem;
}
.org-tree h3 { margin: 0 0 .2rem; }
.org-tree .muted { margin: 0 0 .75rem; }
.org-boss {
  display: flex;
  justify-content: center;
}
.org-card {
  min-width: 200px;
  padding: .55rem .85rem;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  text-align: center;
}
.org-card b { display: block; font-size: .95rem; }
.org-card em { display: block; font-style: normal; font-size: .8rem; opacity: .86; margin-top: .15rem; }
.org-card small { display: block; opacity: .72; font-size: .72rem; margin-top: .12rem; }
.org-card--mid { background: #1c4d5c; }
.org-card--seat {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  min-width: 0;
}
.org-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
  margin-top: .75rem;
}
.org-seats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .45rem;
  margin-top: .7rem;
}
.role-card {
  text-align: left;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 7px 8px 6px;
  color: #fff;
  cursor: pointer;
  transition: 0.15s ease;
  font-family: inherit;
}
.role-card:hover {
  border-color: rgba(227, 155, 18, 0.7);
  background: rgba(227, 155, 18, 0.12);
}
.role-card.on {
  border-color: #e39b12;
  background: rgba(227, 155, 18, 0.18);
  box-shadow: 0 0 0 1px rgba(227, 155, 18, 0.35);
}
.role-card:disabled { opacity: 0.7; cursor: wait; }
.role-card__title {
  font-weight: 800;
  font-size: 0.78rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.role-card__user {
  font-size: 0.68rem;
  color: #f0c36a;
  margin-bottom: 2px;
  font-family: ui-monospace, Consolas, monospace;
}
.role-card__desc {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h5-banner {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, rgba(227, 155, 18, 0.35), rgba(28, 140, 122, 0.22));
  border: 1px solid rgba(227, 155, 18, 0.45);
}
.h5-banner strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.h5-banner span {
  display: block;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.4;
}
.sys-name {
  margin: 14px 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

#app.is-app { transition: grid-template-columns .2s ease; }
#app.is-app.is-nav-off { grid-template-columns: 64px 1fr; }
#app.is-nav-off .logo > div,
#app.is-nav-off .nav-h span,
#app.is-nav-off .nav-h .chev,
#app.is-nav-off .nav-k,
#app.is-nav-off .nav-sep,
#app.is-nav-off .nav-sec { display: none; }
#app.is-nav-off .side { padding: .7rem .4rem 1.2rem; }
#app.is-nav-off .logo { justify-content: center; padding: .4rem 0 .8rem; }
#app.is-nav-off .nav-h { justify-content: center; padding: .55rem 0; }
.side-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  margin: 0 .15rem .55rem;
}
.nav-fold {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: #e8eef3;
  border-radius: 8px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}
.nav-fold:hover { background: rgba(255,255,255,.1); }
#app.is-nav-off .side-tools { justify-content: center; }
.nav-sep {
  height: 1px;
  margin: .35rem .55rem;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.crumb-row { display: flex; align-items: center; gap: .55rem; }
.top-fold { display: none; }
#app.is-nav-off .top-fold { display: inline-flex; }

.editor label {
  display: flex;
  flex-direction: column;
  gap: .28rem;
  font-size: .82rem;
  color: var(--muted);
  font-weight: 600;
}
.editor input, .editor select, .editor textarea {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  padding: .5rem .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.editor input[type="date"] {
  min-height: 2.35rem;
  color-scheme: light;
}
.editor input[type="tel"],
.editor input[type="email"] { letter-spacing: .01em; }
.editor label.is-bad input,
.editor label.is-bad select,
.editor input.is-bad { border-color: #c45c4a; background: #fff6f4; }
.af-field-err { color: #c45c4a; font-size: .75rem; font-weight: 500; }

.af-empty {
  padding: 2.2rem 1rem;
  text-align: center;
  color: var(--muted);
}
.af-empty b { display: block; color: var(--ink); margin-bottom: .35rem; }

.af-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  padding: .7rem .85rem;
  color: var(--muted);
  font-size: .82rem;
}
.af-pager__btns { display: flex; flex-wrap: wrap; gap: .3rem; }
.af-pager button { padding: .28rem .55rem; font-size: .78rem; }
.af-pager button.on { background: var(--solar); border-color: var(--solar); color: #1a1204; font-weight: 700; }
.af-pager button:disabled { opacity: .4; cursor: default; }

#afLayer { position: relative; z-index: 40; }
.af-mask {
  position: fixed;
  inset: 0;
  background: rgba(13, 28, 44, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  opacity: 0;
  transition: opacity .16s ease;
}
.af-mask.in { opacity: 1; }
.af-dlg {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: 18px;
  border: 1px solid rgba(217,208,192,.9);
  box-shadow: 0 28px 64px rgba(16,32,51,.24);
  overflow: hidden;
}
.af-dlg--warn { border-color: rgba(196,92,74,.28); }
.af-dlg header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.2rem .2rem;
}
.af-dlg h3 { margin: 0; font-size: 1.12rem; letter-spacing: .01em; }
.af-dlg__body { padding: .45rem 1.2rem 1.1rem; color: #4a5866; line-height: 1.65; font-size: .95rem; }
.af-dlg footer {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: .85rem 1.2rem 1.15rem;
  background: #f7f3eb;
  border-top: 1px solid var(--line);
}
.af-x {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 1.3rem;
  color: var(--muted);
  border-radius: 8px;
  padding: 0;
}
.af-x:hover { background: #f3eee4; color: var(--ink); }
.af-btn--danger { background: #c45c4a; color: #fff; }

.af-drawer {
  position: fixed;
  inset: 0;
  background: rgba(13, 28, 44, .38);
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity .18s ease;
  z-index: 30;
}
.af-drawer.in { opacity: 1; }
.af-drawer__panel {
  width: min(920px, 100%);
  height: 100%;
  background: var(--paper);
  box-shadow: -16px 0 40px rgba(16,32,51,.16);
  display: flex;
  flex-direction: column;
  transform: translateX(24px);
  transition: transform .18s ease;
}
.af-drawer.in .af-drawer__panel { transform: none; }
.af-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
  padding: 1rem 1.2rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.af-drawer__head h2 { margin: 0; font-size: 1.15rem; }
.af-drawer__head p { margin: .25rem 0 0; color: var(--muted); font-size: .82rem; }
.af-drawer__body { flex: 1; overflow: auto; padding: 1rem 1.2rem 0; }
.af-drawer .editor {
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
}
.af-drawer .editor-act {
  position: sticky;
  bottom: 0;
  margin: 1rem -1.2rem 0;
  padding: .85rem 1.2rem 1.1rem;
  background: linear-gradient(180deg, rgba(243,238,228,0), var(--paper) 28%);
  border-top: 1px solid var(--line);
  z-index: 2;
}
.af-toast {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  background: #16324f;
  color: #fff;
  padding: .7rem 1rem;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(16,32,51,.22);
  opacity: 0;
  transform: translateY(8px);
  transition: .2s ease;
  z-index: 50;
  max-width: min(360px, 90vw);
}
.af-toast.in { opacity: 1; transform: none; }
.af-toast--ok { background: #1c8c7a; }
.af-toast--warn { background: #b77808; }
.af-toast--err { background: #c45c4a; }

.nav-help {
  display: block; width: 100%; margin-top: auto;
  border: 0; background: none; padding: .55rem .55rem;
  color: #c5d2dc; font: inherit; font-size: .88rem;
  text-align: left; cursor: pointer; border-radius: 8px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.08);
}
.nav-help:hover { color: var(--solar); background: rgba(255,255,255,.06); }
#app.is-nav-off .nav-help { text-align: center; padding: .45rem 0; font-size: 0; }
#app.is-nav-off .nav-help::before { content: '?'; font-size: 1.05rem; font-weight: 700; color: var(--solar); }
.top-help {
  min-width: 2rem; font-weight: 700;
}
.help-mask {
  display: none; position: fixed; inset: 0; z-index: 70;
  background: rgba(8,20,33,.35);
}
.help-drawer {
  display: none; position: fixed; top: 0; right: 0; z-index: 80;
  width: min(360px, 92vw); height: 100%;
  background: #fffdf8; box-shadow: -12px 0 32px rgba(8,20,33,.18);
  flex-direction: column;
}
body.help-open .help-mask { display: block; }
body.help-open .help-drawer { display: flex; }
.help-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: #0d1c2c; color: #fff; flex-shrink: 0;
}
.help-head h2 { margin: 0; font-size: 1rem; }
.help-x {
  border: 1px solid rgba(255,255,255,.25); background: transparent;
  color: var(--solar); width: 2rem; height: 2rem; border-radius: 8px; cursor: pointer;
}
.help-body { overflow: auto; padding: 14px 16px 28px; font-size: .86rem; line-height: 1.65; color: #334155; }
.help-body h3 { margin: 16px 0 6px; font-size: .92rem; color: #0d1c2c; }
.help-body section:first-child h3 { margin-top: 0; }
.help-body p, .help-body li { margin: 0 0 8px; }
.help-bound { margin: 0; padding-left: 1.15em; }
.help-bound li { margin-bottom: 8px; }
.help-bound a { color: var(--teal); }
.help-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.help-links a { color: var(--teal); }

@media (max-width: 1100px) {
  #app.is-login { overflow: auto; }
  .login-page { overflow: auto; }
  .login-page__shell { flex-wrap: wrap; align-items: flex-start; }
  .login-card { width: min(400px, 100%); }
  .role-panel { width: min(720px, 100%); }
  .role-grid--org { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  #app.is-app { grid-template-columns: 1fr; }
  #app.is-app.is-nav-off { grid-template-columns: 1fr; }
  .side { height: auto; position: relative; }
  #app.is-nav-off .side { display: none; }
  .top-fold { display: inline-flex; }
  .kpis, .grid2, .rep-grid, .editor, .story, .crm360, .doc-links-cols, .lane-tl { grid-template-columns: 1fr 1fr; }
  .org-seats { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 720px) {
  .role-grid, .role-grid--org { grid-template-columns: 1fr; }
  .org-split, .org-seats { grid-template-columns: 1fr 1fr; }
  .login-page__shell { align-items: stretch; flex-wrap: wrap; }
  .lang-switch--hero button { min-width: 4.4rem; padding: .55rem .7rem; font-size: .9rem; }
  .editor, .crm360, .doc-links-cols { grid-template-columns: 1fr; }
  .af-pager { flex-direction: column; align-items: flex-start; }
}
