:root {
  --color-bg: #f4f7fb;
  --color-surface: #ffffff;
  --color-surface-soft: #eef3f9;
  --color-text: #1d2939;
  --color-muted: #667085;
  --color-border: #d9e2ec;
  --color-primary: #2859c5;
  --color-primary-dark: #1d4296;
  --color-accent: #e9efff;
  --color-success: #157347;
  --color-warning: #a15c00;
  --color-danger: #b42318;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(29, 41, 57, 0.08);
  --content-width: 1080px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; line-height: 1.55; }

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-dark); }

.shell { width: min(calc(100% - 2rem), var(--content-width)); margin: 0 auto; }

.site-header { background: #172b4d; color: #fff; box-shadow: 0 2px 12px rgba(23, 43, 77, 0.18); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: #fff; font-weight: 700; text-decoration: none; letter-spacing: .01em; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #172b4d; background: #bcd0ff; }
.site-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem .9rem; }
.site-nav a { color: #e7edff; text-decoration: none; font-size: .95rem; }
.site-nav a:hover { color: #fff; text-decoration: underline; }

main { min-height: calc(100vh - 126px); padding: 3rem 0 4rem; }
.site-header + main { padding-top: 3rem; }
.site-footer { padding: 1.25rem 0; color: var(--color-muted); font-size: .9rem; border-top: 1px solid var(--color-border); background: var(--color-surface); }

h1, h2, h3 { line-height: 1.2; color: #172b4d; }
h1 { margin: 0 0 1rem; font-size: clamp(1.8rem, 4vw, 2.65rem); }
h2 { margin-top: 2.25rem; font-size: 1.45rem; }
h3 { margin-top: 1.75rem; font-size: 1.15rem; }
.lead { max-width: 680px; color: var(--color-muted); font-size: 1.15rem; }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-heading h1 { margin-bottom: .35rem; }
.page-heading p { margin: 0; color: var(--color-muted); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.card, .panel { padding: 1.35rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); box-shadow: var(--shadow); }
.card h2, .card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.button, button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .6rem 1rem; border: 1px solid var(--color-primary); border-radius: 8px; color: #fff; background: var(--color-primary); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.button:hover, button:hover { border-color: var(--color-primary-dark); color: #fff; background: var(--color-primary-dark); }
.button-secondary { color: var(--color-primary); background: var(--color-surface); }
.button-secondary:hover { color: var(--color-primary-dark); background: var(--color-accent); }
.button-danger { border-color: var(--color-danger); background: var(--color-danger); }
.button-small { min-height: 34px; padding: .35rem .7rem; font-size: .9rem; }

form { max-width: 680px; }
.form-card { max-width: 680px; padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); box-shadow: var(--shadow); }
label { display: block; margin-bottom: 1rem; font-weight: 600; }
input, textarea, select { display: block; width: 100%; margin-top: .4rem; padding: .7rem .8rem; border: 1px solid #b8c5d6; border-radius: 8px; color: var(--color-text); background: #fff; font: inherit; }
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #9bb7ff; outline-offset: 2px; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.5rem; }
.hint { color: var(--color-muted); font-size: .92rem; }

.alert { margin: 1rem 0; padding: 1rem 1.1rem; border: 1px solid; border-radius: 8px; }
.alert ul { margin: .5rem 0 0; padding-left: 1.25rem; }
.alert-error { border-color: #f3b5b0; color: #7a271a; background: #fff4f2; }
.alert-info { border-color: #b8cdf7; color: #1e3a70; background: #f0f5ff; }

.status { display: inline-flex; padding: .2rem .55rem; border-radius: 999px; background: var(--color-surface-soft); color: var(--color-muted); font-size: .82rem; font-weight: 700; }
.status-published, .status-approved { color: var(--color-success); background: #e7f6ed; }
.status-pending { color: var(--color-warning); background: #fff3d6; }
.status-rejected, .status-disabled { color: var(--color-danger); background: #fff0ee; }
.list-reset { display: grid; gap: .85rem; margin: 0; padding: 0; list-style: none; }
.list-item { padding: 1rem; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface); }
.list-item p { margin: .35rem 0; }
.muted { color: var(--color-muted); }
.prose { max-width: 780px; }
.prose pre { overflow-x: auto; padding: 1rem; border-radius: 8px; background: #172b4d; color: #edf2ff; }
.prose code { padding: .1rem .25rem; border-radius: 4px; background: var(--color-surface-soft); }
.prose pre code { padding: 0; background: transparent; }
.sticky-nav { position: sticky; top: .75rem; z-index: 1; padding: 1rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: rgba(255, 255, 255, .94); }

@media (max-width: 640px) {
  .shell { width: min(calc(100% - 1.25rem), var(--content-width)); }
  .header-inner, .page-heading { align-items: stretch; flex-direction: column; }
  .site-nav { justify-content: flex-start; padding-bottom: .8rem; }
  main { padding-top: 2rem; }
  .button, button { width: 100%; }
  .actions .button, .actions button, .form-actions .button, .form-actions button { width: auto; }
}
