/* Vanilla UI of the .pm back offices served by pm (doc, scan, qrcode, nfc,
 * rfid…), no framework. It wears pm.studio's admin look (its theme.css and
 * admin.css): cream paper, white cards, an ink sidebar, Outfit; light or
 * dark as the system says. Black and white by default; the colour mode
 * (localStorage "pm-accent", set on <html data-accent>) takes the user's
 * brand colour (--brand, from the server) or the .pm violet-blue. Each
 * product adds its own /cdn/apps/<product>/ui.css. */

@font-face { font-family: Outfit; font-weight: 500; font-display: swap; src: url(/cdn/common/suite/fonts/outfit-500.ttf) format("truetype"); }
@font-face { font-family: Outfit; font-weight: 800; font-display: swap; src: url(/cdn/common/suite/fonts/outfit-800.ttf) format("truetype"); }

:root {
	--bg: #fefdf8;
	--bg-2: #f7f6f0;
	--card: #ffffff;
	--card-2: #f1f1ee;
	--line: #e4e4e7;
	--line-2: #d4d4d8;
	--text: #18181b;
	--mute: #6b6e66;
	--dim: #8f9289;

	--ok: #1f9d55;
	--warn: #e08a00;
	--ko: #c0392b;
	--ok-bg: #e6f4ea;
	--ok-fg: #1e5c33;
	--warn-bg: #fff0c7;
	--warn-fg: #795716;
	--ko-bg: #fae1dc;
	--ko-fg: #8c4438;

	/* Black and white: the accent is the ink. */
	--acc: #151713;
	--acc-2: #3f4239;
	--acc-ink: #ffffff;
	--acc-text: #151713;
	--acc-soft: rgba(21, 23, 19, .08);
	--acc-grad: linear-gradient(135deg, #151713, #4a4d45);

	/* The ink sidebar, the same in light and dark. */
	--side-bg: #151713;
	--side-text: #ffffff;
	--side-mute: #a3a69d;
	--side-hover: rgba(255, 255, 255, .06);
	--side-current: #2c3029;
	--side-line: rgba(255, 255, 255, .1);

	--glass: rgba(254, 253, 248, .78);
	--veil: rgba(21, 23, 19, .45);
	--row-hover: rgba(127, 127, 127, .06);

	--r: 10px;
	--r-lg: 14px;
	--side: 244px;
	--top: 64px;
	--ease: all .2s ease;
	--shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .06);
	--font: Outfit, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #111210;
		--bg-2: #161715;
		--card: #1b1c1a;
		--card-2: #262724;
		--line: #33342f;
		--line-2: #474842;
		--text: #ecece8;
		--mute: #a3a69d;
		--dim: #7c7f76;

		--ok: #34c77b;
		--warn: #f0a531;
		--ko: #f0726a;
		--ok-bg: rgba(52, 199, 123, .16);
		--ok-fg: #7ee2a8;
		--warn-bg: rgba(240, 165, 49, .16);
		--warn-fg: #f5c56e;
		--ko-bg: rgba(240, 114, 106, .16);
		--ko-fg: #f5a49d;

		--acc: #f1f1ee;
		--acc-2: #c8cbc2;
		--acc-ink: #151713;
		--acc-text: #f1f1ee;
		--acc-soft: rgba(241, 241, 238, .08);
		--acc-grad: linear-gradient(135deg, #f1f1ee, #a3a69d);

		--side-bg: #0b0c0a;
		--side-current: #22241f;

		--glass: rgba(17, 18, 16, .78);
		--veil: rgba(0, 0, 0, .6);
		--shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .4);
		color-scheme: dark;
	}
}

