:root {
  color-scheme: light;
  --ink: #1a1d22;
  --muted: #6f737b;
  --line: #e9e7e1;
  --paper: #f4f2ed;
  --panel: #fffefb;
  --accent: #1e5c47;
  --accent-soft: #e3eee8;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, a { font: inherit; }
button, .button { border: 0; border-radius: 999px; padding: 11px 18px; color: white; background: var(--accent); font-weight: 700; cursor: pointer; text-decoration: none; }
button.secondary, .button.secondary { color: var(--ink); background: transparent; border: 1px solid #d6d3cc; }
button:disabled { cursor: wait; opacity: .65; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; display: flex; flex-direction: column; background: #17231e; color: white; }
.brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 12px; margin: 0 8px 42px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #dbe9df; color: #183d31; font-weight: 900; }
.brand span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { color: #99aaa3; margin-top: 4px; }
nav { display: grid; gap: 8px; }
nav a { color: #b6c1bd; text-decoration: none; display: flex; justify-content: space-between; padding: 11px 13px; border-radius: 10px; }
nav a.active, nav a:hover { color: white; background: #24372f; }
nav b { font-size: 12px; background: #355147; border-radius: 20px; padding: 1px 8px; }
.sidebar-foot { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid #31423b; display: flex; gap: 10px; align-items: center; }
.sidebar-foot span:last-child { display: flex; flex-direction: column; }
.sidebar-foot small { color: #9caaa5; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #7ed0a9; box-shadow: 0 0 0 5px #2b483b; }
main { width: min(1220px, 100%); padding: 54px 5vw; }
.topbar { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 34px; }
.topbar h1 { font-family: ui-serif, Georgia, serif; font-weight: 600; letter-spacing: -.035em; font-size: clamp(34px, 4vw, 54px); line-height: 1.06; margin: 4px 0 10px; }
.topbar p { margin: 0; color: var(--muted); }
.eyebrow { margin: 0; color: #597066; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.top-actions { display: flex; gap: 10px; flex-shrink: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metrics article, .panel, .run-strip { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.metrics article { padding: 20px; display: grid; }
.metrics span { color: var(--muted); }
.metrics strong { font-family: ui-serif, Georgia, serif; font-size: 34px; font-weight: 600; margin: 6px 0 0; }
.metrics small { color: #8a8e94; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 18px; }
.panel { padding: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: end; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.panel h2 { margin: 4px 0 0; font: 600 24px/1.2 ui-serif, Georgia, serif; }
.panel-head a { color: var(--accent); font-weight: 700; text-decoration: none; }
.message-list { display: grid; }
.message-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 13px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.message-row:last-child { border: 0; padding-bottom: 0; }
.message-row div { display: flex; flex-direction: column; min-width: 0; }
.message-row strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message-row div span { color: var(--muted); font-size: 13px; }
.sender-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #ece9e1; font-weight: 800; }
.pill { border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 800; }
.pill.amber { color: #8a5500; background: #fff0cb; }
.pill.blue { color: #25597c; background: #dfeef7; }
.pill.violet { color: #65508e; background: #eee7fb; }
.focus-card { background: #24392f; color: white; border-color: #24392f; }
.focus-card .eyebrow { color: #9fc2b3; }
.focus-card > p:not(.eyebrow) { color: #c4d0cb; }
.focus-card dl { margin: 24px 0; padding: 18px 0; border-block: 1px solid #3e544a; }
.focus-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.focus-card dt { color: #aebdb7; }
.focus-card dd { margin: 0; font-weight: 700; }
.focus-card button { background: #e9f2ed; color: #183b30; width: 100%; }
.focus-card button.danger { background: transparent; color: #f0c7c2; border: 1px solid #60736a; }
.approval-actions { display: grid; grid-template-columns: 1fr .55fr; gap: 8px; }
.approval-actions form { margin: 0; }
.empty-state { min-height: 190px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); padding: 28px; }
.empty-state strong { color: var(--ink); font: 600 21px ui-serif, Georgia, serif; }
.empty-state span { max-width: 460px; margin-top: 7px; }
.notices p { border: 1px solid #bcd8ca; background: #e7f3ec; border-radius: 12px; padding: 10px 14px; color: #174a38; }
.auth-card { max-width: 520px; margin: 8vh auto; padding: 38px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; }
.auth-card h1 { font: 600 40px/1.1 ui-serif, Georgia, serif; margin: 8px 0 12px; }
.auth-card > p:not(.eyebrow) { color: var(--muted); }
.auth-card form { display: grid; gap: 16px; margin-top: 28px; }
.auth-card label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; }
.auth-card input { width: 100%; border: 1px solid #d5d2cb; border-radius: 10px; background: white; padding: 12px 13px; font: inherit; }
.form-error { color: #9b2f27 !important; min-height: 24px; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font: 600 clamp(34px, 4vw, 50px)/1.08 ui-serif, Georgia, serif; margin: 5px 0 8px; }
.page-head > p:last-child { color: var(--muted); }
.split-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.data-list { display: grid; }
.data-list > article, .data-link { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.data-list > article:last-child, .data-link:last-child { border-bottom: 0; }
.data-list article > div, .data-link > div { display: grid; min-width: 0; }
.data-list article span, .data-link div span { color: var(--muted); }
.document pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.75 ui-sans-serif, sans-serif; }
.run-strip { margin-top: 18px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.run-strip > div, .run-strip span:nth-child(2) { display: flex; align-items: center; gap: 12px; }
.run-strip span span { display: flex; flex-direction: column; color: var(--ink); }
.run-strip small { color: var(--muted); }
.run-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 900; }
.row-actions { display: flex !important; grid-auto-flow: column; align-items: center; gap: 8px; }
.row-actions form { margin: 0; }
button.compact { padding: 6px 11px; font-size: 12px; }
.form-panel { max-width: 880px; }
.form-panel form { display: grid; gap: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; }
.form-grid input, .form-grid select { width: 100%; border: 1px solid #d5d2cb; border-radius: 10px; background: white; padding: 12px 13px; font: inherit; color: var(--ink); }
.form-actions { display: flex; gap: 10px; }
.one-column { grid-template-columns: 1fr; }
.settings-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.settings-grid .form-panel { max-width: none; }
.settings-grid .form-panel > form { margin-top: 20px; }
.invite-result { margin-bottom: 18px; }
.invite-result p { color: var(--muted); }
.invite-result input { width: 100%; border: 1px solid #d5d2cb; border-radius: 10px; padding: 12px 13px; background: #f8f7f3; }
.pending-list { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.pending-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pending-list form { margin: 0; }
.section-gap { margin-top: 18px; }
.mobile-nav { display: none; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 76px 1fr; }
  .sidebar { padding-inline: 12px; }
  .brand { margin-inline: 7px; }
  .brand span:last-child, nav a span, nav a b, .sidebar-foot span:last-child { display: none; }
  nav a { justify-content: center; min-height: 42px; }
  nav a::before { content: "•"; font-size: 22px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .workspace-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 14px 18px; flex-direction: row; align-items: center; }
  .brand { margin: 0; }
  .brand span:last-child { display: flex; }
  .sidebar nav, .sidebar-foot { display: none; }
  main { padding: 30px 18px 96px; }
  .topbar { display: block; }
  .top-actions { margin-top: 22px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics article { padding: 15px; }
  .panel { padding: 18px; }
  .message-row { grid-template-columns: 36px 1fr; }
  .message-row .pill { grid-column: 2; justify-self: start; }
  .run-strip { align-items: flex-start; gap: 12px; }
  .split-head { display: block; }
  .split-head .button { display: inline-block; margin-top: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; z-index: 5; inset: auto 10px 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px; border: 1px solid #d8d5ce; border-radius: 16px; background: rgba(255, 254, 251, .96); box-shadow: 0 8px 30px rgba(23, 35, 30, .15); backdrop-filter: blur(10px); }
  .mobile-nav a { color: var(--muted); text-decoration: none; text-align: center; padding: 9px 4px; border-radius: 10px; font-size: 13px; font-weight: 700; }
  .mobile-nav a:hover { color: var(--accent); background: var(--accent-soft); }
}
