/* ==========================================================================
   PRC Portal — Camellia Division
   Theme: NovaPay palette (dark slate + sky blue), Outfit / DM Sans
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
	--bg: #0F1319;
	--bg2: #141920;
	--bg3: #1A2130;
	--bg4: #1E2838;
	--sky: #4A9EE8;
	--sky2: #7EC8F0;
	--sky3: #2A6AAA;
	--sky4: #0D2A44;
	--text: #E4EEF8;
	--text2: #8AAEC8;
	--text3: #506070;
	--border: #1E3050;
	--border2: #2A4060;
	--green: #3DCC8E;
	--red: #E85A5A;
	--amber: #E8B04A;
	--violet: #9A8CF0;

	--green-bg: rgba(61, 204, 142, .12);
	--red-bg: rgba(232, 90, 90, .12);
	--amber-bg: rgba(232, 176, 74, .12);
	--sky-bg: rgba(74, 158, 232, .12);
	--muted-bg: rgba(138, 174, 200, .10);

	--radius: 12px;
	--radius-sm: 8px;
	--header-h: 64px;
	--max-w: 1320px;
	--silk: cubic-bezier(0.16, 1, 0.3, 1);
	--shadow: 0 24px 60px -24px rgba(0, 0, 0, .6);
	--font-display: 'Outfit', system-ui, sans-serif;
	--font-body: 'DM Sans', system-ui, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 14px;
	line-height: 1.55;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: var(--sky2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
::selection { background: var(--sky3); color: #fff; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

/* Grid backdrop (NovaPay signature, toned down for an app) */
.backdrop {
	position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.backdrop::before, .backdrop::after {
	content: ''; position: absolute; width: 900px; height: 900px;
	background-image:
		linear-gradient(rgba(74, 158, 232, .35) 1px, transparent 1px),
		linear-gradient(90deg, rgba(74, 158, 232, .35) 1px, transparent 1px);
	background-size: 120px 120px;
	opacity: .12;
	transform: rotate(-12deg);
}
.backdrop::before { top: -420px; right: -320px; mask-image: radial-gradient(circle at 60% 40%, #000 0%, transparent 62%); -webkit-mask-image: radial-gradient(circle at 60% 40%, #000 0%, transparent 62%); }
.backdrop::after { bottom: -520px; left: -420px; opacity: .07; mask-image: radial-gradient(circle at 40% 60%, #000 0%, transparent 60%); -webkit-mask-image: radial-gradient(circle at 40% 60%, #000 0%, transparent 60%); }

/* ---------------------------------------------------------------- Typography */
h1, h2, h3, h4, .display { font-family: var(--font-display); letter-spacing: -.02em; color: var(--text); }
h1 { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -.03em; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--text2); }
.faint { color: var(--text3); }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }
.upper { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 600; color: var(--text3); }

/* ---------------------------------------------------------------- Header */
.app-header {
	position: sticky; top: 0; z-index: 50;
	height: var(--header-h);
	background: rgba(15, 19, 25, .86);
	backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
	border-bottom: 1px solid var(--border);
}
.app-header .inner {
	max-width: var(--max-w); margin: 0 auto; height: 100%;
	display: flex; align-items: center; gap: 28px; padding: 0 28px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand-mark {
	width: 34px; height: 34px; border-radius: 9px;
	background: linear-gradient(140deg, var(--sky) 0%, var(--sky3) 100%);
	display: grid; place-items: center;
	box-shadow: 0 6px 18px -6px rgba(74, 158, 232, .7), inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-mark svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-text { line-height: 1.1; }
.brand-text b { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -.03em; display: block; }
.brand-text span { font-size: 11px; color: var(--text3); letter-spacing: .04em; }

.nav { display: flex; gap: 4px; }
.nav a {
	position: relative; display: inline-flex; align-items: center; gap: 8px;
	padding: 8px 14px; border-radius: 9px;
	color: var(--text2); font-weight: 500; font-size: 14px;
	transition: color .3s var(--silk), background .3s var(--silk);
}
.nav a:hover { color: var(--text); background: var(--bg3); }
.nav a.active { color: var(--text); background: var(--bg4); box-shadow: inset 0 0 0 1px var(--border2); }
.nav a svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.badge-count {
	min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
	background: var(--sky); color: #06121F; font-size: 11px; font-weight: 700;
	display: inline-grid; place-items: center; font-family: var(--font-display);
}
.badge-count.zero { background: var(--bg4); color: var(--text3); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.month-picker { position: relative; display: flex; align-items: center; gap: 8px; }
.month-picker label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; }
.month-picker select { min-width: 132px; }
.month-picker .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(61, 204, 142, .15); }
.month-picker .live-dot.off { background: var(--text3); box-shadow: none; }

.user-menu { position: relative; }
.user-chip {
	display: flex; align-items: center; gap: 10px;
	padding: 4px 10px 4px 4px; border-radius: 999px;
	border: 1px solid var(--border); background: var(--bg2);
	transition: border-color .3s var(--silk);
}
.user-chip:hover { border-color: var(--border2); }
.avatar {
	width: 32px; height: 32px; border-radius: 50%;
	display: grid; place-items: center;
	background: var(--sky4); color: var(--sky2);
	font-family: var(--font-display); font-weight: 700; font-size: 12px;
	border: 1px solid var(--border2);
}
.user-chip .who { text-align: left; line-height: 1.15; }
.user-chip .who b { display: block; font-size: 13px; font-weight: 600; }
.user-chip .who span { font-size: 11px; color: var(--text3); }
.dropdown {
	position: absolute; right: 0; top: calc(100% + 8px); width: 260px;
	background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--radius);
	box-shadow: var(--shadow); padding: 8px;
	opacity: 0; transform: translateY(-6px); pointer-events: none;
	transition: opacity .25s var(--silk), transform .35s var(--silk);
}
.dropdown.open { opacity: 1; transform: none; pointer-events: auto; }
.dropdown .meta { padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown .meta b { display: block; }
.dropdown .meta div { font-size: 12px; color: var(--text2); }
.dropdown button {
	width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; color: var(--text2);
	display: flex; align-items: center; gap: 10px;
}
.dropdown button:hover { background: var(--bg4); color: var(--text); }
.dropdown button.danger:hover { color: var(--red); }
.dropdown svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.menu-toggle { display: none; }

/* ---------------------------------------------------------------- Page */
.page { position: relative; z-index: 1; max-width: var(--max-w); margin: 0 auto; padding: 28px 28px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 12px; color: var(--sky2); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.page-head p { color: var(--text2); margin-top: 6px; max-width: 640px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.screen { animation: rise .55s var(--silk) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Cards */
.card {
	background: var(--bg2);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	position: relative;
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 15px; }
.card-head .sub { font-size: 12px; color: var(--text3); }
.card-body { padding: 18px 20px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- Buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: 38px; padding: 0 16px; border-radius: 9px;
	font-weight: 600; font-size: 13.5px; white-space: nowrap;
	border: 1px solid transparent;
	transition: transform .35s var(--silk), background .3s var(--silk), border-color .3s var(--silk), color .3s var(--silk), box-shadow .3s var(--silk);
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--sky); color: #06121F; box-shadow: 0 8px 22px -10px rgba(74, 158, 232, .9); }
.btn-primary:hover:not(:disabled) { background: var(--sky2); }
.btn-ghost { background: var(--bg3); border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { border-color: var(--border2); background: var(--bg4); }
.btn-success { background: var(--green); color: #052016; }
.btn-success:hover:not(:disabled) { filter: brightness(1.08); }
.btn-danger { background: transparent; border-color: rgba(232, 90, 90, .45); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red-bg); }
.btn-link { height: auto; padding: 0; color: var(--sky2); font-weight: 500; }
.btn-link:hover:not(:disabled) { transform: none; color: var(--text); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn-icon { width: 34px; padding: 0; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
	content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
	border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn-primary.loading::after, .btn-success.loading::after { border-color: rgba(6,18,31,.25); border-top-color: #06121F; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--text2); letter-spacing: .01em; }
.field .hint { font-size: 11.5px; color: var(--text3); }
.field .error, .error-text { font-size: 12px; color: var(--red); }
.req::after { content: ' *'; color: var(--red); }
.input, .select, textarea.input {
	width: 100%; height: 40px; padding: 0 12px;
	background: var(--bg3); border: 1px solid var(--border); border-radius: 9px;
	color: var(--text); outline: none;
	transition: border-color .25s var(--silk), box-shadow .25s var(--silk), background .25s var(--silk);
}
textarea.input { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.input::placeholder { color: var(--text3); }
.input:hover, .select:hover { border-color: var(--border2); }
.input:focus, .select:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(74, 158, 232, .18); background: #1B2434; }
.input:disabled, .select:disabled { opacity: .6; cursor: not-allowed; }
.input.invalid, .select.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(232, 90, 90, .14); }
.select {
	appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238AAEC8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 12px center;
}
.select option { background: var(--bg3); color: var(--text); }
.input-sm, .select-sm { height: 34px; font-size: 13px; }
input[type="date"].input { color-scheme: dark; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text3); font-weight: 600; }
.input-prefix .input { padding-left: 28px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--text3); fill: none; stroke-width: 2; }
.search .input { padding-left: 36px; }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; gap: 2px; }
.seg button {
	height: 30px; padding: 0 12px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text2);
	transition: background .3s var(--silk), color .3s var(--silk);
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--bg4); color: var(--text); box-shadow: inset 0 0 0 1px var(--border2), 0 2px 8px -2px rgba(0,0,0,.4); }
.seg.seg-yes button.on[data-v="yes"] { background: var(--green-bg); color: var(--green); box-shadow: inset 0 0 0 1px rgba(61,204,142,.4); }
.seg.seg-yes button.on[data-v="no"] { background: var(--red-bg); color: var(--red); box-shadow: inset 0 0 0 1px rgba(232,90,90,.4); }
.seg.invalid { border-color: var(--red); }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--text2); user-select: none; }
.switch input { display: none; }
.switch i { width: 32px; height: 18px; border-radius: 9px; background: var(--bg4); border: 1px solid var(--border2); position: relative; transition: background .3s var(--silk); }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text2); transition: transform .35s var(--silk), background .3s; }
.switch input:checked + i { background: var(--sky3); border-color: var(--sky); }
.switch input:checked + i::after { transform: translateX(14px); background: #fff; }

/* Check pills */
.pill-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { position: relative; cursor: pointer; }
.check-pill input { position: absolute; opacity: 0; pointer-events: none; }
.check-pill span {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 7px 12px; border-radius: 999px; font-size: 12.5px;
	background: var(--bg3); border: 1px solid var(--border); color: var(--text2);
	transition: all .3s var(--silk);
}
.check-pill span::before {
	content: ''; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--border2); flex-shrink: 0;
	transition: all .3s var(--silk);
}
.check-pill:hover span { border-color: var(--border2); color: var(--text); }
.check-pill input:checked + span { background: var(--sky-bg); border-color: rgba(74,158,232,.5); color: var(--text); }
.check-pill input:checked + span::before {
	background: var(--sky) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306121F' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/10px no-repeat;
	border-color: var(--sky);
}
.check-pill input:disabled + span { opacity: .45; cursor: not-allowed; }
.check-pill em { font-style: normal; font-size: 10.5px; color: var(--text3); }

.campaign-card { display: block; cursor: pointer; }
.campaign-card input { position: absolute; opacity: 0; pointer-events: none; }
.campaign-card .cc {
	display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 10px;
	background: var(--bg3); border: 1px solid var(--border); transition: all .3s var(--silk); height: 100%;
}
.campaign-card .cc .tick { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border2); flex-shrink: 0; margin-top: 2px; transition: all .3s var(--silk); }
.campaign-card:hover .cc { border-color: var(--border2); }
.campaign-card input:checked + .cc { border-color: rgba(74,158,232,.55); background: var(--sky-bg); }
.campaign-card input:checked + .cc .tick { background: var(--sky) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306121F' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/11px no-repeat; border-color: var(--sky); }
.campaign-card input:disabled + .cc { cursor: default; }
.campaign-card b { display: block; font-size: 13px; font-weight: 600; }
.campaign-card small { color: var(--text3); font-size: 11.5px; }

/* ---------------------------------------------------------------- Chips & tags */
.chip {
	display: inline-flex; align-items: center; gap: 6px;
	height: 24px; padding: 0 10px; border-radius: 999px;
	font-size: 11.5px; font-weight: 600; white-space: nowrap;
	background: var(--muted-bg); color: var(--text2);
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.not_logged { background: transparent; box-shadow: inset 0 0 0 1px var(--border2); color: var(--text3); }
.chip.logged { background: var(--green-bg); color: var(--green); }
.chip.sample { background: var(--sky-bg); color: var(--sky2); }
.chip.input { background: rgba(154,140,240,.12); color: var(--violet); }
.chip.campaign { background: var(--amber-bg); color: var(--amber); }
.chip.draft { background: var(--muted-bg); color: var(--text2); }
.chip.submitted { background: var(--sky-bg); color: var(--sky2); }
.chip.approved { background: var(--green-bg); color: var(--green); }
.chip.returned { background: var(--red-bg); color: var(--red); }
.chip.pending_doctor, .chip.pending { background: var(--amber-bg); color: var(--amber); }
.chip.rejected_doctor, .chip.rejected { background: var(--red-bg); color: var(--red); }
.doc-card .cta { gap: 8px; flex-wrap: wrap; }
.doc-card .cta .btn { margin-left: auto; }
.tag {
	display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px;
	font-size: 11px; font-weight: 700; letter-spacing: .03em;
	background: var(--bg4); color: var(--text2); border: 1px solid var(--border);
}
.tag.msd { background: rgba(154, 140, 240, .12); color: var(--violet); border-color: rgba(154, 140, 240, .3); }
.tag.t-HC { color: #7EC8F0; }
.tag.t-PD { color: #F0A27E; }
.tag.t-AF { color: #8FE0B5; }
.tag.t-DP { color: #E8C46A; }
.tag.warn { background: var(--amber-bg); color: var(--amber); border-color: rgba(232,176,74,.3); }
.tag.off { background: var(--red-bg); color: var(--red); border-color: rgba(232,90,90,.25); }

/* Banner / callouts */
.banner {
	display: flex; gap: 12px; align-items: flex-start;
	padding: 12px 14px; border-radius: 10px; font-size: 13px;
	background: var(--sky-bg); border: 1px solid rgba(74,158,232,.3); color: var(--text);
}
.banner svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; margin-top: 1px; }
.banner.warn { background: var(--amber-bg); border-color: rgba(232,176,74,.35); }
.banner.warn svg { color: var(--amber); }
.banner.danger { background: var(--red-bg); border-color: rgba(232,90,90,.35); }
.banner.danger svg { color: var(--red); }
.banner.ok { background: var(--green-bg); border-color: rgba(61,204,142,.35); }
.banner.ok svg { color: var(--green); }
.banner.muted { background: var(--bg3); border-color: var(--border); color: var(--text2); }

/* ---------------------------------------------------------------- Doctors screen */
.status-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.status-strip button {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 8px 12px 8px 10px; border-radius: 10px;
	background: var(--bg2); border: 1px solid var(--border); color: var(--text2); font-size: 12.5px; font-weight: 500;
	transition: all .3s var(--silk);
}
.status-strip button b { font-family: var(--font-display); font-size: 16px; color: var(--text); font-weight: 700; }
.status-strip button:hover { border-color: var(--border2); color: var(--text); }
.status-strip button.on { border-color: var(--sky); background: var(--sky-bg); color: var(--text); }
.status-strip .chip { height: 20px; padding: 0 8px; font-size: 11px; }

.targets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.target { padding: 16px 20px; border-right: 1px solid var(--border); }
.target:last-child { border-right: 0; }
.target .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 8px; }
.target .top span { font-size: 12.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.target .top b { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.target .top b small { font-size: 12px; color: var(--text3); font-weight: 500; }
.bar { height: 6px; border-radius: 3px; background: var(--bg4); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--sky3), var(--sky)); transition: width .9s var(--silk); }
.bar.done i { background: linear-gradient(90deg, #2a9d6c, var(--green)); }
.bar.thin { height: 4px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 18px 0; }
.filters .search { flex: 1; min-width: 220px; max-width: 360px; }

.doctor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.doc-card {
	display: flex; flex-direction: column; gap: 12px; text-align: left;
	padding: 16px; border-radius: var(--radius);
	background: var(--bg2); border: 1px solid var(--border);
	transition: transform .45s var(--silk), border-color .3s var(--silk), background .3s var(--silk), box-shadow .45s var(--silk);
	animation: rise .5s var(--silk) both;
}
.doc-card:hover { transform: translateY(-3px); border-color: var(--border2); background: #161D27; box-shadow: 0 18px 40px -24px rgba(0,0,0,.8); }
.doc-card .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.doc-card .name { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; letter-spacing: -.01em; line-height: 1.25; }
.doc-card .spec { font-size: 12.5px; color: var(--text3); margin-top: 2px; }
.doc-card .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-card .stats { display: flex; gap: 0; border-top: 1px solid var(--border); padding-top: 12px; }
.doc-card .stats div { flex: 1; }
.doc-card .stats b { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 700; line-height: 1.1; }
.doc-card .stats span { font-size: 11px; color: var(--text3); }
.doc-card .cta { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--sky2); font-weight: 600; }
.doc-card .cta svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; transition: transform .4s var(--silk); }
.doc-card:hover .cta svg { transform: translateX(3px); }
.doc-card.is-pending { border-style: dashed; }
.doc-card.disabled { cursor: default; }
.doc-card.disabled:hover { transform: none; box-shadow: none; }

/* ---------------------------------------------------------------- Drawer */
.overlay {
	position: fixed; inset: 0; z-index: 80; background: rgba(5, 8, 12, .62);
	opacity: 0; transition: opacity .35s var(--silk);
}
.overlay.open { opacity: 1; }
.drawer {
	position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
	width: min(720px, 100vw);
	background: var(--bg); border-left: 1px solid var(--border2);
	display: flex; flex-direction: column;
	transform: translateX(100%); transition: transform .55s var(--silk);
	box-shadow: -30px 0 80px -20px rgba(0,0,0,.6);
}
.drawer.open { transform: none; }
.drawer-head { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; gap: 14px; align-items: flex-start; background: var(--bg2); }
.drawer-head h2 { font-size: 20px; letter-spacing: -.02em; }
.drawer-head .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 16px; }
.drawer-foot {
	padding: 14px 24px; border-top: 1px solid var(--border); background: var(--bg2);
	display: flex; align-items: center; gap: 10px;
}
.drawer-foot .summary { font-size: 13px; color: var(--text2); }
.drawer-foot .summary b { color: var(--text); font-family: var(--font-display); font-size: 15px; }
.close-x { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--text2); border: 1px solid var(--border); margin-left: auto; flex-shrink: 0; transition: all .3s var(--silk); }
.close-x:hover { color: var(--text); border-color: var(--border2); background: var(--bg3); }
.close-x svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }

.section { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); }
.section-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.section-head .n {
	width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
	background: var(--sky4); color: var(--sky2); font-family: var(--font-display); font-weight: 700; font-size: 12px;
	border: 1px solid rgba(74,158,232,.3);
}
.section-head h3 { font-size: 14px; }
.section-head .aside { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.section-body { padding: 16px 18px; }
.section.has-error { border-color: rgba(232,90,90,.5); }

.sample-row { display: grid; grid-template-columns: 1fr 110px 34px; gap: 8px; align-items: start; margin-bottom: 8px; }
.sample-row .error-text { grid-column: 1 / -1; margin-top: -2px; }
.qty-wrap { position: relative; }
.qty-wrap span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--text3); pointer-events: none; }
.qty-wrap .input { padding-right: 40px; }

.ro-list { display: flex; flex-direction: column; gap: 6px; }
.ro-list .li { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 8px; background: var(--bg3); font-size: 13px; }
.ro-list .li b { font-family: var(--font-display); }

/* ---------------------------------------------------------------- Modal */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
/* Overlay must stay under the dialog — backdrop-filter on a covering overlay was blurring the popup itself. */
.modal-wrap .overlay { z-index: 0; }
.modal {
	position: relative; z-index: 1;
	width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto;
	background: var(--bg2); border: 1px solid var(--border2); border-radius: 16px;
	box-shadow: var(--shadow);
	transform: translateY(14px) scale(.98); opacity: 0;
	transition: transform .5s var(--silk), opacity .3s var(--silk);
}
.modal-wrap.open .modal { transform: none; opacity: 1; }
.modal-head { padding: 20px 22px 0; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h2 { font-size: 19px; }
.modal-head p { color: var(--text2); font-size: 13px; margin-top: 4px; }
.modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* ---------------------------------------------------------------- Toasts */
.toasts { position: fixed; top: calc(var(--header-h) + 14px); right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
[data-field="activity"]:empty { display: none; }
[data-field="activity"] .error-text { padding: 10px 14px; border-radius: 10px; background: var(--red-bg); border: 1px solid rgba(232,90,90,.35); font-size: 13px; }
.toast {
	pointer-events: auto; min-width: 260px; max-width: 420px;
	display: flex; gap: 12px; align-items: flex-start;
	padding: 12px 14px; border-radius: 12px;
	background: var(--bg3); border: 1px solid var(--border2); box-shadow: var(--shadow);
	font-size: 13px;
	animation: toast-in .5s var(--silk) both;
}
.toast.out { animation: toast-out .35s var(--silk) forwards; }
.toast .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.toast .ic svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 3; }
.toast.success .ic { background: var(--green-bg); color: var(--green); }
.toast.error .ic { background: var(--red-bg); color: var(--red); }
.toast.info .ic { background: var(--sky-bg); color: var(--sky2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* ---------------------------------------------------------------- Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
	position: relative; padding: 10px 14px; color: var(--text2); font-weight: 600; font-size: 13.5px;
	display: inline-flex; gap: 8px; align-items: center; white-space: nowrap;
	transition: color .3s var(--silk);
}
.tabs button::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px; background: var(--sky); transform: scaleX(0); transition: transform .45s var(--silk); }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { transform: scaleX(1); }
.tabs .badge-count { height: 18px; min-width: 18px; font-size: 10.5px; }

/* Admin: multi manager picker + summary bars */
.mgr-pick {
	display: flex; flex-wrap: wrap; gap: 8px;
	max-height: 200px; overflow: auto; padding: 10px;
	background: var(--bg3); border: 1px solid var(--border); border-radius: 12px;
}
.mgr-cell > div + div { margin-top: 6px; }
.hbar-list { display: flex; flex-direction: column; gap: 12px; }
.hbar-row { display: flex; flex-direction: column; gap: 6px; }
.hbar-label { font-size: 13px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.hbar-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.link-list { display: flex; flex-direction: column; gap: 8px; }
.link-row { font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--bg3); border: 1px solid var(--border); }

/* ---------------------------------------------------------------- Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
	text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
	color: var(--text3); padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg2);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .25s var(--silk); }
.table tbody tr:hover { background: rgba(30, 40, 56, .45); }
.table tr.clickable { cursor: pointer; }
.table tr.clickable td:first-child .nm { color: var(--text); }
.table tr.clickable:hover td:first-child .nm { color: var(--sky2); }
.table .r { text-align: right; }
.table .nm { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.table .sb { font-size: 11.5px; color: var(--text3); margin-top: 2px; }
.table tfoot td { font-weight: 700; background: var(--bg3); border-top: 1px solid var(--border2); }
.cov { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.cov .bar { flex: 1; }
.cov span { font-family: var(--font-display); font-weight: 600; min-width: 42px; text-align: right; }

/* ---------------------------------------------------------------- Dashboard */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; padding: 10px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); }
.toolbar .sep { width: 1px; height: 24px; background: var(--border); }
.toolbar .period { margin-left: auto; font-size: 12.5px; color: var(--text2); padding-right: 6px; }
.toolbar .period b { color: var(--text); font-weight: 600; }

