/*
 * Centralized Ledger Engine demo design system
 * Shared tokens and primitives only. Page layouts and domain-specific states
 * belong in assets/css/pages so changes do not leak across unrelated views.
 */

:root {
  color-scheme: light;

  /* Semantic theme pairs, following the shadcn/ui token convention. */
  --background: #f7f7f5;
  --foreground: #1c1917;
  --card: #ffffff;
  --card-foreground: #1c1917;
  --primary: #0f766e;
  --primary-foreground: #ffffff;
  --secondary: #f1f1ef;
  --secondary-foreground: #292524;
  --muted-surface: #f1f1ef;
  --muted-foreground: #716d68;
  --border: #dedcd8;
  --input: #d6d3d1;
  --ring: rgba(15, 118, 110, 0.28);
  --destructive: #b4232d;
  --destructive-foreground: #ffffff;

  /* Compatibility aliases used by the domain-specific page styles. */
  --bg: var(--background);
  --paper: var(--card);
  --panel: var(--card);
  --surface: var(--card);
  --surface-2: var(--secondary);
  --ink: var(--foreground);
  --muted: var(--muted-foreground);
  --line: var(--border);
  --accent: var(--primary);
  --accent-dark: #0b5f59;
  --accent-2: #0b4d63;
  --navy: var(--accent-2);
  --blue: #1f5d7a;
  --green: #2f6c47;
  --ok: #256843;
  --warn: #9a5a13;
  --amber: #8a6118;
  --danger: var(--destructive);
  --risk: #8c2525;

  /* Domain labels */
  --core: #1d6650;
  --wallet: #185d78;
  --recon: #73551c;
  --migration: #7b3f63;

  /* Shape and type */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --control-radius: var(--radius-sm);
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.06);
  --shadow-raised: 0 8px 24px rgba(28, 25, 23, 0.08);
  --font-sans: "Segoe UI", Arial, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: 0;
}

p {
  color: var(--muted);
}

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

code {
  border-radius: 4px;
  background: #ece6da;
  padding: 2px 5px;
  font-family: var(--mono);
  font-size: 0.93em;
}

pre {
  overflow: auto;
  border-radius: var(--control-radius);
  background: #17212b;
  color: #f8fafc;
  padding: 14px;
  font: 13px/1.5 var(--mono);
}

pre code,
.schema-card code,
.map-row code {
  border-radius: 0;
  background: transparent;
  padding: 0;
}

button,
.button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  text-decoration: none;
}

.links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--ink);
  padding: 7px 10px;
  text-decoration: none;
}

button {
  cursor: pointer;
}

button:hover,
.button:hover,
.button-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

button.primary,
.button.primary,
.button-link.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

button.primary:hover,
.button.primary:hover,
.button-link.primary:hover {
  background: var(--accent-dark);
  color: white;
}

button.danger {
  border-color: #e2b4b4;
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.mono {
  font-family: var(--mono);
}

.hidden {
  display: none !important;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.tag,
.badge,
.pill,
.label,
.status,
.rule-label,
.delta-badge {
  border-radius: 999px;
}

.notice {
  border: 1px solid #ecd6aa;
  border-left: 5px solid var(--warn);
  border-radius: var(--radius);
  background: #fff7e8;
  color: #68400d;
  padding: 11px 14px;
}

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
