/* WEBSITEPLAN.md §3.4.2 — manufacturer portal styles.
   Extends the main styles.css with an amber accent so the portal
   reads as visibly distinct from the engineer-facing main site. */

:root {
  --mfr-accent:        #d97706;   /* amber-600 */
  --mfr-accent-strong: #b45309;   /* amber-700 */
  --mfr-accent-soft:   #fef3c7;   /* amber-100 */
  --mfr-accent-tint:   rgba(217, 119, 6, 0.08);
  --mfr-sidebar-bg:    #1c1917;   /* stone-900 */
  --mfr-sidebar-fg:    #fafaf9;   /* stone-50 */
  --mfr-sidebar-mute:  #a8a29e;   /* stone-400 */
  --mfr-sidebar-hover: #292524;   /* stone-800 */
  --mfr-content-bg:    #fafaf9;
  --mfr-card-bg:       #ffffff;
  --mfr-border:        #e7e5e4;
  --mfr-text:          #1c1917;
  --mfr-text-mute:     #57534e;

  --mfr-sidebar-w: 220px;
}

html.dark {
  --mfr-content-bg:  #0c0a09;
  --mfr-card-bg:     #1c1917;
  --mfr-border:      #292524;
  --mfr-text:        #fafaf9;
  --mfr-text-mute:   #a8a29e;
  --mfr-accent-soft: rgba(217, 119, 6, 0.18);
}

/* ---------- Layout ---------- */

.mfr-body {
  margin: 0;
  background: var(--mfr-content-bg);
  color: var(--mfr-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--mfr-sidebar-w) 1fr;
  grid-template-rows: 56px 1fr auto;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main"
    "sidebar foot";
}

.mfr-sidebar { grid-area: sidebar; background: var(--mfr-sidebar-bg); color: var(--mfr-sidebar-fg); padding: 18px 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.mfr-topbar  { grid-area: topbar;  background: var(--mfr-card-bg); border-bottom: 1px solid var(--mfr-border); }
.mfr-main    { grid-area: main;    padding: 28px 32px; }
.mfr-foot    { grid-area: foot;    text-align: center; padding: 14px 24px; color: var(--mfr-text-mute); font-size: 12px; border-top: 1px solid var(--mfr-border); }

@media (max-width: 720px) {
  .mfr-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 56px 1fr auto;
    grid-template-areas: "sidebar" "topbar" "main" "foot";
  }
  .mfr-sidebar { position: static; height: auto; }
  .mfr-main { padding: 18px 14px; }
}

/* ---------- Sidebar ---------- */

.mfr-sidebar-brand { padding: 0 18px 12px; }
.mfr-brand-link    { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--mfr-sidebar-fg); }
.mfr-brand-mark    {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--mfr-accent) 0%, var(--mfr-accent-strong) 100%);
  border-radius: 8px;
  font-weight: 700; font-size: 12px; letter-spacing: 0.04em; color: white;
}
.mfr-brand-text    { font-weight: 600; font-size: 14px; }

.mfr-nav { flex: 1 1 auto; padding: 8px 8px; }
.mfr-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.mfr-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 6px;
  color: var(--mfr-sidebar-mute);
  text-decoration: none;
  font-size: 13.5px;
  transition: background .12s, color .12s;
}
.mfr-nav a:hover { background: var(--mfr-sidebar-hover); color: var(--mfr-sidebar-fg); }
.mfr-nav a.is-active {
  background: var(--mfr-accent-tint);
  color: #fde68a;        /* amber-200 — readable on dark sidebar */
  border-left: 3px solid var(--mfr-accent);
  padding-left: 9px;
}
.mfr-nav-icon { font-size: 14px; flex: 0 0 18px; text-align: center; }

/* §6.4.3 — Unread-leads badge on the Leads nav item. Pushed to the
   right end of the link via margin-left:auto so the icon + label
   stay left-aligned with the rest of the nav. */
.mfr-nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--mfr-accent, #d97706);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
/* Active row: badge stays accent-colored vs amber-200 hover so the
   number is unambiguously legible. */
