/**
 * Sales Agents — front-end rep dashboard styles.
 *
 * Mobile-first per spec. Layout phases:
 *
 *   Phone (≤ 720px):
 *     - Sidebar hidden
 *     - Bottom tab bar shown
 *     - Topbar compact
 *     - Cards stack
 *
 *   Tablet/desktop (> 720px):
 *     - Sidebar pinned left
 *     - Bottom bar hidden
 *     - KPI strip + 2-column splits enabled
 *
 * Consumes the same --wwp-* token set as the admin shell (loaded
 * alongside wswp-brand.css) so the front-end and admin chrome read
 * as one product.
 */

/* ---------- reset + base ---------- */
.wswp-rep,
.wswp-rep * { box-sizing: border-box; }
body.wswp-rep {
	margin: 0;
	min-height: 100vh;
	background: var(--wwp-bg);
	color: var(--wwp-ink);
	font-family: var(--wwp-sans);
	-webkit-font-smoothing: antialiased;
}
.wswp-rep__app {
	display: flex;
	min-height: 100vh;
}

/* ---------- sidebar (desktop) ---------- */
.wswp-rep__sidebar {
	display: none;
	width: 240px;
	flex-shrink: 0;
	background: var(--wwp-ink);
	color: var(--wwp-bg);
	flex-direction: column;
	padding: 24px 16px;
	position: sticky;
	top: 0;
	height: 100vh;
}
.wswp-rep__brand {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 8px 8px 24px;
	border-bottom: 1px solid rgba(255,255,255,.08);
	margin-bottom: 16px;
}
.wswp-rep__brand-mark {
	width: 28px; height: 28px;
	border-radius: 6px;
	background: var(--wwp-accent);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wwp-serif);
	font-size: 16px;
	margin-bottom: 6px;
}
.wswp-rep__brand-text {
	font-family: var(--wwp-serif);
	font-size: 18px;
	line-height: 1;
}
.wswp-rep__brand-sub {
	color: rgba(245,241,230,.6);
	font-family: var(--wwp-mono);
	text-transform: uppercase;
	letter-spacing: .05em;
	font-size: 10px;
}
.wswp-rep__nav { display: flex; flex-direction: column; gap: 2px; }
.wswp-rep__nav-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	color: rgba(245,241,230,.78);
	text-decoration: none;
	border-radius: 8px;
	font-size: 14px;
}
.wswp-rep__nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.wswp-rep__nav-link.is-active {
	background: rgba(232,65,42,.15);
	color: #fff;
}
.wswp-rep__nav-link svg { color: currentColor; flex: 0 0 20px; }
.wswp-rep__sidebar-foot {
	margin-top: auto;
	padding-top: 16px;
	border-top: 1px solid rgba(255,255,255,.08);
}

/* ---------- main column ---------- */
.wswp-rep__main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}
.wswp-rep__topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
	border-bottom: 1px solid var(--wwp-rule-softer);
	background: var(--wwp-bg);
	position: sticky;
	top: 0;
	z-index: 5;
}
.wswp-rep__topbar-title {
	font-family: var(--wwp-serif);
	font-weight: 400;
	font-size: 22px;
	line-height: 1.1;
	margin: 0;
}
@media (min-width: 720px) {
	.wswp-rep__topbar-title { font-size: 30px; }
}
.wswp-rep__topbar-meta {
	color: var(--wwp-ink-soft);
	font-size: 13px;
}
.wswp-rep__topbar-hello {
	font-family: var(--wwp-mono);
	font-size: 12px;
	color: var(--wwp-ink-muted);
	text-transform: uppercase;
	letter-spacing: .05em;
}
.wswp-rep__view {
	padding: 24px;
	padding-bottom: 100px; /* room for the mobile bottom bar */
	max-width: 1180px;
	width: 100%;
	margin: 0 auto;
}

