/* LawDek v2 — plain hand-written CSS.
 *
 * Visual tokens adopted 2026-04-16 from the pre-React vanilla
 * implementation (~/lawdek/static/styles.css at commit 957b83f).
 * That design was validated with the user before the React port
 * carried it forward unchanged. This v2 port keeps the exact
 * palette, spacing rhythm, and component shapes so anyone coming
 * from the prior tool sees the same product.
 *
 * Structural classes (container, nav, brand, muted, small, tiny,
 * plain-list, link-accent, filter-bar, sev-*) stay stable across
 * the visual port.
 */

:root {
  --bg: #f9fafb;
  --bg-card: #ffffff;
  --bg-row-hover: #f9fafb;

  --text: #4b5563;
  --text-heading: #111827;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;

  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --accent: #1e40af;
  --accent-soft: #dbeafe;
  --accent-hover: #1e3a8a;

  --warn: #dc2626;
  --warn-soft: #fee2e2;
  --ok: #059669;

  --radius: 8px;
  --radius-sm: 6px;

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); }
body {
  font: 16px/1.5 var(--font-sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 0 32px; }

/* Header / nav */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 52px;
}
.brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; }
.nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
}
.nav a:hover {
  background: #f3f4f6;
  text-decoration: none;
}
.nav a.active { color: var(--accent); background: var(--accent-soft); }

/* Main */
main { padding: 24px 0 64px; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.3;
}
h1 { font-size: 26px; margin-bottom: 8px; }
h2 { font-size: 20px; margin-top: 32px; margin-bottom: 12px; font-weight: 600; }
h3 { font-size: 17px; margin-top: 24px; margin-bottom: 8px; font-weight: 600; }
h4 { font-size: 15px; margin-top: 16px; margin-bottom: 6px; font-weight: 600; }
p { margin-bottom: 12px; }

.muted { color: var(--text-muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; color: var(--text-muted); }

/* Links */
.link-accent { color: var(--accent); }
.link-accent:hover { color: var(--accent-hover); text-decoration: underline; }

/* Lists */
.plain-list { list-style: none; }
.plain-list li { margin-bottom: 6px; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.card:hover { box-shadow: var(--shadow-md); }

/* Landing path tiles (grid of 2-4) */
.path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.path {
  display: block;
  padding: 28px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.15s;
  color: inherit;
}
.path:hover { box-shadow: var(--shadow-md); text-decoration: none; }
.path-title { font-size: 20px; font-weight: 700; color: var(--text-heading); margin-bottom: 6px; }
.path-desc { font-size: 16px; color: var(--text); line-height: 1.4; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #fafbfc;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-row-hover); }

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 28rem;
}
label {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 500;
}
input[type="text"], input[type="email"], input[type="date"],
input[type="number"], textarea, select {
  font: inherit;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-heading);
  font-size: 16px;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.1);
}
input::placeholder, textarea::placeholder { color: var(--text-subtle); }

button, .btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
}
button:hover, .btn:hover { background: var(--accent-hover); }
button.secondary, .btn-secondary {
  background: var(--bg-card);
  color: var(--text-heading);
  border: 1px solid var(--border);
}
button.secondary:hover, .btn-secondary:hover {
  background: #f3f4f6;
  border-color: var(--border-strong);
}
.btn-ghost {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  padding: 6px 12px;
}
.btn-ghost:hover { background: var(--accent-soft); text-decoration: none; }

/* Filter bar (schedule page) */
.filter-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: end;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filter-bar label { min-width: 10rem; }

/* HTMX indicator */
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-indicator { opacity: 0; transition: opacity 200ms; }

/* Severity tags — critical = red so it punches through; high = amber;
 * medium/low = gray. Matches the pre-React conjunction dashboard
 * palette where critical was the only chromatic severity. */
.sev {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  min-width: 2rem;
  text-align: center;
}
.sev-critical { background: var(--warn-soft); color: var(--warn); }
.sev-high     { background: #fef3c7; color: #b45309; }
.sev-medium   { background: #f3f4f6; color: var(--text); }
.sev-low      { background: #f9fafb; color: var(--text-muted); }

/* Definition lists (used in detail drawers) */
dl { font-size: 14px; }
dl dt { color: var(--text-muted); font-weight: 500; }
dl dd { color: var(--text-heading); }
