/* WEES design tokens and base components, shared by the block page, the
   sign-in portal and the reports dashboard. Values match WEES Helpdesk
   (OpenHelpdesk static/css/app.css) so the products look like one family;
   the teal and coral come from the WEES logo. */
:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --page-plane: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --gridline: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);

  --series-1: #2a78d6; /* blue: links, primary buttons, "allowed" */
  --series-2: #eb6834; /* orange: "blocked" */

  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;

  /* WEES logo */
  --brand-teal: #227f85;
  --brand-teal-deep: #0b4e53;
  --brand-coral: #ff6b54;
  --brand-gradient: linear-gradient(135deg, #2b959a 0%, #227f85 45%, #0b4e53 100%);

  --radius: 10px;
  --radius-sm: 6px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-1: #1c1c1a;
    --page-plane: #121211;
    --text-primary: #f2f2ef;
    --text-secondary: #b9b7b0;
    --text-muted: #87857d;
    --gridline: #333230;
    --baseline: #46453f;
    --border: rgba(255, 255, 255, 0.12);
    --series-1: #3987e5;
    --series-2: #d95926;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1c1c1a;
  --page-plane: #121211;
  --text-primary: #f2f2ef;
  --text-secondary: #b9b7b0;
  --text-muted: #87857d;
  --gridline: #333230;
  --baseline: #46453f;
  --border: rgba(255, 255, 255, 0.12);
  --series-1: #3987e5;
  --series-2: #d95926;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--page-plane);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--series-1); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.subtitle { color: var(--text-secondary); margin: 0 0 20px; font-size: 14px; }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--surface-1); border-bottom: 1px solid var(--border);
  padding: 0 20px; min-height: 56px;
}
.topbar .brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 16px; color: var(--text-primary); text-decoration: none;
}
.brand-logo { width: 24px; height: 24px; border-radius: 6px; display: block; }
.topbar nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.topbar nav a, .topbar nav button.tab {
  color: var(--text-secondary); padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; background: none; border: 0; font-family: inherit; cursor: pointer;
}
.topbar nav a:hover, .topbar nav button.tab:hover { background: var(--page-plane); text-decoration: none; }
.topbar nav .active, .topbar nav [aria-selected="true"] { color: var(--text-primary); background: var(--page-plane); }

.link-btn {
  color: var(--text-secondary); padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; background: none; border: none; font-family: inherit; cursor: pointer;
}
.link-btn:hover { background: var(--page-plane); }
.theme-toggle { font-size: 16px; line-height: 1; padding: 7px 10px; }

/* Layout */
.container { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.stat-tile {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.stat-tile .value { font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-tile .label { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

/* Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary);
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--page-plane); text-decoration: none; }
.btn.primary { background: var(--series-1); border-color: var(--series-1); color: #fff; }
.btn.primary:hover { background: #2166b8; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px; background: var(--surface-1); color: var(--text-primary);
}
.input:focus { outline: 2px solid var(--series-1); outline-offset: 1px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text-secondary); }

/* Tables */
table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--text-muted); border-bottom: 1px solid var(--gridline); padding: 8px 10px;
  background: var(--surface-1); position: sticky; top: 0;
}
table.list td { padding: 10px; border-bottom: 1px solid var(--gridline); font-size: 14px; vertical-align: middle; }
table.list tr:hover td { background: var(--page-plane); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.neutral { background: rgba(137,135,129,0.16); color: var(--text-secondary); }
.badge.critical { background: rgba(208,59,59,0.14); color: var(--status-critical); }

.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px;
  background: rgba(208,59,59,0.10); color: var(--status-critical); border: 1px solid rgba(208,59,59,0.25);
}

/* Sign-in and notice pages (portal, block page) */
.auth-wrap { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; background: var(--page-plane); }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.auth-card.wide { max-width: 560px; }
.brand-band {
  display: flex; align-items: center; gap: 12px; padding: 18px 24px;
  background: var(--brand-gradient); color: #fff;
}
.brand-band img { width: 40px; height: 40px; border-radius: 10px; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,0.18); }
.brand-band .name { font-weight: 700; font-size: 17px; letter-spacing: 0.01em; }
.brand-band .tag { font-size: 12.5px; opacity: 0.85; }
.auth-body { padding: 24px; }
.auth-body h1 { font-size: 21px; }
.auth-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px; border-top: 1px solid var(--gridline);
  color: var(--text-muted); font-size: 12px;
}
.auth-foot a { color: var(--text-muted); }
.coral-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--brand-coral); box-shadow: 0 0 0 4px rgba(255,107,84,0.22); vertical-align: 2px; margin-right: 10px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 18px 0 0; font-size: 14px; }
dl.kv dt { color: var(--text-muted); }
dl.kv dd { margin: 0; font-weight: 600; word-break: break-all; }
