:root {
  --bg: #ffffff;
  --fg: #1b1f24;
  --muted: #57606a;
  --accent: #0b5cad;
  --border: #d0d7de;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14181d; --fg: #e6edf3; --muted: #9aa4af; --accent: #6cb2ff; --border: #30363d; }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--bg); padding: 8px; z-index: 10; }
.site-header, .site-footer { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.site-footer { border-top: 1px solid var(--border); border-bottom: 0; color: var(--muted); margin-top: auto; }
.brand { font-weight: 600; }
.container { width: 100%; max-width: 48rem; margin: 0 auto; padding: 24px 16px; }
a { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 1.6rem; line-height: 1.25; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.nav { display: flex; align-items: center; gap: 12px; }
.inline { display: inline; margin: 0; }
.form { display: grid; gap: 8px; max-width: 24rem; }
.form label { font-weight: 600; margin-top: 8px; }
input[type="text"], input[type="password"] {
  width: 100%; padding: 8px 10px; font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
}
input:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button { padding: 8px 14px; font: inherit; cursor: pointer; color: var(--bg); background: var(--accent); border: 0; border-radius: 6px; }
.alert { padding: 10px 12px; border: 1px solid var(--accent); border-radius: 6px; }
/* M1: panel del caso y navegación (CSS puro, sin JavaScript). */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.actions, .pager p { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
a.button, button { display: inline-block; min-height: 44px; min-width: 44px; padding: 10px 14px; line-height: 1.4; text-decoration: none; color: var(--bg); background: var(--accent); border: 0; border-radius: 6px; font: inherit; }
a.button:hover, button:hover { filter: brightness(1.1); }
a.button:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }
.form a { display: inline-block; padding: 10px 4px; }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; font-weight: 600; padding: 8px 0; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
ol.sections { list-style: decimal; padding-left: 1.5rem; margin: 0 0 12px; }
ol.sections li { padding: 6px 0; }
ol.sections a { display: inline-block; padding: 8px 2px; font-weight: 600; }
ol.sections a[aria-current="page"] { text-decoration: none; border-bottom: 3px solid var(--accent); }
.state, .when { display: block; color: var(--muted); }
.note, .position { color: var(--muted); }
@media (max-width: 40rem) {
  table.stack thead { position: absolute; left: -9999px; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border: 1px solid var(--border); border-radius: 6px; margin-bottom: 12px; padding: 4px 0; }
  table.stack td { border: 0; padding: 4px 10px; }
  table.stack td::before { font-weight: 600; }
  table.stack td:nth-child(1)::before { content: "Nº de caso: "; }
  table.stack td:nth-child(2)::before { content: "Estado: "; }
  table.stack td:nth-child(3)::before { content: "Creado (UTC): "; }
  table.stack td:nth-child(4)::before { content: "Última modificación (UTC): "; }
  table.stack td:nth-child(5)::before { content: none; }
  .actions a.button, .pager a.button { width: 100%; text-align: center; }
  input[type="text"], select { font-size: 1rem; min-height: 44px; }
}
main > p > a:only-child { display: inline-block; padding: 10px 4px; }   /* «Volver…»: objetivo táctil mayor (WCAG 2.5.8) */
/* Aviso persistente del sitio (p. ej. entorno de demostración): siempre visible, también al desplazarse. */
.site-banner { position: sticky; top: 0; z-index: 20; background: #b42318; color: #fff; text-align: center; padding: 8px 12px; font-size: 0.95rem; letter-spacing: 0.02em; }
