:root {
  /* Road Angel brand (roadangelgroup.com): charcoal, white, orange accent, warm grey */
  --bg: #f5f3ef;
  --card: #ffffff;
  --ink: #222222;
  --muted: #666666;
  --line: #ddd8d0;
  --brand: #222222;
  --brand-ink: #ffffff;
  --accent: #ff6a00;
  --accent-ink: #222222;
  --warn: #8a4b00;
  --warn-bg: #fff1e6;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --good: #1f6b3a;
  --good-bg: #e7f3ea;
  --cust: #f5f3ef;
  --mine: #fff4ec;
  --radius: 12px;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("source-sans-3.9ef356ea553a.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 "Source Sans 3", Arial, sans-serif;
}
a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #000; }
h1 { font-size: 1.7rem; font-weight: 600; margin: 0 0 .75rem; line-height: 1.2; letter-spacing: .2px; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; }
p { margin: .4rem 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* header */
.topbar { background: var(--brand); color: var(--brand-ink); border-bottom: 4px solid var(--accent); }
.topbar .inner { max-width: 760px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar .brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.topbar .logo { height: 22px; width: auto; display: block; color: #fff; }
.topbar .sub { font-size: .95rem; color: #cccccc; border-left: 1px solid #555; padding-left: 12px; white-space: nowrap; }
@media (max-width: 420px) { .topbar .logo { height: 18px; } .topbar .sub { font-size: .85rem; padding-left: 8px; } }
.topbar a.out { color: #ffffff; font-size: .95rem; text-decoration-color: var(--accent); }
.wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 60px; }

/* cards & lists */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 12px; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover, a.card:focus { border-color: var(--brand); }
.card .row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.card .who { font-weight: 650; }
.card .when { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.card .subject { margin: 2px 0 4px; }
.card .preview { color: var(--muted); font-size: .95rem; }
.card.waiting { border-left: 6px solid var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

/* badges */
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--cust); color: var(--muted); white-space: nowrap; }
.badge.go { background: var(--accent); color: #222; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

/* conversation bubbles */
.thread { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 24px; }
.bubble { max-width: 92%; padding: 12px 14px; border-radius: 14px; background: var(--cust); border: 1px solid var(--line); }
.bubble.mine { align-self: flex-end; background: var(--mine); border-color: #ffd2b0; }
.bubble.note { align-self: center; background: #fffbe6; border-color: #f0e2a8; font-size: .92rem; max-width: 100%; }
.bubble .meta { font-size: .8rem; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bubble .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.files a { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; text-decoration: none; }
.files img { max-width: 160px; max-height: 120px; border-radius: 6px; display: block; }

/* forms */
label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; font: inherit; padding: 12px; border: 1px solid #b9c4cf; border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { min-height: 140px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(255,106,0,.45); border-color: var(--ink); }
.help { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.errorlist { color: var(--bad); list-style: none; padding: 0; margin: 4px 0; font-size: .9rem; }
.btn { display: inline-block; font: inherit; font-weight: 700; border: 2px solid var(--brand); border-radius: 999px; padding: 12px 26px; background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { background: #000; border-color: #000; color: #fff; }
.btn.big { width: 100%; font-size: 1.15rem; padding: 15px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.big:hover { background: #e65f00; border-color: #e65f00; color: #000; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn.secondary:hover { background: var(--ink); color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.small { padding: 7px 12px; font-size: .9rem; }
.btn:focus { outline: 3px solid rgba(255,106,0,.55); outline-offset: 2px; }
.filepick { margin: 12px 0; padding: 12px; border: 2px dashed #cfc8bc; border-radius: 10px; background: #faf9f6; }
.filepick input { width: 100%; }

/* alerts */
.alert { padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; }
.alert.success { background: var(--good-bg); color: var(--good); }
.alert.error { background: var(--bad-bg); color: var(--bad); }
.alert.info { background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--accent); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }

/* staff */
.staff .topbar .inner, .staff .wrap { max-width: 1200px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: #dddddd; text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.nav a.on, .nav a:hover { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 -3px 0 var(--accent); border-radius: 6px 6px 0 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .n { font-size: 1.8rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .9rem; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .95rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f5f3ef; font-weight: 650; font-size: .85rem; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.filters > * { flex: 1 1 160px; }
.filters .btn { flex: 0 0 auto; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form select { width: auto; flex: 1 1 200px; }
.qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; }
code { background: #f0ede7; padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
details summary { cursor: pointer; font-weight: 600; }

@media (max-width: 800px) {
  .cols { grid-template-columns: 1fr; }
  .staff .topbar .inner { flex-direction: column; align-items: flex-start; }
}

.footer { max-width: 760px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: .85rem; }
.staff .footer { max-width: 1200px; }