/* ---------- KPI strip ---------- */
.wswp-rep__kpis {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px;
	margin: 0 0 24px;
}
.wswp-rep__kpi {
	background: var(--wwp-bg-card);
	border: 1px solid var(--wwp-rule-softer);
	border-radius: 14px;
	padding: 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.wswp-rep__kpi-label {
	font-family: var(--wwp-mono);
	font-size: 10px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--wwp-ink-muted);
	font-weight: 600;
}
.wswp-rep__kpi-value {
	font-family: var(--wwp-serif);
	font-size: 32px;
	line-height: 1.05;
	color: var(--wwp-ink);
}
.wswp-rep__kpi-note {
	font-size: 12px;
	color: var(--wwp-ink-muted);
}

/* ---------- split layout ---------- */
.wswp-rep__split {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}
.wswp-rep__col       { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.wswp-rep__col--wide { /* default; gets 2:1 share above 960px */ }

/* ---------- mobile bottom bar ---------- */
.wswp-rep__bottombar {
	position: fixed;
	bottom: 0; left: 0; right: 0;
	background: var(--wwp-ink);
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	z-index: 50;
	padding-bottom: env(safe-area-inset-bottom, 0px);
}
.wswp-rep__bottom-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 8px 4px;
	color: rgba(245,241,230,.7);
	text-decoration: none;
	font-size: 10px;
	font-family: var(--wwp-mono);
	letter-spacing: .04em;
	text-transform: uppercase;
}
.wswp-rep__bottom-link.is-active { color: var(--wwp-accent); }
.wswp-rep__bottom-link svg { width: 22px; height: 22px; }

/* ---------- breakpoints ---------- */
@media (min-width: 720px) {
	.wswp-rep__sidebar  { display: flex; }
	.wswp-rep__bottombar { display: none; }
	.wswp-rep__view     { padding: 28px 32px 60px; }
}
@media (min-width: 960px) {
	.wswp-rep__split {
		grid-template-columns: 2fr 1fr;
		align-items: start;
	}
}

/* ---------- order-on-behalf wizard ---------- */
.wswp-oob__search { position: relative; }
.wswp-oob__suggest {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: var(--wwp-bg-card);
	border: 1px solid var(--wwp-rule-soft);
	border-radius: 10px;
	margin: 4px 0 0;
	padding: 4px;
	list-style: none;
	max-height: 320px;
	overflow-y: auto;
	box-shadow: 0 16px 32px rgba(15,12,8,.10);
	z-index: 10;
}
.wswp-oob__suggest li {
	padding: 8px 10px;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	gap: 12px;
	align-items: center;
}
.wswp-oob__suggest li:hover { background: var(--wwp-neutral-bg); }
.wswp-oob__suggest-empty { color: var(--wwp-ink-muted); cursor: default !important; }
.wswp-oob__methods {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
}
.wswp-oob__method {
	border: 1px solid var(--wwp-rule-soft);
	border-radius: 12px;
	padding: 14px 14px 12px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	cursor: pointer;
	background: var(--wwp-bg-card);
}
.wswp-oob__method input { margin-bottom: 4px; }
.wswp-oob__method.is-selected { border-color: var(--wwp-ink); box-shadow: 0 0 0 1px var(--wwp-ink) inset; }
.wswp-oob__method.is-disabled { opacity: .55; cursor: not-allowed; }
.wswp-oob__method strong { font-size: 14px; }
.wswp-oob__review-totals {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px;
	background: var(--wwp-bg);
	border-radius: 10px;
	border: 1px solid var(--wwp-rule-softer);
	max-width: 440px;
}

/* ---------- tighten admin-borrowed pills inside the rep app ---------- */
.wswp-rep .wswp__card    { background: var(--wwp-bg-card); }
.wswp-rep .wswp__btn     { font-family: var(--wwp-sans); }
.wswp-rep .wswp__trail   { background: var(--wwp-bg); }

/* ---------- print: statement view ---------- */
@media print {
	.wswp-rep__sidebar,
	.wswp-rep__topbar,
	.wswp-rep__bottombar,
	.wswp__btn { display: none !important; }
	.wswp-rep__main,
	.wswp-rep__view { padding: 0 !important; }
	.wswp__card { border: 0 !important; box-shadow: none !important; }
	body.wswp-rep { background: #fff !important; }
}
