/*
 * Command centre styles.
 *
 * Every value here is copied verbatim from design/migrateos-dashboard.html, which
 * is the design authority (CLAUDE.md rule 4). Nothing is approximated and no
 * one-off hex value is introduced: if a colour or radius is needed that the token
 * block does not have, it goes into the design file first.
 *
 * Only the blocks this view actually uses are here. The drawer, approval queue,
 * task list and login panel stay in the design file until the features that need
 * them exist — copied-but-unused CSS is how a stylesheet stops describing the
 * product.
 */

:root{
  --ink:#0E1B2C;          /* passport cover navy */
  --ink-2:#16263C;
  --ink-3:#1F3452;
  --paper:#F3F5F8;        /* cool document ground */
  --card:#FFFFFF;
  --line:#DDE3EB;
  --text:#18283D;
  --muted:#5B6B80;
  --foil:#B9902F;         /* gold foil */
  --foil-2:#DCB75A;
  --grant:#1E7D5B;        /* granted green */
  --amber:#C77F14;
  --alert:#BE3B2A;
  --radius:10px;
  --shadow:0 1px 2px rgba(14,27,44,.06),0 8px 24px rgba(14,27,44,.07);
}
*{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px}
body{font-family:'Public Sans',system-ui,sans-serif;background:var(--paper);color:var(--text);-webkit-font-smoothing:antialiased}
.mono{font-family:'Spline Sans Mono',monospace}
.eyebrow{font-family:'Archivo',sans-serif;font-stretch:125%;font-weight:600;font-size:.66rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
button{font:inherit;cursor:pointer;border:none;background:none;color:inherit}
:focus-visible{outline:2px solid var(--foil);outline-offset:2px;border-radius:4px}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
.hidden{display:none!important}

/* ---------- APP SHELL ---------- */
#app{display:grid;grid-template-columns:232px 1fr;min-height:100vh}
aside{background:var(--ink);color:#C7D2E0;display:flex;flex-direction:column;padding:1.4rem 0;position:sticky;top:0;height:100vh}
.aside-brand{padding:0 1.4rem 1.5rem}
.wordmark{font-family:'Archivo';font-stretch:125%;font-weight:700;font-size:1.05rem;letter-spacing:.22em;color:#fff}
.wordmark b{color:var(--foil-2);font-weight:700}
nav{flex:1}
.nav-item{display:flex;align-items:center;gap:.7rem;width:100%;padding:.62rem 1.4rem;font-size:.86rem;font-weight:500;color:#9FB0C6;border-left:3px solid transparent;text-align:left}
.nav-item svg{width:17px;height:17px;flex:none}
.nav-item:hover{color:#fff;background:rgba(255,255,255,.04)}
.nav-item.active{color:#fff;background:linear-gradient(90deg,rgba(220,183,90,.12),transparent);border-left-color:var(--foil-2)}
/* Not in the mock, which had every screen built. A section that does not exist yet
   is shown dimmed and inert rather than as a button that silently does nothing. */
.nav-item:disabled{opacity:.45;cursor:default}
.nav-item:disabled:hover{color:#9FB0C6;background:none}

main{padding:1.6rem 2rem 3rem;max-width:1240px;width:100%}
.topbar{display:flex;align-items:center;gap:1rem;margin-bottom:1.6rem}
.topbar h1{font-family:'Archivo';font-stretch:125%;font-weight:600;font-size:1.25rem}
.topbar .date{font-size:.8rem;color:var(--muted)}
.avatar{width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,var(--foil),var(--foil-2));color:#fff;display:grid;place-items:center;font-weight:700;font-size:.8rem;margin-left:auto}

/* stat strip */
.strip-controls{display:flex;align-items:center;gap:.8rem;margin-bottom:.8rem}
.seg{display:inline-flex;background:var(--card);border:1px solid var(--line);border-radius:8px;padding:2px}
.seg button{padding:.32rem .7rem;font-size:.72rem;font-weight:600;color:var(--muted);border-radius:6px}
.seg button.on{background:var(--ink);color:#fff}
.seg button:disabled{opacity:.4;cursor:default}
.strip-controls .hint{font-size:.7rem;color:var(--muted);margin-left:auto}
.stats{display:grid;grid-template-columns:repeat(5,1fr);gap:1rem;margin-bottom:1.6rem}
.stat{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:1rem 1.1rem;box-shadow:var(--shadow)}
.stat .n{font-family:'Spline Sans Mono';font-weight:600;font-size:1.7rem;margin-top:.35rem}
.stat .d{font-size:.74rem;color:var(--muted);margin-top:.2rem}
.stat.warn .n{color:var(--alert)}
.stat.gold .n{color:var(--foil)}

/* 2.1fr rather than the mock's 1.7fr: the matters table carries six columns and a
   stage pill, and at 1.7fr "Docs Collection" and "Next deadline" wrap. The rail
   holds short lines and narrows without complaint. */
.grid{display:grid;grid-template-columns:2.1fr 1fr;gap:1.25rem;align-items:start}
.panel{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.panel-h{display:flex;align-items:center;gap:.6rem;padding:1rem 1.2rem;border-bottom:1px solid var(--line)}
.panel-h h2{font-family:'Archivo';font-stretch:125%;font-weight:600;font-size:.95rem}
.panel-h .count{font-family:'Spline Sans Mono';font-size:.72rem;color:var(--muted)}

/* matters table */
.matters{margin-top:0}
table{width:100%;border-collapse:collapse;font-size:.84rem}
/* nowrap on both: a column header and a status pill are single tokens, and at any
   viewport where they would break they should compress the column instead. The
   grid ratio alone cannot guarantee this — measured at 2.1fr the pill missed by
   two pixels, which a different window width would simply reintroduce. */
th{font-family:'Archivo';font-stretch:125%;font-size:.62rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);text-align:left;padding:.7rem 1.2rem;border-bottom:1px solid var(--line);font-weight:600;white-space:nowrap}
td{padding:.78rem 1.2rem;border-bottom:1px solid var(--line);vertical-align:middle}
tr:last-child td{border-bottom:none}
.who .name{font-weight:600}
.who .sub{font-size:.72rem;color:var(--muted)}
.stage{display:inline-flex;align-items:center;gap:.4rem;font-size:.72rem;font-weight:600;padding:.22rem .6rem;border-radius:99px;background:#EEF2F7;color:#3D5270;white-space:nowrap}
.stage::before{content:"";width:6px;height:6px;border-radius:50%;background:#3D5270}
.stage.docs{background:#FAF3E2;color:#8A6D1C}.stage.docs::before{background:var(--amber)}
.stage.qa{background:#EFF7F3;color:var(--grant)}.stage.qa::before{background:var(--grant)}
.stage.lodg{background:#EDF0FA;color:#3C4F9E}.stage.lodg::before{background:#3C4F9E}
.stage.rfi{background:#FBEFEC;color:var(--alert)}.stage.rfi::before{background:var(--alert)}
.qbadge{font-family:'Spline Sans Mono';font-size:.76rem;font-weight:600}
.qbadge.g{color:var(--grant)}.qbadge.a{color:var(--amber)}.qbadge.r{color:var(--alert)}
.bal{font-family:'Spline Sans Mono';font-size:.76rem;font-weight:600;color:var(--grant)}
.bal.due{color:var(--amber)}
.bal.block{color:var(--alert)}
.bal .why{display:block;font-family:'Public Sans';font-size:.6rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--alert);margin-top:.1rem}
.missing{font-family:'Spline Sans Mono';font-size:.76rem;color:var(--muted)}

/* Empty states. Not in the mock, which was full of data everywhere; a real
   practice on day one is not. Uses existing tokens only. */
.empty{padding:1.5rem 1.2rem;font-size:.82rem;color:var(--muted);line-height:1.55}
.empty b{display:block;font-family:'Archivo';font-stretch:125%;font-weight:600;font-size:.85rem;color:var(--text);margin-bottom:.3rem}

/* The lifecycle flag: a contact in the Matter pipeline who is not marked a client.
   Shown rather than hidden — see matter_opportunities in migration 0014. */
.flag{display:inline-flex;align-items:center;gap:.35rem;font-size:.68rem;font-weight:700;letter-spacing:.06em;color:var(--alert);background:#FBEFEC;border:1px solid #EBC5BE;border-radius:99px;padding:.1rem .45rem;margin-left:.4rem}

/* deadlines rail */
.dl{display:flex;gap:.85rem;padding:.85rem 1.2rem;border-bottom:1px solid var(--line);align-items:center}
.dl:last-child{border:none}
.dl-days{flex:none;width:56px;text-align:center;border-radius:8px;padding:.4rem 0;background:#F4F6F9}
.dl-days .n{font-family:'Spline Sans Mono';font-weight:600;font-size:1.05rem;line-height:1}
.dl-days .u{font-size:.58rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.dl.hot .dl-days{background:#FBEFEC}.dl.hot .n{color:var(--alert)}
.dl.warm .dl-days{background:#FAF3E2}.dl.warm .n{color:var(--amber)}
.dl-t{font-size:.84rem;font-weight:600}
.dl-s{font-size:.74rem;color:var(--muted);margin-top:.1rem}

/* tasks */
.task{display:flex;gap:.7rem;padding:.75rem 1.2rem;border-bottom:1px solid var(--line);align-items:flex-start}
.task:last-child{border:none}
.task input[type=checkbox]{margin-top:.25rem;accent-color:var(--foil);width:15px;height:15px}
.task .tt{font-size:.83rem;font-weight:600}
.task .ts{font-size:.72rem;color:var(--muted);margin-top:.15rem}
.auto{display:inline-flex;align-items:center;font-size:.6rem;font-weight:700;letter-spacing:.07em;color:#8A6D1C;background:#FAF5E6;border:1px solid #EADFC0;border-radius:99px;padding:.1rem .45rem;margin-left:.45rem;vertical-align:1px}
.task .assig{margin-left:auto;flex:none;display:flex;align-items:center;padding-top:.1rem}
.mini-av{width:24px;height:24px;border-radius:50%;background:var(--ink-3);color:#fff;font-size:.6rem;font-weight:700;display:grid;place-items:center;border:2px solid #fff}
.mini-av+.mini-av{margin-left:-8px}
.mini-av.gold{background:linear-gradient(135deg,var(--foil),var(--foil-2))}

/* AI activity */
.act{display:flex;gap:.75rem;padding:.8rem 1.2rem;border-bottom:1px solid var(--line)}
.act:last-child{border:none}
.act-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--foil);margin-top:.42rem}
.act-t{font-size:.82rem;line-height:1.45}
.act-t .mono{font-size:.74rem;color:var(--muted)}
.act-time{margin-left:auto;flex:none;font-family:'Spline Sans Mono';font-size:.68rem;color:var(--muted);padding-top:.15rem}

/* drawer */
tr.row:hover{background:#FAFBFD;cursor:pointer}
#scrim{position:fixed;inset:0;background:rgba(14,27,44,.45);opacity:0;pointer-events:none;transition:opacity .2s;z-index:40}
#drawer{position:fixed;top:0;right:-520px;width:min(520px,94vw);height:100vh;background:var(--card);z-index:50;box-shadow:-16px 0 48px rgba(14,27,44,.2);transition:right .25s ease;display:flex;flex-direction:column}
body.drawer-open #scrim{opacity:1;pointer-events:auto}
body.drawer-open #drawer{right:0}
.dr-h{padding:1.3rem 1.5rem 1.1rem;border-bottom:1px solid var(--line);background:linear-gradient(180deg,#FAFBFD,transparent);position:relative}
.dr-h .eyebrow{color:var(--foil)}
.dr-h h3{font-family:'Archivo';font-stretch:125%;font-weight:600;font-size:1.15rem;margin:.3rem 0 .15rem}
.dr-h .sub{font-size:.8rem;color:var(--muted)}
.dr-close{position:absolute;top:1.1rem;right:1.2rem;font-size:1.1rem;color:var(--muted);padding:.3rem .5rem}
.dr-body{flex:1;overflow-y:auto;padding:1.2rem 1.5rem}
.dr-sec{margin-bottom:1.5rem}
.dr-sec h4{font-family:'Archivo';font-stretch:125%;font-size:.68rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin-bottom:.7rem;font-weight:600}
.kv{display:grid;grid-template-columns:1fr 1fr;gap:.6rem .9rem}
.kv .k{font-size:.7rem;color:var(--muted)}
.kv .v{font-size:.85rem;font-weight:600}
.tl{border-left:2px solid var(--line);padding-left:1rem;display:flex;flex-direction:column;gap:.85rem}
.tl-i{position:relative;font-size:.82rem;line-height:1.45}
.tl-i::before{content:"";position:absolute;left:-1.34rem;top:.35rem;width:9px;height:9px;border-radius:50%;background:var(--line)}
.tl-i.gold::before{background:var(--foil)}
.tl-i .t{color:var(--muted);font-family:'Spline Sans Mono';font-size:.68rem;display:block}
.doclist{display:flex;flex-direction:column;gap:.5rem}
.doc{display:flex;align-items:center;gap:.6rem;border:1px solid var(--line);border-radius:8px;padding:.55rem .75rem;font-size:.8rem}
.doc .st{margin-left:auto;font-size:.68rem;font-weight:700}
.doc .st.ok{color:var(--grant)}.doc .st.iss{color:var(--alert)}.doc .st.mis{color:var(--muted)}
.billrow{display:flex;justify-content:space-between;font-size:.8rem;padding:.35rem 0;border-bottom:1px dashed var(--line)}
.billrow:last-child{border:none}
.billrow .v{font-family:'Spline Sans Mono';font-weight:600}
.msg{display:flex;gap:.6rem;margin-bottom:.85rem}
.msg .mini-av{flex:none;border:none;width:28px;height:28px;font-size:.64rem}
.msg-b{background:#F4F6F9;border-radius:10px;padding:.55rem .75rem;font-size:.8rem;line-height:1.45;flex:1}
.msg-in{display:flex;gap:.5rem;margin-top:.2rem}
.msg-in input{flex:1;border:1px solid var(--line);border-radius:8px;padding:.55rem .75rem;font:inherit;font-size:.8rem;background:#FBFCFE}
.msg-in input:disabled{background:#F4F6F9;color:var(--muted)}
.msg-in button{padding:.5rem .8rem;background:var(--ink);color:#fff;border-radius:8px;font-size:.76rem;font-weight:600}
.msg-in button:disabled{opacity:.4;cursor:default}
.dr-foot{padding:1rem 1.5rem;border-top:1px solid var(--line);display:flex;gap:.7rem}
.btn-appr{padding:.5rem .95rem;background:var(--ink);color:#fff;border-radius:7px;font-size:.78rem;font-weight:600}
.btn-open{padding:.45rem .95rem;border:1px solid var(--line);border-radius:7px;font-size:.78rem;font-weight:600;color:var(--muted)}
.dr-foot .btn-appr{flex:1;padding:.75rem}
.dr-foot .btn-open{flex:1;text-align:center;padding:.75rem}
.dr-foot button:disabled{opacity:.45;cursor:default}

/* An empty state inside the drawer, where the panel padding does not apply. */
.dr-empty{font-size:.8rem;color:var(--muted);line-height:1.55}

/* the session gate */
#gate{min-height:100vh;display:grid;place-items:center;background:var(--ink);padding:2rem}
.gate-card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:2.2rem 2.4rem;max-width:460px}
.gate-card h1{font-family:'Archivo';font-stretch:125%;font-weight:600;font-size:1.15rem;margin:.5rem 0 .7rem}
.gate-card p{font-size:.85rem;color:var(--muted);line-height:1.6}

@media(max-width:960px){
  #app{grid-template-columns:1fr}
  aside{position:fixed;left:-260px;z-index:45}
  .grid{grid-template-columns:1fr}
  .stats{grid-template-columns:repeat(2,1fr)}
  main{padding:1.2rem}
}
