:root {
  --brand: #111827;
  --brand-soft: #eef2f7;
  --ink: #18202a;
  --muted: #667085;
  --line: #e5e7eb;
  --bg: #f5f7fa;
  --card: #ffffff;
  --success: #067647;
  --warning: #b54708;
  --danger: #b42318;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.shell { min-height: 100vh; }
.portal-header { background: var(--brand); color: white; padding: 18px 24px; }
.portal-header-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 20px; justify-content: space-between; }
.company-mark { display: flex; align-items: center; gap: 12px; min-width: 0; }
.company-logo-placeholder { width: 44px; height: 44px; border-radius: 12px; background: white; color: var(--brand); display: grid; place-items: center; font-weight: 900; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.company-name { font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a { padding: 9px 12px; border-radius: 10px; opacity: .92; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.14); opacity: 1; }
.container { max-width: 1120px; margin: 0 auto; padding: 34px 24px 64px; }
.hero { margin-bottom: 28px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; }
h1 { margin: 6px 0 8px; font-size: clamp(30px, 5vw, 48px); line-height: 1.05; }
h2 { margin: 0 0 16px; font-size: 24px; }
h3 { margin: 0 0 8px; font-size: 18px; }
p { line-height: 1.6; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 8px 30px rgba(16,24,40,.04); }
.job-card { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.meta { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.badge { display: inline-flex; width: fit-content; align-items: center; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; background: #ecfdf3; color: var(--success); }
.badge.pending { background: #fff7ed; color: var(--warning); }
.button { appearance: none; border: 0; border-radius: 12px; padding: 11px 15px; background: var(--brand); color: white; font-weight: 800; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
.button.secondary { background: white; color: var(--ink); border: 1px solid var(--line); }
.button.danger { background: var(--danger); }
.button.small { padding: 8px 11px; font-size: 13px; }
.section { margin-top: 30px; }
.quick-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.quick-actions a { min-height: 100px; display: flex; flex-direction: column; justify-content: space-between; }
.doc-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.doc-row:first-child { border-top: 0; }
.doc-type { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.footer { max-width: 1120px; margin: 0 auto 28px; padding: 0 24px; }
.powered { display: inline-flex; align-items: center; gap: 10px; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; color: var(--muted); font-size: 12px; }
.powered img { width: 122px; height: auto; display: block; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid #d0d5dd; border-radius: 11px; padding: 11px 12px; background: white; color: var(--ink); }
textarea { min-height: 130px; resize: vertical; }
.alert { padding: 12px 14px; border-radius: 12px; background: #eff8ff; color: #175cd3; border: 1px solid #b2ddff; }
.equipment-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 18px; }
.equipment-fields div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.equipment-fields strong { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }

/* ServiceM8 action simulator */
.action-shell { max-width: 680px; margin: 30px auto; padding: 0 18px; }
.action-brand { display:flex; justify-content:center; margin-bottom:18px; }
.action-brand img { width: 220px; height:auto; }
.toggle-row { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.toggle-row:first-of-type { border-top: 0; }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #d0d5dd; border-radius: 999px; transition: .2s; cursor:pointer; }
.slider:before { content: ""; position:absolute; width:24px; height:24px; left:3px; top:3px; background:white; border-radius:50%; box-shadow:0 1px 3px rgba(0,0,0,.2); transition:.2s; }
.switch input:checked + .slider { background: #12b76a; }
.switch input:checked + .slider:before { transform: translateX(22px); }
.code { background:#101828;color:#e4e7ec;border-radius:12px;padding:14px;overflow:auto;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; }

@media (max-width: 760px) {
  .portal-header-inner { align-items: flex-start; flex-direction: column; }
  .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .grid.two, .grid.three, .quick-actions, .equipment-fields { grid-template-columns: 1fr; }
  .container { padding: 26px 16px 48px; }
  .footer { padding: 0 16px; }
}

/* Customer authentication */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: linear-gradient(180deg,var(--brand) 0 34%,var(--bg) 34% 100%); }
.auth-card { width: min(100%, 480px); background: white; border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: 0 22px 60px rgba(16,24,40,.14); }
.auth-company { display:flex; align-items:center; gap:12px; padding-bottom:18px; margin-bottom:22px; border-bottom:1px solid var(--line); }
.auth-heading { margin-bottom:22px; }
.auth-heading h1 { font-size:38px; }
.auth-powered { display:flex; justify-content:center; align-items:center; gap:10px; padding-top:22px; margin-top:24px; border-top:1px solid var(--line); color:var(--muted); font-size:12px; }
.auth-powered img { width:118px; height:auto; background:#fff; }
.code-input { font-size:26px; letter-spacing:.28em; text-align:center; font-weight:800; }
.poc-code { margin: 16px 0; padding:14px; border-radius:12px; border:1px dashed #f79009; background:#fffaeb; display:flex; align-items:center; justify-content:space-between; gap:14px; color:#93370d; }
.poc-code span { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.poc-code strong { font-size:24px; letter-spacing:.16em; }
.small-text { font-size:12px; }
.footer-row { display:flex; justify-content:space-between; align-items:center; gap:16px; }
@media (max-width:760px){.footer-row{align-items:flex-start;flex-direction:column}.auth-wrap{padding:18px 12px}.auth-card{padding:20px}.auth-heading h1{font-size:34px}}

/* Equipment / ServiceM8 Assets */
.equipment-card { position: relative; overflow: hidden; }
.equipment-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); font-size: 21px; margin-bottom: 14px; }
.equipment-preview { display: grid; gap: 8px; margin-top: 14px; }
.equipment-preview span { display: grid; grid-template-columns: minmax(100px,.45fr) 1fr; gap: 12px; font-size: 13px; padding-top: 8px; border-top: 1px solid var(--line); }
.equipment-preview strong { color: var(--muted); }
.equipment-actions { margin-top: 18px; }
.equipment-detail-hero { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.selected-equipment { display:flex; align-items:center; justify-content:space-between; gap:16px; border:1px solid var(--line); border-radius:14px; padding:14px; background:var(--brand-soft); }
@media (max-width:760px){.equipment-preview span{grid-template-columns:1fr}.equipment-detail-hero{display:block}}

/* Equipment service history */
.section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:8px; }
.history-row { display:grid; grid-template-columns: 14px 1fr; gap:12px; padding:16px 0; border-top:1px solid var(--line); }
.history-row:first-of-type { border-top:0; }
.history-marker { width:10px; height:10px; margin-top:6px; border-radius:50%; background:var(--brand); box-shadow:0 0 0 4px var(--brand-soft); }
.history-body { min-width:0; }
.history-top { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.history-note { margin:16px 0 0; padding-top:14px; border-top:1px solid var(--line); }
@media (max-width:760px){.history-top{flex-direction:column}.history-top .button{width:100%}}

/* Request Service → ServiceM8 Inbox */
.request-note { display:grid; gap:5px; padding:14px 15px; border:1px solid var(--line); border-radius:13px; background:#f9fafb; color:var(--muted); font-size:13px; }
.request-note strong { color:var(--ink); }
.confirmation-equipment { margin:18px 0; max-width:560px; }

/* Company logos */
.company-logo { background:#fff; border:1px solid rgba(16,24,40,.08); border-radius:12px; display:grid; place-items:center; overflow:hidden; flex:none; }
.company-logo img { width:100%; height:100%; object-fit:contain; display:block; padding:6px; }
.company-logo-header, .company-logo-auth { width:44px; height:44px; }
.company-logo-mini { width:34px; height:34px; border-radius:10px; }
.company-logo-preview { width:46px; height:46px; }

/* Company Admin */
.admin-body { background:#f4f6f8; }
.admin-auth-body { margin:0; background:#f4f6f8; }
.admin-auth-wrap { min-height:100vh; display:grid; place-items:center; padding:28px 18px; background:linear-gradient(180deg,#111 0 34%,#f4f6f8 34% 100%); }
.admin-auth-card { width:min(100%,480px); background:#fff; border:1px solid var(--line); border-radius:22px; padding:28px; box-shadow:0 22px 60px rgba(16,24,40,.16); }
.admin-jobwall-brand { display:flex; justify-content:center; padding-bottom:22px; margin-bottom:24px; border-bottom:1px solid var(--line); }
.admin-jobwall-brand img { width:220px; max-width:75%; height:auto; }
.admin-primary { background:#111; color:#fff; }
.admin-topbar { height:74px; background:#fff; border-bottom:1px solid var(--line); position:sticky; top:0; z-index:20; }
.admin-topbar-inner { height:100%; max-width:1440px; margin:0 auto; padding:0 28px; display:flex; align-items:center; justify-content:space-between; gap:20px; }
.admin-brand { display:flex; align-items:center; gap:12px; font-weight:800; }
.admin-brand img { width:150px; height:auto; }
.admin-brand span { padding-left:12px; border-left:1px solid var(--line); color:var(--muted); }
.admin-company-chip { display:flex; align-items:center; gap:10px; font-weight:750; }
.admin-shell { max-width:1440px; margin:0 auto; display:grid; grid-template-columns:230px minmax(0,1fr); min-height:calc(100vh - 74px); }
.admin-sidebar { background:#fff; border-right:1px solid var(--line); padding:24px 16px; display:flex; flex-direction:column; justify-content:space-between; gap:24px; }
.admin-sidebar nav { display:grid; gap:5px; }
.admin-sidebar nav a { padding:11px 13px; border-radius:10px; font-weight:700; color:#475467; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background:#f2f4f7; color:#101828; }
.admin-sidebar-bottom { display:grid; gap:12px; padding:14px 10px; border-top:1px solid var(--line); font-size:13px; }
.link-button { padding:0; border:0; background:transparent; color:var(--muted); cursor:pointer; text-align:left; }
.admin-main { padding:38px clamp(24px,5vw,64px) 70px; min-width:0; }
.admin-page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:28px; }
.admin-page-head h1 { font-size:clamp(32px,4vw,46px); }
.admin-url-card { background:#111; color:#fff; border-radius:18px; padding:22px; display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:20px; }
.admin-url-card .eyebrow { color:#98a2b3; }
.admin-url-card strong { font-size:20px; }
.admin-stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.admin-stat { background:#fff; border:1px solid var(--line); border-radius:16px; padding:20px; display:grid; gap:5px; }
.admin-stat strong { font-size:30px; }
.admin-stat span { color:var(--muted); font-size:13px; }
.admin-module-summary { display:grid; }
.admin-module-summary > div { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 0; border-top:1px solid var(--line); }
.admin-module-summary > div:first-child { border-top:0; }
.badge.off { background:#f2f4f7; color:#667085; }
.admin-editor-grid { display:grid; grid-template-columns:minmax(320px,.8fr) minmax(380px,1.2fr); gap:22px; align-items:start; }
.colour-row { display:grid; grid-template-columns:64px 1fr; gap:10px; }
.colour-row input[type=color] { padding:3px; min-height:46px; }
.success-banner { margin-bottom:20px; padding:13px 15px; border-radius:12px; background:#ecfdf3; border:1px solid #abefc6; color:#067647; font-weight:700; }
.preview-card { position:sticky; top:98px; }
.mini-portal { border:1px solid #d0d5dd; border-radius:17px; overflow:hidden; margin-top:14px; background:#f5f7fa; }
.mini-portal-head { padding:16px; background:var(--preview-brand); color:#fff; display:flex; align-items:center; gap:12px; }
.mini-portal-head > div:last-child { display:grid; gap:2px; }
.mini-portal-head span { font-size:11px; opacity:.78; }
.mini-portal-body { padding:22px; }
.mini-job-card { display:grid; gap:5px; padding:14px; margin-top:14px; background:#fff; border:1px solid var(--line); border-radius:12px; }
.mini-job-card span { color:var(--muted); font-size:12px; }
.mini-powered { display:inline-flex; align-items:center; gap:8px; padding:8px 10px; background:#fff; border:1px solid var(--line); border-radius:10px; margin-top:20px; color:var(--muted); font-size:10px; }
.mini-powered img { width:92px; height:auto; }
.module-list { display:grid; gap:14px; max-width:860px; }
.module-card { background:#fff; border:1px solid var(--line); border-radius:16px; padding:20px; display:flex; align-items:center; justify-content:space-between; gap:24px; }
.module-card.locked { background:#f9fafb; }
.module-card h3 { margin-bottom:4px; }
.module-card p { margin:0; }
.module-card.locked > div:last-child { display:grid; justify-items:end; gap:5px; }
.admin-toggle { display:block; width:56px; height:32px; position:relative; flex:none; }
.admin-toggle input { opacity:0; width:0; height:0; position:absolute; }
.admin-toggle span { position:absolute; inset:0; border-radius:999px; background:#d0d5dd; cursor:pointer; transition:.2s; }
.admin-toggle span:before { content:""; position:absolute; width:26px; height:26px; left:3px; top:3px; background:#fff; border-radius:50%; box-shadow:0 1px 3px rgba(0,0,0,.2); transition:.2s; }
.admin-toggle input:checked + span { background:#12b76a; }
.admin-toggle input:checked + span:before { transform:translateX(24px); }
.portal-preview-stage { background:#e4e7ec; border-radius:22px; padding:28px; }
.preview-browser { background:#fff; border:1px solid #d0d5dd; border-radius:18px; overflow:hidden; box-shadow:0 20px 60px rgba(16,24,40,.10); }
.preview-browser-bar { height:48px; background:#f9fafb; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:7px; padding:0 14px; }
.preview-browser-bar > span { width:10px; height:10px; border-radius:50%; background:#d0d5dd; }
.preview-browser-bar > div { margin-left:10px; background:#fff; border:1px solid var(--line); border-radius:8px; padding:6px 12px; color:#667085; font-size:12px; flex:1; }
.preview-portal header { background:var(--preview-brand); color:#fff; padding:18px 22px; display:flex; align-items:center; gap:12px; }
.preview-portal header > div:nth-child(2) { display:grid; gap:2px; }
.preview-portal header > div:nth-child(2) span { opacity:.75; font-size:11px; }
.preview-portal header nav { margin-left:auto; display:flex; gap:8px; flex-wrap:wrap; }
.preview-portal header nav span { font-size:11px; padding:6px 8px; background:rgba(255,255,255,.12); border-radius:7px; }
.preview-portal main { padding:30px; }

@media (max-width: 980px) {
  .admin-shell { grid-template-columns:1fr; }
  .admin-sidebar { border-right:0; border-bottom:1px solid var(--line); padding:10px 16px; }
  .admin-sidebar nav { display:flex; overflow-x:auto; }
  .admin-sidebar nav a { white-space:nowrap; }
  .admin-sidebar-bottom { display:none; }
  .admin-editor-grid { grid-template-columns:1fr; }
  .preview-card { position:static; }
  .admin-stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .admin-topbar-inner { padding:0 16px; }
  .admin-brand img { width:120px; }
  .admin-brand span { display:none; }
  .admin-company-chip > span { display:none; }
  .admin-main { padding:26px 16px 50px; }
  .admin-page-head, .admin-url-card, .module-card { align-items:stretch; flex-direction:column; }
  .admin-stat-grid { grid-template-columns:1fr; }
  .portal-preview-stage { padding:10px; }
  .preview-portal header { align-items:flex-start; flex-wrap:wrap; }
  .preview-portal header nav { width:100%; margin-left:0; }
}

/* Self-service ServiceM8 onboarding */
.onboarding-body { background:#f4f6f8; }
.onboarding-wrap { width:min(100%,1040px); margin:0 auto; padding:34px 18px 70px; }
.onboarding-brand { display:flex; justify-content:center; margin-bottom:24px; }
.onboarding-brand img { width:230px; max-width:65%; height:auto; background:#fff; padding:10px 14px; border-radius:14px; }
.onboarding-progress { display:flex; align-items:center; justify-content:space-between; gap:16px; width:min(100%,760px); margin:0 auto 18px; color:#667085; font-size:13px; }
.onboarding-progress span:before { content:"✓"; display:inline-grid; place-items:center; width:22px; height:22px; margin-right:8px; border-radius:50%; background:#ecfdf3; color:#067647; font-weight:900; }
.onboarding-card { width:min(100%,760px); margin:0 auto; padding:30px; }
.onboarding-card.wide { width:min(100%,940px); }
.onboarding-card h1 { font-size:clamp(32px,5vw,48px); }
.slug-input { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; border:1px solid #d0d5dd; border-radius:10px; overflow:hidden; background:#fff; }
.slug-input input { border:0; border-radius:0; }
.slug-input span { padding:0 14px; color:#667085; font-size:13px; white-space:nowrap; }
.onboarding-url-preview { margin:-4px 0 16px; padding:11px 13px; border-radius:10px; background:#101828; color:#fff; font:600 13px ui-monospace,SFMono-Regular,Menlo,monospace; overflow-wrap:anywhere; }
.onboarding-preview { width:min(100%,760px); margin:18px auto 0; }
.onboarding-stage { margin:22px 0; padding:14px; }
.module-list.compact { max-width:none; }
.publish-button { width:100%; min-height:52px; font-size:16px; }
@media (max-width:640px){
  .onboarding-wrap{padding:24px 12px 48px}.onboarding-card{padding:22px}.onboarding-progress{align-items:flex-start;flex-direction:column;gap:7px}.slug-input{grid-template-columns:1fr}.slug-input span{padding:0 12px 10px}.onboarding-preview{padding:18px}
}
