:root {
  --ink: #141414;
  --muted: #6e6a66;
  --faint: #a29d98;
  --line: #e7e2dd;
  --paper: #faf8f6;
  --bg: #ffffff;
  --accent: #84481c;
  --accent-soft: #f3ebe5;
  --ok: #4f6b3a;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-weight: 300; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button { font-family: var(--font); }

/* ---- top bar ---- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 18px; }
.brand img { height: 40px; width: auto; display: block; }
.brand .sep { width: 1px; height: 26px; background: var(--line); }
.caps { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted);
  font-weight: 400; }
.top .meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 13px; padding: 0; }

/* ---- layout ---- */
.wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: calc(100vh - 69px); }
main { padding: 34px 40px 60px; max-width: 1100px; }
aside { border-left: 1px solid var(--line); background: var(--paper); position: sticky; top: 69px;
  height: calc(100vh - 69px); display: flex; flex-direction: column; }

.hello h1 { font-weight: 300; font-size: 34px; margin: 0 0 6px; letter-spacing: -.01em; }
.hello p { margin: 0; color: var(--muted); font-size: 14px; }
.rule { display: flex; align-items: center; gap: 14px; margin: 34px 0 18px; }
.rule::before, .rule::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.rule::before { flex: 0 0 26px; background: var(--accent); }

/* ---- numbers ---- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 28px; }
.kpi { background: var(--bg); padding: 18px 20px; }
.kpi .n { font-size: 34px; font-weight: 300; line-height: 1; }
.kpi .l { margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.35; }

/* ---- jobs ---- */
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--bg); }
.job .no { font-size: 11px; letter-spacing: .2em; color: var(--accent); font-weight: 500; }
.job h3 { margin: 4px 0 2px; font-weight: 500; font-size: 16px; }
.job .dates { font-size: 12px; color: var(--muted); }
.bar { height: 4px; border-radius: 4px; background: var(--accent-soft); margin: 14px 0 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.job .prog { font-size: 12px; color: var(--muted); }
.job ul { list-style: none; padding: 0; margin: 12px 0 0; font-size: 13px; }
.job li { display: flex; gap: 10px; padding: 5px 0; border-top: 1px dashed var(--line); }
.job li b { font-weight: 500; min-width: 52px; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font-size: 11px; padding: 4px 9px; border-radius: 99px; background: var(--paper);
  border: 1px solid var(--line); color: var(--muted); }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.empty { font-size: 13px; color: var(--faint); }

/* ---- two-up panels ---- */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hbar { display: grid; grid-template-columns: 120px 1fr 28px; align-items: center; gap: 10px;
  font-size: 13px; margin: 7px 0; }
.hbar .t { height: 8px; background: var(--paper); border-radius: 4px; overflow: hidden; }
.hbar .t i { display: block; height: 100%; background: var(--accent); opacity: .85; }
.hbar span:last-child { text-align: right; color: var(--muted); }
.list { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.list li span:last-child { color: var(--muted); white-space: nowrap; }
.big { font-size: 26px; font-weight: 300; }
.sub { font-size: 12px; color: var(--muted); }
.months { display: flex; align-items: flex-end; gap: 8px; height: 70px; margin-top: 14px; }
.months div { flex: 1; text-align: center; font-size: 10px; color: var(--muted); }
.months i { display: block; background: var(--accent); opacity: .8; border-radius: 3px 3px 0 0; margin-bottom: 4px; }

/* ---- chat ---- */
.chat-head { padding: 20px 22px 12px; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 6px 0 0; font-weight: 400; font-size: 18px; }
.msgs { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.msg { font-size: 14px; line-height: 1.5; max-width: 92%; }
.msg.user { align-self: flex-end; background: var(--ink); color: #fff; padding: 9px 13px;
  border-radius: 14px 14px 2px 14px; }
.msg.bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--line);
  padding: 10px 14px; border-radius: 14px 14px 14px 2px; }
.msg.bot ul { margin: 6px 0; padding-left: 18px; }
.msg.bot p { margin: 0 0 6px; }
.msg.bot p:last-child { margin: 0; }
.msg.wait { color: var(--faint); font-style: italic; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.sugg button { font-size: 12px; border: 1px solid var(--line); background: var(--bg); border-radius: 99px;
  padding: 6px 11px; cursor: pointer; color: var(--ink); font-weight: 300; }
.sugg button:hover { border-color: var(--accent); color: var(--accent); }
form.ask { display: flex; gap: 8px; padding: 14px 18px 18px; border-top: 1px solid var(--line); }
form.ask input { flex: 1; border: 1px solid var(--line); border-radius: 99px; padding: 11px 16px;
  font: 300 14px var(--font); background: var(--bg); outline: none; }
form.ask input:focus { border-color: var(--accent); }
form.ask button { border: 0; background: var(--accent); color: #fff; border-radius: 99px;
  padding: 0 18px; font-size: 14px; cursor: pointer; }
.note { font-size: 11px; color: var(--faint); padding: 0 22px 14px; }
.fab { display: none; }

/* ---- login ---- */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--paper); padding: 16px; }
.login .box { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 40px 36px;
  width: 100%; max-width: 380px; text-align: center; }
