/* Palette and type follow faithbiblemd.org: steel blue, pale blue bands, charcoal footer,
   a light serif for headings and Poppins for everything else. */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Poppins:wght@400;500;600&display=swap');
:root {
  --bg: #ffffff;
  --surface: #f5f9fb;
  --text: #3a444d;
  --muted: #6b7680;
  --border: #d9e5eb;
  --accent: #5d8b9e;
  --accent-deep: #165f7e;
  --accent-ink: #ffffff;
  --band: #b1d1df;
  --band-ink: #243640;
  --footer: #555555;
  --ok: #3a8a4a;
  --warn: #b26a00;
  --bad: #b3261e;
  --radius: 4px;
  --maxw: 1080px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161c21;
    --surface: #1f272e;
    --text: #e6ecf0;
    --muted: #9fadb8;
    --border: #2e3a43;
    --accent: #7fb0c4;
    --accent-deep: #a9d3e4;
    --accent-ink: #0f1a20;
    --band: #22404d;
    --band-ink: #e6ecf0;
    --footer: #0f1418;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--sans);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); }
img { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 60px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--accent-deep);
  font-family: var(--serif); font-weight: 600; font-size: 1.5rem; letter-spacing: .01em; line-height: 1;
}
.brand::before {
  content: ""; width: 34px; height: 34px; flex: none; border-radius: 50%;
  border: 3px solid currentColor;
  background:
    linear-gradient(currentColor, currentColor) 50% 50% / 3px 70% no-repeat,
    linear-gradient(currentColor, currentColor) 50% 38% / 62% 3px no-repeat;
}
.brand small { font-family: var(--sans); font-weight: 500; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-left: 2px; }
nav.main { display: flex; gap: 4px 22px; flex-wrap: wrap; align-items: center; }
#auth-slot { display: contents; }
nav.main a { text-decoration: none; color: var(--text); padding: 8px 0; font-size: .95rem; font-weight: 500; }
nav.main a[aria-current="page"], nav.main a:hover { color: var(--accent); }
header.site .wrap { min-height: 72px; }

main { padding: 32px 0 56px; flex: 1; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: .005em; }
h1 { font-size: 2.8rem; margin: 0 0 8px; line-height: 1.1; color: var(--text); }
h2 { font-size: 1.9rem; margin: 36px 0 12px; line-height: 1.2; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 28px; max-width: 62ch; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card h3 { margin: 0 0 6px; font-size: 1.35rem; color: var(--accent-deep); }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
a.card { text-decoration: none; color: inherit; display: block; transition: transform .15s, box-shadow .15s; }
a.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(22, 95, 126, .12); }

