/* ProWPHost portal. Plain CSS, no build step. */
:root {
    --text: #1c2430;
    --muted: #5b6573;
    --line: #dde2e8;
    --bg: #f6f7f9;
    --card: #ffffff;
    --accent: #1b5fd1;
    --accent-text: #ffffff;
    --ok: #1d6b3a;    --ok-bg: #e3f4e9;
    --warn: #7a4b00;  --warn-bg: #fdf1d8;
    --bad: #9b1c1c;   --bad-bg: #fbe4e4;
    --radius: 8px;
    --tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--accent); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .75rem; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip-link { position: absolute; left: .5rem; top: -3rem; padding: .5rem 1rem; background: var(--card); z-index: 10; }
.skip-link:focus { top: .5rem; }

/* Header and navigation */
.site-header {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem;
    padding: .5rem 1.5rem; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.primary-nav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; flex: 1; }
.primary-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.primary-nav .tools { margin-left: auto; }
.primary-nav a {
    display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 .75rem;
    color: var(--text); text-decoration: none; border-radius: var(--radius);
}
.primary-nav a:hover { background: var(--bg); }
.primary-nav a[aria-current="page"] { font-weight: 600; box-shadow: inset 0 -3px 0 var(--accent); }

.profile-menu { position: relative; }
.profile-menu summary { display: flex; align-items: center; min-height: var(--tap); padding: 0 .75rem; cursor: pointer; }
.profile-menu ul {
    position: absolute; right: 0; min-width: 12rem; margin: .25rem 0 0; padding: .25rem 0; list-style: none;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); z-index: 5;
}
.profile-menu li a, .profile-menu .link-button {
    display: flex; align-items: center; width: 100%; min-height: var(--tap); padding: 0 1rem;
    color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
}

/* Page and content */
.page { max-width: 72rem; margin: 0 auto; padding: 1.5rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.muted { color: var(--muted); }
.notice { padding: .75rem 1rem; background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); }
.empty-state { text-align: center; padding: 2.5rem 1rem; }

/* Forms */
.stack > * + * { margin-top: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.field input, .field select, .field textarea {
    width: 100%; min-height: var(--tap); padding: .5rem .75rem; font: inherit;
    border: 1px solid #9aa3ae; border-radius: var(--radius); background: var(--card);
}
.field--inline { display: flex; align-items: center; gap: .5rem; }
.field--inline input { width: 1.25rem; min-height: 1.25rem; }
.field--inline label { margin: 0; font-weight: 400; }
.field-error { color: var(--bad); margin: .25rem 0 0; }
.button {
    display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 1.25rem;
    font: inherit; font-weight: 600; color: var(--accent-text); background: var(--accent);
    border: 0; border-radius: var(--radius); text-decoration: none; cursor: pointer;
}
.button--secondary { color: var(--accent); background: var(--card); border: 1px solid var(--accent); }

/* Status badges: always text plus colour, never colour alone */
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .875rem; font-weight: 600; }
.badge--ok { color: var(--ok); background: var(--ok-bg); }
.badge--warn { color: var(--warn); background: var(--warn-bg); }
.badge--bad { color: var(--bad); background: var(--bad-bg); }
.badge--muted { color: var(--muted); background: var(--bg); border: 1px solid var(--line); }

/* Tabs (plain links; they work without JavaScript) */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 1rem 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 1rem; color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { font-weight: 600; box-shadow: inset 0 -3px 0 var(--accent); }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .875rem; color: var(--muted); font-weight: 600; }
td a { display: inline-flex; align-items: center; min-height: var(--tap); }

/* Guest pages */
.guest { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 1rem; }
.guest-card { width: 100%; max-width: 26rem; }

pre.legacy { white-space: pre-wrap; font-family: inherit; margin: 0; }

/* Phones: one row of scrollable nav links; tables become stacked cards labelled by data-label */
@media (max-width: 640px) {
    .site-header { padding: .5rem 1rem; }
    .primary-nav { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; }
    .primary-nav .tools { margin-left: 0; }
    .page { padding: 1rem; }
    table, thead, tbody, tr, th, td { display: block; }
    thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .75rem; background: var(--card); }
    td { border: 0; padding: .5rem .75rem; }
    td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: right; }
    td[data-label]::before { content: attr(data-label); font-size: .875rem; color: var(--muted); text-align: left; flex: none; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.page-heading h1 { margin: 0; }
section.card + section.card { margin-top: 1rem; }
.card > h2:first-child { margin-top: 0; }
.thread { list-style: none; padding: 0; }
.thread > li + li { margin-top: .75rem; }
.message--staff { border-left: 4px solid var(--accent); }
.qr svg { width: 12rem; height: 12rem; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; }
.filters .field { min-width: 12rem; flex: 1; }
.attention + .attention { margin-top: 1rem; }
.attention ul { margin: 0; padding-left: 1.25rem; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.pagination { display: flex; gap: .25rem; list-style: none; padding: 0; }
.pagination a, .pagination span { display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); justify-content: center; }

.inline-form { display: inline; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
