:root {
  --ink: #172033;
  --muted: #657085;
  --canvas: #f4f6fa;
  --surface: #ffffff;
  --line: #e2e6ee;
  --primary: #3157d5;
  --primary-dark: #2645ad;
  --success-bg: #e6f6ed;
  --success-text: #187348;
  --inactive-bg: #eef0f4;
  --inactive-text: #626b7d;
}

html { font-size: 15px; }
body { background: var(--canvas); color: var(--ink); min-height: 100vh; }
.app-header { background: rgba(255, 255, 255, .95); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; backdrop-filter: blur(10px); }
.navbar { min-height: 64px; }
.navbar-brand { color: var(--ink); display: inline-flex; align-items: center; gap: .65rem; font-weight: 700; }
.brand-mark { align-items: center; background: linear-gradient(145deg, #3157d5, #6e49d7); border-radius: .75rem; color: #fff; display: inline-flex; font-weight: 800; height: 46px; justify-content: center; letter-spacing: -.03em; width: 46px; }
.small-mark { border-radius: .55rem; height: 32px; width: 32px; font-size: .78rem; }
.user-name { color: var(--muted); font-size: .9rem; }
.page-content { padding-bottom: 4rem; padding-top: 2.25rem; }
.page-heading { align-items: flex-end; display: flex; gap: 2rem; justify-content: space-between; margin-bottom: 1.75rem; }
.page-heading.compact { align-items: flex-start; }
.page-heading h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 700; letter-spacing: -.035em; margin: 0 0 .4rem; }
.eyebrow { color: var(--primary); font-size: .75rem; font-weight: 700; letter-spacing: .1em; margin-bottom: .45rem; text-transform: uppercase; }
.back-link { color: var(--muted); display: inline-block; margin-bottom: .65rem; text-decoration: none; }
.back-link:hover { color: var(--primary); }
.surface-card, .form-card, .login-card { border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 10px 30px rgba(31, 43, 71, .045); overflow: hidden; }
.form-card { max-width: 820px; }
.table > :not(caption) > * > * { border-bottom-color: var(--line); padding: 1rem; }
.table > thead th { background: #fafbfc; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.description-cell { max-width: 300px; }
code { background: #eef1fb; border-radius: .35rem; color: #344ca1; padding: .16rem .38rem; }
.status-pill { border-radius: 999px; display: inline-block; font-size: .75rem; font-weight: 700; padding: .3rem .62rem; white-space: nowrap; }
.status-pill.active { background: var(--success-bg); color: var(--success-text); }
.status-pill.inactive { background: var(--inactive-bg); color: var(--inactive-text); }
.config-value { display: inline-block; font-family: var(--bs-font-monospace); max-width: 360px; overflow-wrap: anywhere; white-space: pre-wrap; }
.action-row { align-items: center; display: flex; flex-wrap: wrap; gap: .45rem; min-width: 255px; }
.action-row form { margin: 0; }
.btn { border-radius: .55rem; font-weight: 600; }
.btn-primary { background-color: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); }
.form-control { border-color: #ccd2df; border-radius: .55rem; padding: .68rem .8rem; }
.form-control:focus, .form-check-input:focus { border-color: #8197e6; box-shadow: 0 0 0 .2rem rgba(49, 87, 213, .14); }
.form-actions { border-top: 1px solid var(--line); display: flex; gap: .65rem; margin-top: 1.75rem; padding-top: 1.5rem; }
.text-danger { font-size: .85rem; }
.validation-summary-valid { display: none; }
.empty-state { padding: 4.5rem 1.5rem; text-align: center; }
.alert { border-radius: .7rem; }
.login-shell { align-items: center; display: flex; justify-content: center; min-height: calc(100vh - 5rem); }
.login-card { max-width: 440px; width: 100%; }

@media (max-width: 767.98px) {
  .page-content { padding-top: 1.4rem; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 1rem; }
  .page-heading > .btn { align-self: flex-start; }
  .table > :not(caption) > * > * { padding: .8rem; }
}