.login img { width: 220px; height: auto; }
.login input { width: 100%; margin-top: 26px; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; font: 300 15px var(--font); }
.login button { width: 100%; margin-top: 12px; border: 0; background: var(--ink); color: #fff;
  border-radius: 8px; padding: 12px; font-size: 15px; cursor: pointer; }
.login .err { color: #a33; font-size: 13px; margin-top: 12px; min-height: 16px; }

/* ---- site check-in ---- */
.checkin { margin-top: 14px; border: 1px solid var(--accent); background: var(--bg); color: var(--accent);
  border-radius: 99px; padding: 7px 14px; font-size: 13px; cursor: pointer; font-weight: 400; }
.checkin:hover { background: var(--accent); color: #fff; }
.checked { font-size: 12px; color: var(--ok); margin: 12px 0 0; }
dialog#ci { border: 1px solid var(--line); border-radius: 14px; padding: 26px 26px 20px; width: min(560px, 94vw);
  max-height: 88vh; color: var(--ink); font-family: var(--font); }
dialog#ci::backdrop { background: rgba(20,20,20,.35); }
dialog#ci h3 { font-weight: 500; margin: 6px 0 4px; }
dialog#ci fieldset { border: 0; border-top: 1px solid var(--line); margin: 14px 0 0; padding: 14px 0 0; }
dialog#ci legend { font-size: 14px; font-weight: 500; padding: 0; float: left; width: 100%; }
dialog#ci legend span { display: block; font-weight: 300; font-size: 12px; color: var(--muted); margin-top: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; clear: both; padding-top: 4px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: inline-block; font-size: 12px; padding: 6px 11px; border: 1px solid var(--line);
  border-radius: 99px; }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.note-in, .by-in { width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 11px; font: 300 13px var(--font); }
.by-in { margin-top: 18px; }
.ci-actions { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 16px; }
.save { border: 0; background: var(--accent); color: #fff; border-radius: 99px; padding: 10px 18px;
  font-size: 14px; cursor: pointer; }

/* ---- small screens ---- */
@media (max-width: 1000px) {
  .wrap { grid-template-columns: 1fr; }
  main { padding: 24px 16px 90px; }
  .top { padding: 12px 16px; }
  .brand .sep, .brand .caps { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr; }
  aside { position: fixed; inset: 0; top: 0; height: 100vh; z-index: 20; transform: translateY(100%);
    transition: transform .25s ease; }
  aside.open { transform: none; }
  .fab { display: block; position: fixed; right: 16px; bottom: 16px; z-index: 15; border: 0;
    background: var(--accent); color: #fff; border-radius: 99px; padding: 14px 20px; font-size: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,.18); }
  .close { display: inline-block !important; }
}
.close { display: none; float: right; }

/* ---- whose court ---- */
.nm { font-weight: 500; }
.list li > span:first-child { min-width: 0; }
.warm, .list li span.warm { color: #9a6a1f; }
.hot, .list li span.hot { color: #a2401f; font-weight: 500; }
.list a { color: var(--accent); text-decoration: none; }
#me .list li { padding: 9px 0; }

/* ---- chat history ---- */
.chat-tools { float: right; display: flex; gap: 14px; }
.hist { flex: 1; overflow-y: auto; padding: 8px 22px 18px; }
.hist-item { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 2px; width: 100%; }
.hist-item:hover .nm { color: var(--accent); }

[hidden] { display: none !important; }

/* ---- approvals ---- */
.brief { margin-top: 26px; background: var(--accent-soft); border-color: transparent; }
.brief p, .brief li { font-size: 14px; }
.prop { border-top: 1px solid var(--line); padding: 12px 0; }
.prop:first-of-type { border-top: 0; }
.prop-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.prop .why { margin-top: 4px; }
.prop-actions { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.prop-actions .save { padding: 8px 16px; font-size: 13px; }
.prop-actions button:disabled { opacity: .5; cursor: default; }
.result { color: var(--ok); }
.recent { margin-top: 10px; }
.recent summary { cursor: pointer; }
.msg.props { max-width: 100%; width: 100%; }

/* ---- tabs + approvals view ---- */
.tabs { display: flex; gap: 6px; margin-left: 18px; }
.tab { font-size: 13px; color: var(--muted); text-decoration: none; padding: 7px 12px; border-radius: 99px; }
.tab.active { background: var(--accent-soft); color: var(--accent); }
.badge { display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 99px; background: var(--accent);
  color: #fff; font-size: 11px; text-align: center; margin-left: 4px; }
.ok-strip { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 18px; text-decoration: none;
  color: var(--ink); border-color: var(--accent); }
.ok-strip .link { margin-left: auto; }
.modes { margin-top: 24px; }
.group { margin-bottom: 14px; }
.group-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
@media (max-width: 1000px) { .tabs { margin-left: 8px; } .tab { padding: 6px 9px; } }

.scope { margin-top: 4px; font-size: 11px; letter-spacing: .02em; }
.scope.internal, .scope.assistant { color: var(--ok); }
.scope.external { color: #a2401f; font-weight: 500; }