.kpi { padding: 18px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; transition: border-color .3s var(--silk), transform .45s var(--silk); }
.kpi:hover { border-color: var(--border2); transform: translateY(-2px); }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .k-label { font-size: 12px; color: var(--text2); font-weight: 500; }
.kpi .k-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--sky4); color: var(--sky2); }
.kpi .k-ic svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kpi .k-ic.g { background: var(--green-bg); color: var(--green); }
.kpi .k-ic.r { background: var(--red-bg); color: var(--red); }
.kpi .k-ic.a { background: var(--amber-bg); color: var(--amber); }
.kpi .k-ic.v { background: rgba(154,140,240,.12); color: var(--violet); }
.kpi .k-val { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.kpi .k-val small { font-size: 15px; color: var(--text3); font-weight: 500; letter-spacing: 0; }
.kpi .k-foot { font-size: 11.5px; color: var(--text3); }

.therapy-rows { display: flex; flex-direction: column; gap: 14px; }
.therapy-row .tr-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; gap: 8px; }
.therapy-row .tr-top b { font-weight: 600; font-size: 13px; }
.therapy-row .tr-top span { font-size: 12px; color: var(--text2); }
.therapy-row .tr-meta { display: flex; gap: 14px; margin-top: 7px; font-size: 11.5px; color: var(--text3); }
.therapy-row .tr-meta b { color: var(--text2); font-family: var(--font-display); font-weight: 600; }

