/* Radiant QuikLog -- brand stylesheet.
   Crimson #d00008, charcoal #303030, white background, Montserrat.
   Mirrors the QuikQA web aesthetic for visual consistency across the suite. */

:root {
  --crimson: #d00008;
  --crimson-dark: #a80006;
  --charcoal: #303030;
  --ink: #1a1a1a;
  --bg: #ffffff;
  --panel: #fafafa;
  --line: #e6e6e8;
  --muted: #6b6b70;
  --pass: #1f8a3b;  --pass-bg: #e8f6ec;
  --action: #c98a00; --action-bg: #fdf3df;
  --fail: #c4131c;  --fail-bg: #fdeaea;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.55;
}
a { color: var(--crimson); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.wordmark { font-weight: 800; font-size: 1.32rem; letter-spacing: -0.01em; color: var(--ink); }
.wordmark .accent { color: var(--crimson); }
.brand-sub {
  font-size: 0.62rem; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--muted);
}
.header-tag {
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.13em; color: var(--muted);
}
.nav-links { display: flex; gap: 18px; align-items: center; }
.nav-links a { color: var(--charcoal); font-size: 0.86rem; font-weight: 500; }

/* ---- Layout ---- */
.container { max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; }
.narrow { max-width: 760px; }
.page-title { font-size: 1.9rem; font-weight: 700; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 28px; font-size: 0.95rem; }
.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }

