:root {
	color-scheme: light;
	--bg: #eef2f1;
	--surface: #ffffff;
	--fg: #10282e;
	--muted: #546a6f;
	--accent: #0d5c6b;
	--accent-soft: #dcebee;
	--border: #d3dddc;
	--danger: #b4322a;
	--danger-soft: #fbe9e7;
	--warn: #9a5b00;
	--warn-soft: #fdf0d9;
	--ok: #1d7a4c;
	--wa: #128c4b;
	--radius: 8px;
	--radius-lg: 14px;
	--space: 1rem;
	--shadow: 0 1px 2px rgba(16, 40, 46, 0.06), 0 4px 14px rgba(16, 40, 46, 0.05);
	--font: "Instrument Sans", "Segoe UI", Roboto, sans-serif;
	--display: "Bricolage Grotesque", "Instrument Sans", sans-serif;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.shell {
	max-width: 42rem;
	margin: 0 auto;
	padding: calc(var(--space) * 3) var(--space);
}

h1 {
	margin: 0 0 0.35rem;
	font-family: var(--display);
	font-size: clamp(2rem, 5vw, 3rem);
	line-height: 1.05;
	letter-spacing: -0.03em;
}

h2 {
	margin: 0;
	font-family: var(--display);
	font-size: 1.35rem;
	letter-spacing: -0.01em;
}

h3 {
	margin: 0;
	font-size: 1.1rem;
}

.lede {
	margin: 0 0 0.75rem;
	font-size: 1.05rem;
}

.hint {
	margin: 0;
	color: var(--muted);
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 44px;
	padding: 0.55rem 1rem;
	text-decoration: none;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-weight: 500;
	cursor: pointer;
}

.btn:hover {
	filter: brightness(1.1);
}

.btn:disabled {
	opacity: 0.55;
	cursor: default;
}

.btn:active {
	transform: translateY(1px);
}

.btn-secondary {
	background: var(--surface);
	color: var(--fg);
	border-color: var(--border);
}

.card {
	padding: var(--space);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
}

.input,
.select,
.textarea {
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--fg);
	font: inherit;
	min-height: 44px;
}

.field {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.35rem;
	margin-bottom: var(--space);
}

.field > label {
	font-size: 0.875rem;
	color: var(--muted);
}

/*
 * 390px-safe, like .grid below. A grid with no column list gets one implicit
 * auto column, and an auto column is never narrower than its widest item's
 * min-content width. One nowrap scrolling strip (days, time slots) anywhere
 * inside an item therefore widened the whole column past the screen: the page
 * scrolled sideways instead of the strip scrolling on its own. minmax(0, 1fr)
 * caps the column at the container; the min-width rule keeps a child from
 * bringing the same floor back if an app redefines the columns. :where() adds
 * no specificity, so a min-width the app sets on a child still wins.
 */
.stack {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space);
}

:where(.field, .stack, .list) > * {
	min-width: 0;
}

.row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

/*
 * 390px-safe. An unclamped minmax track overflows a 390px viewport once the
 * shell padding is subtracted, and nothing in the pipeline ever looked at a
 * phone-width layout, so every generated app inherited the horizontal scroll.
 * min() clamps the track to the container instead.
 */
.grid {
	display: grid;
	gap: var(--space);
	grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
}

.list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.list-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}

.table {
	width: 100%;
	border-collapse: collapse;
}

.table th,
.table td {
	padding: 0.6rem 0.5rem;
	text-align: left;
	border-bottom: 1px solid var(--border);
}

.table th {
	font-size: 0.8125rem;
	color: var(--muted);
	font-weight: 600;
}

.empty {
	padding: calc(var(--space) * 2);
	text-align: center;
	color: var(--muted);
}

.empty-title {
	margin: 0 0 0.25rem;
	color: var(--fg);
	font-weight: 600;
}

/* Loading. Every fetch has one; without a primitive each app invented its own. */
.loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: calc(var(--space) * 1.5);
	color: var(--muted);
}

