/* Shared by the console and the agent app. Colours only ever come from the
   Freelancer tokens in tokens.css, so both themes stay complete. */
:root {
  --bg: var(--fl-background-sunken);
  --panel: var(--fl-background);
  --line: var(--fl-border);
  --text: var(--fl-foreground);
  --muted: var(--fl-foreground-muted);
  --accent: var(--fl-secondary);
  --primary: var(--fl-primary);
  --urgent: var(--fl-error);
  --warn: var(--fl-warning);
  --ok: var(--fl-success);
  --radius: 10px;
  color-scheme: light dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--fl-font-sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .balance { text-wrap: balance; }
p, li, .pretty { text-wrap: pretty; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important;
}
.btn:hover:not(:disabled) { border-color: var(--fl-border-strong); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--fl-primary-fill); border-color: var(--fl-primary-fill); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--fl-primary-hover); border-color: var(--fl-primary-hover); }
.btn.blue { background: var(--fl-secondary-fill); border-color: var(--fl-secondary-fill); color: #fff; }
.btn.danger { color: var(--urgent); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--fl-focus-ring); outline-offset: 2px;
}

/* Pills: a soft fill with a dot, the way the product marks status. */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
  background: color-mix(in srgb, var(--c, var(--muted)) 14%, transparent);
  color: color-mix(in srgb, var(--c, var(--muted)) 80%, var(--text));
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); }
.pill.FOLLOW_UP { --c: var(--fl-secondary); }
.pill.ONBOARDING { --c: #8b5cf6; }
.pill.CPV_PENDING { --c: var(--fl-warning); }
.pill.CPV_ISSUE { --c: var(--fl-error); }
.pill.ACTIVE { --c: var(--fl-success); }
.pill.STOPPED { --c: var(--fl-border-neutral); }
.pill.NOT_INTERESTED { --c: var(--fl-border-neutral); }
.pill.ok { --c: var(--fl-success); }
.pill.warn { --c: var(--fl-warning); }
.pill.bad { --c: var(--fl-error); }
.pill.info { --c: var(--fl-secondary); }

/* Forms */
label.field { display: grid; gap: 4px; font-weight: 500; }
label.field > span.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input[type=text], input[type=tel], input[type=url], input[type=number], input[type=search], input[type=datetime-local], input[type=date], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel);
}
textarea { min-height: 80px; resize: vertical; }
.choice { display: grid; gap: 8px; }
.choice label {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 500;
}
.choice label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.choice label small { display: block; font-weight: 400; color: var(--muted); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty img { width: 160px; opacity: 0.9; display: block; margin: 0 auto 8px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100;
  background: var(--fl-nav-bg); color: #fff; padding: 10px 16px; border-radius: 10px;
  box-shadow: var(--fl-shadow-md); max-width: min(92vw, 520px); text-wrap: pretty;
}
.toast.bad { background: var(--fl-error); }
