@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Enterprise Palette */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #ef4444;
  --success: #10b981;
  --radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Base Reset */
body.matrix-skin {
  margin: 0; padding: 0;
  background-color: var(--bg-app); color: var(--text-main);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; line-height: 1.5;
}
* { box-sizing: border-box; }
a { color: var(--primary); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

/* Typography */
.mx-h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-main); margin: 0 0 0.5rem 0; }
.mx-text-muted { color: var(--text-muted); font-size: 0.875rem; }
.mx-label { display: block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.5rem; }

/* Layout Utilities */
.mx-container { max-width: 1400px; margin: 0 auto; padding: 2rem; }
.mx-flex-row { display: flex; align-items: center; gap: 1rem; }
.mx-flex-between { display: flex; align-items: center; justify-content: space-between; }
.mx-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.mx-grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* Components */
.mx-navbar { background: var(--bg-surface); border-bottom: 1px solid var(--border-color); padding: 1rem 2rem; position: sticky; top: 0; z-index: 100; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow-sm); }
.mx-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.mx-card-header { border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; margin-bottom: 1rem; font-weight: 600; font-size: 1.1rem; }

/* Forms & Inputs */
.mx-input, .mx-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mx-input:focus, .mx-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
/* v27.85 — Inline extraction editor.  Compact field sizing inside the
   scrollable grid (CSS-only per the v27.32 no-inline-styles contract;
   overrides the base .mx-input padding/size). */