.spinner {
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
	border: 2px solid var(--border);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: fab-spin 0.7s linear infinite;
}

@keyframes fab-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Placeholder for content whose shape is known before its data arrives. */
.skeleton {
	display: block;
	height: 1rem;
	border-radius: calc(var(--radius) / 2);
	background: linear-gradient(90deg, var(--border), transparent, var(--border));
	background-size: 200% 100%;
	animation: fab-shimmer 1.2s linear infinite;
}

@keyframes fab-shimmer {
	to {
		background-position: -200% 0;
	}
}

/* Error strip: a failure the user can see and retry, never a silent no-op. */
.alert {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--border);
	border-left: 3px solid var(--muted);
	border-radius: var(--radius);
}

.alert-error {
	border-left-color: var(--danger);
	color: var(--danger);
}

.badge {
	display: inline-block;
	padding: 0.1rem 0.5rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	font-size: 0.8125rem;
	color: var(--muted);
}

/*
 * The scaffold had exactly one @media rule (prefers-color-scheme) and no width
 * breakpoint at all, so the shell was a 42rem column at every size.
 * Mobile-first stays the default; these only widen it.
 */
@media (min-width: 48rem) {
	.shell {
		max-width: 52rem;
		padding: calc(var(--space) * 3) calc(var(--space) * 1.5);
	}
}

