/* BKBG Support — minimal, functional styling. Swap in your own branding freely. */

:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e2e4e9;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --danger: #dc2626;
  --ok: #16a34a;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--accent); }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.narrow { max-width: 640px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px; background: #0c1b2e; border-bottom: 1px solid #1c2e46;
}
.topbar .logo { height: 56px; display: block; }
.topbar .who { color: #a9b7cc; font-size: 13px; }
.topbar .who a { color: #8fc3ff; }

.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 76px); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
}

.auth-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; width: 320px;
}

label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; font-family: inherit; color: var(--text); background: #fff;
}
textarea { resize: vertical; min-height: 100px; }

button, .btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: 6px; padding: 9px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
button.secondary, .btn.secondary { background: #e5e7eb; color: var(--text); }
button.danger { background: var(--danger); }

.error { color: var(--danger); font-size: 14px; }
.success { color: var(--ok); font-size: 14px; }
.muted { color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: #fafbfc; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-Open { background: #dbeafe; color: #1d4ed8; }
.badge-Pending { background: #fef3c7; color: #b45309; }
.badge-Resolved { background: #dcfce7; color: #15803d; }
.badge-WaitingonCustomer { background: #ede9fe; color: #6d28d9; }
.badge-Scheduled { background: #cffafe; color: #0e7490; }
.badge-PartsNeeded { background: #fee2e2; color: #b91c1c; }

.priority-Urgent { color: var(--danger); font-weight: 700; }
.priority-High { color: #d97706; font-weight: 600; }
.priority-Medium { color: var(--text); }
.priority-Low { color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: end; }
.filters label { margin-bottom: 0; min-width: 140px; }

.thread { margin: 16px 0; }
.msg { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.msg-note { background: #fffbeb; border-color: #fde68a; }
.msg-customer { background: #eff6ff; }
.msg-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.msg-body { white-space: pre-wrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.stat { text-align: center; }
.stat .num { font-size: 28px; font-weight: 700; }
.stat .label { color: var(--muted); font-size: 13px; }
.stats-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stats-row .card { flex: 1; min-width: 140px; }

.sig-pad-wrap { border: 1px solid var(--border); border-radius: 6px; background: #fff; touch-action: none; }
.sig-pad-wrap canvas { display: block; width: 100%; height: 180px; cursor: crosshair; }
.sig-image { max-width: 320px; border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 6px; }

.parts-used-note { margin-top: 0; }
