/*
 * Supplements MudBlazor rather than replacing it.
 *
 * Most of the mockups' identity lives in Theme/CopierTheme.cs — palette,
 * typography, radius — because MudBlazor applies those itself. What is left here
 * is the handful of things MudBlazor has no opinion about: the dark app bar with
 * horizontal nav, the status badge palette, and the sign-in page (still a Razor
 * Page, so it gets no MudBlazor styling at all).
 *
 * Loaded after MudBlazor.min.css, so these rules win where they overlap.
 */

:root {
  --bg: #f4f5f7;
  --surface: #fff;
  --surface-muted: #fafbfc;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --divider: #eceef2;

  --text: #151a22;
  --text-muted: #5b6472;
  --text-dim: #444c59;

  --header: #0f1724;
  --header-text: #c4cbd8;
  --header-active: #1f2a3d;
  --avatar: #2c3a54;

  --primary: #1d4ed8;
  --sell: #c2410c;

  --ok-bg: #e2f4e8;   --ok-text: #14683a;
  --warn-bg: #fcefcc; --warn-text: #76500a;
  --bad-bg: #fde6e6;  --bad-text: #9b1c1c;
  --mute-bg: #eceef2; --mute-text: #444c59;
  --info-bg: #e3ecfd; --info-text: #1b3f9e;
  --miss-bg: #f6dcea; --miss-text: #7a1745;

  --mono: ui-monospace, "SF Mono", Consolas, monospace;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Numbers, prices, tickets and ids are monospaced throughout the mockups. */
.copier-mono { font-family: var(--mono); font-size: 13px; }

/* ---------------------------------------------------------------------------
 * App bar: dark, 60px, horizontal nav. MudBlazor defaults to a drawer, so the
 * nav is hand-built to match the mockups.
 * ------------------------------------------------------------------------- */

.copier-appbar { background: var(--header) !important; }

.copier-brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .01em;
  color: #fff;
  margin-right: 28px;
}

.copier-nav { display: flex; gap: 4px; }

.copier-nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--header-text);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .12s ease, color .12s ease;
}

.copier-nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.copier-nav-link.on { background: var(--header-active); color: #fff; }

.copier-appbar-meta {
  color: var(--header-text);
  font-size: 12px;
  margin: 0 6px;
}

.copier-signout {
  background: none;
  border: 0;
  color: var(--header-text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 8px;
}

.copier-signout:hover { color: #fff; background: rgba(255, 255, 255, .06); }

.copier-avatar {
  background: var(--avatar) !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 12px;
}

/* ---------------------------------------------------------------------------
 * Status badges. Applied to MudChip so the palette stays the mockups' rather
 * than MudBlazor's semantic colours, which are tuned for Material contrast.
 * ------------------------------------------------------------------------- */

.badge-ok, .badge-warn, .badge-bad, .badge-mute, .badge-info, .badge-miss {
  font-size: 12px !important;
  font-weight: 600 !important;
  height: 24px !important;
}

.badge-ok   { background: var(--ok-bg)   !important; color: var(--ok-text)   !important; }
.badge-warn { background: var(--warn-bg) !important; color: var(--warn-text) !important; }
.badge-bad  { background: var(--bad-bg)  !important; color: var(--bad-text)  !important; }
.badge-mute { background: var(--mute-bg) !important; color: var(--mute-text) !important; }
.badge-info { background: var(--info-bg) !important; color: var(--info-text) !important; }
.badge-miss { background: var(--miss-bg) !important; color: var(--miss-text) !important; }

/* ---------------------------------------------------------------------------
 * Sign-in page.
 *
 * Login and logout remain Razor Pages because a Blazor circuit cannot issue an
 * auth cookie — there is no HTTP response to attach it to. So this page gets no
 * MudBlazor CSS and needs its own small set of styles.
 * ------------------------------------------------------------------------- */

.centred {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.centred-brand {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .01em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.card-pad { padding: 24px; }
.centred .card { width: 100%; max-width: 420px; box-sizing: border-box; }

.sub { color: var(--text-muted); font-size: 12px; }

.lbl { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: block; }

.in {
  height: 48px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
}

.in:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

.btn {
  height: 52px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.btn:hover { background: #1a46c2; }

.btn-secondary {
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  line-height: 42px;
  text-decoration: none;
}

.field + .field { margin-top: 20px; }

.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.check .lbl { margin: 0; }

.error-summary {
  background: var(--bad-bg);
  color: var(--bad-text);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}

.field-error { color: var(--bad-text); font-size: 12px; margin-top: 6px; display: block; }
.field-error:empty { display: none; }

/* Small utility used in dense tables where MudBlazor has no equivalent. */
.fw-600 { font-weight: 600; }

/* Order-summary rows: hairline between each, none above the first. */
.copier-summary-row { border-top: 1px solid var(--divider); }
.copier-summary-row:first-of-type { border-top: 0; }

/* KPI tiles: 28px semibold number with an inline muted caption, per the mockups. */
.copier-kpi { font-size: 28px; font-weight: 700; margin-top: 2px; line-height: 1.2; }
.copier-kpi-caption { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.copier-kpi-ok   { color: var(--ok-text); }
.copier-kpi-warn { color: var(--warn-text); }
.copier-kpi-bad  { color: var(--bad-text); }
.copier-kpi-info { color: var(--info-text); }

/* Nested per-EA table inside an expanded trade card. */
.copier-nested { background: var(--surface-muted); }
.copier-group-header {
  background: var(--bg);
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--text-dim) !important;
}
