/* Shared design tokens and components for Frans web dashboards */
:root {
  --accent:        #e65100;
  --accent-light:  #fff5f0;
  --bg:            #f5f5f5;
  --card:          #fff;
  --border:        #e0e0e0;
  --border-strong: #ccc;
  --text:          #1a1a1a;
  --text-secondary:#555;
  --muted:         #888;
  --muted-light:   #bbb;
  --good:          #2e7d32;
  --warn:          #e65100;
  --bad:           #c62828;
  --good-bg:       #e8f5e9;
  --warn-bg:       #fff3e0;
  --bad-bg:        #ffebee;
  --radius:        8px;
  --font:          -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:     ui-monospace, "SF Mono", "Cascadia Code", monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: #1976d2; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ──────────────────────────────────────────────────────── */
.page      { max-width: 960px; margin: 0 auto; padding: 24px 24px 40px; }
.page-body { padding: 24px 24px 40px; }

/* ── Nav ─────────────────────────────────────────────────────────── */
.nav { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: rgba(245,245,245,.97); backdrop-filter: blur(4px); padding: 8px 24px; border-bottom: 1px solid var(--border); }
.nav-brand { font-weight: 700; font-size: 14px; color: var(--text); text-decoration: none; margin-right: 4px; }
.nav-brand:hover { color: var(--accent); text-decoration: none; }
.nav-link { font-size: 12px; font-weight: 600; color: #555; text-decoration: none; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--card); white-space: nowrap; transition: background .12s, color .12s, border-color .12s; }
.nav-link:hover { background: #e8f0fe; color: #1565c0; border-color: #90caf9; text-decoration: none; }
.nav-link.active { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* ── Typography ──────────────────────────────────────────────────── */
h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
h2 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: #555; text-transform: uppercase; letter-spacing: .5px; }

/* ── Cards & sections ────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card > h2 { font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--text); }
.card h3 { font-size: 14px; font-weight: 600; margin: 12px 0 8px; }
.section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }

/* ── Forms ───────────────────────────────────────────────────────── */
label { font-size: 13px; font-weight: 500; display: block; margin-bottom: 4px; }
select, input[type="text"], input[type="file"], textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--bg); font-family: inherit; color: var(--text); }
textarea { min-height: 60px; resize: vertical; }
.row { display: flex; gap: 12px; margin-bottom: 12px; }
.row > * { flex: 1; }
.radio-row { display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; cursor: pointer; }
.radio-row input[type="radio"] { width: auto; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn { padding: 8px 18px; border: none; border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; font-family: inherit; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(.9); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-save { margin-top: 8px; padding: 6px 18px; background: #1a1a2e; color: #fff; border: none; border-radius: var(--radius); cursor: pointer; font-size: 13px; font-family: inherit; }
.btn-save:disabled { opacity: .5; cursor: default; }

/* ── Status / alerts ─────────────────────────────────────────────── */
.status { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; display: none; }
.status.info    { display: block; background: #eff6ff; color: #1e40af; }
.status.success { display: block; background: #f0fdf4; color: #166534; }
.status.error   { display: block; background: var(--bad-bg); color: #991b1b; }
.save-status { font-size: 12px; margin-top: 6px; min-height: 16px; }
.save-status.ok  { color: var(--good); }
.save-status.err { color: var(--bad); }

/* ── Table ───────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--border); font-size: 12px; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: .04em; }
td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr.expandable { cursor: pointer; }
tbody tr.expandable:hover td { background: var(--bg); }
tbody tr.expandable td.expand-toggle { color: var(--muted-light); font-size: 10px; user-select: none; width: 16px; padding-right: 0; }
tbody tr.expandable.open td.expand-toggle { color: var(--accent); }
tr.job-detail-row td { padding: 0; border-bottom: 1px solid var(--border); }
.job-detail-inner { padding: 12px 16px; background: #f9f9f9; font-size: 12px; color: #555; display: grid; gap: 16px; }
.job-detail-inner h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 6px; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-green  { background: var(--good-bg); color: var(--good); }
.badge-orange { background: var(--warn-bg); color: var(--accent); }
.badge-red    { background: var(--bad-bg);  color: var(--bad); }
.badge-grey   { background: var(--bg);      color: var(--muted); }
.badge-yellow { background: #fffde7;        color: #f57f17; }

/* ── Filter bar ──────────────────────────────────────────────────── */
.filter-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; background: var(--card); border-radius: var(--radius); padding: 12px 16px; border: 1px solid var(--border); }
.filter-bar label { font-size: 12px; color: #555; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 0; }
.filter-bar select { width: auto; padding: 5px 8px; }
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-bar .matched { font-size: 12px; color: var(--muted); margin-left: auto; }

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--card); border-radius: 10px; width: min(680px,95vw); max-height: 88vh; overflow-y: auto; padding: 28px 32px; box-shadow: 0 8px 40px rgba(0,0,0,.25); }
.modal.modal-lg { width: min(900px,95vw); }
.modal-close { float: right; cursor: pointer; font-size: 18px; color: var(--muted); background: none; border: none; padding: 0; }
.modal-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.modal-sub { font-size: 12px; color: var(--muted); font-family: var(--font-mono); margin-bottom: 20px; }
.modal-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 6px; margin-top: 16px; }

/* ── Utilities ───────────────────────────────────────────────────── */
.json-tree { background: #1e1e2e; color: #cdd6f4; border-radius: var(--radius); padding: 16px; font-family: var(--font-mono); font-size: 12px; line-height: 1.6; overflow-x: auto; max-height: 600px; overflow-y: auto; white-space: pre-wrap; }
.empty       { color: var(--muted-light); font-size: 13px; }
.empty-state { text-align: center; padding: 40px; color: var(--muted); }
.refresh     { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.helper      { font-size: 12px; color: var(--muted); margin-top: 4px; }
.label-check { display: block; margin-bottom: 6px; font-size: 13px; }
.label-check input { margin-right: 6px; }
.feedback-comment { margin-top: 8px; padding: 8px 10px; background: #fffde7; border-left: 3px solid #f9a825; font-size: 12px; font-style: italic; white-space: pre-wrap; color: #555; border-radius: 0 4px 4px 0; }