.mfr-nav a.is-active .mfr-nav-badge {
  background: var(--mfr-accent, #d97706);
  color: #1c1917;
}

.mfr-sidebar-foot { padding: 14px 18px; border-top: 1px solid #292524; }
.mfr-back-link    { color: var(--mfr-sidebar-mute); text-decoration: none; font-size: 13px; }
.mfr-back-link:hover { color: var(--mfr-sidebar-fg); }

/* ---------- Topbar ---------- */

.mfr-topbar-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  gap: 16px; flex-wrap: wrap;
}
.mfr-topbar-id   { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--mfr-text); flex-wrap: wrap; }
.mfr-user-name   { font-weight: 500; }
.mfr-company     { color: var(--mfr-text-mute); }
.mfr-sep         { color: var(--mfr-text-mute); }
.mfr-tier-badge  {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  background: var(--mfr-accent-soft);
  color: var(--mfr-accent-strong);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.mfr-tier-pro       { background: #c7d2fe; color: #3730a3; }
.mfr-tier-enterprise{ background: #fce7f3; color: #9d174d; }

.mfr-topbar-actions { display: inline-flex; gap: 8px; }
.mfr-logout-form { margin: 0; }

/* ---------- Buttons ---------- */

.mfr-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 14px; border-radius: 6px;
  font-size: 13.5px; font-weight: 500; text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .12s;
}
.mfr-btn-primary { background: var(--mfr-accent); color: white; border-color: var(--mfr-accent); }
.mfr-btn-primary:hover:not(:disabled) { background: var(--mfr-accent-strong); border-color: var(--mfr-accent-strong); }
.mfr-btn-ghost { background: transparent; color: var(--mfr-text); border-color: var(--mfr-border); }
.mfr-btn-ghost:hover:not(:disabled) { background: var(--mfr-accent-tint); border-color: var(--mfr-accent); color: var(--mfr-accent-strong); }

/* ---------- Page chrome ---------- */

.mfr-page          { max-width: 1080px; margin: 0 auto; }
.mfr-page-head     { margin-bottom: 22px; }
.mfr-page-head h1  { margin: 0 0 6px; font-size: 26px; font-weight: 600; }
.mfr-page-sub      { margin: 0; color: var(--mfr-text-mute); font-size: 14px; line-height: 1.55; }

.mfr-breadcrumb    { font-size: 12.5px; color: var(--mfr-text-mute); margin-bottom: 10px; display: flex; gap: 6px; align-items: center; }
.mfr-breadcrumb a  { color: var(--mfr-text-mute); text-decoration: none; }
.mfr-breadcrumb a:hover { color: var(--mfr-accent-strong); }

/* ---------- Cards ---------- */

.mfr-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.mfr-card {
  display: block;
  padding: 18px 20px;
  background: var(--mfr-card-bg);
  border: 1px solid var(--mfr-border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color .12s, transform .12s, box-shadow .12s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.mfr-card:hover  { border-color: var(--mfr-accent); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(217, 119, 6, 0.12); }
.mfr-card h3     { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.mfr-card-blurb  { margin: 0 0 8px; color: var(--mfr-text-mute); font-size: 13px; line-height: 1.5; }
.mfr-card-phase  { margin: 0; font-size: 12px; color: var(--mfr-accent-strong); }

/* ---------- Stub card (placeholder pages) ---------- */

.mfr-stub-card {
  background: var(--mfr-card-bg);
  border: 1px solid var(--mfr-border);
  border-left: 4px solid var(--mfr-accent);
  border-radius: 10px;
  padding: 28px 32px;
  margin-top: 18px;
  max-width: 640px;
}
.mfr-stub-icon  { font-size: 36px; margin-bottom: 6px; }
.mfr-stub-card h2 { margin: 0 0 10px; font-size: 18px; }
.mfr-stub-card p  { margin: 0 0 16px; color: var(--mfr-text-mute); line-height: 1.55; font-size: 14px; }
.mfr-stub-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Accessibility ---------- */

.sr-skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--mfr-accent); color: white;
  padding: 8px 12px; text-decoration: none;
}
.sr-skip-link:focus { left: 8px; top: 8px; z-index: 99; }