/* Colour mode: doc.pm's violet to electric blue. */
:root[data-accent="color"] {
	--acc: #7c3aed;
	--acc-2: #3b82f6;
	--acc-ink: #fff;
	--acc-text: #6d28d9;
	--acc-soft: rgba(124, 58, 237, .1);
	--acc-grad: linear-gradient(135deg, #7c3aed, #3b82f6);
}
@media (prefers-color-scheme: dark) {
	:root[data-accent="color"] { --acc: #8b5cf6; --acc-text: #a78bfa; --acc-soft: rgba(139, 92, 246, .14); --acc-grad: linear-gradient(135deg, #8b5cf6, #3b82f6); }
}

/* Colour mode with a brand: its colour, darkened or lightened where it is text. */
:root[data-accent="color"][style*="--brand"] {
	--acc: var(--brand);
	--acc-2: color-mix(in srgb, var(--brand) 70%, #fff);
	--acc-text: color-mix(in srgb, var(--brand) 80%, #000);
	--acc-soft: color-mix(in srgb, var(--brand) 12%, transparent);
	--acc-grad: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #fff));
}
@media (prefers-color-scheme: dark) {
	:root[data-accent="color"][style*="--brand"] { --acc-text: color-mix(in srgb, var(--brand) 45%, #fff); --acc-soft: color-mix(in srgb, var(--brand) 18%, transparent); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 14px/1.5 var(--font);
	font-feature-settings: "cv11", "ss01";
	-webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
::selection { background: var(--acc); color: var(--acc-ink); }

.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.v-mute { color: var(--mute); }
.v-dim { color: var(--dim); }
.v-mono { font-family: var(--mono); font-size: 12px; }
.v-ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.v-ico.sm { width: 15px; height: 15px; }
.v-ico.lg { width: 28px; height: 28px; }

/* ---------- Shell: sidebar + main ---------- */

.v-app {
	display: grid;
	grid-template-columns: var(--side) minmax(0, 1fr);
	min-height: 100vh;
}
.v-side {
	position: sticky;
	top: 0;
	height: 100vh;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 14px 16px;
	background: var(--side-bg);
	color: var(--side-text);
	z-index: 30;
	--text: var(--side-text);
	--mute: var(--side-mute);
	--dim: var(--side-mute);
	--card: var(--side-hover);
	--line: var(--side-line);
	--line-2: rgba(255, 255, 255, .18);
}
.v-side .v-nav a.is-current { background: var(--side-current); }
.v-side .v-nav-label { font-size: 10px; letter-spacing: .12em; font-weight: 700; }
.v-logo {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 40px;
	padding: 0 10px;
	margin-bottom: 12px;
	font-weight: 700;
	letter-spacing: .02em;
}
.v-logo img { display: block; height: 22px; width: auto; }
.v-logo-mark {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: var(--r);
	background: var(--acc-grad);
	color: var(--acc-ink);
	font-size: 13px;
}
.v-nav-label { padding: 14px 10px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.v-nav a {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 36px;
	padding: 0 10px;
	border-radius: var(--r);
	color: var(--mute);
	transition: var(--ease);
}
.v-nav a:hover { color: var(--text); background: var(--card); }
.v-nav a.is-current { color: var(--text); background: var(--card); }
.v-nav a.is-current::before {
	content: "";
	position: absolute;
	left: -12px;
	top: 8px;
	bottom: 8px;
	width: 3px;
	border-radius: 0 3px 3px 0;
	background: var(--acc-grad);
}
.v-nav .v-count { margin-left: auto; font-size: 11px; color: var(--dim); }
.v-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }

.v-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	height: 36px;
	padding: 0 10px;
	border: 0;
	border-radius: var(--r);
	background: none;
	color: var(--mute);
	cursor: pointer;
	transition: var(--ease);
}
.v-toggle:hover { color: var(--text); background: var(--card); }
.v-switch {
	position: relative;
	margin-left: auto;
	width: 30px;
	height: 18px;
	border-radius: 99px;
	background: var(--line-2);
	transition: var(--ease);
}
.v-switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--text);
	transition: var(--ease);
}
[aria-pressed="true"] .v-switch { background: var(--acc-grad); }
[aria-pressed="true"] .v-switch::after { left: 15px; background: #fff; }

.v-main { min-width: 0; display: flex; flex-direction: column; }
.v-top {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 12px;
	height: var(--top);
	padding: 0 24px;
	background: var(--glass);
	backdrop-filter: saturate(180%) blur(14px);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid var(--line);
}
.v-search { position: relative; flex: 1; max-width: 480px; }
.v-search .v-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.v-search input {
	width: 100%;
	height: 38px;
	padding: 0 56px 0 38px;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: var(--card);
	outline: none;
	transition: var(--ease);
}
.v-search input::placeholder { color: var(--dim); }
.v-search input:focus { border-color: var(--line-2); box-shadow: 0 0 0 4px var(--acc-soft); }
.v-kbd {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	padding: 1px 6px;
	border: 1px solid var(--line-2);
	border-radius: 5px;
	font: 11px var(--mono);
	color: var(--dim);
}
.v-top-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.v-icon-btn {
	position: relative;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: var(--card);
	color: var(--mute);
	cursor: pointer;
	transition: var(--ease);
}
.v-icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.v-icon-btn:active { transform: scale(.96); }
.v-icon-btn.v-burger { display: none; }
.v-dot {
	position: absolute;
	top: 7px;
	right: 7px;
	min-width: 8px;
	height: 8px;
	border-radius: 99px;
	background: var(--ko);
	box-shadow: 0 0 0 2px var(--card);
}

.v-menu { position: relative; }
.v-pop {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	width: 300px;
	padding: 6px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: var(--card);
	box-shadow: var(--shadow);
	opacity: 0;
	transform: translateY(-4px) scale(.98);
	transform-origin: top right;
	pointer-events: none;
	transition: var(--ease);
	z-index: 40;
}
.v-menu.is-open .v-pop { opacity: 1; transform: none; pointer-events: auto; }
.v-pop-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.v-pop a, .v-pop .v-pop-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 6px;
	color: var(--mute);
	transition: var(--ease);
}
.v-pop a:hover { color: var(--text); background: var(--card-2); }
.v-pop small { display: block; color: var(--dim); font-size: 12px; }
.v-pop-empty { padding: 16px 10px; color: var(--dim); text-align: center; }

.v-avatar {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: var(--acc-grad);
	color: var(--acc-ink);
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
	transition: var(--ease);
}
.v-avatar:hover { transform: scale(1.04); }

.v-content { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 24px 96px; }
.v-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.v-head p { margin-top: 4px; color: var(--mute); }
.v-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Buttons ---------- */

.v-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 38px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: var(--card);
	color: var(--text);
	font-weight: 500;
	white-space: nowrap;
	cursor: pointer;
	transition: var(--ease);
}
.v-btn:hover { border-color: var(--line-2); background: var(--card-2); }
.v-btn:active { transform: translateY(1px) scale(.99); }
.v-btn.is-primary { border-color: transparent; background: var(--acc-grad); color: var(--acc-ink); }
.v-btn.is-primary:hover { filter: brightness(1.08); box-shadow: 0 6px 20px var(--acc-soft); }
.v-btn.is-ghost { background: transparent; }
.v-btn.is-danger:hover { border-color: var(--ko); color: var(--ko); }
.v-btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.v-btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Cards, KPIs ---------- */

.v-card {
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: var(--card);
	box-shadow: var(--shadow);
}
.v-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.v-card-head p { color: var(--dim); font-size: 12px; }
.v-card-body { padding: 16px 20px 20px; }

.v-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 16px; margin-bottom: 16px; }
.v-kpi { position: relative; padding: 18px 20px; overflow: hidden; transition: var(--ease); }
.v-kpi::after {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 1px;
	background: var(--acc-grad);
	opacity: 0;
	transition: var(--ease);
}
.v-kpi:hover { border-color: var(--line-2); transform: translateY(-1px); }
.v-kpi:hover::after { opacity: .9; }
.v-kpi-label { display: flex; align-items: center; justify-content: space-between; color: var(--mute); font-size: 13px; }
.v-kpi-label .v-ico { color: var(--dim); }
.v-kpi-value { margin-top: 10px; font-size: 28px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.v-kpi-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--dim); }
.v-delta { display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 99px; font-weight: 600; font-variant-numeric: tabular-nums; }
.v-delta.is-up { color: var(--ok-fg); background: var(--ok-bg); }
.v-delta.is-down { color: var(--ko-fg); background: var(--ko-bg); }
.v-delta.is-flat { color: var(--mute); background: var(--card-2); }

.v-charts { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.v-chart { position: relative; height: 260px; }
.v-card.is-fill { display: flex; flex-direction: column; }
.v-card.is-fill .v-card-body { flex: 1; display: flex; }
.v-card.is-fill .v-chart { flex: 1; min-width: 0; min-height: 260px; height: auto; }
.v-chart.is-round { height: 220px; }
.v-legend { display: grid; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.v-legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); }
.v-legend i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.v-legend b { margin-left: auto; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.v-empty-chart {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	text-align: center;
	color: var(--dim);
	font-size: 13px;
	pointer-events: none;
}

/* ---------- Folders ---------- */

.v-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.v-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.v-folder { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px; transition: var(--ease); }
.v-folder:hover { border-color: var(--line-2); transform: translateY(-1px); }
.v-folder-top { display: flex; align-items: center; gap: 10px; }
.v-folder-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r); background: var(--acc-soft); color: var(--acc-text); flex: none; }
.v-folder-name { min-width: 0; }
.v-folder-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.v-folder-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font: 12px var(--mono); }
.v-folder-meta { display: flex; gap: 12px; color: var(--mute); font-size: 12px; }
.v-folder-meta span { display: inline-flex; align-items: center; gap: 4px; }
.v-folder-gear { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--dim); transition: var(--ease); }
.v-folder-gear:hover { color: var(--text); background: var(--card-2); }
.v-folder.is-new { display: grid; place-items: center; min-height: 110px; border-style: dashed; background: transparent; box-shadow: none; color: var(--mute); }
.v-folder.is-new:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- Table ---------- */

