/* ============================================================
   X3 Fleet Safety — Shared App-Page Components
   Loaded by authenticated pages (drivers, vehicles, dq-files,
   inspections, mvrs, da-tests, training, incidents, audit,
   settings, assistant, audit-export, import-guide).

   This file holds the structural bits that were previously
   duplicated across 8+ inline <style> blocks. Page-specific
   color variants (.pill-*, etc.) stay inline per page.
   ============================================================ */

/* ---------- Toolbar (search + filter row above tables) ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}
.toolbar .grow { flex: 1; min-width: 240px; }
.toolbar input[type=search],
.toolbar input[type=text],
.toolbar input[type=date],
.toolbar select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.toolbar input:focus,
.toolbar select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27, 58, 107, .12);
}

/* ---------- Data tables ---------- */
table.data {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 30, 56, .04);
  border: 1px solid var(--border);
}
table.data thead { background: var(--bg); }
table.data th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}
table.data td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--bg); }
table.data .name { font-weight: 700; color: var(--navy); }
table.data .muted { color: var(--slate); font-size: 13px; }

/* ---------- Status pills (base — color variants inline per page) ---------- */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ---------- Inline icon buttons (edit, delete, etc.) ---------- */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--slate);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
}
.icon-btn:hover { background: var(--bg); color: var(--navy); }
.icon-btn.danger:hover { background: #FEE2E2; color: var(--red); }
.icon-btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* ---------- Empty states ---------- */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--slate);
}
.empty .emoji { font-size: 40px; margin-bottom: 12px; }
.empty h3 { color: var(--navy); font-size: 18px; margin-bottom: 8px; }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 30, 56, .55);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.modal h2 { color: var(--navy); margin-bottom: 14px; }
.modal .close-row {
  display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end;
}
.modal .close-row .btn { width: auto; }

/* ---------- Section titles inside cards ---------- */
.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ---------- Common pill tint tiers (reuse in page-local .pill-* rules) ---------- */
.pill.tier-green,
.pill.tier-valid    { background: #DCFCE7; color: var(--green); }
.pill.tier-amber,
.pill.tier-expiring { background: #FEF3C7; color: var(--amber); }
.pill.tier-red,
.pill.tier-expired  { background: #FEE2E2; color: var(--red); }
.pill.tier-slate,
.pill.tier-inactive { background: #F1F5F9; color: var(--slate); }
.pill.tier-blue     { background: #DBEAFE; color: #1E40AF; }
