/* Satin-aluminum, graphite and deep-copper visual system for private MetalFlow operations. */
:root {
  color-scheme: dark;
  --mf-bg: #0d1419;
  --mf-surface: #18232a;
  --mf-surface-raised: #24313a;
  --mf-surface-muted: #2d3c45;
  --mf-platinum: #f2f5f7;
  --mf-text: #e6edf0;
  --mf-text-muted: #bdc9cf;
  --mf-gold: #db986e;
  --mf-gold-light: #f0bb98;
  --mf-gold-muted: #382a25;
  --mf-ink: #201711;
  --mf-border: #4c5c65;
  --mf-control-border: #8898a1;
  --mf-accent-border: #96694e;
  --mf-success: #a6e9ba;
  --mf-success-surface: #1a3529;
  --mf-danger: #ffc1bb;
  --mf-danger-surface: #3c2629;
  --mf-radius: 15px;
  --mf-focus: 0 0 0 3px rgb(219 152 110 / 22%);
  --mf-shadow: 0 18px 46px rgb(2 8 12 / 28%);
  --mf-gutter: clamp(14px, 3vw, 32px);
}

.metalflow-app,
.metalflow-app * { box-sizing: border-box; }

.metalflow-app {
  min-height: 100dvh;
  margin: 0;
  background: radial-gradient(ellipse at 14% 4%, rgb(133 157 169 / 12%), transparent 36%),
    radial-gradient(ellipse at 94% 86%, rgb(166 99 68 / 9%), transparent 42%), var(--mf-bg);
  color: var(--mf-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mf-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 22px;
  padding: 14px max(var(--mf-gutter), calc((100% - 1110px) / 2));
  background: linear-gradient(112deg, #27353e, #151f25 70%, #1e2428);
  border-bottom: 1px solid var(--mf-accent-border);
}

.mf-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--mf-platinum);
  text-decoration: none;
}

.mf-monogram {
  display: grid;
  width: 40px;
  flex: 0 0 40px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #ba8967;
  border-radius: 11px;
  background: linear-gradient(148deg, #604335, #293139 75%);
  color: var(--mf-gold-light);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
}

.mf-company-name {
  display: block;
  margin: 0;
  color: var(--mf-platinum);
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -.04em;
}

.mf-brand-caption {
  display: block;
  margin: 2px 0 0;
  color: var(--mf-text-muted);
  font-size: .78rem;
}

.mf-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.mf-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--mf-text);
  font-weight: 680;
  text-decoration: none;
}

.mf-nav a:hover { background: var(--mf-surface-raised); }
.mf-nav a[aria-current="page"] {
  border-color: var(--mf-accent-border);
  background: var(--mf-gold-muted);
  color: var(--mf-gold-light);
}

.mf-page {
  width: min(100%, 1174px);
  margin-inline: auto;
  padding: clamp(20px, 4vw, 44px) var(--mf-gutter) max(30px, env(safe-area-inset-bottom));
}

.mf-panel {
  min-width: 0;
  padding: clamp(15px, 2.6vw, 27px);
  background: linear-gradient(152deg, rgb(207 224 233 / 4%), transparent 42%), var(--mf-surface);
  border: 1px solid var(--mf-border);
  border-radius: var(--mf-radius);
  box-shadow: var(--mf-shadow);
}

.mf-panel + .mf-panel { margin-top: 14px; }

.mf-title {
  margin: 0 0 5px;
  color: var(--mf-platinum);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -.05em;
  font-weight: 750;
}

.mf-subtitle { max-width: 62ch; margin: 0; color: var(--mf-text-muted); }
.mf-divider { margin: 20px 0; border: 0; border-top: 1px solid var(--mf-border); }

.mf-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.mf-button--primary {
  color: var(--mf-ink);
  border-color: #c98c69;
  background: linear-gradient(125deg, var(--mf-gold-light), #cc845c);
}
.mf-button--primary:hover:not(:disabled) { background: var(--mf-gold-light); }
.mf-button--secondary {
  color: var(--mf-platinum);
  background: var(--mf-surface-raised);
  border-color: var(--mf-control-border);
}
.mf-button--secondary:hover:not(:disabled) { background: var(--mf-surface-muted); }
.mf-button:disabled { cursor: not-allowed; opacity: .55; }

.metalflow-app :is(a, .mf-button, .mf-field, .mf-company-switch, .mf-table-wrap):focus-visible {
  outline: 2px solid var(--mf-gold);
  outline-offset: 2px;
  box-shadow: var(--mf-focus);
}

.mf-field, .mf-company-switch {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--mf-platinum);
  background: var(--mf-surface-raised);
  border: 1px solid var(--mf-control-border);
  border-radius: 9px;
  font: inherit;
  font-size: 1rem;
}
.mf-field { display: block; width: 100%; }
.mf-field::placeholder { color: var(--mf-text-muted); opacity: 1; }
.mf-company-switch { font-weight: 650; }

.mf-label {
  display: block;
  margin-bottom: 4px;
  color: var(--mf-platinum);
  font-size: .875rem;
  font-weight: 650;
}

.mf-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 30px;
  font-size: .8rem;
  font-weight: 650;
}
.mf-state--ready { color: var(--mf-success); background: var(--mf-success-surface); }
.mf-state--error { color: var(--mf-danger); background: var(--mf-danger-surface); }
.mf-state--pending { color: var(--mf-platinum); background: var(--mf-surface-muted); }

.mf-table-wrap { overflow-x: auto; }
.mf-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.mf-table th, .mf-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--mf-border);
  vertical-align: middle;
}
.mf-table th {
  color: var(--mf-platinum);
  font-size: .75rem;
  font-weight: 720;
  text-transform: uppercase;
  letter-spacing: .045em;
  background: var(--mf-surface-muted);
}
.mf-table tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 640px) {
  .mf-header { gap: 8px; padding-block: 10px; }
  .mf-monogram { width: 35px; flex-basis: 35px; border-radius: 9px; }
  .mf-brand { gap: 8px; }
  .mf-nav a { padding-inline: 9px; font-size: .875rem; }
  .mf-header-label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mf-button { transition: none; }
}
