/* Shared visual system for the B2B workspace and public access. */
:root {
  --nav-width: 248px;
  --ink: #182238;
  --muted: #68758c;
  --blue: #4959d9;
  --cyan: #4959d9;
  --line: #e5e9f1;
  --bg: #f6f7fb;
  --navy: #16213b;
  --shadow: 0 12px 36px #18223809;
  --radius: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; touch-action: manipulation; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid #7c8cf4; outline-offset: 4px; }
input, select, textarea { max-width: 100%; min-width: 0; padding: 11px 13px; border: 1px solid #dce2ec; border-radius: 9px; background: #fff; color: var(--ink); transition: border-color .16s, box-shadow .16s; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #4959d91a; }
input[type=checkbox] { width: 18px; height: 18px; padding: 0; flex: 0 0 18px; accent-color: var(--blue); }
label { display: grid; gap: 7px; margin: 16px 0; color: #3e4b63; font-size: 13px; font-weight: 600; }
label small { color: var(--muted); font-weight: 400; }
h1,h2,h3,p { overflow-wrap: anywhere; }
h1 { margin: 0 0 12px; font-size: clamp(27px,3vw,34px); font-weight: 700; line-height: 1.25; letter-spacing: -.035em; }
h2 { font-size: 18px; font-weight: 650; line-height: 1.4; letter-spacing: -.02em; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 16px; }
.ui-icon { width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }
.button { gap: 9px; min-height: 42px; padding: 10px 17px; border: 1px solid transparent; border-radius: 9px; background: var(--blue); color: #fff!important; font-size: 13px; font-weight: 600; box-shadow: 0 3px 6px #4959d918; transition: background .16s, border-color .16s, box-shadow .16s; cursor: pointer; }
.button:hover { background: #3c4bc6; transform: none; box-shadow: 0 4px 10px #4959d928; }
.button.secondary { border-color: #dfe4ee; background: #fff; color: #3e4b63!important; box-shadow: 0 1px 2px #18223804; }
.button.secondary:hover { border-color: #bdc6ee; background: #f6f7ff; color: var(--blue)!important; }
.button.small { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.button.danger { background: #bd3f50; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-size: 19px; font-weight: 750; letter-spacing: -.045em; line-height: 1.2; }
.brand-mark { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; border-radius: 12px; background: var(--blue); color: #fff; box-shadow: 0 3px 8px #4959d922; }
.brand-mark .ui-icon { width: 25px; height: 25px; }
.brand .brand-mark { display: grid; margin: 0; color: #fff; font-size: 19px; letter-spacing: normal; text-transform: none; }
.brand .brand-copy { display: block; margin: 0; color: var(--ink); font-size: 19px; font-weight: 750; letter-spacing: -.045em; text-transform: none; }
.brand .brand-copy>span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .015em; text-transform: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--nav-width); padding: 30px 18px 18px; background: #fff; border-right: 1px solid var(--line); z-index: 10; }
.sidebar .brand { margin: 0 10px 42px; }
.nav-section-label { margin: 0 14px 12px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.sidebar nav a,.future { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 11px 13px; border-radius: 9px; color: #647089; font-size: 13px; font-weight: 500; }
.sidebar nav a:hover { background: #f5f6fb; color: var(--ink); }
.sidebar nav a[aria-current=page] { background: #eef0ff; color: #4050ce; font-weight: 650; }
.future { gap: 8px; color: #8c97aa; font-size: 12px; }
.future small { margin-left: auto; padding: 2px 5px; border: 1px solid #e6e9f0; border-radius: 5px; background: #fafbfc; font-size: 9px; font-weight: 500; white-space: nowrap; }
.future .ui-icon { width: 18px; flex-basis: 18px; }
.sidebar-footer { margin-top: auto; padding-top: 22px; }
.account-card { display: flex; align-items: center; gap: 10px; padding: 14px 9px; border-top: 1px solid var(--line); }
.account-avatar,.client-avatar { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 11px; background: #eef0fd; color: #4b5ac5; font-size: 14px; font-weight: 700; }
.account-card>div { min-width: 0; }
.account-card strong { display: block; font-size: 12px; font-weight: 600; }
.account-card span:not(.account-avatar) { display: block; overflow: hidden; max-width: 156px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer form { margin: 0; }
.logout-button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.logout-button:hover { background: #f4f5fa; color: var(--ink); }
.workspace { min-width: 0; max-width: 1530px; min-height: 100vh; margin: 0 auto; padding: 0 38px 48px; }
.authenticated .workspace { margin-left: var(--nav-width); }
.workspace-topbar { display: flex; justify-content: space-between; align-items: center; min-height: 76px; margin: 0 -38px 34px; padding: 0 38px; border-bottom: 1px solid var(--line); background: #ffffffb3; color: var(--muted); font-size: 12px; }
.workspace-role { display: flex; align-items: center; gap: 7px; color: #65738e; }
.workspace-role .ui-icon { width: 16px; height: 16px; flex-basis: 16px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 25px; }
.page-head h1 { margin: 6px 0 10px; font-size: clamp(27px,3vw,34px); line-height: 1.25; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.eyebrow { color: #727f98; font-size: 10px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.panel { min-width: 0; margin: 0 0 22px; padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 2px 4px #18223802; }
.panel h2:first-child { margin-top: 0; }
.panel p { color: var(--muted); font-size: 13px; }
.panel>label input,.panel>label textarea { width: 100%; }
.workspace>form.panel:not(.settings-form):not(.filters) { max-width: 800px; }
.summary-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0 0 34px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.summary-strip>div { padding: 22px 26px; }
.summary-strip>div+div { border-left: 1px solid var(--line); }
.summary-strip span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.summary-strip strong { color: #273550; font-size: 24px; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 18px; }
.section-heading h2 { margin: 0; }
.section-heading>span { color: var(--muted); font-size: 11px; }
.client-grid,.opportunity-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.client-grid .panel,.opportunity-grid .panel { margin: 0; }
.client-card { display: flex; flex-direction: column; transition: border-color .2s, box-shadow .2s; }
.client-card:hover { border-color: #c9d0ec; box-shadow: var(--shadow); }
.client-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 20px; }
.client-avatar { width: 46px; height: 46px; flex-basis: 46px; border-radius: 13px; font-size: 20px; }
.client-card:nth-child(3n+2) .client-avatar { background: #ecf7f2; color: #2a7f64; }
.client-card:nth-child(3n+3) .client-avatar { background: #fff5e9; color: #ac7835; }
.client-card h2 { margin: 0 0 10px; font-size: 20px; }
.client-description { display: -webkit-box; min-height: 64px; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-height: 1.65; }
.client-recipient { display: flex; align-items: center; gap: 8px; margin: auto 0 20px; padding-top: 14px; color: var(--muted); font-size: 12px; }
.client-recipient span { min-width: 0; overflow-wrap: anywhere; }
.client-recipient .ui-icon { width: 16px; height: 16px; flex-basis: 16px; }
.card-link { justify-content: space-between; width: 100%; }
.status-pill,.badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 6px; font-size: 10px; font-weight: 600; line-height: 1.6; }
.status-pill.positive { background: #edf8f2; color: #277c59; }
.status-pill.pending { background: #fff6e6; color: #916824; }
.badge { background: #edf1ff; color: #4b5bc4; }
.client-subtitle { display: flex; align-items: center; gap: 7px; }
.client-subtitle .ui-icon { width: 16px; height: 16px; flex-basis: 16px; }
.client-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 24px; padding-bottom: 0; border-bottom: 1px solid var(--line); }
.client-tabs a { padding: 12px 15px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }
.client-tabs a:hover { color: var(--blue); }
.client-tabs a[aria-current=page] { border-bottom-color: var(--blue); color: var(--blue); font-weight: 650; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 16px; padding: 18px; }
.filters label { flex: 1; min-width: 120px; margin: 0; font-size: 11px; }
.filters label:first-child { flex: 1.7; }
.filters input,.filters select { width: 100%; font-size: 12px; }
.filters .button { min-height: 43px; }
.muted { color: var(--muted); font-size: 12px; }
.card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 17px; color: var(--muted); font-size: 11px; }
.card-meta>span:last-child { max-width: 65%; text-align: right; }
.opportunity-card { display: flex; flex-direction: column; }
.opportunity-card:has(input:checked) { border-color: #a8b4ee; box-shadow: 0 0 0 1px #a8b4ee33; }
.opportunity-card h2 { display: -webkit-box; overflow: hidden; margin: 0 0 12px; font-size: 16px; line-height: 1.55; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.opportunity-card h2 a { color: #273550; }
.opportunity-card h2 a:hover { color: var(--blue); }
.opportunity-agency { color: var(--muted); font-size: 11px!important; }
.opportunity-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: auto 0 0; padding: 17px 0 19px; }
.opportunity-facts dt { margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.opportunity-facts dd { margin: 0; color: #35415a; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.opportunity-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.select-check { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 12px; font-weight: 500; }
.opportunity-footer form { margin: 0; }
.sticky-actions { position: sticky; bottom: 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 24px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fffffff5; box-shadow: 0 5px 22px #1822380d; backdrop-filter: blur(12px); }
.sticky-actions form { margin: 0; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.notice { margin: 18px 0 22px; padding: 14px 17px; border-radius: 10px; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.notice.info { background: #eff3fc; border-color: #dce5f8; color: #536784; }
.notice.success { background: #eff9f3; border-color: #cfe9da; color: #397454; }
.notice.warning { background: #fff8ed; border-color: #f0dfbd; color: #86632e; }
.notice.error { background: #fff2f3; border-color: #f1d2d8; color: #a34355; }
.selection-list { margin: 0; padding-left: 20px; }
.selection-list li { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.selection-list li:last-child { border-bottom: 0; }
.selection-list form { margin: 10px 0 0; }
.table-wrap { overflow-x: auto; margin-bottom: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 12px; }
th,td { padding: 18px 22px; border-bottom: 1px solid #edf0f5; text-align: left; vertical-align: middle; }
th { background: #fbfcfe; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfe; }
td>a { color: #33415d; font-size: 13px; font-weight: 600; }
.table-secondary { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.numeric { font-weight: 600; font-variant-numeric: tabular-nums; }
.settings-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 22px; padding: 25px; }
.settings-form .full { grid-column: 1/-1; }
.settings-form h2 { margin-bottom: 0; }
.settings-form>.button { justify-self: start; align-self: end; margin: 16px 0; }
.empty-state { grid-column: 1/-1; padding: 48px 24px; text-align: center; }
.empty-state>.ui-icon { width: 36px; height: 36px; margin-bottom: 12px; color: #8795d8; }
.empty-state h2 { margin: 0 0 10px; }
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px max(32px,calc((100vw - 1240px)/2)); border-bottom: 1px solid var(--line); background: #fff; }
.public .workspace { max-width: 1304px; padding: 40px 32px; }
.auth-shell { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 610px; border: 1px solid var(--line); border-radius: 24px; background: #fff; overflow: hidden; box-shadow: var(--shadow); }
.auth-story { position: relative; display: flex; flex-direction: column; padding: 60px 48px 32px; background: radial-gradient(ellipse at 100% 0,#39458b70,transparent 55%),#18233e; color: #fff; overflow: hidden; }
.auth-story:after { position: absolute; right: -130px; bottom: -180px; width: 420px; height: 420px; border: 1px solid #ffffff09; border-radius: 50%; box-shadow: 0 0 0 50px #ffffff03,0 0 0 100px #ffffff02; content: ''; pointer-events: none; }
.story-tag { align-self: flex-start; padding: 6px 10px; border: 1px solid #7c8abd38; border-radius: 6px; color: #b7c1e4; font-size: 10px; letter-spacing: .02em; }
.auth-story h2 { position: relative; margin: 30px 0 16px; color: #fff; font-size: clamp(28px,3vw,38px); font-weight: 600; line-height: 1.25; letter-spacing: -.04em; }
.auth-story>p { max-width: 370px; color: #aebad4; font-size: 13px; line-height: 1.8; }
.story-features { display: grid; gap: 22px; margin: 28px 0 48px; }
.story-features>div { display: flex; align-items: flex-start; gap: 13px; }
.story-features .ui-icon { color: #9caef3; margin-top: 3px; }
.story-features strong { display: block; font-size: 12px; font-weight: 600; }
.story-features small { display: block; margin-top: 4px; color: #a4b1ce; font-size: 11px; }
.story-footnote { margin-top: auto; color: #8e9bb7; font-size: 10px; }
.auth-form-area { display: flex; flex-direction: column; justify-content: center; padding: 40px 45px; }
.public .auth-card { width: 100%; max-width: 400px; margin: 0 auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.auth-card h1 { margin: 10px 0 14px; font-size: 30px; line-height: 1.2; }
.auth-card>p { margin-bottom: 26px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.auth-card label { margin: 18px 0; }
.auth-card input { min-height: 47px; }
.auth-card input[name=code] { font-size: 24px; letter-spacing: .3em; text-align: center; }
.auth-card .button.wide { min-height: 47px; margin-top: 8px; }
.auth-security { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 26px 0 0; color: var(--muted); font-size: 11px; }
.auth-security .ui-icon { width: 14px; height: 14px; flex-basis: 14px; }
.hero { max-width: 1000px; padding: 70px 0; }
.hero h1 { max-width: 820px; margin: 18px 0 24px; font-size: clamp(38px,5vw,64px); line-height: 1.1; }
.hero p { max-width: 640px; color: var(--muted); font-size: 16px; line-height: 1.8; }
.detail-panel,.detail-grid,.watch-form { border-radius: var(--radius); border-color: var(--line); }
.detail-grid dd { color: var(--ink); }
@media(min-width:1600px) { .authenticated .workspace { max-width: 1530px; } .client-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media(max-width:1150px) { :root { --nav-width: 220px; } .workspace { padding: 0 24px 36px; } .workspace-topbar { margin-left: -24px; margin-right: -24px; padding: 0 24px; } .future { flex-wrap: wrap; } .future small { margin-left: 28px; } .auth-story { padding: 42px 30px 28px; } .auth-form-area { padding: 36px 30px; } .opportunity-grid { grid-template-columns: 1fr; } }
@media(max-width:850px) { .client-grid { grid-template-columns: 1fr; } .summary-strip>div { padding: 18px; } .summary-strip strong { font-size: 21px; } .auth-shell { min-height: 560px; } .auth-story h2 { font-size: 28px; } }
@media(max-width:760px){
  .sidebar { position: static; width: 100%; padding: 18px 18px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin: 0 0 17px; font-size: 18px; }
  .sidebar .brand-copy>span { display: block; font-size: 10px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 5px; }
  .sidebar nav a,.future { min-height: 36px; padding: 8px 10px; font-size: 11px; }
  .sidebar nav .ui-icon,.future .ui-icon { width: 16px; height: 16px; flex-basis: 16px; }
  .future { flex-wrap: nowrap; gap: 6px; }.future small { margin-left: 0; }
  .nav-section-label,.account-card { display: none; }
  .sidebar-footer { position: absolute; top: 20px; right: 15px; margin: 0; padding: 0; }
  .logout-button { width: auto; padding: 8px; }
  .authenticated .workspace { margin-left: 0; }
  .workspace { padding: 0 18px 30px; }
  .workspace-topbar { min-height: 54px; margin: 0 -18px 25px; padding: 0 18px; font-size: 10px; }
  .workspace-role { font-size: 10px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 22px; }
  .page-head h1 { font-size: 28px; }.page-head p { font-size: 12px; }
  .panel { padding: 20px; border-radius: 13px; }
  .summary-strip { margin-bottom: 26px; }.summary-strip>div { padding: 16px 12px; }
  .summary-strip span { font-size: 10px; }.summary-strip strong { font-size: 18px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 3px; }.section-heading h2 { font-size: 17px; }
  .client-grid,.opportunity-grid { gap: 16px; }
  .client-tabs { gap: 0; }.client-tabs a { padding: 10px; font-size: 11px; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
  .filters label { min-width: 0; }.filters label:first-child { grid-column: 1/-1; }.filters .button { align-self: end; }
  .settings-form { grid-template-columns: 1fr; gap: 0; }.settings-form .full { grid-column: 1; }
  .opportunity-footer { gap: 10px; }.opportunity-facts { gap: 10px; }
  .sticky-actions { bottom: 8px; padding: 12px; }.sticky-actions .button { font-size: 12px; }
  th,td { padding: 16px; }.table-wrap { border-radius: 12px; }
  .public-header { padding: 17px 20px; }.public-header .brand { font-size: 17px; }.public-header .button { font-size: 11px; }
  .public .workspace { padding: 24px 18px; }
  .auth-shell { grid-template-columns: 1fr; min-height: 0; border-radius: 18px; }
  .auth-story { padding: 28px; }.auth-story h2 { margin: 20px 0 10px; font-size: 28px; }.auth-story>p { margin-bottom: 0; }
  .story-features,.story-footnote { display: none; }.auth-form-area { padding: 30px 26px; }
  .auth-card h1 { font-size: 27px; }.auth-card>p { margin-bottom: 20px; }
  .hero { padding: 30px 0; }
}
@media(max-width:380px) { .summary-strip { grid-template-columns: 1fr; }.summary-strip>div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }.summary-strip>div+div { border-left: 0; border-top: 1px solid var(--line); }.summary-strip span { margin: 0; }.opportunity-facts { grid-template-columns: 1fr; }.future { font-size: 10px; } }
@media(prefers-reduced-motion:reduce) { *,*:before,*:after { scroll-behavior: auto!important; transition: none!important; animation: none!important; } }
/* Administration shares the existing workspace and customer components. */
.admin-context {position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;margin:0 0 24px;border:1px solid #c7d2fe;border-radius:14px;background:#eef2ff;color:#27377b;box-shadow:0 4px 18px #33415510}
.admin-context small {display:block;margin-top:4px;overflow-wrap:anywhere}
.admin-context form {margin:0}
.message-preview {white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:1.7;margin:0}
.admin-shortcut {display:block;color:inherit;text-decoration:none;transition:border-color .15s,transform .15s}
.admin-shortcut:hover {border-color:#818cf8;transform:translateY(-2px)}
.table-wrap td .button,.table-wrap td form {margin:4px 0}
.admin-summary {grid-template-columns:repeat(4,minmax(0,1fr))}
.client-grid.admin-shortcuts {grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:28px}
@media(max-width:850px){.admin-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-summary>div:nth-child(3){border-left:0}.admin-summary>div:nth-child(n+3){border-top:1px solid var(--line)}.client-grid.admin-shortcuts{grid-template-columns:1fr}}
@media(max-width:700px){.admin-context{align-items:stretch;flex-direction:column;padding:14px}.admin-context .button{width:100%}.message-preview{font-size:14px}}
