:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #182624;
  background: #f4f6f3;
  font-synthesis: none;
  --ink: #182624;
  --muted: #536660;
  --line: #dbe4dd;
  --panel: #fff;
  --green: #1f6148;
  --lime: #d6f184;
  --forest: #122b23;
  --focus: #226ccd;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .5rem; font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -.055em; line-height: 1.06; overflow-wrap: anywhere; }
h2 { margin-bottom: .45rem; font-size: 1.25rem; letter-spacing: -.025em; }
h3 { margin-bottom: .4rem; font-size: 1rem; }
p { line-height: 1.6; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
.muted { color: var(--muted); }
.connection { max-width: 36rem; margin: 4rem auto; padding: 1rem; text-align: center; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: #fff; font-size: 1.05rem; font-weight: 700; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .55rem; background: var(--lime); color: var(--forest); font-weight: 900; }
.eyebrow { margin-bottom: .75rem; color: #c3e777; font-size: .72rem; font-weight: 700; letter-spacing: .14em; }

.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-brand {
  color: #fff;
  background: radial-gradient(ellipse at 100% 100%, #387450, transparent 62%), var(--forest);
  padding: clamp(2rem, 7vw, 6rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5rem;
}
.login-brand h1 { font-size: clamp(2.5rem, 6vw, 5.5rem); }
.login-brand p:last-child { max-width: 29rem; color: #d5e4da; }
.login-panel { display: grid; place-items: center; padding: clamp(1.4rem, 5vw, 4rem); }
.form { display: grid; gap: 1rem; }
.form-login { width: min(100%, 25rem); }
.form-login h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.form-login p { margin-bottom: 0; }
.form label { display: grid; gap: .45rem; font-weight: 600; font-size: .92rem; }
.form label .muted { font-weight: 400; }
input, select, textarea { width: 100%; border: 1px solid #a9bab0; border-radius: .5rem; background: #fff; color: var(--ink); padding: .72rem .8rem; min-height: 2.75rem; }
textarea { resize: vertical; }
.primary, .secondary, .danger {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.75rem;
  padding: .6rem .9rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  font-weight: 650;
  text-decoration: none;
}
.primary { background: var(--green); color: #fff; }
.primary:hover { background: #194b39; }
.secondary { border-color: #bfcfc4; background: #fff; color: var(--ink); }
.secondary:hover { background: #edf4ef; }
.danger { background: #91352f; color: #fff; }
.danger:hover { background: #752721; }
.form-message { margin: 0; color: var(--green); overflow-wrap: anywhere; }
.form-message:empty { display: none; }
.form-message[data-error="true"] { color: #8a2d26; }

.shell { display: grid; grid-template-columns: 16rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--forest); color: #cfdfd5; display: flex; flex-direction: column; gap: 1.65rem; padding: 1.6rem 1.1rem; position: sticky; top: 0; align-self: start; min-height: 100vh; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.menu-toggle { display: none; min-height: 2.75rem; padding: .55rem .75rem; color: #fff; background: #203d33; border: 1px solid #4f6d5d; border-radius: .5rem; }
.business-picker { display: grid; gap: .45rem; font-size: .8rem; font-weight: 600; }
.business-picker select { background: #203d33; color: #fff; border-color: #4f6d5d; text-overflow: ellipsis; }
#nav { display: grid; gap: .25rem; }
#nav a { border-radius: .5rem; padding: .7rem .75rem; width: 100%; font-size: .92rem; text-decoration: none; }
#nav a:hover { background: #234637; color: #fff; }
#nav a[aria-current="page"] { background: #31513e; color: #e6f6bd; font-weight: 700; }
.sidebar-company { margin-top: auto; padding: .4rem; font-size: .72rem; letter-spacing: .1em; }
.work-area { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: .85rem; background: #fff; border-bottom: 1px solid var(--line); padding: .75rem clamp(1rem, 4vw, 3rem); }
.topbar-actions { display: flex; gap: .85rem; align-items: center; flex: 0 0 auto; font-size: .88rem; }
.workspace-label { font-weight: 650; overflow-wrap: anywhere; }
#content { margin-inline: auto; max-width: 88rem; padding: clamp(1rem, 4vw, 3rem); }
.heading { margin-bottom: 1.5rem; }
.heading p { margin-bottom: 0; }
.hero { border-radius: 1rem; padding: clamp(1.5rem, 4vw, 3.15rem); background: radial-gradient(ellipse at 100% 100%, #346c4d, transparent 65%), var(--forest); color: #fff; }
.hero p:last-child { color: #d9e9de; }
.panel, .metric { border: 1px solid var(--line); border-radius: .8rem; background: var(--panel); padding: 1.2rem; min-width: 0; }
.panel p:last-child { margin-bottom: 0; }
.panel + .panel, .section { margin-top: 1rem; }
.grid, .agent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.agent-grid { align-items: start; }
.agent-grid .panel { margin: 0; }
.agent-grid summary + p { margin: .7rem 0 .4rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.two-col .panel { margin-top: 0; }
.metric { display: grid; gap: .5rem; }
.metric strong { font-size: clamp(1.25rem, 2.15vw, 1.9rem); letter-spacing: -.035em; overflow-wrap: anywhere; }
.metric .muted { font-size: .87rem; }
.stack { display: grid; gap: .7rem; margin: .6rem 0 0; padding: 0; list-style: none; }
.stack li { padding-top: .7rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.stack li:first-child { border-top: 0; padding-top: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.stack li p { margin: .3rem 0 0; }
.stack + .secondary { margin-top: 1rem; }
.agent-grid details summary, .task-detail summary { cursor: pointer; color: var(--green); font-weight: 600; }
.task-detail { margin-top: .4rem; }
.task-detail dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem 1rem; max-width: 30rem; margin: .65rem 0; }
.task-detail dd { margin: 0; font-weight: 650; text-align: end; }
.import-help { margin-bottom: 1rem; }
.import-help p { margin: .65rem 0 0; }
pre { margin-bottom: 0; padding: .75rem; background: #f3f6f2; border-radius: .45rem; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .86rem; }
.badge { display: inline-block; padding: .25rem .5rem; border-radius: .35rem; background: #e9f1ed; color: #264b39; font-size: .77rem; font-weight: 650; }
.empty { color: var(--muted); padding: .7rem 0; }
.notice { border-left: 4px solid #709e6e; padding: .7rem .9rem; background: #e8f2e9; border-radius: .35rem; overflow-wrap: anywhere; }
.notice.error { background: #f9eae7; border-color: #963c32; color: #742b25; }
.metric-summary { font-size: .88rem; margin: .85rem 0 0; color: var(--muted); overflow-wrap: anywhere; }
code { overflow-wrap: anywhere; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 13rem minmax(0, 1fr); }
  .grid, .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .login, .shell { grid-template-columns: minmax(0, 1fr); }
  .login-brand { gap: 2rem; }
  .login-brand h1 br { display: none; }
  .sidebar { position: static; display: grid; gap: .85rem; min-height: auto; padding: 1rem; }
  .menu-toggle { display: block; }
  .sidebar-company, #account-label { display: none; }
  #nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #nav[data-expanded="false"] { display: none; }
  #nav a { padding: .62rem .5rem; }
}
@media (max-width: 360px) {
  .grid, .agent-grid { grid-template-columns: 1fr; }
}
