@layer reset, shell, components, responsive;
@layer reset {
  :root { color-scheme:dark; font-family:Inter,"Segoe UI",system-ui,sans-serif; --base:#0b1020; --side:#0d1426; --panel:#111a2e; --elevated:#141f35; --line:#263451; --text:#eef3ff; --muted:#a1afcb; --dim:#8090b1; --accent:#9caafe; --bright:#b5bfff; --green:#70dfb5; --radius:15px; }
  * { box-sizing:border-box; }
  body { margin:0; min-width:300px; background:var(--base); color:var(--text); }
  button,input,select,textarea { font:inherit; }
  button,a,input,select,textarea,summary { -webkit-tap-highlight-color:transparent; }
  a { color:var(--bright); text-decoration:none; }
  a:hover { color:white; }
  :focus-visible { outline:2px solid #b9c4ff; outline-offset:3px; }
  h1,h2,h3,p { margin:0; }
  h1 { font-size:clamp(1.85rem,4vw,2.55rem); letter-spacing:-.045em; line-height:1.1; font-weight:735; }
  h2 { font-size:1.09rem; font-weight:640; letter-spacing:-.012em; }
  h3 { font-size:.95rem; font-weight:630; }
  p { line-height:1.55; }
  svg { width:19px; height:19px; flex:none; }
}
@layer shell {
  .shell { display:grid; grid-template-columns:252px minmax(0,1fr); min-height:100dvh; }
  .sidebar { height:100dvh; position:sticky; top:0; z-index:3; display:flex; flex-direction:column; background:var(--side); border-right:1px solid var(--line); padding:23px 15px 15px; }
  .brand { display:flex; align-items:center; gap:12px; color:var(--text); padding:1px 9px 23px; }
  .brand img { width:40px; height:40px; }
  .brand strong { display:block; font-size:.9rem; letter-spacing:.21em; }
  .brand small { display:block; color:var(--muted); font-size:.65rem; letter-spacing:.16em; margin-top:4px; }
  nav { overflow:auto; flex:1; padding:0 0 6px; }
  .group-label { margin:12px 10px 5px; font-size:.65rem; color:var(--dim); font-weight:750; letter-spacing:.13em; text-transform:uppercase; }
  .nav-link { display:flex; align-items:center; padding:9px 9px; margin:2px 0; gap:9px; min-height:36px; font-size:.81rem; color:#b2bfda; border-radius:8px; border:1px solid transparent; }
  .nav-link svg { width:16px; height:16px; color:#8799c5; }
  .nav-link:hover { background:#19233a; }
  .nav-link[aria-current=page] { background:#202a4d; border-color:#384778; color:#e0e5ff; font-weight:650; }
  .nav-link[aria-current=page] svg { color:#adb8ff; }
  .identity { border:1px solid var(--line); padding:11px 9px; margin-top:12px; display:flex; align-items:center; gap:9px; border-radius:12px; }
  .identity div:nth-child(2) { flex:1; }
  .identity button { border:0; background:none; color:var(--muted); font-size:.7rem; cursor:pointer; padding:5px; }
  .identity strong { display:block; font-size:.77rem; }
  .identity small { color:var(--dim); font-size:.67rem; }
  .identity .avatar { width:30px; height:30px; font-size:.7rem; }
  .body { min-width:0; }
  .topbar { height:62px; display:flex; justify-content:space-between; align-items:center; gap:12px; padding:0 clamp(18px,4vw,43px); border-bottom:1px solid var(--line); background:#0e1526; }
  .crumb { display:flex; gap:10px; align-items:center; color:var(--muted); font-size:.8rem; }
  .crumb svg { width:12px; height:12px; }
  .crumb strong { color:var(--text); font-weight:600; }
  .top-controls { display:flex; gap:10px; align-items:center; }
  .body main { max-width:1560px; margin:0 auto; padding:clamp(23px,4vw,44px); }
  .page-head { display:flex; align-items:start; justify-content:space-between; gap:16px; margin-bottom:24px; }
  .page-head p { color:var(--muted); font-size:.88rem; margin-top:9px; }
  .page-head .button { flex-shrink:0; }
  .loading,.signin { min-height:100dvh; display:grid; place-items:center; padding:20px; }
  .signin { background:radial-gradient(ellipse at 47% 40%,#1d294b,transparent 61%); }
  .signin .panel { width:min(100%,440px); padding:30px; box-shadow:0 25px 75px #0007; }
  .signin form { display:grid; gap:14px; margin-top:21px; }
}
@layer components {
  .button { background:#1a2742; border:1px solid #344565; color:#d9e4ff; padding:9px 13px; min-height:36px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; gap:7px; cursor:pointer; font-size:.79rem; font-weight:600; line-height:1.25; }
  .button:hover { background:#26365b; color:white; }
  .button.primary { background:#a2afff; color:#121931; border-color:#aab6ff; }
  .button.primary:hover { background:#c0caff; }
  .button svg { width:15px; height:15px; }
  .button.square { min-width:36px; padding:7px; }
  .button.mobile-menu { display:none; }
  .button:disabled { opacity:.5; cursor:wait; }
  .panel,.metric { background:linear-gradient(150deg,#151f35,var(--panel) 75%); border:1px solid var(--line); border-radius:var(--radius); }
  .panel { padding:19px; min-width:0; }
  .panel-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:16px; }
  .panel-head a { font-size:.77rem; }
  .metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; margin-bottom:17px; }
  .metric { padding:17px; min-width:0; }
  .metric-top { display:flex; justify-content:space-between; gap:8px; align-items:center; color:#b3c0dd; font-size:.76rem; }
  .icon-chip { width:33px; height:33px; display:grid; place-items:center; border-radius:9px; background:#222e52; color:var(--bright); flex:none; }
  .icon-chip svg { width:16px; height:16px; }
  .metric-value { font-weight:730; font-size:1.9rem; letter-spacing:-.052em; margin:8px 0 4px; }
  .muted { color:var(--muted); font-size:.8rem; }
  .dashboard-grid,.split { display:grid; grid-template-columns:minmax(0,1.58fr) minmax(0,1fr); gap:15px; margin-bottom:15px; }
  .stack { display:grid; gap:15px; }
  .table-wrap { overflow:auto; }
  table { width:100%; border-collapse:collapse; font-size:.82rem; }
  td,th { padding:12px 8px; text-align:left; border-bottom:1px solid var(--line); vertical-align:top; overflow-wrap:anywhere; }
  th { font-size:.68rem; color:var(--muted); letter-spacing:.05em; text-transform:uppercase; }
  tr:last-child td { border-bottom:0; }
  .empty { text-align:center; color:var(--muted); min-height:111px; display:grid; place-content:center; gap:7px; padding:17px; border:1px dashed #334362; border-radius:11px; font-size:.82rem; }
  .empty b { color:var(--text); }
  .empty .icon-chip { margin:auto; }
  .row { display:flex; justify-content:space-between; align-items:center; gap:12px; border-bottom:1px solid var(--line); padding:11px 0; min-width:0; }
  .row:last-child { border-bottom:0; }
  .row b { display:block; font-size:.86rem; overflow-wrap:anywhere; }
  .row small { color:var(--muted); font-size:.73rem; overflow-wrap:anywhere; }
  .row .badge { flex:none; }
  .badge { display:inline-flex; align-items:center; gap:6px; padding:4px 8px; border-radius:20px; font-size:.68rem; line-height:1.2; white-space:nowrap; font-weight:650; border:1px solid transparent; }
  .badge::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
  .badge.green { color:var(--green); background:#15332f; border-color:#25483f; }
  .badge.amber { color:#ffe0a0; background:#372e26; border-color:#503d2e; }
  .badge.red { color:#ffadbd; background:#3c2436; border-color:#563145; }
  .badge.muted { color:#b7c4e4; background:#202a40; border-color:#354461; }
  .avatar { display:grid; place-items:center; border-radius:9px; width:39px; height:39px; background:#26335b; color:#c4ccff; font-size:.79rem; font-weight:750; flex:none; }
  .cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(250px,100%),1fr)); gap:13px; }
  .person { display:grid; gap:10px; }
  .person-top { display:flex; gap:10px; align-items:center; }
  .person p { font-size:.81rem; color:var(--muted); }
  .org-root { border-color:#5263a3; max-width:300px; margin:0 auto 22px; }
  .org-group h2 { margin-bottom:7px; }
  .kanban { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
  .lane { padding:12px; background:#0d1528; border:1px solid var(--line); border-radius:12px; min-width:0; }
  .lane > header { display:flex; justify-content:space-between; margin-bottom:11px; gap:8px; align-items:center; font-size:.78rem; }
  .lane .panel { margin:8px 0; padding:11px; overflow-wrap:anywhere; }
  .lane .panel .badge { margin:8px 0; }
  .actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; align-items:center; }
  .fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(175px,100%),1fr)); gap:11px; }
  label { display:grid; gap:6px; color:var(--muted); font-size:.78rem; min-width:0; }
  input,select,textarea { width:100%; min-width:0; padding:9px 10px; outline:0; background:#0c1528; color:var(--text); border:1px solid #384a6c; border-radius:7px; }
  textarea { min-height:96px; resize:vertical; }
  form .button { margin-top:10px; }
  .inline { display:flex; gap:8px; align-items:center; }
  .inline input { width:auto; }
  details { padding:10px 0; overflow-wrap:anywhere; }
  summary { cursor:pointer; color:var(--bright); font-size:.82rem; font-weight:600; }
  details > div, details > pre { margin-top:10px; }
  pre,code { white-space:pre-wrap; overflow-wrap:anywhere; font-size:.76rem; color:#c8d4f3; }
  .hash { display:inline-block; margin:8px 0; word-break:break-all; }
  .budget-track { display:flex; justify-content:space-between; gap:8px; margin:12px 0 7px; font-size:.76rem; color:var(--muted); }
  meter { appearance:none; width:100%; height:12px; }
  meter::-webkit-meter-bar { border:0; border-radius:20px; background:#263352; }
  meter::-webkit-meter-optimum-value { background:#9bacff; border-radius:20px; }
  .stage-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
  .stage { border:1px solid var(--line); background:#111b31; border-radius:8px; padding:9px; color:var(--muted); font-size:.72rem; display:flex; gap:8px; justify-content:space-between; }
  .stage span { color:var(--text); font-weight:650; }
  #notice { position:fixed; z-index:8; right:20px; bottom:20px; max-width:min(470px,calc(100% - 40px)); background:#1b2947; padding:13px 17px; border:1px solid #50638b; border-radius:10px; color:var(--text); box-shadow:0 8px 36px #0007; font-size:.83rem; }
  #notice[data-error=true] { background:#422338; border-color:#884568; }
  .section-gap { margin-top:14px; }
}
@layer responsive {
  @media (max-width:1120px) { .shell { grid-template-columns:218px minmax(0,1fr); } .kanban { grid-template-columns:repeat(2,minmax(0,1fr)); } }
  @media (max-width:860px) { .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .dashboard-grid,.split { grid-template-columns:minmax(0,1fr); } }
  @media (max-width:680px) {
    .shell { display:block; }
    .sidebar { position:fixed; top:0; left:0; width:min(290px,85vw); transform:translateX(-105%); box-shadow:0 0 50px #000a; }
    .shell[data-menu=true] .sidebar { transform:none; }
    .button.mobile-menu { display:inline-flex; }
    .crumb > span,.crumb > svg,.top-controls > .badge { display:none; }
    .topbar { height:58px; }
    .body main { padding:20px 15px 28px; }
    .page-head { flex-wrap:wrap; margin-bottom:19px; }
    .metric { padding:12px; }
    .metric-value { font-size:1.55rem; }
    .stage-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  }
  @media (max-width:450px) {
    .kanban { grid-template-columns:minmax(0,1fr); }
    .panel { padding:14px; }
    .metric-top .icon-chip { width:25px; height:25px; }
  }
}

