:root {
  color-scheme: light;
  --ink: #17211c;
  --muted: #66736c;
  --surface: #ffffff;
  --canvas: #f2f5f1;
  --line: #dce4de;
  --brand: #176b4a;
  --brand-dark: #0d4e35;
  --accent: #e9b949;
  --danger-bg: #fff0ef;
  --danger: #9d2921;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
a { color: inherit; }
.site-shell { min-height: 100vh; }
.site-header {
  min-height: 74px; padding: 0 5vw; display: flex; align-items: center;
  justify-content: space-between; gap: 2rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: var(--brand); color: white; font-weight: 800; letter-spacing: -.04em;
}
.brand strong, .brand small { display: block; }
.brand small { margin-top: .1rem; color: var(--muted); font-size: .74rem; }
.account { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: .88rem; }
.account form { margin: 0; }
.site-nav { padding: 0 5vw; display: flex; gap: 1.4rem; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-nav a { display: inline-block; flex: 0 0 auto; padding: 1rem .2rem .8rem; text-decoration: none; font-weight: 650; }
.site-nav a.active { color: var(--brand); border-bottom: 3px solid var(--brand); }
.content { width: min(1120px, 90vw); margin: 0 auto; padding: 3.5rem 0; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; margin-bottom: 2rem; }
h1 { margin: .2rem 0 .55rem; font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.04em; }
.eyebrow { margin: 0; color: var(--brand); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.6; }
.status { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .7rem; border-radius: 999px; background: #e6f5ed; color: var(--brand-dark); font-size: .83rem; font-weight: 700; }
.status span { width: 8px; height: 8px; border-radius: 50%; background: #25a566; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.status-grid-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.status-card, .auth-card, .error-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgb(23 33 28 / 5%); }
.status-card { padding: 1.4rem; }
.status-card p { margin: 0 0 1.4rem; color: var(--muted); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.status-card strong, .status-card small { display: block; }
.status-card strong { margin-bottom: .4rem; font-size: 1.05rem; overflow-wrap: anywhere; }
.status-card small { color: var(--muted); }
.auth-card, .error-card { width: min(440px, 100%); margin: 5vh auto; padding: clamp(1.7rem, 5vw, 2.8rem); }
.form-stack { display: grid; gap: 1.15rem; margin-top: 1.8rem; }
label { display: grid; gap: .45rem; color: #34433b; font-size: .86rem; font-weight: 700; }
input { width: 100%; border: 1px solid #bdc9c1; border-radius: 9px; padding: .78rem .85rem; background: white; color: var(--ink); font: inherit; }
textarea, select { width: 100%; border: 1px solid #bdc9c1; border-radius: 9px; padding: .78rem .85rem; background: white; color: var(--ink); font: inherit; }
input:focus { outline: 3px solid rgb(23 107 74 / 15%); border-color: var(--brand); }
textarea:focus, select:focus { outline: 3px solid rgb(23 107 74 / 15%); border-color: var(--brand); }
.button { display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 9px; padding: .7rem 1rem; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.button-primary { background: var(--brand); color: white; }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { background: #edf2ee; color: #304037; font-size: .82rem; }
.alert { margin-top: 1.2rem; padding: .8rem 1rem; border-radius: 9px; background: var(--danger-bg); color: var(--danger); font-size: .9rem; }
.alert ul { margin-bottom: 0; }
.panel { padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgb(23 33 28 / 5%); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-heading h2 { margin: .2rem 0; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.section-gap { margin-top: 1.5rem; }
.table-panel { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
code { overflow-wrap: anywhere; }
.strong-link { font-weight: 750; color: var(--brand-dark); }
.badge { display: inline-flex; padding: .28rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 750; white-space: nowrap; }
.badge-enabled, .badge-info { background: #e6f5ed; color: var(--brand-dark); }
.badge-disabled, .badge-error { background: var(--danger-bg); color: var(--danger); }
.badge-neutral { background: #edf1ee; color: #4c5b53; }
.badge-warning { background: #fff6d9; color: #745700; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: .9rem; white-space: nowrap; }
.actions form { margin: 0; }
.link-button { padding: 0; border: 0; background: none; color: var(--brand-dark); font: inherit; text-decoration: underline; cursor: pointer; }
.form-panel { width: min(680px, 100%); }
.form-panel-wide { width: 100%; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.full-width { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .7rem; margin-top: .5rem; }
label small, .help-text { color: var(--muted); font-weight: 400; line-height: 1.5; }
.checkbox-label { grid-template-columns: auto 1fr; align-items: center; justify-content: start; }
.checkbox-label input { width: auto; }
.checkbox-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
.checkbox-grid label { grid-template-columns: auto 1fr; align-items: center; }
.checkbox-grid input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 1rem; }
.message-preview { white-space: pre-wrap; }
.detail-list { display: grid; gap: 1.2rem; }
.detail-list div { display: grid; grid-template-columns: minmax(140px, .35fr) 1fr; gap: 1rem; }
.detail-list span { color: var(--muted); }
.inline-action { display: flex; }
.empty-state { padding: 1.5rem; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.2rem; color: var(--muted); }
.flash-stack { display: grid; gap: .5rem; margin-bottom: 1.2rem; }
.flash { padding: .8rem 1rem; border-radius: 9px; background: #e6f5ed; color: var(--brand-dark); }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.integration-card dl { display: grid; gap: .7rem; }
.integration-card dl div { display: grid; gap: .2rem; }
.integration-card dt { color: var(--muted); font-size: .76rem; text-transform: uppercase; }
.integration-card dd { margin: 0; overflow-wrap: anywhere; }
.credential-note { margin-bottom: 1.2rem; padding: .8rem 1rem; background: #f4f7f5; border-radius: 9px; color: var(--muted); }
.integration-summary { display: grid; gap: .8rem; }
.integration-summary div { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.activity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.activity-list li { display: grid; gap: .25rem; }
.activity-list span { color: var(--muted); font-size: .8rem; }
.filter-bar { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)) auto; align-items: end; gap: .7rem; margin-bottom: 1rem; }
.filter-grid { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.filter-actions { display: flex; align-items: end; gap: .5rem; }
.sub-nav { display: flex; gap: .8rem; margin: .8rem 0; }
.sub-nav a { padding: .5rem .75rem; border-radius: 8px; background: #edf2ee; font-weight: 700; text-decoration: none; }

@media (max-width: 760px) {
  .site-header, .page-heading { align-items: flex-start; flex-direction: column; }
  .site-header { padding-top: 1rem; padding-bottom: 1rem; }
  .account { width: 100%; justify-content: space-between; }
  .status-grid, .status-grid-wide, .two-column, .card-grid, .form-grid, .filter-bar { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .detail-list div { grid-template-columns: 1fr; gap: .25rem; }
}
