/* WP Monitor dashboard, Work Logger visual language: light, square, white surfaces. */
:root {
    --bg: #f3f4f6;
    --surface: #fff;
    --border: #dfe3e8;
    --border-strong: #c8cfd6;
    --text: #17202a;
    --muted: #5b6570;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --red: #c2410c;
    --red-mark: #dc2626;
    --yellow: #d97706;
    --grey: #94a3b8;
    --green: #15803d;
    --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); }
a { color: var(--accent); }
p { margin: 0 0 12px; }
h1 { font-size: 34px; line-height: 1.15; font-weight: 700; margin: 0 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 28px 0 10px; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* Shell */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 32px; min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.mainnav { display: flex; align-items: stretch; gap: 24px; align-self: stretch; }
.mainnav a, .mainnav button.link { display: flex; align-items: center; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; padding-top: 3px; }
.mainnav a:hover, .mainnav button.link:hover { color: var(--text); }
.mainnav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.mainnav form { display: flex; margin: 0; }
main { max-width: 1240px; margin: 0 auto; padding: 48px 32px 64px; }

/* Page header */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.page-header h1 { margin: 0; }
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* Controls */
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 1px solid var(--accent); border-radius: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
button:hover, .button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button.secondary { min-height: 36px; padding: 0 14px; background: var(--surface); color: var(--text); border-color: var(--border-strong); font-weight: 600; font-size: 14px; }
.button.secondary:hover { border-color: var(--text); background: var(--surface); }
button.link { min-height: 0; padding: 0; background: none; border: 0; color: var(--accent); font-weight: inherit; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], select {
    width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 0; background: var(--surface); color: var(--text); font: inherit;
}
input:focus, select:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; margin: 0 0 16px; font-weight: 600; }
label input, label select { display: block; margin-top: 6px; }
label.check { font-weight: 400; }
label.check input { display: inline; width: auto; min-height: 0; margin: 0 6px 0 0; }
fieldset { border: 1px solid var(--border); padding: 16px 20px 4px; margin: 0 0 20px; }
legend { font-weight: 700; padding: 0 6px; }
form.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Surfaces */
.panel { background: var(--surface); border: 1px solid var(--border); padding: 32px 40px; margin: 0 0 32px; }
.panel.narrow { max-width: 480px; margin: 0 auto 32px; }
.panel.wide-ish { max-width: 760px; }
.notice { padding: 14px 18px; border: 1px solid var(--border); border-left: 4px solid var(--muted); background: var(--surface); margin: 0 0 20px; }
.notice > :last-child { margin-bottom: 0; }
.notice.ok { border-left-color: var(--green); background: #edf8f1; }
.notice.error { border-left-color: #b91c1c; background: #fdf2f2; }
.page > .notice { margin-bottom: 32px; }

/* Status mark: a small square, never a full-row colour */
.mark { display: inline-block; width: 10px; height: 10px; flex: none; background: var(--grey); }
.mark-red { background: var(--red-mark); }
.mark-yellow { background: var(--yellow); }
.mark-green { background: var(--green); }
.mark-grey { background: var(--grey); }

/* Summary strip */
.summary { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--border); margin: 0 0 32px; }
.summary-item { display: block; padding: 24px 32px; color: var(--text); text-decoration: none; border-left: 1px solid var(--border); border-bottom: 3px solid transparent; }
.summary-item:first-child { border-left: 0; }
.summary-item:hover { background: #f9fafb; }
.summary-item.is-active { border-bottom-color: var(--accent); }
.summary-label { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); }
.summary-value { display: block; margin-top: 6px; font-size: 32px; font-weight: 700; line-height: 1.2; }

/* Security ticker: known vulnerabilities grouped by vulnerability */
.ticker { background: var(--surface); border: 1px solid var(--border); margin: 0 0 32px; }
.ticker-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; padding: 14px 32px 12px; }
.ticker-head h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ticker-head p { margin: 0; font-size: 14px; }
.ticker-rows { list-style: none; margin: 0; padding: 0; }
.ticker-item { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; column-gap: 20px; padding: 10px 32px; border-top: 1px solid var(--border); }
.ticker-item.is-active { box-shadow: inset 3px 0 0 var(--accent); }
.ticker-item .badge { justify-self: start; padding: 1px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ticker-item.is-serious .badge { font-weight: 700; }
.ticker-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; overflow-wrap: anywhere; }
.ticker-name { font-weight: 400; }
.ticker-item.is-serious .ticker-name { font-weight: 700; }
.ticker-name a { color: inherit; text-decoration: none; }
.ticker-name a:hover { color: var(--accent); text-decoration: underline; }
.ticker-meta { color: var(--muted); font-size: 14px; }
.ticker-count { color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap; }
.ticker-item.is-serious .ticker-count { color: var(--text); }
.ticker-count:hover, .ticker-item.is-serious .ticker-count:hover { color: var(--accent); }
.ticker-more summary { padding: 10px 32px; border-top: 1px solid var(--border); color: var(--accent); font-weight: 600; cursor: pointer; }
.ticker-source { margin: 0; padding: 10px 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

/* Search */
.search label { margin-bottom: 10px; font-size: 17px; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px auto; gap: 16px; }
.search-row button { min-height: 48px; padding: 0 28px; }
.search-result { margin: 14px 0 0; color: var(--muted); }

/* Installation list */
.sites { list-style: none; margin: 0; padding: 0; }
.site { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 20px; align-items: center; column-gap: 32px; background: var(--surface); border: 1px solid var(--border); padding: 22px 32px 22px 40px; margin: 0 0 -1px; }
.site:hover { position: relative; border-color: var(--border-strong); }
.site p { margin: 0; }
.site-name { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.site-name a { color: inherit; text-decoration: none; }
.site-name a:hover { text-decoration: underline; }
.site .site-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; padding-left: 22px; color: var(--muted); }
.is-stale { color: var(--red); }
.site-facts { display: grid; grid-template-columns: 80px 96px 96px; gap: 20px; margin: 0; white-space: nowrap; }
.site-facts dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.site-facts dd { margin: 0; color: var(--muted); }
.site-facts .has-updates dd { color: var(--text); font-weight: 700; }
.site-actions { display: flex; justify-content: flex-end; gap: 8px; min-width: 168px; }
.site-open { color: var(--muted); font-size: 20px; text-align: right; text-decoration: none; }
.site-open:hover { color: var(--accent); }
.empty { color: var(--muted); }
.empty p { margin: 0; }

/* Installation detail and plugin search */
.back { margin: -24px 0 20px; }
.back a { color: var(--muted); font-weight: 600; text-decoration: none; }
.back a:hover { color: var(--text); }
.page-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; color: var(--muted); }
.status-label { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.header-actions { display: flex; gap: 8px; padding-top: 22px; }
.summary.is-static .summary-item:hover { background: none; }
.summary-value.is-text { font-size: 20px; padding-top: 8px; }
.summary-note { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 48px 0 20px; padding: 2px 0 2px 28px; border-left: 4px solid #475569; }
.section-head h2 { margin: 0; font-size: 28px; line-height: 1.2; }
.section-head .eyebrow { margin-bottom: 4px; overflow-wrap: anywhere; }
.section-head.tone-yellow { border-left-color: var(--yellow); }
.section-head.tone-stale, .section-head.tone-red { border-left-color: var(--red); }
.section-meta { margin: 0; color: var(--muted); font-weight: 600; text-align: right; }
.rows { margin: 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--border); }
.rows.empty { padding: 22px 40px; }
.empty-title { color: var(--text); font-weight: 700; margin-bottom: 4px; }
.props > div { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; padding: 14px 40px; border-top: 1px solid var(--border); }
.props > div:first-child { border-top: 0; }
.props dt { color: var(--muted); font-weight: 600; }
.props dd { margin: 0; overflow-wrap: anywhere; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) 140px 200px; align-items: center; column-gap: 24px; padding: 16px 40px; border-top: 1px solid var(--border); }
.item:first-child { border-top: 0; }
.item p { margin: 0; }
.item-name { font-weight: 700; overflow-wrap: anywhere; }
.item-name a { color: inherit; text-decoration: none; }
.item-name a:hover { color: var(--accent); text-decoration: underline; }
.item-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.item-version { color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.item-update { text-align: right; }
.item.is-inactive .item-name { color: var(--muted); font-weight: 600; }
.badge { display: inline-block; padding: 3px 10px; border: 1px solid var(--border-strong); background: #f8fafc; font-size: 14px; font-weight: 700; white-space: nowrap; }
.badge-update { border-color: #fcd9a0; background: #fff8eb; color: #b45309; }
.badge-critical, .badge-high { border-color: #f5c2c2; background: #fdf2f2; color: #b91c1c; }
.badge-medium { border-color: #fcd9a0; background: #fff8eb; color: #b45309; }
.source-note { margin: 12px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.login-form { margin-top: 16px; padding: 22px 40px; }
.login-form label { margin-bottom: 4px; }
.login-row { display: flex; gap: 12px; }
.login-row input { flex: 1 1 auto; min-width: 0; }
.login-row button { min-height: 48px; }
.login-row button.secondary { min-height: 48px; }
.field-error { color: #b91c1c; font-weight: 600; }
.search-row.is-single { grid-template-columns: minmax(0, 1fr) auto; }

/* Add installation (details/summary, no script needed) */
.add-installation { position: relative; }
.add-installation summary { list-style: none; }
.add-installation summary::-webkit-details-marker { display: none; }
.add-form { position: absolute; right: 0; top: calc(100% + 8px); z-index: 2; width: 340px; padding: 24px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 8px 24px rgba(23, 32, 42, 0.08); }
.add-form button { width: 100%; }
.pairing-code code { font-size: 26px; font-weight: 700; letter-spacing: 2px; }

/* Setup, account and log pages */
.checks { list-style: none; padding: 0; margin: 0 0 16px; }
.checks li { padding: 4px 0 4px 24px; position: relative; }
.checks li::before { position: absolute; left: 0; font-weight: 700; }
.checks li.ok::before { content: "\2713"; color: var(--green); }
.checks li.warn::before { content: "!"; color: var(--yellow); }
.checks li.error::before { content: "\2717"; color: #b91c1c; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 700; color: var(--muted); font-size: 13px; }
.panel table { margin-top: 8px; }
.qr { margin: 16px 0; }
.qr svg { max-width: 100%; height: auto; }
code.secret { font-size: 18px; letter-spacing: 1px; }
.codes { columns: 2; list-style: none; padding: 0; }

@media (max-width: 960px) {
    .site { grid-template-columns: minmax(0, 1fr) auto 20px; row-gap: 14px; }
    .site-facts { grid-column: 1; grid-row: 2; padding-left: 22px; }
    .site-actions { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; min-width: 0; }
    .site-open { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 640px) {
    .topbar-inner { padding: 12px 16px; }
    .mainnav { flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
    .mainnav a, .mainnav button.link { padding: 3px 0 4px; }
    main { padding: 28px 16px 48px; }
    h1 { font-size: 28px; }
    .panel { padding: 20px; }
    .summary { grid-template-columns: 1fr 1fr; }
    .summary-item { padding: 16px 20px; }
    .summary-item:nth-child(3) { border-left: 0; }
    .summary-item:nth-child(n+3) { border-top: 1px solid var(--border); }
    .summary-value { font-size: 26px; }
    .search-row { grid-template-columns: 1fr; gap: 10px; }
    .ticker-head, .ticker-more summary, .ticker-source { padding-left: 20px; padding-right: 20px; }
    .ticker-item { grid-template-columns: minmax(0, 1fr); row-gap: 6px; padding: 12px 20px; }
    .site { grid-template-columns: minmax(0, 1fr) 20px; padding: 18px 16px 18px 20px; }
    .site-facts { display: flex; flex-wrap: wrap; gap: 4px 18px; }
    .site-actions { grid-column: 1; grid-row: 3; flex-direction: row; padding-left: 22px; }
    .site-actions .button { flex: 1 1 0; }
    .site-open { grid-column: 2; grid-row: 1; }
    .add-installation { width: 100%; }
    .add-installation summary { width: 100%; }
    .add-form { position: static; width: auto; margin-top: 8px; box-shadow: none; }
    .back { margin-top: -8px; }
    .header-actions { padding-top: 0; width: 100%; }
    .header-actions .button { flex: 1 1 0; }
    .summary-value.is-text { font-size: 17px; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 36px; padding-left: 16px; }
    .section-head h2 { font-size: 23px; }
    .section-meta { text-align: left; }
    .rows.empty, .login-form { padding: 18px 20px; }
    .props > div { grid-template-columns: 1fr; gap: 2px; padding: 12px 20px; }
    .item { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; padding: 14px 20px; }
    .item-version { grid-column: 2; grid-row: 1; text-align: right; }
    .item-update { grid-column: 1 / -1; text-align: left; }
    .item-update:empty { display: none; }
    .login-row { flex-wrap: wrap; }
    .login-row input { flex-basis: 100%; }
    .login-row button { flex: 1 1 0; }
}