.btn {
  display: inline-block; padding: 11px 22px; border-radius: 2px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: inherit; font-size: .85rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.secondary:hover { background: var(--surface); color: var(--accent-deep); }
.btn.secondary { background: transparent; color: var(--accent); }
.btn:disabled { opacity: .6; cursor: default; }

form.stack { display: grid; gap: 14px; max-width: 420px; }
label { display: grid; gap: 6px; font-weight: 600; }
input, textarea, select {
  font: inherit; padding: 10px 12px; border-radius: 2px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { color: var(--muted); font-size: .9rem; font-weight: 400; }
.error { color: var(--bad); margin: 0; }
.notice {
  border-left: 4px solid var(--warn); background: var(--surface);
  padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; color: var(--muted);
}
.badge {
  display: inline-block; font-size: .8rem; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
}

footer.site { background: var(--footer); color: #e9eef1; padding: 28px 0; font-size: .9rem; }
footer.site .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
footer.site a { color: #ffffff; }

/* Home page hero: pale blue band with a faint grid, like a wiring diagram. */
.hero {
  background:
    linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(22,95,126,.12) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(22,95,126,.12) 31px 32px),
    var(--band);
  color: var(--band-ink); padding: 56px 0 48px; margin: -32px 0 32px;
}
.hero h1 { font-size: 3.4rem; color: var(--band-ink); margin-bottom: 10px; }
.hero .lead { color: var(--band-ink); opacity: .85; font-size: 1.1rem; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.hero .btn.secondary { background: rgba(255,255,255,.6); }
@media (max-width: 600px) { h1 { font-size: 2.2rem; } .hero h1 { font-size: 2.5rem; } }
.notice { border-left-color: var(--accent); }

.floorplan {
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
  min-height: 320px; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 24px;
}

/* Tickets */
.status {
  display: inline-block; font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  background: var(--border); color: var(--text);
}
.status.open { background: #e3f0fb; color: #1f5f8b; }
.status.in_progress { background: #fff3d6; color: #8a5300; }
.status.waiting { background: #fde7e5; color: #8f1f17; }
.status.resolved, .status.closed { background: #e2f3e3; color: #22602a; }
@media (prefers-color-scheme: dark) {
  .status.open { background: #1b3a52; color: #9cd0f5; }
  .status.in_progress { background: #4a3306; color: #ffd27a; }
  .status.waiting { background: #4e1a16; color: #ffb3ab; }
  .status.resolved, .status.closed { background: #173f1d; color: #9fe0a6; }
}
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list th { font-size: .78rem; color: var(--muted); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
table.list tr:last-child td { border-bottom: 0; }
table.list a { font-weight: 600; text-decoration: none; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.filters a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--muted); font-size: .9rem; }
.filters a[aria-current] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.thread { display: grid; gap: 12px; margin: 16px 0; }
.msg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.msg.internal { border-style: dashed; }
.msg .meta { color: var(--muted); font-size: .85rem; margin-bottom: 6px; }
.msg .body { white-space: pre-wrap; margin: 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row label { flex: 1 1 180px; }
.two { display: grid; gap: 24px; grid-template-columns: 2fr 1fr; }
@media (max-width: 720px) { .two { grid-template-columns: 1fr; } }
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Inventory and files */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.toolbar input[type=search] { flex: 1 1 200px; width: auto; }
.toolbar select { width: auto; }
details.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; }
details.panel summary { cursor: pointer; font-weight: 600; }
.ok { color: var(--ok); margin: 0; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 6px 12px; font-size: .9rem; }
table.list td.actions { white-space: nowrap; text-align: right; }
.filesize { color: var(--muted); font-size: .85rem; }

/* Network status */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 0 0 8px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; }
.stat .label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat strong { font-size: 1.6rem; line-height: 1.2; font-family: var(--serif); font-weight: 600; }
.stat strong.good { color: var(--ok); }
.stat strong.bad { color: var(--bad); }
.stat .sub { color: var(--muted); font-size: .85rem; }
.chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.chart svg { width: 100%; height: 220px; display: block; }
@media (max-width: 600px) { .chart svg { height: 180px; } }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart path { fill: none; stroke-width: 2; stroke-linejoin: round; }
.chart path.down, .sw.down { stroke: var(--accent); background: var(--accent); }
.chart path.up, .sw.up { stroke: var(--ok); background: var(--ok); }
.chart .outage, .sw.out { fill: var(--bad); background: var(--bad); opacity: .5; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; margin-top: 8px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.on { background: var(--ok); } .dot.off { background: var(--bad); }
td.staff, th.staff { display: none; }
body.is-staff td.staff, body.is-staff th.staff { display: table-cell; }

/* Floor plan with pins */
.plan { position: relative; display: inline-block; max-width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; line-height: 0; }
.plan img { display: block; max-width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.plan.editing { cursor: crosshair; }
.pins { position: absolute; inset: 0; }
.pin { position: absolute; transform: translate(-50%, -50%); line-height: 1.2; }
.pin .marker {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--muted); color: #fff; font-size: .8rem; font-weight: 700;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.pin.on .marker { background: var(--ok); } .pin.off .marker { background: var(--bad); animation: pulse 1.6s infinite; }
.pin .tag {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, 4px); white-space: nowrap;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 6px; font-size: .75rem; font-weight: 600; pointer-events: none;
}
.plan.editing .pin { cursor: grab; touch-action: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(179,38,30,.25); } }