@media (min-width: 64rem) {
	.shell {
		max-width: 64rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.spinner,
	.skeleton {
		animation: none;
	}
}

:where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* ---------- Idéal Optic ---------- */
.muted { color: var(--muted); margin: 0; }
.small { font-size: 0.875rem; }
.stack-lg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.stack-lg > * { min-width: 0; }
.row-tight { gap: 0.4rem; }
.form-error { margin: 0; color: var(--danger); font-weight: 500; }
.ok-text { color: var(--ok); font-weight: 600; }
.low-text { color: var(--danger); font-weight: 600; }
.input-short { max-width: 12rem; }
.search { max-width: 32rem; }
.textarea { min-height: auto; resize: vertical; }

.mark { width: 2.1rem; height: 1.05rem; color: var(--accent); flex: none; }
.brand { display: flex; align-items: center; gap: 0.55rem; font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand-lg { font-size: 1.8rem; }
.brand-lg .mark { width: 3rem; height: 1.5rem; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--accent); }
.login-card { width: 100%; max-width: 24rem; padding: 2rem 1.5rem; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }

.topbar { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 64rem; margin: 0 auto; padding: 0.6rem 1rem; display: flex; align-items: center; gap: 0.75rem 1.25rem; flex-wrap: wrap; }
.topbar-inner .btn-ghost { margin-left: auto; }
.trial-banner {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem;
	margin-bottom: 1.25rem; padding: 0.8rem 1rem; border-radius: var(--radius);
	background: var(--accent-soft); border: 1px solid var(--border); font-size: 0.92rem;
}
.trial-banner > span { flex: 1 1 18rem; min-width: 0; }
.trial-wait { background: #fff6e0; border-color: #f0d38a; }
.trial-ok { background: #e8f6ee; border-color: #b9e1c8; }
.pay-panel { max-width: 36rem; }
.pay-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.admin-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; }
.admin-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; flex: 1 1 16rem; overflow-wrap: anywhere; }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.statut-a_payer { background: #fde8e8; color: #9b1c1c; }
.statut-en_attente { background: #fff6e0; color: #8a5a00; }
.statut-essai_paye { background: #e8f6ee; color: #1f6b3d; }
.account-chip { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.account-chip .btn-ghost { margin-left: 0; }
.boutique-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.account { gap: 2rem; align-content: center; grid-template-columns: minmax(0, 1fr); padding: 2rem 1rem; }
.account-pitch { color: #fff; max-width: 30rem; width: 100%; justify-self: center; display: grid; gap: 1rem; }
.account-pitch h1 { color: #fff; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 0; }
.account-pitch .muted { color: rgba(255, 255, 255, 0.82); }
.formules { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.formules li {
	display: flex; flex-direction: column; gap: 0.1rem; padding: 0.8rem 0.9rem;
	background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22); border-radius: var(--radius);
}
.formules .muted { color: rgba(255, 255, 255, 0.75); }
.formule-prix { font-family: var(--display); font-size: 1.15rem; font-weight: 700; }
.account .login-card { justify-self: center; }
.account-title { margin: 0.25rem 0 0; font-size: 1.25rem; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--bg); border-radius: var(--radius); gap: 4px; }
.seg button {
	min-height: 40px; border: 0; border-radius: calc(var(--radius) - 2px); background: transparent;
	font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
}
.seg .seg-on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
@media (min-width: 860px) {
	.account { grid-template-columns: minmax(0, 1.1fr) minmax(0, 24rem); max-width: 64rem; margin: 0 auto; gap: 3rem; }
	.account-pitch { justify-self: start; }
}
.tabs { display: flex; gap: 0.25rem; order: 3; width: 100%; overflow-x: auto; }
.tab {
	flex: 1 0 auto; min-height: 44px; padding: 0.5rem 0.9rem; border: 0; border-radius: var(--radius);
	background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer;
}
.tab:hover { color: var(--fg); background: var(--bg); }

/* Tableau de bord */
.dash-date { text-transform: capitalize; }
.quick { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stats-4 { grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); }
.stats-4 .stat-n { font-size: 1.45rem; overflow-wrap: anywhere; }
.stats-4 .stat-hero .stat-n { font-size: 1.6rem; }
.dash-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); }
.dash-block { min-width: 0; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.dash-block-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.dash-block-head h2 { margin: 0; font-size: 1.05rem; }
.dash-count { display: inline-block; min-width: 1.6rem; padding: 0.05rem 0.45rem; margin-left: 0.2rem; border-radius: 999px;
	background: var(--accent-soft); color: var(--accent); font-size: 0.85rem; text-align: center; font-variant-numeric: tabular-nums; }
.dash-block .empty { padding: 1rem 0.5rem; }
.dash-list { list-style: none; margin: 0; padding: 0; display: grid; }
.dash-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; padding: 0.55rem 0; border-top: 1px solid var(--border); }
.dash-list li:first-child { border-top: 0; }
.dash-time { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3rem; }
.dash-grow { flex: 1 1 8rem; min-width: 0; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.rdv-honore { background: #e8f6ee; color: #1f6b3d; }
.rdv-manque { background: var(--danger-soft); color: var(--danger); }

/* Caisse */
.panel-title { margin: 0; scroll-margin-top: 7rem; }
.small-title { margin: 0; font-size: 1rem; }
.ligne-edit { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr)); align-items: end;
	padding: 0.75rem; background: var(--bg); border-radius: var(--radius); }
.ligne-edit .field { margin-bottom: 0; }
.ligne-prod, .ligne-lib { grid-column: 1 / -1; }
.ligne-del { justify-self: start; }
.totaux { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.remise-field { margin-bottom: 0; flex: 0 1 14rem; }
.totaux-list { margin: 0; display: grid; gap: 0.3rem; min-width: min(18rem, 100%); flex: 1 1 16rem; }
.totaux-list > div { display: flex; justify-content: space-between; gap: 1rem; }
.totaux-list dt { color: var(--muted); }
.totaux-list dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.totaux-total { padding-top: 0.4rem; border-top: 1px solid var(--border); font-size: 1.15rem; }
.totaux-total dt { color: var(--fg); font-weight: 700; }
.reste { padding: 0.55rem 0.7rem; border-radius: var(--radius); font-size: 1.1rem; }
.reste dt { color: inherit; font-weight: 700; }
.reste-du { background: var(--danger-soft); color: var(--danger); }
.reste-ok { background: #e8f6ee; color: #1f6b3d; }
.reste-banner { margin: 0; padding: 0.7rem 0.9rem; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); }
.vente-card { display: grid; gap: 1rem; }
.vente-lignes { list-style: none; margin: 0; padding: 0; }
.vente-lignes li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.vl-main { display: grid; gap: 0.1rem; min-width: 0; }
.vl-total { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rx-box { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; padding: 0.75rem 0.9rem; border-radius: var(--radius);
	background: var(--accent-soft); color: var(--accent); }
.encaisser .field { margin-bottom: 0; }
.pay-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; }
.vente-row { width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem;
	padding: 0.85rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	font: inherit; color: inherit; text-align: left; cursor: pointer; margin-bottom: 0.5rem; }
.vente-row:hover { border-color: var(--accent); }
.vr-main { display: grid; gap: 0.1rem; min-width: 0; flex: 1 1 12rem; }
.vr-side { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; font-variant-numeric: tabular-nums; }
.vt-devis { background: var(--accent-soft); color: var(--accent); }
.vt-du { background: var(--danger-soft); color: var(--danger); }
.vt-partiel { background: var(--warn-soft); color: var(--warn); }
.vt-solde { background: #e8f6ee; color: #1f6b3d; }
.vt-annule { background: var(--bg); color: var(--muted); }
@media print {
	.topbar, .no-print, .trial-banner { display: none !important; }
	.card, .vente-card { box-shadow: none; }
}
.tab { white-space: nowrap; }

/* ---------- Rendez-vous et commandes ---------- */
.seg-wide { max-width: 28rem; }
.agenda-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.agenda-bar > .btn:last-child { margin-left: auto; }
.agenda-nav { display: flex; gap: 0.35rem; }
.agenda-title { font-size: 1.15rem; margin: 0; text-transform: capitalize; }
.agenda-title .small { text-transform: none; font-weight: 500; }
.day-head { margin: 0; font-size: 0.95rem; text-transform: capitalize; color: var(--muted); }
.day-today { color: var(--accent); }
.rdv { display: flex; gap: 0.9rem; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); }
.rdv-heure { font-family: var(--display); font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; min-width: 3.2rem; }
.rdv-main { flex: 1; min-width: 0; display: grid; gap: 0.35rem; }
.rdv-honore { border-left-color: var(--ok); background: #f6faf8; }
.rdv-manque { border-left-color: var(--danger); }
.rdv-annule { border-left-color: var(--border); opacity: 0.6; }
.rdv-annule strong { text-decoration: line-through; }
.rdv-badge-honore { background: #e8f6ee; color: #1f6b3d; }
.rdv-badge-manque { background: var(--danger-soft); color: var(--danger); }
.rdv-badge-annule { background: var(--bg); color: var(--muted); }
.commande { display: grid; gap: 0.75rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.commande-prete { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok) inset; }
.commande-retiree { opacity: 0.7; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.steps li { padding: 0.4rem 0.25rem 0; border-top: 4px solid var(--border); font-size: 0.75rem; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.steps .step-done { border-top-color: var(--accent); color: var(--fg); }
.steps .step-on { border-top-color: var(--accent); color: var(--accent); font-weight: 700; }
.commande-prete .steps .step-on { border-top-color: var(--ok); color: var(--ok); }
.tab-active, .tab-active:hover { color: var(--accent); background: var(--accent-soft); }
@media (min-width: 48rem) {
	.tabs { order: 0; width: auto; }
	.tab { flex: none; }
}

.btn-ghost {
	min-height: 44px; padding: 0.4rem 0.6rem; border: 0; background: transparent; color: var(--accent);
	font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--radius); justify-self: start;
}
.btn-ghost:hover { background: var(--accent-soft); }
.btn.small { min-height: 38px; padding: 0.35rem 0.75rem; font-size: 0.875rem; }
.btn-wa { background: var(--wa); }

.shell { max-width: 64rem; padding-top: 1.75rem; padding-bottom: 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.page-head > div { min-width: 0; flex: 1 1 18rem; }

.panel { padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); scroll-margin-top: 7rem; }
.panel .field { margin-bottom: 0; }
.form-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); }

.stats { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 48rem) { .stats { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.stat { display: flex; flex-direction: column; gap: 0.15rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); font-size: 0.9rem; }
.stat-n { font-family: var(--display); font-size: 2rem; font-weight: 700; color: var(--fg); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-hero { background: var(--accent); border-color: var(--accent); color: #cfe4e8; }
.stat-hero .stat-n { color: #fff; font-size: 2.6rem; }

.meta { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; color: var(--muted); font-size: 0.9rem; }
.meta a { color: var(--accent); font-weight: 600; }

.due { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 4px; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.due-late { background: var(--danger-soft); color: var(--danger); }
.due-soon { background: var(--warn-soft); color: var(--warn); }
.due-ok { background: var(--accent-soft); color: var(--accent); }
.due-none { background: var(--bg); color: var(--muted); }

.renewal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 1rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.renewal-main { flex: 1 1 16rem; min-width: 0; display: grid; gap: 0.25rem; }
.renewal-side { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
@media (min-width: 48rem) { .renewal-side { align-items: flex-end; } }
.renewal-done { background: #f6faf8; }
.link-strong { padding: 0; border: 0; background: none; font: inherit; font-size: 1.1rem; font-weight: 600; color: var(--fg); text-align: left; cursor: pointer; }
.link-strong:hover { color: var(--accent); text-decoration: underline; }

.client-row {
	width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.2rem; padding: 0.85rem 1rem; text-align: left;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font: inherit; color: var(--fg); cursor: pointer;
}
.client-row:hover { border-color: var(--accent); }
.client-name { font-weight: 600; }
@media (min-width: 48rem) {
	.client-row { grid-template-columns: 1.5fr 1fr auto; align-items: center; }
}

.back { padding-left: 0; }
.detail-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 56rem) { .detail-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; } }

.rx { display: grid; gap: 0.6rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.rx p { margin: 0; }
.rx-latest { border-color: var(--accent); box-shadow: var(--shadow); }
.rx-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.rx-table { display: grid; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.rx-r { display: grid; grid-template-columns: 3rem repeat(3, minmax(0, 1fr)); font-variant-numeric: tabular-nums; }
.rx-r > span { padding: 0.45rem 0.6rem; border-top: 1px solid var(--border); }
.rx-h > span { border-top: 0; background: var(--bg); font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.rx-r > span:first-child { font-weight: 700; color: var(--accent); }

.eyes { display: grid; gap: 0.5rem; }
.eye { display: grid; grid-template-columns: 2.5rem repeat(3, minmax(0, 1fr)); gap: 0.5rem; align-items: center; }
.eye-label { font-weight: 700; color: var(--accent); }
.eye-head { font-size: 0.8rem; color: var(--muted); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { min-height: 40px; padding: 0.4rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--fg); font: inherit; font-weight: 500; cursor: pointer; }
.chip-on { background: var(--fg); border-color: var(--fg); color: #fff; }
.chip-warn { color: var(--danger); }
.chip-warn.chip-on { background: var(--danger); border-color: var(--danger); color: #fff; }

.product { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.85rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.product-low { border-left: 4px solid var(--danger); }
.product-main { flex: 1 1 14rem; min-width: 0; display: grid; gap: 0.15rem; }
.product-type { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.qty { display: flex; align-items: center; gap: 0.5rem; }
.qty-n { display: grid; justify-items: center; min-width: 4.5rem; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.qty-n strong { font-size: 1.35rem; line-height: 1.1; }
.qty-btn { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font: inherit; font-size: 1.3rem; color: var(--fg); cursor: pointer; }
.qty-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.qty-btn:disabled { opacity: 0.4; cursor: default; }

.empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty .hint { margin: 0; }
