:root {
  /* Tapli brand: Tapli blue for actions, electric blue only on dark navy, Figtree throughout.
     Colours can be changed per company in Settings. */
  --accent: #006cff;
  --electric: #05effb;
  --navy: #0d1b2e;
  --ink: #14213a;
  --muted: #5b6880;
  --line: #dde3ee;
  --wash: #f2f5fa;
  --paper: #ffffff;
  --good: #1f7a4d;
  --warn: #a8640c;
  --bad: #b3261e;
  --display: "Figtree", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--wash);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.15; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 4.5vw, 44px); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 0.8em; }
p:last-child { margin-bottom: 0; }
ul { margin: 0 0 0.8em; padding-left: 1.2em; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
.num, td.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }

button, .btn {
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--accent); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--bad); }
button.link { border: 0; background: none; padding: 4px 6px; color: var(--accent); font-weight: 600; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

input, textarea, select {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; color: var(--ink); font-size: 15px; }
label.check input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--accent); }

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--wash);
  color: var(--muted);
  border: 1px solid var(--line);
}
.pill.sent { color: #2f5bb7; border-color: #c9d6f2; background: #eef3fc; }
.pill.viewed { color: var(--warn); border-color: #efd8b4; background: #fdf5e8; }
.pill.accepted { color: var(--good); border-color: #bfe0cd; background: #ebf7f0; }
.pill.declined, .pill.expired { color: var(--bad); border-color: #efc9c6; background: #fcefee; }
.chip { font-size: 12px; font-weight: 700; color: var(--good); background: #ebf7f0; border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.tag { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); padding: 1px 6px; border-radius: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 14px;
  z-index: 50; box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
@media (prefers-reduced-motion: no-preference) { .toast { animation: rise .2s ease-out; } }
@keyframes rise { from { transform: translate(-50%, 8px); opacity: .6; } }