/* ---- Hero ---- */
.hero {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(135deg, #fff 60%, #fff4f3);
  padding: 30px 32px; margin-bottom: 24px;
}
.hero h1 { margin: 0 0 8px; font-size: 1.7rem; }
.hero p { margin: 0; color: var(--charcoal); max-width: 720px; }
.hero .accent-rule {
  width: 54px; height: 4px; background: var(--crimson);
  border-radius: 2px; margin-bottom: 16px;
}

/* ---- Summary cards ---- */
.summary-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-bottom: 24px;
}
.summary-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; background: #fff; text-align: center;
}
.summary-card .count { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.summary-card .lbl {
  font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.13em; color: var(--muted); margin-top: 4px;
}
.summary-card.status-ok       { background: var(--pass-bg);    color: var(--pass); }
.summary-card.status-due-soon { background: var(--action-bg);  color: var(--action); }
.summary-card.status-overdue  { background: var(--fail-bg);    color: var(--fail); }
.summary-card.status-nodate   { background: #eee;              color: var(--muted); }
.summary-card .count, .summary-card .lbl { color: inherit; }
.summary-card .lbl { opacity: 0.85; }

/* ---- Buttons ---- */
.btn {
  display: inline-block; cursor: pointer;
  background: var(--crimson); color: #fff; border: none;
  font-family: inherit; font-weight: 600; font-size: 0.92rem;
  padding: 11px 22px; border-radius: 6px;
  transition: background 0.12s; text-decoration: none;
}
.btn:hover { background: var(--crimson-dark); text-decoration: none; color: #fff; }
.btn.secondary {
  background: #fff; color: var(--charcoal); border: 1px solid #ccc;
}
.btn.secondary:hover { background: var(--panel); color: var(--charcoal); }
.btn.danger {
  background: #fff; color: var(--fail); border: 1px solid #e9c0c4;
}
.btn.danger:hover { background: var(--fail-bg); color: var(--fail); }
.btn-row { margin-top: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.linkbtn {
  background: none; border: none; cursor: pointer;
  color: var(--crimson); font-family: inherit;
  font-size: 0.84rem; font-weight: 600;
  padding: 0; text-decoration: underline;
}
.linkbtn:hover { color: var(--crimson-dark); }

/* ---- Forms ---- */
.form-panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; background: #fff;
}
.field { margin-bottom: 16px; }
.field label {
  display: block; font-weight: 600; font-size: 0.84rem;
  margin-bottom: 5px; color: var(--charcoal);
}
.field .hint { font-weight: 400; color: var(--muted); font-size: 0.78rem; }
.field input[type=text], .field input[type=number], .field input[type=date],
.field select, .field textarea {
  width: 100%; padding: 9px 11px; font-size: 0.9rem;
  border: 1px solid #ccccd0; border-radius: 6px;
  font-family: inherit; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--crimson);
  box-shadow: 0 0 0 3px rgba(208,0,8,0.1);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 18px; }
.section-head {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--crimson); font-weight: 700;
  margin: 22px 0 12px; padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
}
.section-head:first-child { margin-top: 0; }

/* ---- Tables ---- */
table.data {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
  margin: 4px 0 18px;
}
table.data th, table.data td {
  text-align: left; padding: 8px 12px; border: 1px solid var(--line);
}
table.data th { background: var(--panel); color: var(--charcoal); font-weight: 600; }
table.data tr:nth-child(even) td { background: #fcfcfc; }

/* Detail page: 'th' (label) column ~42% like the QuikQA result page */
.panel table.data th { width: 32%; }

/* Inventory table: subtle left-stripe + cell tint per status */
table.inventory tr td:first-child { border-left-width: 4px; }
table.inventory tr.status-ok       td:first-child { border-left-color: var(--pass); }
table.inventory tr.status-due-soon td:first-child { border-left-color: var(--action); }
table.inventory tr.status-due-soon td { background: #fffbf0; }
table.inventory tr.status-overdue  td:first-child { border-left-color: var(--fail); }
table.inventory tr.status-overdue  td { background: #fff1f1; }
table.inventory tr.status-nodate   td:first-child { border-left-color: var(--muted); }

/* ---- Verdict pills ---- */
.verdict {
  display: inline-block; font-weight: 800;
  padding: 4px 12px; border-radius: 6px;
  font-size: 0.78rem; letter-spacing: 0.03em;
}
.verdict.status-ok       { background: var(--pass-bg);   color: var(--pass); }
.verdict.status-due-soon { background: var(--action-bg); color: var(--action); }
.verdict.status-overdue  { background: var(--fail-bg);   color: var(--fail); }
.verdict.status-nodate   { background: #eee;             color: var(--muted); }

/* ---- Result head / panels ---- */
.result-head {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 26px; margin-bottom: 22px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; background: #fff;
}
.result-head .summary { color: var(--charcoal); font-size: 0.95rem; }
.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 26px; margin-bottom: 22px; background: #fff;
}
.panel h2 {
  margin: 0 0 14px; font-size: 1.05rem;
  border-bottom: 2px solid var(--crimson); padding-bottom: 7px;
  display: inline-block;
}
.empty {
  text-align: center; padding: 48px 24px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ---- Alerts ---- */
.alert { padding: 11px 15px; border-radius: 6px; font-size: 0.87rem; margin-bottom: 16px; }
.alert.error { background: var(--fail-bg); color: var(--fail); border: 1px solid #f3c0c0; }
.alert.info  { background: #eef4fb;        color: #2a5a8a;     border: 1px solid #cfe0f0; }

.hint     { color: var(--muted); font-size: 0.85rem; }
.footnote { font-size: 0.78rem; color: var(--muted); margin-top: 20px; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 40px;
  padding: 24px; text-align: center;
  font-size: 0.78rem; color: var(--muted);
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}

/* ---- Hosted evaluation-instance banner ---- */
/* Shown only when QUIKLOG_EVAL_BANNER=1 (the public eval deployment).
   Carries the no-print class so it never appears on printed reports. */
.eval-banner {
  background: var(--action-bg);
  border-bottom: 1px solid var(--action);
  color: #6f4e00;
  padding: 9px 24px;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.45;
}
.eval-banner strong { color: var(--action); }

/* ---- Print ---- */
@media print {
  .no-print { display: none !important; }
  body { font-size: 11px; }
  .container { max-width: none; padding: 0; }
  .result-head, .panel {
    border: 1px solid #999; box-shadow: none;
    page-break-inside: avoid;
  }
  .verdict { border: 1px solid #999; }
  table.data tr:nth-child(even) td { background: #fff; }
  .hero, .summary-grid, .alert { display: none !important; }
}
