  :root {
    --bg: #f9f8f7; --sidebar: #ffffff; --panel: #ffffff; --panel-2: #f0efed;
    --line: #e6e5e3; --text: #2c2c2b; --muted: #7d7a75;
    --blue: #2783de; --blue-soft: #e5f2fc;
    --green: #46a171; --green-soft: #e8f1ec;
    --orange: #d5803b; --orange-soft: #fbebde;
    --red: #e56458; --red-soft: #fce9e7;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.5; font-size: 16px; }
  .app { display: flex; min-height: 100vh; }

  nav { width: 250px; background: var(--sidebar); border-right: 1px solid var(--line); padding: 18px 12px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .nav-logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
  .nav-logo .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--blue-soft); display: flex; align-items: center; justify-content: center; font-size: 16px; }
  .nav-logo b { font-size: 15px; display: block; }
  .nav-logo small { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; }
  .nav-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: none; color: var(--muted); padding: 10px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; margin-bottom: 2px; font-family: inherit; }
  .nav-item:hover { background: var(--panel-2); color: var(--text); }
  .nav-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
  .nav-item .ico { width: 18px; text-align: center; }
  .badge { margin-left: auto; min-width: 20px; height: 20px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
  .nav-sep { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.5px; padding: 16px 12px 6px; }
  .nav-persona { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 1px solid transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; margin-bottom: 2px; font-family: inherit; }
  .nav-persona:hover { background: var(--panel-2); }
  .nav-persona.active { border-color: var(--blue); background: var(--blue-soft); }
  .nav-persona .p-ava { width: 26px; height: 26px; border-radius: 50%; background: var(--panel-2); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--text); flex-shrink: 0; }
  .nav-persona.active .p-ava { background: var(--blue); color: #fff; }
  .nav-persona .p-name { font-size: 13px; font-weight: 600; }
  .nav-persona .p-tier { font-size: 11px; color: var(--muted); }
  .nav-close { display: none; }

  .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 15; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .backdrop.show { opacity: 1; pointer-events: auto; }

  main { flex: 1; min-width: 0; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 12px 26px; border-bottom: 1px solid var(--line); background: var(--sidebar); position: sticky; top: 0; z-index: 10; }
  .topbar .grow { flex: 1; }
  .menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 7px 11px; font-size: 15px; cursor: pointer; align-items: center; justify-content: center; }
  .chip { display: flex; align-items: center; gap: 9px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px 5px 5px; font-size: 13px; }
  .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }

  .content { padding: 26px; max-width: 1040px; }
  h2.greet { font-size: 23px; margin-bottom: 4px; font-weight: 700; }
  .greet-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

  .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 20px; overflow: hidden; }
  .panel-head { padding: 13px 20px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 9px; }
  .panel-head .ico { color: var(--blue); }
  .panel-head .sub { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
  .panel-body { padding: 18px 20px; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  @media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

  .shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .shortcut { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px 12px; text-align: center; cursor: pointer; transition: all .15s; font-size: 13.5px; color: var(--text); font-family: inherit; }
  .shortcut:hover { border-color: var(--blue); transform: translateY(-1px); }
  .shortcut.picked { border-color: var(--blue); background: var(--blue-soft); }
  .shortcut .ico { font-size: 22px; margin-bottom: 7px; }

  .pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
  .pill.green { background: var(--green-soft); color: var(--green); }
  .pill.blue { background: var(--blue-soft); color: var(--blue); }
  .pill.orange { background: var(--orange-soft); color: var(--orange); }
  .pill.gray { background: var(--panel-2); color: var(--muted); }
  .pill.red { background: var(--red-soft); color: var(--red); }

  .alert { border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; font-size: 14px; border: 1px solid; }
  .alert.blue { background: var(--blue-soft); border-color: #c4ddf5; }
  .alert.orange { background: var(--orange-soft); border-color: #f0d3b8; }

  .doc { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .doc:last-child { border-bottom: none; }
  .doc .d-ico { width: 34px; height: 34px; border-radius: 8px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
  .doc .d-body { flex: 1; min-width: 0; }
  .doc .d-name { font-weight: 600; font-size: 14px; }
  .doc .d-meta { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
  .doc .d-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

  .dept { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
  .dept-head { padding: 15px 18px; display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
  .dept-ico { width: 36px; height: 36px; border-radius: 9px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; font-size: 17px; }
  .dept-name { font-size: 15.5px; font-weight: 700; }
  .dept-meta { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
  .spacer { flex: 1; }
  .dept-items { border-top: 1px solid var(--line); padding: 6px 18px 12px; }

  .stage { display: flex; gap: 13px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
  .stage:last-child { border-bottom: none; }
  .stage .s-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
  .stage .s-dot.done { background: var(--green); }
  .stage .s-dot.now { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
  .stage .s-dot.next { background: var(--line); }
  .stage .s-name { font-weight: 600; font-size: 14px; }
  .stage .s-when { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

  .counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
  .counter { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
  .counter .n { font-size: 30px; font-weight: 800; color: var(--blue); font-variant-numeric: tabular-nums; }
  .counter.warn .n { color: var(--orange); }
  .counter.ok .n { color: var(--green); }
  .counter .l { color: var(--muted); font-size: 12px; margin-top: 3px; }

  .info-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
  .info-row:last-child { border-bottom: none; }
  .info-row .k { color: var(--muted); }
  .info-row .v { font-weight: 600; text-align: right; }

  .trip { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
  .trip-head { padding: 14px 16px; cursor: pointer; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .trip-head:hover { background: #fbfaf9; }
  .trip-route { font-size: 15.5px; font-weight: 700; }
  .trip-meta { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
  .legs { display: none; border-top: 1px solid var(--line); padding: 6px 16px 12px; }
  .trip.open .legs { display: block; }
  .leg { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
  .leg:last-child { border-bottom: none; }
  .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
  .dot.ok { background: var(--green); }
  .dot.warn { background: var(--orange); }
  .leg-body { flex: 1; }
  .leg-name { font-weight: 600; font-size: 14px; }
  .leg-time { color: var(--blue); font-size: 12.5px; }
  .leg-detail { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
  .leg-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; padding: 3px 8px; border-radius: 6px; height: fit-content; margin-top: 4px; white-space: nowrap; }
  .leg-tag.ok { color: var(--green); background: var(--green-soft); }
  .leg-tag.warn { color: var(--orange); background: var(--orange-soft); }

  .dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
  .member { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; gap: 11px; align-items: center; }
  .member .m-ava { width: 34px; height: 34px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: var(--blue); flex-shrink: 0; }
  .member .m-name { font-size: 13.5px; font-weight: 600; }
  .member .m-sub { font-size: 11.5px; color: var(--muted); }

  .form-row { margin-bottom: 14px; }
  .form-row label { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
  .form-row input, .form-row select, .form-row textarea { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 10px 12px; font-size: 14px; font-family: inherit; }
  .field-error { color: var(--red); font-size: 12px; margin-top: 5px; display: none; }
  .field-error.show { display: block; }
  .btn { background: var(--blue); color: #fff; border: none; font-weight: 700; padding: 12px 22px; border-radius: 9px; font-size: 14px; cursor: pointer; font-family: inherit; }
  .btn.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
  .btn.sm { padding: 8px 14px; font-size: 13px; }
  .btn:disabled { opacity: .45; cursor: default; }
  .success-box { text-align: center; padding: 36px 20px; }
  .success-box .big { font-size: 42px; margin-bottom: 10px; }
  .success-box h3 { font-size: 18px; margin-bottom: 8px; }
  .success-box p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

  .empty { text-align: center; padding: 30px 16px; color: var(--muted); font-size: 14px; }
  .prog { height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
  .prog > div { height: 100%; background: var(--blue); }
  .prog.mini { height: 5px; margin: 6px 0 0; max-width: 220px; }

  .note { color: var(--muted); font-size: 12px; margin-top: 12px; }
  .view-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
  .view-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }

  .tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 4px 12px 0; flex-wrap: wrap; }
  .tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; padding: 10px 12px; cursor: pointer; margin-bottom: -1px; font-family: inherit; }
  .tab:hover { color: var(--text); }
  .tab.active { color: var(--blue); border-color: var(--blue); font-weight: 600; }

  .task { display: flex; align-items: flex-start; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
  .task:last-child { border-bottom: none; }
  .task input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--blue); flex-shrink: 0; cursor: pointer; }
  .task .t-name { font-size: 14px; }
  .task.done .t-name { color: var(--muted); text-decoration: line-through; }

  .search { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 11px 14px; font-size: 14px; font-family: inherit; margin-bottom: 14px; }

  .win { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .win:last-child { border-bottom: none; }
  .w-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
  .w-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
  .w-text { font-size: 13.5px; margin-top: 2px; }
  .w-by { color: var(--muted); }

  .pipe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .pipe-col { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
  .pipe-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
  .pipe-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
  .pipe-item { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; }

  .org-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
  .org-row:hover { background: var(--panel-2); }
  .org-caret { width: 14px; color: var(--muted); font-size: 12px; flex-shrink: 0; }
  .org-kids { margin-left: 22px; border-left: 1px solid var(--line); padding-left: 10px; }
  .o-ava { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11.5px; color: var(--blue); flex-shrink: 0; }

  .wiz-foot { display: flex; gap: 10px; margin-top: 14px; }
  .org-adv { margin-left: 22px; border-left: 1px dashed var(--line); padding-left: 10px; }

  .group-h { font-weight: 600; font-size: 13.5px; margin-bottom: 10px; }
  .ocanvas { overflow-x: auto; }
  .otree { width: max-content; min-width: 100%; margin: 0 auto; text-align: center; }
  .ocard { display: inline-block; background: #fff; border: 2px solid #f5a623; border-radius: 10px; padding: 7px 9px; min-width: 132px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
  .ocard.tbc { border-color: #7ed957; background: #eef9e8; border-style: dashed; }
  .ocard.cons { border-color: #4a90e2; background: #ebf3fc; }
  .ocard.adv { border-style: dashed; border-color: #4a90e2; background: #fff; min-width: 130px; padding: 6px 10px; }
  .oc-name { font-weight: 700; font-size: 12.5px; }
  .oc-role { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
  .oconnect { width: 2px; height: 18px; background: var(--line); margin: 0 auto; }
  .orow { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
  .obranches { display: flex; gap: 12px; align-items: flex-start; width: max-content; margin: 4px auto 0; }
  .obranch { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); padding: 12px 9px; min-width: 168px; }
  .obranch .ocard { display: block; min-width: 0; }
  .okids { margin-left: 12px; padding-left: 10px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
  .oadv { display: flex; flex-direction: column; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; }
  .olegend { display: flex; gap: 16px; justify-content: center; margin-bottom: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
  .odot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
  .pvsel { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-size: 13px; font-family: inherit; color: var(--text); }
  .onode { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
  .okidsrow { display: flex; gap: 10px; margin-top: 14px; align-items: flex-start; position: relative; }
  .okidsrow:before { content: ""; position: absolute; top: 0; left: 60px; right: 60px; height: 2px; background: var(--line); }
  .okidsrow > .onode { position: relative; padding-top: 14px; }
  .okidsrow > .onode:before { content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 14px; background: var(--line); }
  .okidsrow.root { justify-content: center; }
  .onode > .oadv { margin-top: 6px; }
  .asform { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 8px; }
  .asform select, .asform input, .pklane { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; color: var(--text); }
  .doc.clk { cursor: pointer; }
  .doc.clk:hover .d-name { color: var(--blue); }
  .rback { margin-bottom: 14px; }
  .reader { max-width: 720px; }
  .rkind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }
  .rtitle { font-size: 21px; font-weight: 700; margin: 5px 0 6px; }
  .rmeta { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
  .rbody p { font-size: 15px; margin-bottom: 13px; }
  .rlist { margin: 0 0 13px 22px; font-size: 15px; }
  .rlist li { margin-bottom: 6px; }
  .raction { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

  button:focus-visible, .shortcut:focus-visible, .tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

  @media (max-width: 800px) {
    nav { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
    nav.open { transform: none; }
    .nav-close { display: block; position: absolute; top: 14px; right: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 32px; height: 32px; font-size: 14px; cursor: pointer; }
    .menu-btn { display: flex; }
    .content { padding: 18px 14px; }
    .pipe { grid-template-columns: 1fr; }
    .topbar { padding: 12px 14px; }
  }

  .signin { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); z-index: 30; padding: 20px; }
  .signin-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 34px 30px; width: 100%; max-width: 360px; text-align: center; }
  .signin-card .mark { width: 44px; height: 44px; border-radius: 11px; background: var(--blue-soft); display: flex; align-items: center; justify-content: center; font-size: 22px; margin: 0 auto 14px; }
  .signin-card b { display: block; font-size: 17px; margin-bottom: 6px; }
  .signin-card p { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
  .signin-card .btn { width: 100%; }
  .signin-local { margin-top: 12px; display: flex; gap: 8px; }
  .signin-local input { flex: 1; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; font-family: inherit; color: var(--text); min-width: 0; }
  .signout { background: none; border: none; color: var(--muted); font-size: 12.5px; cursor: pointer; font-family: inherit; padding: 4px 8px; border-radius: 6px; }
  .signout:hover { background: var(--panel-2); color: var(--text); }
  .btn.busy { opacity: .6; cursor: default; }

  [hidden] { display: none !important; }