.v-table-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.v-seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
.v-seg button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 28px;
	padding: 0 10px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--mute);
	font-size: 13px;
	cursor: pointer;
	transition: var(--ease);
}
.v-seg button:hover { color: var(--text); }
.v-seg button[aria-pressed="true"] { background: var(--card-2); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.v-seg small { color: var(--dim); font-variant-numeric: tabular-nums; }
.v-scroll { overflow-x: auto; }
.v-table { width: 100%; border-collapse: collapse; }
.v-table th {
	padding: 10px 14px;
	border-bottom: 1px solid var(--line);
	color: var(--dim);
	font-size: 12px;
	font-weight: 500;
	text-align: left;
	white-space: nowrap;
}
.v-table th button { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.v-table th button:hover, .v-table th button[aria-sort] { color: var(--text); }
.v-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.v-table tr:last-child td { border-bottom: 0; }
.v-table tbody tr { transition: var(--ease); }
.v-table tbody tr:hover { background: var(--row-hover); }
.v-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.v-doc { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.v-table th:first-child, .v-table td:first-child { padding-left: 20px; }
.v-table th:last-child, .v-table td:last-child { padding-right: 16px; }
@media (max-width: 1280px) { .v-table .is-hide-md { display: none; } }
.v-thumb { width: 34px; height: 44px; flex: none; border: 1px solid var(--line); border-radius: 4px; background: var(--bg-2) center / cover no-repeat; display: grid; place-items: center; color: var(--dim); }
.v-doc-text { min-width: 0; }
.v-doc-text > b { display: block; font-weight: 500; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: var(--ease); }
.v-doc:hover .v-doc-text > b { color: var(--acc-text); }
.v-doc-text > span { display: block; color: var(--dim); font: 12px var(--mono); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-table .is-nowrap { white-space: nowrap; }
.v-table .is-folder { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.v-row-actions a { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; color: var(--dim); transition: var(--ease); }
.v-row-actions a:hover { color: var(--text); background: var(--card-2); }
.v-chip { display: inline-block; padding: 0 6px; margin: 1px 2px 1px 0; border: 1px solid var(--line); border-radius: 4px; color: var(--mute); font: 11px/18px var(--mono); text-transform: uppercase; }

.v-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.v-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.v-badge.is-live { color: var(--ok-fg); background: var(--ok-bg); }
.v-badge.is-locked { color: var(--warn-fg); background: var(--warn-bg); }
.v-badge.is-empty { color: var(--ko-fg); background: var(--ko-bg); }

.v-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }
.v-pager-btns { display: flex; gap: 6px; }
.v-table-empty { padding: 48px 20px; text-align: center; color: var(--dim); }
.v-table-empty .v-ico { margin: 0 auto 10px; }

/* ---------- Forms ---------- */

.v-narrow { max-width: 880px; margin: 0 auto; }
.v-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.v-tabs a {
	position: relative;
	padding: 14px 10px;
	color: var(--mute);
	white-space: nowrap;
	transition: var(--ease);
}
.v-tabs a:hover { color: var(--text); }
.v-tabs a.is-active { color: var(--text); }
.v-tabs a.is-active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--acc-grad); }
.v-panel { padding: 24px; }
.v-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.v-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.v-grid .is-full { grid-column: 1 / -1; }
.v-stack { display: grid; gap: 16px; }
.v-stack.is-tight { gap: 8px; }
.v-field { display: grid; gap: 6px; align-content: start; }
.v-field > span { color: var(--mute); font-size: 13px; font-weight: 500; }
.v-hint { color: var(--dim); font-size: 12px; }
.v-input {
	width: 100%;
	min-height: 40px;
	padding: 9px 12px;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: var(--bg-2);
	outline: none;
	transition: var(--ease);
}
.v-input::placeholder { color: var(--dim); }
.v-input:hover { border-color: var(--line-2); }
.v-input:focus { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
textarea.v-input { min-height: 96px; resize: vertical; }
select.v-input { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23a1a1aa' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input[type="color"].v-input { height: 40px; padding: 4px; cursor: pointer; }
input[type="color"].v-input:disabled { opacity: .35; cursor: not-allowed; }
input[type="file"].v-input { padding: 7px; color: var(--mute); }
.v-input-group { display: flex; gap: 8px; }
.v-input-group .v-input { flex: 1; }
.v-feedback { min-height: 18px; font-size: 12px; color: var(--dim); }
.v-feedback.is-ok { color: var(--ok); }
.v-feedback.is-ko { color: var(--ko); }

.v-check {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: var(--bg-2);
	cursor: pointer;
	transition: var(--ease);
}
.v-check:hover { border-color: var(--line-2); }
.v-check input { appearance: none; position: relative; width: 34px; height: 20px; margin: 0; flex: none; border-radius: 99px; background: var(--line-2); cursor: pointer; transition: var(--ease); }
.v-check input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: var(--ease); }
.v-check input:checked { background: var(--acc-grad); }
.v-check input:checked::after { left: 17px; background: var(--acc-ink); }
.v-check b { display: block; font-weight: 500; }
.v-check small { display: block; color: var(--dim); font-size: 12px; }

.upload-zone, .media-cover {
	display: grid;
	place-items: center;
	gap: 4px;
	min-height: 120px;
	padding: 16px;
	border: 1px dashed var(--line-2);
	border-radius: var(--r);
	background: var(--bg-2);
	color: var(--mute);
	font-size: 13px;
	text-align: center;
	cursor: pointer;
	transition: var(--ease);
}
.upload-zone:hover, .media-cover:hover, .upload-zone.is-drag { border-color: var(--acc); background: var(--acc-soft); color: var(--text); }
.upload-zone b, .media-cover b { color: var(--text); font-weight: 500; }
.upload-zone p, .media-cover p { color: var(--dim); font-size: 12px; }
.media-filename { color: var(--acc-text); font: 12px var(--mono); word-break: break-all; }
.media-cover-img, .preview img { max-height: 128px; margin: 6px auto 0; border: 1px solid var(--line); border-radius: 6px; }

.v-media { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
.v-media img { height: 64px; border: 1px solid var(--line); border-radius: 4px; }
.v-media-info { min-width: 0; }
.v-media-info span { display: block; color: var(--dim); font: 12px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-media .v-del { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--mute); font-size: 13px; cursor: pointer; white-space: nowrap; }
.v-media .v-del:has(input:checked) { color: var(--ko); }
.media-row { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card-2); }
.media-row-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.media-row-head .v-input { width: auto; min-width: 180px; }
.media-pages { color: var(--mute); font-size: 13px; }
.media-remove { margin-left: auto; }

.v-savebar {
	position: fixed;
	left: var(--side);
	right: 0;
	bottom: 0;
	z-index: 25;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	padding: 12px 24px;
	background: var(--veil);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-top: 1px solid var(--line);
}
.v-savebar .v-error { margin-right: auto; }
.v-error { color: var(--ko); font-weight: 500; }
.v-alert { padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--ko) 35%, transparent); border-radius: var(--r); background: var(--ko-bg); color: var(--ko-fg); font-size: 13px; }
.v-divider { height: 1px; margin: 24px 0; background: var(--line); border: 0; }

.v-members { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.v-members li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
.v-members li > span { min-width: 0; }
.v-members small { display: block; color: var(--dim); }
.v-members .v-btn { margin-left: auto; }
.v-members .is-none { justify-content: center; color: var(--dim); border-style: dashed; }

.v-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--veil); backdrop-filter: blur(6px); }
.v-overlay-box { width: 300px; padding: 24px; text-align: center; }
.v-progress { height: 6px; margin-top: 14px; border-radius: 99px; background: var(--line); overflow: hidden; }
.v-progress i { display: block; height: 100%; width: 0; background: var(--acc-grad); transition: width .2s ease; }