.inline-edit-field { padding: 0.3rem 0.5rem; font-size: 0.85rem; }
.mx-dropzone { border: 2px dashed var(--border-color); border-radius: var(--radius); padding: 3rem 2rem; text-align: center; background: #f1f5f9; transition: all 0.2s; cursor: pointer; margin-bottom: 1.5rem; }
.mx-dropzone:hover { border-color: var(--primary); background: #e2e8f0; }
/* v27.47 — Visually-hidden utility (canonical clip-rect pattern).
   Hides an element from sight WITHOUT preventing its programmatic
   activation via .click() — used on the Factory Floor file input so
   only the dropzone is a click target while the OS dialog still
   honours `multiple`. */
.mx-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* v27.48 — Form Type toggle on the Draft Review page.  Bounded width
   so the dropdown reads as an action chip in the toolbar, not a
   page-spanning input. */
.mx-form-toggle { max-width: 360px; }

/* Buttons */
.mx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; background: var(--primary); color: #fff; padding: 0.625rem 1.25rem; border: none; border-radius: 6px; font-weight: 600; font-size: 0.875rem; cursor: pointer; transition: background 0.15s, box-shadow 0.15s; box-shadow: var(--shadow-sm); }
.mx-btn:hover { background: var(--primary-hover); text-decoration: none; }
.mx-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.mx-btn-ghost { background: transparent; color: var(--text-main); border: 1px solid var(--border-color); box-shadow: none; }
.mx-btn-ghost:hover { background: #f1f5f9; text-decoration: none; }
/* v27.93 — MyWORC Export Bridge.  A prominent accent button (success green)
   for the one-click submission-bundle ZIP export, visually distinct from the
   blue primary actions so the agent's download CTA stands out. */
.mx-btn-accent { background: var(--success); }
.mx-btn-accent:hover { background: #059669; }
/* v27.93 — MyWORC Data Sheet.  Compact, copy-friendly key/value rows so the
   agent can rapidly paste extracted values into external portals. */
.mx-data-section { font-weight: 600; color: var(--text-muted); margin: 0.75rem 0 0.25rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.mx-data-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border-color); }
.mx-data-key { flex: 0 0 36%; font-size: 0.8rem; color: var(--text-muted); }
.mx-data-val { flex: 1 1 auto; font-size: 0.85rem; color: var(--text-main); word-break: break-word; }
.mx-data-copy { padding: 0.2rem 0.6rem; font-size: 0.75rem; }
/* v27.94 — Data Sheet panel chrome (CSS-only, no inline styles). */
.mx-data-panel { margin-bottom: 1.5rem; }
.mx-data-summary { cursor: pointer; font-weight: 600; }
.mx-data-body { margin-top: 0.75rem; }
/* v27.94 — Console action bar: groups Approve & Compile + Export buttons. */
.mx-action-group { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
/* v27.95 — Automated Cover Letter workspace (CSS-only, no inline styles). */
.mx-cover-workspace { margin-top: 0.75rem; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 0.75rem; background: #f8fafc; }
.mx-cover-textarea { width: 100%; min-height: 320px; margin-top: 0.5rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; line-height: 1.5; resize: vertical; }

/* Verification Console Specifics */
.mx-iframe-container { height: 75vh; width: 100%; border: 1px solid var(--border-color); border-radius: var(--radius); background: #e2e8f0; }
/* Compact selector for inline use in card headers (e.g. Form Target Swap) */
.mx-select-inline { width: auto; padding: 4px 8px; }
.mx-badge { display: inline-flex; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; background: #e0e7ff; color: #3730a3; }

/* Progress Tracker */
.mx-progress-container { background: #f1f5f9; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; color: #0f172a !important; }
.mx-progress-container * { color: #0f172a !important; }
.mx-progress-track { width: 100%; height: 12px; background-color: #e2e8f0; border-radius: 999px; overflow: hidden; margin-top: 1rem; margin-bottom: 0.5rem; }
.mx-progress-fill { height: 100%; background-color: var(--primary); width: 0%; transition: width 0.3s ease; }
.mx-progress-status { font-size: 0.875rem; font-weight: 600; color: var(--primary) !important; margin-bottom: 0.25rem; }
/* Spinner — used by both the submitter Factory Floor tracker and
   the v27.39 in-place Verification Console rescan tracker. */
@keyframes spin { to { transform: rotate(360deg); } }
.mx-progress-spinner {
  width: 20px; height: 20px;
  border: 3px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Visibility utility — used by many templates to toggle elements
   without inline display:none gymnastics. */
.hidden { display: none !important; }

/* ── v28.02 — Agency Team Management panel ──────────────────────────────── */
.mx-table { width: 100%; border-collapse: collapse; }
.mx-table th, .mx-table td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border-color); }
.mx-table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.mx-form-grid { display: grid; grid-template-columns: max-content 1fr; gap: 0.75rem 1rem; align-items: center; margin-bottom: 1rem; }
.mx-btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.mx-btn-danger:hover { filter: brightness(0.92); }
.mx-invite-url { flex: 1; min-width: 280px; font-size: 0.85rem; }

/* ── v28.04 — Manager ROI Dashboard ─────────────────────────────────────── */
.mx-hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.mx-stat-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.mx-stat-value { font-size: 2.25rem; font-weight: 700; color: var(--primary); line-height: 1.1; }
.mx-stat-label { margin-top: 0.4rem; font-size: 0.9rem; color: var(--text-muted); }
.mx-upsell-banner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; border-left: 4px solid var(--danger); background: #fef2f2; color: #0f172a !important; margin-bottom: 1.5rem; }
.mx-upsell-banner * { color: #0f172a !important; }
.mx-upsell-btn { margin-left: auto; }

/* ── v28.06 — Public landing + registration ─────────────────────────────── */
.mx-hero { text-align: center; padding: 3rem 1rem 2.5rem; }
.mx-hero h1 { font-size: 2.4rem; line-height: 1.15; margin-bottom: 0.75rem; }
.mx-hero-sub { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.mx-hero-cta { font-size: 1.05rem; padding: 0.75rem 1.75rem; }
.mx-pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.mx-price-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.mx-price-card h4 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.mx-price-card ul { margin: 0.75rem 0 1rem 1.1rem; }
.mx-price-card li { margin-bottom: 0.35rem; }
.mx-price-featured { border: 2px solid var(--primary); }
.mx-price { font-weight: 700; color: var(--primary); margin-bottom: 0.5rem; }
.mx-error { border-left: 4px solid var(--danger); background: #fef2f2; color: #0f172a !important; margin-bottom: 1rem; }
.mx-error * { color: #0f172a !important; }