.split { display: flex; flex-direction: column; gap: 16px; }
.split-item { display: flex; align-items: center; gap: 16px; }
.ring { width: 76px; height: 76px; flex-shrink: 0; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .bg { stroke: var(--bg4); }
.ring .fg { stroke: var(--sky); stroke-linecap: round; transition: stroke-dashoffset 1s var(--silk); }
.ring.v .fg { stroke: var(--violet); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.split-item .si-text b { display: block; font-size: 14px; }
.split-item .si-text div { font-size: 12px; color: var(--text2); margin-top: 3px; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 14px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .val { font-family: var(--font-display); font-size: 12px; font-weight: 600; color: var(--text2); }
.bars .b {
	width: 100%; max-width: 44px; border-radius: 7px 7px 3px 3px; min-height: 3px;
	background: linear-gradient(180deg, var(--sky) 0%, var(--sky3) 100%);
	transform-origin: bottom; animation: grow .9s var(--silk) both;
	position: relative;
}
.bars .col.cur .b { background: linear-gradient(180deg, var(--sky2) 0%, var(--sky) 100%); box-shadow: 0 0 24px -4px rgba(74,158,232,.6); }
.bars .col.dim .b { background: var(--bg4); }
.bars .lbl { font-size: 11.5px; color: var(--text3); }
.bars .col.cur .lbl { color: var(--sky2); font-weight: 600; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.crumbs button { color: var(--text2); padding: 4px 8px; border-radius: 6px; font-weight: 500; }
.crumbs button:hover { background: var(--bg3); color: var(--text); }
.crumbs button.cur { color: var(--text); font-weight: 600; pointer-events: none; }
.crumbs .sl { color: var(--text3); }
.lvl { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: var(--bg4); color: var(--text2); letter-spacing: .04em; }

.history { display: flex; flex-direction: column; gap: 12px; }
.h-month { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.h-month:last-child { border-bottom: 0; }
.h-month .hm-label b { display: block; font-family: var(--font-display); font-size: 15px; }
.h-month .hm-body { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; font-size: 12.5px; }
.h-month .hm-body .upper { margin-bottom: 4px; }
.h-month .hm-body ul { list-style: none; color: var(--text2); }
.h-month .hm-body li { padding: 1px 0; }
.h-month.empty .hm-body { display: block; color: var(--text3); }

/* ---------------------------------------------------------------- Approvals */
.entry-card { display: grid; grid-template-columns: minmax(0, 1fr) 320px; animation: rise .5s var(--silk) both; }
.entry-card .ec-main { padding: 18px 20px; border-right: 1px solid var(--border); }
.entry-card .ec-side { padding: 18px 20px; background: rgba(26, 33, 48, .5); border-radius: 0 var(--radius) var(--radius) 0; display: flex; flex-direction: column; gap: 14px; }
.entry-card .ec-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.entry-card .ec-top h3 { font-size: 16px; font-family: var(--font-display); }
.entry-card .ec-top .sb { font-size: 12px; color: var(--text3); margin-top: 3px; }
.entry-card .ec-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.entry-card .ec-cols ul { list-style: none; font-size: 12.5px; color: var(--text2); display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.entry-card .ec-cols li b { color: var(--text); font-family: var(--font-display); }
.entry-card .ec-facts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 12.5px; }
.entry-card .ec-facts div span { display: block; font-size: 11px; color: var(--text3); }
.entry-card .ec-facts div b { font-family: var(--font-display); font-weight: 600; }
.entry-card .ec-side .seg { display: flex; }
.entry-card .ec-side .seg button { flex: 1; padding: 0 6px; }
.entry-card .ec-actions { display: flex; gap: 8px; margin-top: auto; }
.entry-card .ec-actions .btn { flex: 1; }

/* ---------------------------------------------------------------- Empty / skeleton */
.empty { text-align: center; padding: 56px 20px; color: var(--text2); }
.empty .e-ic { width: 54px; height: 54px; border-radius: 14px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--bg3); border: 1px solid var(--border); color: var(--text3); }
.empty .e-ic svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.empty h3 { margin-bottom: 4px; }
.empty p { font-size: 13px; }
.skel { background: linear-gradient(90deg, var(--bg3) 0%, var(--bg4) 50%, var(--bg3) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-card { height: 168px; border-radius: var(--radius); }

/* ---------------------------------------------------------------- Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; position: relative; z-index: 1; }
.login-hero {
	position: relative; overflow: hidden; padding: 48px 56px;
	display: flex; flex-direction: column; justify-content: space-between;
	background: radial-gradient(1200px 600px at 0% 0%, rgba(74,158,232,.16), transparent 60%), var(--bg2);
	border-right: 1px solid var(--border);
}
.login-hero::before {
	content: ''; position: absolute; inset: -40%;
	background-image: linear-gradient(rgba(74,158,232,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(74,158,232,.35) 1px, transparent 1px);
	background-size: 120px 120px; transform: rotate(-12deg); opacity: .14;
	mask-image: radial-gradient(circle at 70% 60%, #000, transparent 55%); -webkit-mask-image: radial-gradient(circle at 70% 60%, #000, transparent 55%);
}
.login-hero > * { position: relative; }
.login-hero h1 { font-size: 46px; line-height: 1.05; font-weight: 800; letter-spacing: -.035em; max-width: 520px; }
.login-hero h1 em { font-style: normal; color: var(--sky); }
.login-hero p.lead { font-size: 16px; color: var(--text2); max-width: 470px; margin-top: 18px; }
.hero-stats { display: flex; gap: 34px; margin-top: 36px; }
.hero-stats b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.hero-stats span { font-size: 12px; color: var(--text3); }
.flow { display: flex; gap: 10px; align-items: center; margin-top: 36px; flex-wrap: wrap; }
.flow .st { padding: 8px 12px; border-radius: 9px; background: var(--bg3); border: 1px solid var(--border); font-size: 12.5px; color: var(--text2); }
.flow .st b { color: var(--text); }
.flow .ar { color: var(--text3); }
.login-side { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.login-box { width: min(420px, 100%); animation: rise .7s var(--silk) both; }
.login-box h2 { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.login-box > p { color: var(--text2); margin: 6px 0 26px; }
.login-box form { display: flex; flex-direction: column; gap: 16px; }
.login-box .btn { height: 44px; font-size: 14.5px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; color: var(--text3); border-radius: 7px; }
.pw-wrap button:hover { color: var(--text); background: var(--bg4); }
.pw-wrap svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; }
.login-error { display: none; }
.login-error.show { display: flex; }
.demo-box { margin-top: 26px; border: 1px dashed var(--border2); border-radius: var(--radius); background: rgba(20,25,32,.6); }
.demo-box summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text2); }
.demo-box summary::-webkit-details-marker { display: none; }
.demo-box summary b { color: var(--text); }
.demo-box .tree { padding: 0 10px 12px; max-height: 300px; overflow: auto; }
.tree ul { list-style: none; padding-left: 16px; border-left: 1px solid var(--border); margin-left: 9px; }
.tree > ul { border-left: 0; padding-left: 0; margin-left: 0; }
.tree li { margin: 2px 0; }
.tree button {
	display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
	padding: 6px 8px; border-radius: 7px; font-size: 12.5px; color: var(--text2);
}
.tree button:hover { background: var(--bg3); color: var(--text); }
.tree button code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 11.5px; color: var(--sky2); }
.tree .lvl { min-width: 26px; text-align: center; }

/* ---------------------------------------------------------------- Misc */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--text3); }
.kv dd { color: var(--text); }
.divider { height: 1px; background: var(--border); margin: 4px 0; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-amber { color: var(--amber); } .text-sky { color: var(--sky2); }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1100px) {
	.grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.entry-card { grid-template-columns: 1fr; }
	.entry-card .ec-main { border-right: 0; border-bottom: 1px solid var(--border); }
	.entry-card .ec-side { border-radius: 0 0 var(--radius) var(--radius); }
	.month-picker label { display: none; }
}
@media (max-width: 900px) {
	.app-header .inner { padding: 0 16px; gap: 12px; }
	.menu-toggle { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border); color: var(--text2); }
	.menu-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
	.nav {
		position: fixed; top: var(--header-h); left: 0; right: 0; flex-direction: column; padding: 12px 16px 18px;
		background: var(--bg2); border-bottom: 1px solid var(--border);
		transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all .35s var(--silk);
	}
	.nav.open { transform: none; opacity: 1; pointer-events: auto; }
	.nav a { padding: 12px 14px; }
	.user-chip .who { display: none; }
	.user-chip { padding: 3px; }
	.brand-text span { display: none; }
	.page { padding: 20px 16px 80px; }
	h1 { font-size: 23px; }
	.grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
	.grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.targets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.target:nth-child(2) { border-right: 0; }
	.target:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
	.entry-card .ec-cols { grid-template-columns: 1fr; }
	.h-month { grid-template-columns: 1fr; gap: 8px; }
	.h-month .hm-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.login-page { grid-template-columns: 1fr; }
	.login-hero { display: none; }
	.toolbar .period { margin-left: 0; width: 100%; }
	.drawer-body { padding: 16px; }
	.drawer-head, .drawer-foot { padding-left: 16px; padding-right: 16px; }
	.drawer-foot { flex-wrap: wrap; }
	.drawer-foot .summary { width: 100%; }
	.toasts { left: 16px; right: 16px; top: calc(var(--header-h) + 10px); align-items: stretch; }
	.toast { max-width: none; }
}
@media (max-width: 520px) {
	.month-picker select { min-width: 0; width: 112px; }
	.grid-6 { grid-template-columns: 1fr 1fr; }
	.kpi .k-val { font-size: 24px; }
	.sample-row { grid-template-columns: 1fr 92px 34px; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