/* ---------- Standalone pages (password) ---------- */

.v-center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.v-auth { width: 100%; max-width: 380px; padding: 28px; }
.v-auth .v-folder-icon { margin-bottom: 16px; }
.v-auth p { margin: 6px 0 20px; color: var(--mute); }

/* ---------- Responsive ---------- */

/* Phones: the figures two by two rather than one per row. */
@media (max-width: 560px) { .v-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 1100px) {
	.v-charts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
	.v-app { grid-template-columns: minmax(0, 1fr); }
	.v-side {
		position: fixed;
		inset: 0 auto 0 0;
		width: var(--side);
		transform: translateX(-100%);
		transition: transform .2s ease;
	}
	.v-app.is-nav .v-side { transform: none; box-shadow: var(--shadow); }
	.v-app.is-nav::after { content: ""; position: fixed; inset: 0; z-index: 29; background: var(--veil); }
	.v-icon-btn.v-burger { display: grid; }
	.v-top { padding: 0 16px; }
	.v-kbd { display: none; }
	.v-content { padding: 20px 16px 96px; }
	.v-savebar { left: 0; padding: 12px 16px; }
	.v-grid, .v-grid.is-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
	.v-kpis { gap: 10px; }
	.v-kpi { padding: 14px; }
	.v-kpi-value { font-size: 22px; margin-top: 6px; }
	.v-kpi-foot { flex-wrap: wrap; }
	.v-head { align-items: stretch; }
	.v-actions .v-btn { flex: 1; }
	.v-table .is-hide-sm { display: none; }
	.v-pop { width: min(300px, calc(100vw - 32px)); }
	.v-panel { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; }
}
.v-gap { margin-top: 16px; }
.v-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }

