/* Product layout and theme; Bootstrap supplies forms, buttons, cards and tables. */
:root {
  --ink: #17253b;
  --muted: #52627a;
  --line: #dfe6ef;
  --canvas: #f3f6fa;
  --sidebar: #142036;
  --accent: #2457a8;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--canvas);
  --bs-body-font-size: .9375rem;
  --bs-border-color: var(--line);
  --bs-link-color-rgb: 36, 87, 168;
  --bs-primary-rgb: 36, 87, 168;
}
[hidden] { display: none !important; }
body { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.skip-link { position: fixed; z-index: 3; top: .5rem; left: .5rem; padding: .5rem .75rem; color: var(--ink); background: white; }
.btn-primary {
  --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: #1a4488; --bs-btn-hover-border-color: #1a4488;
  --bs-btn-active-bg: #173c79; --bs-btn-active-border-color: #173c79;
  --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent);
}
.btn-outline-primary {
  --bs-btn-color: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-bg: var(--accent); --bs-btn-active-border-color: var(--accent);
}
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: auto; display: flex; flex-direction: column; padding: 1.5rem 1rem; color: #d3dfef; background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: .65rem; padding: 0 .25rem 1.3rem; color: #fff; text-decoration: none; font-size: 1.17rem; font-weight: 750; }
.brand:hover { color: #fff; }
.brand small { display: block; color: #a7b8ce; font-size: .72rem; font-weight: 500; letter-spacing: .08em; }
.brand-icon { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; background: #d9e8ff; color: #1a396c; border-radius: .65rem; }
.sidebar .nav { gap: .2rem; }
.nav-caption { padding: 1.1rem .65rem .35rem; color: #a7b8ce; font-size: .72rem; letter-spacing: .08em; }
.sidebar .nav-link { padding: .55rem .7rem; text-align: left; color: #d3dfef; border: 1px solid transparent; white-space: nowrap; }
.sidebar .nav-link:hover, .sidebar .nav-link[aria-current="page"] { color: white; background: #233854; }
.sidebar .nav-link[aria-current="page"] { border-color: #385580; font-weight: 650; }
.sidebar-footer { margin-top: auto; padding: 1.25rem .65rem 0; color: #a7b8ce; font-size: .72rem; letter-spacing: .04em; }
.sidebar-footer span { margin: 0 .2rem; }
main { min-width: 0; width: min(100%, 1450px); padding: 0 clamp(1.15rem, 3vw, 3rem) 3rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; min-height: 4.35rem; margin-bottom: 2rem; padding-block: .75rem; border-bottom: 1px solid var(--line); }
.topbar label { display: flex; gap: .55rem; align-items: center; white-space: nowrap; }
.topbar select { max-width: min(16rem, 65vw); }
.topbar .badge { font-size: .77rem; }
.toolbar-controls { gap: .95rem; }
.account-label { padding-left: .9rem; border-left: 1px solid var(--line); font-size: .83rem; font-weight: 650; overflow-wrap: anywhere; }
h1 { margin: 0 0 .55rem; font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 720; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 1.1rem; font-weight: 680; }
h3 { margin: 1.15rem 0 .5rem; font-size: .95rem; font-weight: 650; }
.intro, .muted, .metric-hint { color: var(--muted); }
.intro { margin-bottom: 1.4rem; }
.muted, .metric-hint { margin-bottom: 0; }
.page-heading { margin-bottom: 1.4rem; }
.eyebrow { margin-bottom: .35rem; color: var(--accent); font-size: .76rem; font-weight: 700; letter-spacing: .11em; }
.card { --bs-card-bg: #fff; --bs-card-cap-bg: #fafbfd; --bs-card-border-radius: .8rem; --bs-card-spacer-x: 1.15rem; --bs-card-spacer-y: 1.15rem; }
.card-header { padding: .8rem 1.15rem; }
.metric-label { color: var(--muted); font-size: .85rem; font-weight: 650; }
.metric-value { margin: .4rem 0 .15rem; font-size: 1.65rem; font-weight: 720; font-variant-numeric: tabular-nums; }
.metric-hint { font-size: .8rem; }
#overview .list-group-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .7rem; padding: .8rem 1.15rem; background: #fff; }
#overview .list-group-item:hover { background: #f3f7fd; }
#overview .list-group-item small { color: var(--muted); grid-column: 1; }
#overview .list-group-item span { color: var(--accent); grid-column: 2; grid-row: 1 / 3; align-self: center; }
.panel { min-width: 0; padding: 1.15rem; }
form.panel { display: grid; gap: .95rem; }
.login-card, .login-feedback { max-width: 27rem; margin-inline: auto; }
.login-card { margin-top: clamp(1rem, 7vh, 5rem); padding: 1.65rem; }
.login-feedback { margin-top: .7rem; }
.password-card { max-width: 32rem; }
.fields, .actions, .pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.fields { align-items: start; gap: .8rem; }
.fields label { flex: 1 1 10.75rem; min-width: 0; }
.order-dates label { flex: 0 1 12rem; }
label { display: grid; gap: .35rem; color: var(--muted); font-size: .83rem; font-weight: 650; }
.form-control, .form-select { min-width: 0; background-color: #fff; border-color: #c9d5e5; }
.form-control:read-only { background-color: #f4f6fa; }
textarea, pre, code, .endpoint-path, #credential-value { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
textarea { resize: vertical; }
.inline-field { display: inline-flex; align-items: center; gap: .5rem; }
.inline-field .form-check-input { margin-top: 0; }
.query-form > button { justify-self: start; }
#apps-output, #app-editor, #admin-account-editor, #admin-accounts-output, .query-output, #debug-summary { margin-top: 1rem; }
.app-row-actions { margin: 0; flex-wrap: nowrap; }
#app-subscription-fields, #app-credentials { min-width: 0; border: 1px solid var(--line); border-radius: .55rem; padding: .85rem; }
#app-credentials legend, #app-subscription-fields legend { float: none; width: auto; padding: 0 .25rem; font-size: .94rem; font-weight: 650; }
#app-tier-options { margin-bottom: .6rem; }
.credential-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; padding: .6rem 0; }
.credential-row + .credential-row { border-top: 1px solid var(--line); }
.credential-control { display: grid; gap: .35rem; min-width: 0; }
.fields .credential-control { flex: 1 1 10.75rem; }
.credential-row .credential-control { flex: 1 1 14rem; max-width: 29rem; }
.credential-control [data-configured] { font-size: .83rem; }
.status { margin-bottom: 0; color: var(--muted); }
.status:empty { display: none; }
.status[data-tone="good"], .metric-value[data-tone="good"] { color: #1c683f; }
.status[data-tone="bad"], .metric-value[data-tone="bad"] { color: #a02638; }
#health[data-tone="good"] { color: #1c683f !important; background: #e7f4ec !important; }
#health[data-tone="bad"] { color: #a02638 !important; background: #fae9ee !important; }
#environment-label[data-environment="production"] { color: #634610 !important; background: #fff2d8 !important; }
.api-categories { margin: 1rem 0; }
.api-categories [aria-pressed="true"] { background: var(--accent); color: #fff; }
.api-layout { display: grid; grid-template-columns: minmax(215px, 290px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.api-content { display: grid; gap: 1rem; min-width: 0; }
.api-documentation { display: grid; gap: 1rem; }
.api-doc-heading { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .45rem .7rem; }
.api-doc-heading h2 { margin: 0; font-size: clamp(1.25rem, 2vw, 1.55rem); }
.api-doc-heading code { grid-column: 1 / -1; color: var(--accent); font-size: .85rem; }
.api-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.method-label { font-size: .74rem; letter-spacing: .03em; }
.method-get { color: #1f5b3b; background: #e5f3ea; }
.method-post { color: #714f08; background: #fff0ca; }
.method-put { color: #75410e; background: #ffe3c4; }
.method-delete { color: #8c2032; background: #fbe4e8; }
.doc-section { display: grid; gap: .65rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.doc-section h3 { margin: 0; }
.doc-section p { margin: 0; }
.doc-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.api-code { max-height: none; white-space: pre-wrap; overflow-wrap: anywhere; }
#api-tester > summary { margin: 0; }
#api-tester[open] > summary { margin-bottom: 1rem; }
#api-form { display: grid; gap: .95rem; }
.api-field-table { overflow-x: auto; }
.api-field-table .table { min-width: 52rem; white-space: normal; }
.api-field-table td:nth-child(2), .api-field-table td:nth-child(6) { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
#endpoint-list { display: grid; gap: .25rem; padding: .55rem; }
.endpoint { display: grid; grid-template-columns: 3.1rem minmax(0, 1fr); text-align: left; align-items: start; gap: .2rem .45rem; padding: .55rem; }
.endpoint[aria-current="true"] { background: #eaf2fd; border-color: #bed3f4; }
.method { align-self: start; justify-self: start; }
.endpoint-path { grid-column: 2; overflow-wrap: anywhere; font-size: .68rem; color: var(--muted); }
pre { background: #f1f5fa; padding: .85rem; border-radius: .5rem; overflow: auto; max-height: 27rem; margin: 0; font-size: .78rem; }
.table { --bs-table-bg: #fff; margin-bottom: 0; white-space: nowrap; font-size: .84rem; }
.table > :not(caption) > * > * { padding: .6rem .65rem; }
.table th { color: var(--muted); }
.table .btn { white-space: nowrap; }
.record-status { display: inline-flex; align-items: center; min-height: 1.5rem; padding: .15rem .48rem; border: 1px solid transparent; border-radius: 999px; font-size: .77rem; font-weight: 650; line-height: 1.1; }
.status-success { color: #1c683f; background: #e7f4ec; border-color: #c7e4d3; }
.status-pending { color: #6f510b; background: #fff5d7; border-color: #f0dfab; }
.status-warning { color: #845112; background: #fff0df; border-color: #f2d3ad; }
.status-danger { color: #91283a; background: #fbe8ec; border-color: #efc9d1; }
.status-info { color: #24539b; background: #eaf2fd; border-color: #cbddf7; }
.status-neutral { color: #52627a; background: #f1f4f8; border-color: #dce3ec; }
.pagination { margin: .85rem 0 0; color: var(--muted); font-size: .82rem; }
dl { margin: .85rem 0 0; display: grid; gap: .45rem 1rem; grid-template-columns: max-content minmax(0, 1fr); }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
details { margin-top: .8rem; }
summary { cursor: pointer; font-weight: 650; margin-bottom: .45rem; }
.timeline { display: grid; gap: .5rem; list-style: none; padding: 0; }
.timeline li { padding: .3rem .85rem .65rem; }
@media (max-width: 880px) {
  body { display: block; }
  .sidebar { height: auto; position: static; padding: .85rem 1.1rem; }
  .brand { padding-bottom: .55rem; }
  .sidebar .nav { flex-flow: row wrap !important; }
  .sidebar .nav-link { font-size: .83rem; padding: .34rem .6rem; }
  .nav-caption, .sidebar-footer { display: none; }
  .topbar { margin-bottom: 1.35rem; }
}
@media (max-width: 640px) {
  .api-layout { display: block; }
  #endpoint-list { max-height: 15rem; overflow: auto; margin-bottom: .7rem; }
  .panel { padding: .85rem; }
  .order-dates label { flex: 1 1 10rem; }
}
