/*
 * HandyOS's visual base: the warm neutrals of Handy a Bordo and Jace, one
 * brand color and plain components. No build step: Propshaft serves it as is.
 */
:root {
  --background: #fdf8f3;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --muted: #f5f5f4;
  --muted-foreground: #5f6b68;
  --border: #e7e5e4;
  --input: #d6d3d1;
  --primary: #171717;
  --primary-foreground: #fafafa;
  --destructive: #b91c1c;
  /* HandyOS: indigo-700; white on it is 7.9:1. */
  --brand: #4338ca;
  --brand-foreground: #ffffff;
  --success-bg: #ecfdf5;
  --danger-bg: #fef2f2;
  --radius: 8px;
  --shadow: 0 1px 2px rgb(15 23 42 / 5%), 0 10px 28px rgb(15 23 42 / 6%);
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--foreground);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.hint { color: var(--muted-foreground); font-size: .9rem; }

.topbar { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; padding: .75rem 1.5rem;
  background: var(--card); border-bottom: 1px solid var(--border); }
.topbar__brand { font-weight: 700; text-decoration: none; color: var(--foreground); }
.topbar__brand span { color: var(--brand); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 1rem; flex: 1; }
.topbar nav a { text-decoration: none; color: var(--foreground); }
.topbar__user { display: flex; gap: .75rem; align-items: center; color: var(--muted-foreground); font-size: .9rem; }

main { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end; margin-bottom: 1.25rem; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem; margin-bottom: 1.25rem; }

.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid var(--border); }
.flash--notice { background: var(--success-bg); }
.flash--alert { background: var(--danger-bg); }

.button, button, input[type="submit"] { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem;
  border-radius: var(--radius); border: 1px solid var(--primary); background: var(--primary); color: var(--primary-foreground);
  font: inherit; text-decoration: none; cursor: pointer; }
.button--soft { background: var(--card); color: var(--foreground); border-color: var(--input); }
.button--danger { background: var(--card); color: var(--destructive); border-color: var(--input); }
.button--brand { background: var(--brand); border-color: var(--brand); color: var(--brand-foreground); }
form.inline { display: inline; }

label { display: block; font-weight: 600; margin-bottom: .25rem; }
input[type="text"], input[type="email"], input[type="date"], input[type="search"], input[type="number"], select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--input); border-radius: var(--radius); font: inherit; background: var(--card); }
.field { margin-bottom: 1rem; }
.fields { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.errors { color: var(--destructive); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.search { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.search input { flex: 1 1 220px; width: auto; }
.search select { width: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .85rem; color: var(--muted-foreground); font-weight: 600; }
.badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; background: var(--muted); font-size: .8rem; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.token { display: block; padding: .75rem; background: var(--muted); border-radius: var(--radius); word-break: break-all;
  font-family: ui-monospace, monospace; }
pre.copy { white-space: pre-wrap; background: var(--muted); padding: .75rem; border-radius: var(--radius); }

.auth { display: grid; place-items: center; min-height: 80vh; }
.auth .panel { max-width: 380px; text-align: center; }