/* ---------- Shared by the product pages ---------- */

.v-flash { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--mute); font-size: 13px; }
.v-flash > .v-ico:first-child { color: var(--acc-text); }
.v-flash b { color: var(--text); font-weight: 600; }
.v-flash .v-btn { margin-left: auto; }
.v-flash.is-ok { border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: var(--ok-bg); color: var(--ok-fg); }
.v-flash.is-ok > .v-ico:first-child { color: var(--ok); }
.v-flash.is-ko { border-color: color-mix(in srgb, var(--ko) 35%, transparent); background: var(--ko-bg); color: var(--ko-fg); }
.v-flash.is-ko > .v-ico:first-child { color: var(--ko); }
.v-flash.is-warn { border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: var(--warn-bg); color: var(--warn-fg); }
.v-flash.is-warn > .v-ico:first-child { color: var(--warn); }

.v-empty { display: grid; justify-items: center; gap: 10px; padding: 48px 24px; text-align: center; }
.v-empty > .v-ico { width: 36px; height: 36px; color: var(--acc-text); }
.v-empty h1, .v-empty h2 { font-size: 20px; }
.v-empty p { max-width: 520px; color: var(--mute); }
.v-empty .v-actions { justify-content: center; margin-top: 8px; }

.v-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 16px 20px; }
.v-filters .v-field { flex: 1 1 160px; }
.v-filters .v-field.is-wide { flex: 3 1 260px; }
.v-filters .v-btn { height: 40px; }
.v-seg a { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 6px; color: var(--mute); font-size: 13px; white-space: nowrap; transition: var(--ease); }
.v-seg a:hover { color: var(--text); }
.v-seg a[aria-current="true"], .v-seg a.is-on { background: var(--card-2); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.v-seg-scroll { max-width: 100%; overflow-x: auto; }

.v-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13px; }
.v-dl dt { color: var(--dim); }
.v-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.v-link { color: var(--acc-text); transition: var(--ease); }
.v-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.v-code { font: 600 13px var(--mono); letter-spacing: .02em; }
h1 .v-code { font-size: inherit; }
.v-trunc { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-cell-ico { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 360px; }
.v-cell-ico .v-ico { color: var(--dim); }
.v-table tr[data-href] { cursor: pointer; }
.v-up { color: var(--ok); }
.v-down { color: var(--ko); }
.v-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.v-cols.is-wide-left { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.v-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--mute); font-size: 13px; }
.v-back:hover { color: var(--text); }
.v-feed { display: grid; margin: 0; padding: 0; list-style: none; }
.v-feed li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.v-feed li:last-child { border-bottom: 0; }
.v-feed li > .v-ico { color: var(--dim); }
.v-feed li > span { min-width: 0; flex: 1; }
.v-feed small { display: block; color: var(--dim); font-size: 12px; }
.v-feed time { color: var(--dim); font-size: 12px; white-space: nowrap; }

/* Read only (an admin looking at someone else's object): the forms that
   change it are shown but inert; the server refuses them anyway. */
.is-ro form[method="post"] { pointer-events: none; }
.is-ro form[method="post"] :is(button, .v-btn, input[type="file"], .v-savebar) { display: none; }
.is-ro form[method="post"] :is(input, select, textarea) { opacity: .7; }

@media (max-width: 900px) {
	.v-cols, .v-cols.is-wide-left { grid-template-columns: minmax(0, 1fr); }
}
a.v-kpi { display: block; }
.v-input.is-auto { width: auto; }
.v-break { overflow-wrap: anywhere; }
.v-pager.is-bare { padding: 12px 0 0; border: 0; }
.v-auth-wide { width: 100%; max-width: 560px; }
.v-field > label { color: var(--mute); font-size: 13px; font-weight: 500; }
.v-input-group.is-end { margin-left: auto; }
.v-table-tools .v-input-group .v-input[type="search"] { min-width: 240px; }
@media (max-width: 560px) { .v-table-tools .v-input-group, .v-table-tools .v-input-group .v-input[type="search"] { width: 100%; min-width: 0; } }
